herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
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/PhaseSpaceMode.h"
17#include "ThePEG/Helicity/Vertex/VertexBase.h"
18#include "GeneralTwoBodyDecayer.fh"
19
20namespace Herwig {
21using namespace ThePEG;
22using Helicity::VertexBasePtr;
23
39
40public:
41
43 typedef pair<tcPDPtr, Energy> PMPair;
44
45public:
46
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
79 virtual Energy partialWidth(PMPair inpart, PMPair outa,
80 PMPair outb) const;
81
92 virtual bool twoBodyMEcode(const DecayMode & dm, int & mecode,
93 double & coupling) const;
94
102 virtual double brat(const DecayMode & dm, const Particle & p,
103 double oldbrat) const;
105
110 vector<VertexBasePtr>,
111 map<ShowerInteraction,VertexBasePtr> &,
112 const vector<map<ShowerInteraction,VertexBasePtr> > &,
113 map<ShowerInteraction,VertexBasePtr>) =0;
114
115protected:
116
123 void setWeight(double wgt) { maxWeight_ = wgt; }
124
131 void colourConnections(const Particle & parent,
132 const ParticleVector & out) const;
133
137 double colourFactor(tcPDPtr in, tcPDPtr out1, tcPDPtr out2) const;
138
142 double matrixElementRatio(const Particle & inpart, const ParticleVector & decay2,
143 const ParticleVector & decay3, MEOption meopt,
144 ShowerInteraction inter);
145
151
152public:
153
161
167 void persistentInput(PersistentIStream & is, int version);
169
176 static void Init();
177
178protected:
179
187 virtual void doinit();
188
193 virtual void doinitrun();
195
196protected:
197
205 typedef vector<pair<int,double > > CFlowPairVec;
206 typedef vector<CFlowPairVec> CFlow;
207
208 const vector<DVector> & getColourFactors(const Particle & inpart,
209 const ParticleVector & decay,
210 unsigned int & nflow);
211
212 const CFlow & colourFlows(const Particle & inpart,
213 const ParticleVector & decay);
214
218 virtual double threeBodyME(const int , const Particle & inpart,
219 const ParticleVector & decay,
220 ShowerInteraction inter, MEOption meopt);
221
223
224private:
225
231
232private:
233
238
242 vector<PDPtr> outgoing_;
243
248
252 vector<DVector> colour_;
253
254};
255
256
260template<typename T, typename Cmp, typename A>
262 const map<ShowerInteraction,T,Cmp,A> & m) {
263 os << m.size();
264 if(m.find(ShowerInteraction::QCD)!=m.end()) {
265 os << 0 << m.at(ShowerInteraction::QCD);
266 }
267 if(m.find(ShowerInteraction::QED)!=m.end()) {
268 os << 1 << m.at(ShowerInteraction::QED);
269 }
270 return os;
271}
272
276template <typename T, typename Cmp, typename A>
277inline PersistentIStream & operator>>(PersistentIStream & is, map<ShowerInteraction,T,Cmp,A> & m) {
278 m.clear();
279 long size;
280 int k;
281 is >> size;
282 while ( size-- && is ) {
283 is >> k;
284 if(k==0)
285 is >> m[ShowerInteraction::QCD];
286 else if(k==1)
287 is >> m[ShowerInteraction::QED];
288 else
289 assert(false);
290 }
291 return is;
292}
293}
294
295#endif /* HERWIG_GeneralTwoBodyDecayer_H */
MEOption
Enum for the matrix element option.
The GeneralTwoBodyDecayer class is designed to be the base class for 2 body decays for some general m...
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
virtual Energy partialWidth(PMPair inpart, PMPair outa, PMPair outb) const
Function to return partial Width.
virtual ParticleVector decay(const Particle &parent, const tPDVector &children) const
For a given decay mode and a given particle instance, perform the decay and return the decay products...
PDPtr incoming_
Store the incoming particle.
void colourConnections(const Particle &parent, const ParticleVector &out) const
Set colour connections.
virtual void doinitrun()
Initialize this object.
vector< pair< int, double > > CFlowPairVec
Member for the generation of additional hard radiation.
virtual bool twoBodyMEcode(const DecayMode &dm, int &mecode, double &coupling) const
Specify the matrix element to be used in the running width calculation.
pair< tcPDPtr, Energy > PMPair
A ParticleData ptr and (possible) mass pair.
virtual void doinit()
Initialize this object after the setup phase before saving an EventGenerator to disk.
virtual double threeBodyME(const int, const Particle &inpart, const ParticleVector &decay, ShowerInteraction inter, MEOption meopt)
Three-body matrix element including additional QCD radiation.
virtual double brat(const DecayMode &dm, const Particle &p, double oldbrat) const
An overidden member to calculate a branching ratio for a certain particle instance.
void setWeight(double wgt)
Set integration weight.
vector< DVector > colour_
Store colour factors for ME calc.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
virtual void setDecayInfo(PDPtr incoming, PDPair outgoing, vector< VertexBasePtr >, map< ShowerInteraction, VertexBasePtr > &, const vector< map< ShowerInteraction, VertexBasePtr > > &, map< ShowerInteraction, VertexBasePtr >)=0
Set the information on the decay.
double colourFactor(tcPDPtr in, tcPDPtr out1, tcPDPtr out2) const
Compute the spin and colour factor.
GeneralTwoBodyDecayer & operator=(const GeneralTwoBodyDecayer &)=delete
The assignment operator is private and must never be called.
double maxWeight_
Maximum weight for integration.
static void Init()
The standard Init function used to initialize the interfaces.
void decayInfo(PDPtr incoming, PDPair outgoing)
Set the information on the decay.
vector< PDPtr > outgoing_
Outgoing particles.
virtual int modeNumber(bool &cc, tcPDPtr parent, const tPDVector &children) const
Which of the possible decays is required.
GeneralTwoBodyDecayer()
The default constructor.
double matrixElementRatio(const Particle &inpart, const ParticleVector &decay2, const ParticleVector &decay3, MEOption meopt, ShowerInteraction inter)
Calculate matrix element ratio R/B.
The PerturbativeDecayer class is the base class for perturbative decays in Herwig and implements the ...
ShowerInteraction
Handy header file to be included in all Shower classes.
-*- C++ -*-
PersistentIStream & operator>>(PersistentIStream &is, HandlerGroup< HDLR > &hg)
vector< tPDPtr > tPDVector
vector< PPtr > ParticleVector
vector< double > DVector
ThePEG::Ptr< ParticleData >::transient_const_pointer tcPDPtr
ThePEG::Ptr< ParticleData >::pointer PDPtr
ostream & operator<<(ostream &, const Collision &)
pair< PDPtr, PDPtr > PDPair