herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
ProcessHandler.h
1// -*- C++ -*-
2//
3// ProcessHandler.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_ProcessHandler_H
10#define HERWIG_ProcessHandler_H
11//
12// This is the declaration of the ProcessHandler class.
13//
14#include "ThePEG/Interface/Interfaced.h"
15#include "ThePEG/Handlers/StandardEventHandler.h"
16#include "ThePEG/Handlers/StandardXComb.h"
17#include "ThePEG/Handlers/SubProcessHandler.h"
18#include "ThePEG/Handlers/LuminosityFunction.h"
19#include "ThePEG/Repository/EventGenerator.h"
20#include "ThePEG/Handlers/SamplerBase.h"
21#include "ThePEG/Cuts/Cuts.h"
22#include "ThePEG/MatrixElement/MEBase.h"
23#include "ThePEG/Handlers/CascadeHandler.h"
24
25#include <cassert>
26
27#include "ProcessHandler.fh"
28#include "stat.h"
29
30namespace Herwig {
31using namespace ThePEG;
32
48class ProcessHandler: public Interfaced, public LastXCombInfo<> {
49
50public:
51
54
56 typedef vector<StdXCombPtr> XVector;
57
59 typedef vector<CrossSection> XSVector;
60
63 typedef map<tMEPtr,XVector> MEXMap;
64
65public:
66
71
72public:
73
76
81 inline tStdXCombPtr generate();
83
84
92
98 void persistentInput(PersistentIStream & is, int version);
100
107 static void Init();
108
113 void initialize(tSubHdlPtr sub, tCutsPtr cuts, tEHPtr eh);
114
118 CrossSection integratedXSec() const;
119
124 void statistics(ostream &, Stat &) const;
125
133 virtual CrossSection dSigDR(const vector<double> & r);
134
135
138
144 inline int statLevel() const;
145
149 inline const cPDPair & incoming() const;
150
154 inline const LuminosityFunction & lumiFn() const;
155
160 inline int lumiDim() const;
161
166 int nBins() const;
167
172 inline int maxDim(int bin) const;
173
178 inline int nDim(int bin) const;
179
184 inline long maxLoop() const;
185
186
187protected:
188
202 virtual CrossSection dSigDR(const pair<double,double> ll, Energy2 maxS,
203 int ibin, int nr, const double * r);
204
205
211 tStdXCombPtr select(int bin, double weight);
212
225 void addME(Energy maxEnergy, tSubHdlPtr sub, tPExtrPtr extractor, tCutsPtr cuts,
226 tCascHdlPtr ckkw, tMEPtr me, const PBPair & pBins);
227
231 inline const XVector & xCombs() const;
232
236 inline XVector & xCombs();
237
241 inline const XSVector & xSecs() const;
242
246 inline XSVector & xSecs();
247
255 inline int binStrategy() const;
256
257
264 inline virtual IBPtr clone() const;
265
270 inline virtual IBPtr fullclone() const;
272
273private:
274
283 inline tEHPtr eventHandler() const;
284
288 inline tSamplerPtr sampler();
289
293 inline tcSamplerPtr sampler() const;
294
300 inline tCutsPtr cuts() const;
301
305 inline tSubHdlPtr subProcess();
306
307
308protected:
309
316 virtual void doinitrun();
317
319
320private:
321
327
332 SamplerPtr theSampler;
333
341
345 tCutsPtr theCuts;//used a transient pointer,
346 //because regular pointer is already in MPIHandler
347
348
352 tSubHdlPtr theSubProcess;//used a transient pointer,
353 //because regular pointer is already in MPIHandler
354
359
365
374
380
381
386 vector<int> theMaxDims;
387
388
389
390protected:
391
399 class InitError: public Exception {};
400
403};
404
405}
406
407#include "ProcessHandler.icc"
408
409#endif /* HERWIG_ProcessHandler_H */
This class is for handling the sampling of semi hard partonic interactions.
vector< int > theMaxDims
The number of degrees of freedom needed to generate the phase space for the different bins.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
vector< StdXCombPtr > XVector
A vector of pointers to StandardXComb objects.
const XSVector & xSecs() const
Return the vector of cross sections.
XSVector theXSecs
The (incrementally summed) cross sections associated with the StandardXComb objects for the last sele...
tEHPtr theHandler
A pointer to the EventHandler that calls us.
tStdXCombPtr generate()
Select a StandardXComb according to it's weight.
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
const LuminosityFunction & lumiFn() const
Access the luminosity function via the EventHandler.
virtual IBPtr clone() const
Make a simple clone of this object.
tSubHdlPtr subProcess()
Access the sub-process handler.
tSubHdlPtr theSubProcess
The SubProcessHandler that is connected to this ProcessHandler.
long maxLoop() const
Return the maximum number attemts allowed to select a sub-process for each event.
XVector theXCombs
The StandardXComb objects.
CrossSection integratedXSec() const
Return the integrated cross section.
int lumiDim() const
The number of phase space dimensions used by the luminosity function.
XSVector & xSecs()
Return the vector of cross sections.
tCutsPtr cuts() const
Return a reference to the Cuts of this MultipleInteractionHandler.
vector< CrossSection > XSVector
A vector of cross sections.
void initialize(tSubHdlPtr sub, tCutsPtr cuts, tEHPtr eh)
Initialize this Multiple Interaction handler and all related objects needed to generate additional ev...
tSamplerPtr sampler()
Return the sampler assigned to this handler.
SamplerPtr theSampler
The phase space sampler responsible for generating phase space points according to the cross section ...
void statistics(ostream &, Stat &) const
Write out accumulated statistics about intergrated cross sections and stuff.
map< tMEPtr, XVector > MEXMap
Map of pointers to StandardXComb objects indexed by pointers to the corresponding MEBase object.
XVector & xCombs()
Return the vector of StandardXComb objects.
int theBinStrategy
The strategy to be used when sampling different StandardXComb objects.
int nBins() const
Return the number of separate bins of StandardXComb objects to sample.
void addME(Energy maxEnergy, tSubHdlPtr sub, tPExtrPtr extractor, tCutsPtr cuts, tCascHdlPtr ckkw, tMEPtr me, const PBPair &pBins)
Create and add StandardXComb objects.
tEHPtr eventHandler() const
Return the ThePEG::EventHandler assigned to this handler.
tcSamplerPtr sampler() const
Return the sampler assigned to this handler.
virtual void doinitrun()
Initialize this object.
virtual CrossSection dSigDR(const pair< double, double > ll, Energy2 maxS, int ibin, int nr, const double *r)
Generate a phase space point and return the corresponding cross section.
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
tCutsPtr theCuts
The kinematical cuts used for this collision handler.
tStdXCombPtr select(int bin, double weight)
Select an StandardXComb.
int maxDim(int bin) const
Return the number of phase space dimensions needed for the sampling of indicated bin of StandardXComb...
virtual CrossSection dSigDR(const vector< double > &r)
Return the cross section for the chosen phase space point.
Selector< StdXCombPtr > XSelector
A weighted list of pointers to StandardXComb objects.
const XVector & xCombs() const
Return the vector of StandardXComb objects.
static void Init()
The standard Init function used to initialize the interfaces.
int nDim(int bin) const
The number of dimensions of the basic phase space to generate sub-processes in for a given bin of Sta...
int binStrategy() const
Return the strategy to be used when sampling different StandardXComb objects.
ProcessHandler()
The default constructor.
MEXMap theMEXMap
The map used to store all XBins with the same matrix element for option 1 in theBinStrategy.
ProcessHandler & operator=(const ProcessHandler &)=delete
The assignment operator is private and must never be called.
int statLevel() const
The level of statistics.
const cPDPair & incoming() const
The pair of incoming particle types obtained via the EventHandler.
-*- C++ -*-
ThePEG::Ptr< InterfacedBase >::pointer IBPtr
pair< cPDPtr, cPDPtr > cPDPair
ThePEG::Ptr< PartonExtractor >::transient_pointer tPExtrPtr
ThePEG::Ptr< CascadeHandler >::transient_pointer tCascHdlPtr
ThePEG::Ptr< EventHandler >::transient_pointer tEHPtr
Documentation for the statistics struct.
Definition: stat.h:18