herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
GeneralTwoBodyDecayer.h
1 // -*- C++ -*-
2 //
3 // GeneralTwoBodyDecayer.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_GeneralTwoBodyDecayer_H
10 #define HERWIG_GeneralTwoBodyDecayer_H
11 //
12 // This is the declaration of the GeneralTwoBodyDecayer class.
13 //
14 
15 #include "Herwig/Decay/PerturbativeDecayer.h"
16 #include "Herwig/Decay/DecayPhaseSpaceMode.h"
17 #include "ThePEG/Helicity/Vertex/VertexBase.h"
18 #include "GeneralTwoBodyDecayer.fh"
19 
20 namespace Herwig {
21 using namespace ThePEG;
22 using Helicity::VertexBasePtr;
23 
39 
40 public:
41 
43  typedef pair<tcPDPtr, Energy> PMPair;
44 
45 public:
46 
50  GeneralTwoBodyDecayer() : maxWeight_(1.), colour_(1,DVector(1,1.))
51  {}
52 
53 
62  virtual ParticleVector decay(const Particle & parent,
63  const tPDVector & children) const;
64 
71  virtual int modeNumber(bool & cc, tcPDPtr parent,const tPDVector & children) const;
72 
81  virtual double me2(const int , const Particle & part,
82  const ParticleVector & decay, MEOption meopt) const = 0;
83 
90  virtual Energy partialWidth(PMPair inpart, PMPair outa,
91  PMPair outb) const;
92 
103  virtual bool twoBodyMEcode(const DecayMode & dm, int & mecode,
104  double & coupling) const;
105 
113  virtual double brat(const DecayMode & dm, const Particle & p,
114  double oldbrat) const;
116 
120  virtual void setDecayInfo(PDPtr incoming, PDPair outgoing,
121  vector<VertexBasePtr>,
122  map<ShowerInteraction,VertexBasePtr> &,
123  const vector<map<ShowerInteraction,VertexBasePtr> > &,
124  map<ShowerInteraction,VertexBasePtr>) =0;
125 
126 protected:
127 
134  void setWeight(double wgt) { maxWeight_ = wgt; }
135 
142  void colourConnections(const Particle & parent,
143  const ParticleVector & out) const;
144 
148  double colourFactor(tcPDPtr in, tcPDPtr out1, tcPDPtr out2) const;
149 
153  double matrixElementRatio(const Particle & inpart, const ParticleVector & decay2,
154  const ParticleVector & decay3, MEOption meopt,
155  ShowerInteraction inter);
156 
160  void decayInfo(PDPtr incoming, PDPair outgoing);
162 
163 public:
164 
171  void persistentOutput(PersistentOStream & os) const;
172 
178  void persistentInput(PersistentIStream & is, int version);
180 
187  static void Init();
188 
189 protected:
190 
198  virtual void doinit();
199 
204  virtual void doinitrun();
206 
207 protected:
208 
216  typedef vector<pair<int,double > > CFlowPairVec;
217  typedef vector<CFlowPairVec> CFlow;
218 
219  const vector<DVector> & getColourFactors(const Particle & inpart,
220  const ParticleVector & decay,
221  unsigned int & nflow);
222 
223  const CFlow & colourFlows(const Particle & inpart,
224  const ParticleVector & decay);
225 
229  virtual double threeBodyME(const int , const Particle & inpart,
230  const ParticleVector & decay,
231  ShowerInteraction inter, MEOption meopt);
232 
234 
235 private:
236 
241  GeneralTwoBodyDecayer & operator=(const GeneralTwoBodyDecayer &) = delete;
242 
243 private:
244 
249 
253  vector<PDPtr> outgoing_;
254 
258  double maxWeight_;
259 
263  vector<DVector> colour_;
264 
265 };
266 
267 
271 template<typename T, typename Cmp, typename A>
273  const map<ShowerInteraction,T,Cmp,A> & m) {
274  os << m.size();
275  if(m.find(ShowerInteraction::QCD)!=m.end()) {
276  os << 0 << m.at(ShowerInteraction::QCD);
277  }
278  if(m.find(ShowerInteraction::QED)!=m.end()) {
279  os << 1 << m.at(ShowerInteraction::QED);
280  }
281  return os;
282 }
283 
287 template <typename T, typename Cmp, typename A>
288 inline PersistentIStream & operator>>(PersistentIStream & is, map<ShowerInteraction,T,Cmp,A> & m) {
289  m.clear();
290  long size;
291  int k;
292  is >> size;
293  while ( size-- && is ) {
294  is >> k;
295  if(k==0)
296  is >> m[ShowerInteraction::QCD];
297  else if(k==1)
298  is >> m[ShowerInteraction::QED];
299  else
300  assert(false);
301  }
302  return is;
303 }
304 }
305 
306 #endif /* HERWIG_GeneralTwoBodyDecayer_H */
ShowerInteraction
Handy header file to be included in all Shower classes.
void setWeight(double wgt)
Set integration weight.
GeneralTwoBodyDecayer()
The default constructor.
The GeneralTwoBodyDecayer class is designed to be the base class for 2 body decays for some general m...
pair< tcPDPtr, Energy > PMPair
A ParticleData ptr and (possible) mass pair.
vector< DVector > colour_
Store colour factors for ME calc.
vector< double > DVector
MEOption
Enum for the matrix element option.
ostream & operator<<(ostream &, const DecayIntegrator &)
Output information on the DecayIntegrator for debugging purposes.
PDPtr incoming_
Store the incoming particle.
vector< tPDPtr > tPDVector
PersistentIStream & operator>>(PersistentIStream &is, map< ShowerInteraction, T, Cmp, A > &m)
Read a map with ShowerInteraction as the key.
pair< PDPtr, PDPtr > PDPair
ThePEG::Ptr< ParticleData >::transient_const_pointer tcPDPtr
The PerturbativeDecayer class is the base class for perturbative decays in Herwig and implements the ...
ThePEG::Ptr< ParticleData >::pointer PDPtr
vector< pair< int, double > > CFlowPairVec
Member for the generation of additional hard radiation.
double maxWeight_
Maximum weight for integration.
vector< PDPtr > outgoing_
Outgoing particles.
-*- C++ -*-
vector< PPtr > ParticleVector