herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
DecayPhaseSpaceChannel.h
1 // -*- C++ -*-
2 //
3 // DecayPhaseSpaceChannel.h is a part of Herwig - A multi-purpose Monte Carlo event generator
4 // Copyright (C) 2002-2019 The Herwig Collaboration
5 //
6 // Herwig is licenced under version 3 of the GPL, see COPYING for details.
7 // Please respect the MCnet academic guidelines, see GUIDELINES for details.
8 //
9 #ifndef HERWIG_DecayPhaseSpaceChannel_H
10 #define HERWIG_DecayPhaseSpaceChannel_H
11 //
12 // This is the declaration of the DecayPhaseSpaceChannel class.
13 //
14 #include <ThePEG/Interface/Interfaced.h>
15 #include <ThePEG/PDT/ParticleData.h>
16 #include <ThePEG/EventRecord/Particle.h>
17 #include "DecayPhaseSpaceChannel.fh"
18 #include "DecayIntegrator.h"
19 #include "Herwig/Utilities/Kinematics.h"
20 #include "ThePEG/Repository/UseRandom.h"
21 #include "DecayPhaseSpaceMode.fh"
22 
23 namespace Herwig {
24 using namespace ThePEG;
25 
53 
58  friend ostream & operator<<(ostream &, const DecayPhaseSpaceChannel &);
59 
64  friend class DecayPhaseSpaceMode;
65 
66 public:
67 
74 
79  DecayPhaseSpaceChannel(tcDecayPhaseSpaceModePtr);
81 
82 public:
83 
102  void addIntermediate(PDPtr part,int jac,double power,int dau1,int dau2) {
103  _intpart.push_back(part);
104  _jactype.push_back(jac);
105  _intpower.push_back(power);
106  _intdau1.push_back(dau1);
107  _intdau2.push_back(dau2);
108  }
109 
119  void resetIntermediate(tcPDPtr part,Energy mass,Energy width) {
120  if(!part) return;
121  int idin=part->id();
122  for(unsigned int ix=0;ix<_intpart.size();++ix) {
123  if(_intpart[ix] && _intpart[ix]->id()==idin) {
124  _intmass[ix] =mass;_intwidth[ix]=width;
125  _intmass2[ix]=mass*mass;_intmwidth[ix]=mass*width;
126  }
127  }
128  }
129 
130  /*
131  * Reset the one of the daughters
132  * @param oldp The id of the particle being reset
133  * @param newp The id of the particle replacing it
134  */
135  void resetDaughter(int oldp, int newp) {
136  for(unsigned int ix=0;ix<_intdau1.size();++ix) {
137  if(_intdau1[ix]==oldp) _intdau1[ix]=newp;
138  }
139  for(unsigned int ix=0;ix<_intdau2.size();++ix) {
140  if(_intdau2[ix]==oldp) _intdau2[ix]=newp;
141  }
142  }
143 
147  bool checkKinematics();
149 
150 protected:
151 
162  vector<Lorentz5Momentum> generateMomenta(const Lorentz5Momentum & pin,
163  const vector<Energy> & massext);
164 
172  double generateWeight(const vector<Lorentz5Momentum> & output);
173 
185  void generateIntermediates(bool cc,const Particle & in, ParticleVector & out);
186 
196  void twoBodyDecay(const Lorentz5Momentum & p,
197  const Energy m1, const Energy m2,
198  Lorentz5Momentum & p1, Lorentz5Momentum & p2);
200 
201 public:
202 
209  void persistentOutput(PersistentOStream & os) const;
210 
216  void persistentInput(PersistentIStream & is, int version);
218 
222  static void Init();
223 
224 public:
225 
233  virtual void init();
234 
239  virtual void initrun();
241 
242 private:
243 
247  DecayPhaseSpaceChannel & operator=(const DecayPhaseSpaceChannel &) = delete;
248 
249 private:
250 
259  Energy generateMass(int ires,Energy lower,Energy upper);
260 
268  InvEnergy2 massWeight(int ires, Energy moff,Energy lower,Energy upper);
270 
271 private:
272 
276  tcDecayPhaseSpaceModePtr _mode;
277 
281  vector <PDPtr> _intpart;
282 
286  vector <int> _jactype;
287 
291  vector<Energy> _intmass;
292 
296  vector<Energy> _intwidth;
297 
301  vector<Energy2> _intmass2;
302 
306  vector<Energy2>_intmwidth;
307 
311  vector<double> _intpower;
312 
316  vector<int> _intdau1;
317 
321  vector<int> _intdau2;
322 
326  vector< vector<int> > _intext;
327 
333  double atanhelper_(int ires, Energy limit);
334 };
335 
336 
340 ostream & operator<<(ostream &, const DecayPhaseSpaceChannel &);
341 
346 }
347 
348 
349 #endif /* HERWIG_DecayPhaseSpaceChannel_H */
tcDecayPhaseSpaceModePtr _mode
pointer to the mode
vector< vector< int > > _intext
The external particles that an intermediate particle final decays to.
The DecayPhaseSpaceMode class is designed to store a group of phase-space channels for use by the Dec...
vector< double > _intpower
The power for the intermediate resonance.
vector< int > _jactype
The type of jacobian to be used for the intermediates.
void resetIntermediate(tcPDPtr part, Energy mass, Energy width)
Reset the properties of an intermediate particle.
vector< Energy2 > _intmwidth
The mass times the width for the intermediate particles.
exception for this class and those inheriting from it
ostream & operator<<(ostream &, const DecayIntegrator &)
Output information on the DecayIntegrator for debugging purposes.
vector< int > _intdau1
The first daughter of the intermediate resonance.
void addIntermediate(PDPtr part, int jac, double power, int dau1, int dau2)
Add a new intermediate particle.
ThePEG::Ptr< ParticleData >::transient_const_pointer tcPDPtr
ThePEG::Ptr< ParticleData >::pointer PDPtr
DecayPhaseSpaceChannel()
Default constructor.
This class is designed to store the information needed for a given phase-space channel for use by the...
-*- C++ -*-
vector< Energy2 > _intmass2
The mass squared of the intermediate particles.
vector< Energy > _intmass
The mass of the intermediates.
vector< Energy > _intwidth
The width of the intermediates.
vector< PPtr > ParticleVector
Generator< Power > power(double z, double p, double lower, double upper)
Construct the density |(x-z)|^p.
vector< PDPtr > _intpart
Pointers to the particle data objects of the intermediate particles.
vector< int > _intdau2
The second daughter of the intermediate resonance.