herwig is hosted by Hepforge, IPPP Durham
Herwig  7.2.1
PhasespaceHelpers.h
1 // -*- C++ -*-
2 //
3 // PhasespaceHelpers.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_PhasespaceHelpers_H
10 #define HERWIG_PhasespaceHelpers_H
11 
12 #include "ThePEG/Config/ThePEG.h"
13 #include "ThePEG/PDT/ParticleData.h"
14 
15 #include "ThePEG/Persistency/PersistentOStream.h"
16 #include "ThePEG/Persistency/PersistentIStream.h"
17 
18 #include "Herwig/MatrixElement/Matchbox/Phasespace/MatchboxPhasespace.h"
19 
20 namespace Herwig {
21 
22 using namespace ThePEG;
23 
24  namespace PhasespaceHelpers {
25 
31  struct PhasespaceInfo {
32 
36  Energy2 sHat;
37 
41  Energy sqrtSHat;
42 
46  double weight;
47 
52 
57  double x0;
58 
63  double xc;
64 
69  Energy M0;
70 
75  Energy Mc;
76 
80  Energy generateMass(tcPDPtr, const pair<Energy,Energy>&);
81 
86  Lorentz5Momentum generateKt(const Lorentz5Momentum& p1,
87  const Lorentz5Momentum& p2,
88  Energy pt);
89 
90  };
91 
97  struct PhasespaceTree {
98 
103  : massRange(ZERO,ZERO), externalId(-1),
104  spacelike(false) {}
105 
110 
114  pair<Energy,Energy> massRange;
115 
119  Lorentz5Momentum momentum;
120 
124  Lorentz5Momentum backwardMomentum;
125 
130 
134  vector<PhasespaceTree> children;
135 
139  set<int> leafs;
140 
144  bool spacelike;
145 
149  bool doMirror;
150 
154  void setup(const Tree2toNDiagram&, int pos = 0);
155 
159  void setupMirrored(const Tree2toNDiagram& diag, int pos);
160 
165  void init(const vector<Lorentz5Momentum>&);
166 
170  void generateKinematics(PhasespaceInfo&,
171  vector<Lorentz5Momentum>&);
172 
176  void put(PersistentOStream&) const;
177 
181  void get(PersistentIStream&);
182 
186  void print(int in = 0);
187 
188  };
189 
190  }
191 
192 }
193 
194 #endif // HERWIG_PhasespaceHelpers_H
Lorentz5Momentum backwardMomentum
A backward momentum, if needed.
tcPDPtr data
The particle running along this line.
General information for phase space generation.
vector< PhasespaceTree > children
The children lines; if empty this is an external line.
Energy2 sHat
The center of mass energy squared.
bool spacelike
Wether or not this is a spacelike line.
Energy Mc
Parameter steering at which virtuality singularities of propagators are actually cut off...
ThePEG::Ptr< ParticleData >::transient_const_pointer tcPDPtr
bool doMirror
Wether or not this is a mirrored channel.
int externalId
The external leg id of this line, if external.
Energy sqrtSHat
The center of mass energy.
set< int > leafs
External lines originating from this line.
double x0
Parameter steering from which on propagator virtualities are sampled flat.
-*- C++ -*-
Wrap around a vector of random numbers to behave as a stream of those.
Lorentz5Momentum momentum
The momentum running along this line.
double xc
Parameter steering at which virtuality singularities of propagators are actually cut off...
StreamingRnd rnd
The random number generator.
Energy M0
Parameter steering from which on propagator virtualities are sampled flat.
pair< Energy, Energy > massRange
The allowed mass range for this line.
constexpr ZeroUnit ZERO
double weight
The phase space weight.