thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
StandardEventHandler.h
1// -*- C++ -*-
2//
3// StandardEventHandler.h is a part of ThePEG - Toolkit for HEP Event Generation
4// Copyright (C) 1999-2019 Leif Lonnblad
5//
6// ThePEG 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 ThePEG_StandardEventHandler_H
10#define ThePEG_StandardEventHandler_H
11// This is the declaration of the StandardEventHandler class.
12
14#include "ThePEG/Handlers/EventHandler.h"
15#include "ThePEG/Repository/Strategy.fh"
16#include "ThePEG/Handlers/SamplerBase.fh"
17#include "ThePEG/PDF/PartonBin.fh"
18#include "ThePEG/MatrixElement/MEBase.fh"
19#include "SubProcessHandler.fh"
20#include "StandardXComb.fh"
21#include "StandardEventHandler.fh"
22#include "ThePEG/Utilities/XSecStat.h"
23#include <fstream>
24
25namespace ThePEG {
26
45
46public:
47
49 typedef vector<SubHdlPtr> SubHandlerList;
50
53
55 typedef vector<StdXCombPtr> XVector;
56
58 typedef vector<CrossSection> XSVector;
59
62 typedef map<tMEPtr,XVector> MEXMap;
63
64public:
65
72
78
79public:
80
85 virtual void initialize();
86
91 virtual void statistics(ostream &) const;
92
96 tSamplerPtr sampler() { return theSampler; }
97
101 tcSamplerPtr sampler() const { return theSampler; }
102
109
116
123
130
137
145 virtual CrossSection dSigDR(const vector<double> & r);
146
151
157
161 void reweight(double factor) const;
162
166 const XVector & xCombs() const { return theXCombs; }
167
171 virtual void select(tXCombPtr newXComb);
172
179
187 tCutsPtr cuts() const { return theCuts; }
188
193 int nBins() const;
194
199 int maxDim(int bin) const { return theMaxDims[bin]; }
200
205 int lumiDim() const { return theLumiDim; }
206
211 int nDim(int bin) const { return lumiDim() + maxDim(bin); }
213
214protected:
215
229 virtual CrossSection dSigDR(const pair<double,double> ll, Energy2 maxS,
230 int ibin, int nr, const double * r);
231
237 tStdXCombPtr select(int bin, double & weight);
238
252 void addME(Energy maxEnergy, tSubHdlPtr sub, tPExtrPtr extractor,
253 tCutsPtr cuts, tCascHdlPtr ckkw, tMEPtr me, const PBPair & pBins,
254 const PartonPairVec& allPBins);
255
261
269 virtual void initGroups();
270
278
283
287 XVector & xCombs() { return theXCombs; }
288
292 virtual void clean();
293
294private:
295
299 const SubHandlerList & subProcesses() const { return theSubProcesses; }
300
305
306public:
307
313 virtual void doupdate();
314
320 virtual void doinit();
321
326 virtual void doinitrun();
327
332 virtual void dofinish();
334
342
348 void persistentInput(PersistentIStream & is, int version);
350
354 static void Init();
355
356protected:
357
364 virtual IBPtr clone() const;
365
370 virtual IBPtr fullclone() const;
372
377 void reject(double weight);
378
379private:
380
391
396
400 CutsPtr theCuts;
401
406
411
416 vector<int> theMaxDims;
417
423
429 SamplerPtr theSampler;
430
436
441
446
451
456
457protected:
458
464 class StandardEventHandlerUpdateException: public UpdateException {};
465
470 class StandardEventHandlerInitError: public Exception {};
473private:
474
479
480};
481
488template <>
491 typedef EventHandler NthBase;
492};
493
498template <>
499struct ClassTraits<StandardEventHandler>
500 : public ClassTraitsBase<StandardEventHandler> {
504 static string className() { return "ThePEG::StandardEventHandler"; }
505};
506
509}
510
511#endif /* ThePEG_StandardEventHandler_H */
This is the main config header file for ThePEG.
A concreate implementation of ClassDescriptionBase describing a concrete class with persistent data.
The EventHandler is the base class used to implement event handlers in ThePEG.
Definition: EventHandler.h:63
Exception is the base class for all exceptions to be used in ThePEG.
Definition: Exception.h:44
The LorentzRotation class combine a SpinOneLorentzRotation and a spin SpinHalfLorentzRotation to prov...
PersistentIStream is used to read persistent objects from a stream where they were previously written...
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition: RCPtr.h:519
Selector is a templated class for storing objects associated with probabilities in a way such that,...
Definition: Selector.h:46
The StandardEventHandler class is the main class for generating simple events without overlayed colli...
int maxDim(int bin) const
Return the number of phase space dimensions needed for the sampling of indicated bin of StandardXComb...
virtual IBPtr clone() const
Make a simple clone of this object.
SamplerPtr theSampler
The phase space sampler responsible for generating phase space points according to the cross section ...
virtual ~StandardEventHandler()
Destructor.
LorentzRotation theCurrentEventBoost
The boost needed to transform the current collision from the CMS system to the lab system.
tCollPtr performCollision()
For the sub-procss and phase-space point selected in the previous call to dSigDR, produce the first s...
XVector & xCombs()
Return the vector of StandardXComb objects.
void addME(Energy maxEnergy, tSubHdlPtr sub, tPExtrPtr extractor, tCutsPtr cuts, tCascHdlPtr ckkw, tMEPtr me, const PBPair &pBins, const PartonPairVec &allPBins)
Create and add StandardXComb objects.
virtual void dofinish()
Finalize this object.
Selector< StdXCombPtr > XSelector
A weighted list of pointers to StandardXComb objects.
virtual void statistics(ostream &) const
Write out accumulated statistics about intergrated cross sections and stuff.
virtual void select(tXCombPtr newXComb)
Change the XComb object.
virtual CrossSection histogramScale() const
Histogram scale.
void setIncomingB(PDPtr)
Helper function for the interface.
virtual CrossSection dSigDR(const vector< double > &r)
Return the cross section for the chosen phase space point.
const SubHandlerList & subProcesses() const
Access the list of sub-process handlers.
virtual void doinit()
Initialize this object after the setup phase before saving an EventGenerator to disk.
SubHandlerList & subProcesses()
Access the list of sub-process handlers.
void setScale(Energy2)
Set information about the current sub-process.
virtual CrossSection integratedXSecErr() const
The estimated error int total integrated cross section of the processes generated in this run.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
tStdXCombPtr select(int bin, double &weight)
Select an StandardXComb.
virtual void clean()
Throw away the last generated event before generating a new one.
vector< CrossSection > XSVector
A vector of cross sections.
PDPtr theIncomingA
The first of the incoming particle types.
bool collisionCuts
True if cuts on collision objects should be performed.
void reject(double weight)
Reject a (partially) generated event.
void setIncomingA(PDPtr)
Helper function for the interface.
SubHandlerList theSubProcesses
The list of SubProcessHandlers.
const LorentzRotation & currentEventBoost() const
Return the boost needed to transform the current event from the CMS system to the lab system.
CutsPtr theCuts
The kinematical cuts used for this collision handler.
virtual CrossSection integratedXSec() const
The estimated total integrated cross section of the processes generated in this run.
tCutsPtr cuts() const
Return a reference to the Cuts of this EventHandler.
PDPtr theIncomingB
The second of the incoming particle types.
const XVector & xCombs() const
Return the vector of StandardXComb objects.
XVector theXCombs
The StandardXComb objects.
tSamplerPtr sampler()
Return the sampler assigned to this event handler.
vector< int > theMaxDims
The number of degrees of freedom needed to generate the phase space for the different bins.
static ClassDescription< StandardEventHandler > initStandardEventHandler
Standard Initialization object.
tcSamplerPtr sampler() const
Return the sampler assigned to this event handler.
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...
static void Init()
Standard Init function used to initialize the interface.
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
int theLumiDim
The number of phase space dimensions used by the luminosity function.
virtual void initGroups()
Initialize groups of StepHandlers.
virtual CrossSection integratedXSecErrNoReweight() const
The estimated error int total integrated cross section of the processes generated in this run,...
vector< StdXCombPtr > XVector
A vector of pointers to StandardXComb objects.
virtual void initialize()
Initialize this event handler and all related objects needed to generate events.
virtual EventPtr generateEvent()
Generate an event.
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 EventPtr continueEvent()
Continue generating an event if the generation has been stopped before finishing.
const StandardEventHandler & operator=(const StandardEventHandler &)=delete
Private and non-existent assignment operator.
virtual void doinitrun()
Initialize this object.
void reweight(double factor) const
Reweight a partially generated event.
int nBins() const
Return the number of separate bins of StandardXComb objects to sample.
virtual void doupdate()
Check sanity of the object during the setup phase.
int lumiDim() const
The number of phase space dimensions used by the luminosity function.
StandardEventHandler()
Default constructor.
map< tMEPtr, XVector > MEXMap
Map of pointers to StandardXComb objects indexed by pointers to the corresponding MEBase object.
LorentzRotation & currentEventBoost()
Return the boost needed to transform the current collision from the CMS system to the lab system.
vector< SubHdlPtr > SubHandlerList
A vector of SubProcessHandlers.
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
virtual CrossSection integratedXSecNoReweight() const
The estimated total integrated cross section of the processes generated in this run,...
XSecStat xSecStats
The overall cross section statistics.
XSecStat is a concrete helper class used to collect statistics about the cross section for a specific...
Definition: XSecStat.h:36
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
int NthBase
The type of the BaseN'th base class (int means there are no further base classes).
Definition: ClassTraits.h:161
static string className()
Return the name of class T.
Definition: ClassTraits.h:66
ClassTraitsType is an empty, non-polymorphic, base class.
Definition: ClassTraits.h:30