Herwig 7 is hosted by Hepforge, IPPP Durham
Herwig  7.1.0
DecayPhaseSpaceChannel.h
1 // -*- C++ -*-
2 //
3 // DecayPhaseSpaceChannel.h is a part of Herwig - A multi-purpose Monte Carlo event generator
4 // Copyright (C) 2002-2017 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  }
144 
145 protected:
146 
157  vector<Lorentz5Momentum> generateMomenta(const Lorentz5Momentum & pin,
158  const vector<Energy> & massext);
159 
167  double generateWeight(const vector<Lorentz5Momentum> & output);
168 
180  void generateIntermediates(bool cc,const Particle & in, ParticleVector & out);
181 
191  void twoBodyDecay(const Lorentz5Momentum & p,
192  const Energy m1, const Energy m2,
193  Lorentz5Momentum & p1, Lorentz5Momentum & p2);
195 
196 public:
197 
204  void persistentOutput(PersistentOStream & os) const;
205 
211  void persistentInput(PersistentIStream & is, int version);
213 
217  static void Init();
218 
219 protected:
220 
227  virtual IBPtr clone() const {return new_ptr(*this);}
228 
233  virtual IBPtr fullclone() const {return new_ptr(*this);}
235 
236 protected:
237 
245  virtual void doinit();
246 
251  virtual void doinitrun();
253 
254 private:
255 
260 
264  DecayPhaseSpaceChannel & operator=(const DecayPhaseSpaceChannel &);
265 
266 private:
267 
276  Energy generateMass(int ires,Energy lower,Energy upper);
277 
285  InvEnergy2 massWeight(int ires, Energy moff,Energy lower,Energy upper);
287 
288 private:
289 
293  tcDecayPhaseSpaceModePtr _mode;
294 
298  vector <PDPtr> _intpart;
299 
303  vector <int> _jactype;
304 
308  vector<Energy> _intmass;
309 
313  vector<Energy> _intwidth;
314 
318  vector<Energy2> _intmass2;
319 
323  vector<Energy2>_intmwidth;
324 
328  vector<double> _intpower;
329 
333  vector<int> _intdau1;
334 
338  vector<int> _intdau2;
339 
343  vector< vector<int> > _intext;
344 
350  double atanhelper_(int ires, Energy limit);
351 };
352 
353 
357 ostream & operator<<(ostream &, const DecayPhaseSpaceChannel &);
358 
363 }
364 
365 
366 namespace ThePEG {
367 
374 template <>
375 
376 struct BaseClassTrait<Herwig::DecayPhaseSpaceChannel,1> {
378  typedef Interfaced NthBase;
379 };
380 
385 template <>
386 
387 struct ClassTraits<Herwig::DecayPhaseSpaceChannel>
388  : public ClassTraitsBase<Herwig::DecayPhaseSpaceChannel> {
390  static string className() { return "Herwig::DecayPhaseSpaceChannel"; }
391 };
392 
395 }
396 
397 #endif /* HERWIG_DecayPhaseSpaceChannel_H */
static ClassDescription< DecayPhaseSpaceChannel > initDecayPhaseSpaceChannel
Describe a concrete class with persistent data.
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.
virtual IBPtr clone() const
Make a simple clone of this object.
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
vector< Energy2 > _intmwidth
The mass times the width for the intermediate particles.
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
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.