herwig is hosted by Hepforge, IPPP Durham
Herwig  7.1.5
ShowerApproximationGenerator.h
1 // -*- C++ -*-
2 //
3 // ShowerApproximationGenerator.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_ShowerApproximationGenerator_H
10 #define Herwig_ShowerApproximationGenerator_H
11 //
12 // This is the declaration of the ShowerApproximationGenerator class.
13 //
14 
15 #include "ThePEG/Handlers/StepHandler.h"
16 #include "Herwig/MatrixElement/Matchbox/Matching/ShowerApproximationKernel.h"
17 #include "Herwig/MatrixElement/Matchbox/Phasespace/MatchboxPhasespace.h"
18 #include "Herwig/MatrixElement/Matchbox/MatchboxFactory.h"
19 
20 namespace Herwig {
21 
22 using namespace ThePEG;
23 
33 
34 public:
35 
42 
48 
49 public:
50 
68  virtual void handle(EventHandler & eh, const tPVector & tagged,
69  const Hint & hint);
71 
72 public:
73 
77  bool prepare(bool didproject);
78 
83  bool generate(const vector<double>&);
84 
88  void restore();
89 
90 protected:
91 
95  double generateFraction(tcPDPtr, double, double) const;
96 
100  double invertFraction(tcPDPtr, double, double) const;
101 
105  Energy ffPtCut() const { return theShowerApproximation->ffPtCut(); }
106 
110  Energy fiPtCut() const { return theShowerApproximation->fiPtCut(); }
111 
115  Energy iiPtCut() const { return theShowerApproximation->iiPtCut(); }
116 
117 public:
118 
125  void persistentOutput(PersistentOStream & os) const;
126 
132  void persistentInput(PersistentIStream & is, int version);
134 
141  static void Init();
142 
143 protected:
144 
151  virtual IBPtr clone() const;
152 
157  virtual IBPtr fullclone() const;
159 
160 
161 // If needed, insert declarations of virtual function defined in the
162 // InterfacedBase class here (using ThePEG-interfaced-decl in Emacs).
163 
164 
165 private:
166 
170  Ptr<ShowerApproximation>::ptr theShowerApproximation;
171 
175  Ptr<MatchboxPhasespace>::ptr thePhasespace;
176 
180  Ptr<MatchboxFactory>::ptr theFactory;
181 
185  map<cPDVector,set<Ptr<ShowerApproximationKernel>::ptr> > theKernelMap;
186 
190  unsigned long thePresamplingPoints;
191 
195  unsigned long theMaxTry;
196 
201  unsigned long theFreezeGrid;
202 
206  tStdXCombPtr lastIncomingXComb;
207 
208  // the next three are filled from the incoming xcomb in the prepare method
209 
213  Ptr<MatchboxMEBase>::ptr theLastBornME;
214 
218  vector<Lorentz5Momentum> theLastMomenta;
219 
223  vector<Lorentz5Momentum> theLastPresamplingMomenta;
224 
229  vector<double> theLastRandomNumbers;
230 
234  tStdXCombPtr theLastBornXComb;
235 
240 
245 
250  ShowerApproximationGenerator & operator=(const ShowerApproximationGenerator &) = delete;
251 
252 };
253 
254 }
255 
256 #endif /* Herwig_ShowerApproximationGenerator_H */
tStdXCombPtr lastIncomingXComb
The last external Born XComb dealt with.
vector< Lorentz5Momentum > theLastMomenta
The last Born phase space point.
Ptr< MatchboxMEBase >::ptr theLastBornME
The last internal Born matrix element dealt with.
ShowerApproximationGenerator generates emissions according to a shower approximation entering a NLO m...
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
Ptr< MatchboxFactory >::ptr theFactory
The factory object to fetch splitting channels from.
unsigned long theFreezeGrid
Return the number of accepted points after which the grid should be frozen.
tStdXCombPtr theLastBornXComb
The last internal Born XComb dealt with.
Ptr< ShowerApproximation >::ptr theShowerApproximation
The shower approximation to consider.
vector< double > theLastRandomNumbers
The random numbers which have produced the last Born phase space point.
unsigned long thePresamplingPoints
The number of points to presample this splitting generator.
Energy iiPtCut() const
Return the pt cut to be applied for initial-initial dipoles.
vector< Lorentz5Momentum > theLastPresamplingMomenta
The last Born phase space point used while presampling.
ThePEG::Ptr< ParticleData >::transient_const_pointer tcPDPtr
pair< PPtr, PPtr > PPair
map< cPDVector, set< Ptr< ShowerApproximationKernel >::ptr > > theKernelMap
Map hard processes to the respective kernels.
Ptr< MatchboxPhasespace >::ptr thePhasespace
The (invertible) phase space generator to use.
bool theDoCompensate
True, if sampler should apply compensation.
pair< double, double > generate(const Generator< Density > &gen, double r)
Generate a random variable and return its weight.
Energy fiPtCut() const
Return the pt cut to be applied for final-initial dipoles.
-*- C++ -*-
vector< tPPtr > tPVector
Energy ffPtCut() const
Return the pt cut to be applied for final-final dipoles.
PPair theLastPartons
The last internal incoming partons dealt with.
unsigned long theMaxTry
The maximum number of trials to generate a splitting.