thepeg
is hosted by
Hepforge
,
IPPP Durham
ThePEG
2.3.0
Handlers
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
13
#include "
ThePEG/Config/ThePEG.h
"
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
25
namespace
ThePEG
{
26
44
class
StandardEventHandler
:
public
EventHandler
{
45
46
public
:
47
49
typedef
vector<SubHdlPtr>
SubHandlerList
;
50
52
typedef
Selector<StdXCombPtr>
XSelector
;
53
55
typedef
vector<StdXCombPtr>
XVector
;
56
58
typedef
vector<CrossSection>
XSVector
;
59
62
typedef
map<tMEPtr,XVector>
MEXMap
;
63
64
public
:
65
71
StandardEventHandler
();
72
76
virtual
~StandardEventHandler
();
78
79
public
:
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
108
virtual
CrossSection
histogramScale
()
const
;
109
115
virtual
CrossSection
integratedXSec
()
const
;
116
122
virtual
CrossSection
integratedXSecErr
()
const
;
123
129
virtual
CrossSection
integratedXSecNoReweight
()
const
;
130
136
virtual
CrossSection
integratedXSecErrNoReweight
()
const
;
137
145
virtual
CrossSection
dSigDR
(
const
vector<double> & r);
146
150
virtual
EventPtr
generateEvent
();
151
156
virtual
EventPtr
continueEvent
();
157
161
void
reweight
(
double
factor)
const
;
162
166
const
XVector
&
xCombs
()
const
{
return
theXCombs
; }
167
171
virtual
void
select
(
tXCombPtr
newXComb);
172
177
const
LorentzRotation
&
currentEventBoost
()
const
{
return
theCurrentEventBoost
; }
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
214
protected
:
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
260
tCollPtr
performCollision
();
261
269
virtual
void
initGroups
();
270
277
LorentzRotation
&
currentEventBoost
() {
return
theCurrentEventBoost
; }
278
282
void
setScale
(
Energy2
);
283
287
XVector
&
xCombs
() {
return
theXCombs
; }
288
292
virtual
void
clean
();
293
294
private
:
295
299
const
SubHandlerList
&
subProcesses
()
const
{
return
theSubProcesses
; }
300
304
SubHandlerList
&
subProcesses
() {
return
theSubProcesses
; }
305
306
public
:
307
313
virtual
void
doupdate
();
314
320
virtual
void
doinit
();
321
326
virtual
void
doinitrun
();
327
332
virtual
void
dofinish
();
334
341
void
persistentOutput
(
PersistentOStream
& os)
const
;
342
348
void
persistentInput
(
PersistentIStream
& is,
int
version);
350
354
static
void
Init
();
355
356
protected
:
357
364
virtual
IBPtr
clone
()
const
;
365
370
virtual
IBPtr
fullclone
()
const
;
372
377
void
reject
(
double
weight);
378
379
private
:
380
385
PDPtr
theIncomingA
;
390
PDPtr
theIncomingB
;
391
395
SubHandlerList
theSubProcesses
;
396
400
CutsPtr
theCuts
;
401
405
bool
collisionCuts
;
406
410
XVector
theXCombs
;
411
416
vector<int>
theMaxDims
;
417
422
LorentzRotation
theCurrentEventBoost
;
423
429
SamplerPtr
theSampler
;
430
435
int
theLumiDim
;
436
440
mutable
XSecStat
xSecStats
;
441
445
static
ClassDescription<StandardEventHandler>
initStandardEventHandler
;
446
450
void
setIncomingA
(
PDPtr
);
451
455
void
setIncomingB
(
PDPtr
);
456
457
protected
:
458
464
class
StandardEventHandlerUpdateException:
public
UpdateException {};
465
470
class
StandardEventHandlerInitError:
public
Exception
{};
473
private
:
474
478
const
StandardEventHandler
&
operator=
(
const
StandardEventHandler
&) =
delete
;
479
480
};
481
488
template
<>
489
struct
BaseClassTrait
<
StandardEventHandler
,1>:
public
ClassTraitsType
{
491
typedef
EventHandler
NthBase
;
492
};
493
498
template
<>
499
struct
ClassTraits<StandardEventHandler>
500
:
public
ClassTraitsBase<StandardEventHandler> {
504
static
string
className
() {
return
"ThePEG::StandardEventHandler"
; }
505
};
506
509
}
510
511
#endif
/* ThePEG_StandardEventHandler_H */
ThePEG.h
This is the main config header file for ThePEG.
ThePEG::ClassDescription
A concreate implementation of ClassDescriptionBase describing a concrete class with persistent data.
Definition:
ClassDescription.h:333
ThePEG::EventHandler
The EventHandler is the base class used to implement event handlers in ThePEG.
Definition:
EventHandler.h:63
ThePEG::Exception
Exception is the base class for all exceptions to be used in ThePEG.
Definition:
Exception.h:44
ThePEG::LorentzRotation
The LorentzRotation class combine a SpinOneLorentzRotation and a spin SpinHalfLorentzRotation to prov...
Definition:
LorentzRotation.h:27
ThePEG::PersistentIStream
PersistentIStream is used to read persistent objects from a stream where they were previously written...
Definition:
PersistentIStream.h:48
ThePEG::PersistentOStream
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
Definition:
PersistentOStream.h:51
ThePEG::Pointer::RCPtr
RCPtr is a reference counted (smart) pointer.
Definition:
RCPtr.h:60
ThePEG::Pointer::TransientRCPtr
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition:
RCPtr.h:519
ThePEG::Qty< std::ratio< L, DL >, std::ratio< E, DE >, std::ratio< Q, DQ > >
Definition:
PhysicalQty.h:77
ThePEG::Qty< 0, 2, 0 >
ThePEG::Selector
Selector is a templated class for storing objects associated with probabilities in a way such that,...
Definition:
Selector.h:46
ThePEG::StandardEventHandler
The StandardEventHandler class is the main class for generating simple events without overlayed colli...
Definition:
StandardEventHandler.h:44
ThePEG::StandardEventHandler::maxDim
int maxDim(int bin) const
Return the number of phase space dimensions needed for the sampling of indicated bin of StandardXComb...
Definition:
StandardEventHandler.h:199
ThePEG::StandardEventHandler::clone
virtual IBPtr clone() const
Make a simple clone of this object.
ThePEG::StandardEventHandler::theSampler
SamplerPtr theSampler
The phase space sampler responsible for generating phase space points according to the cross section ...
Definition:
StandardEventHandler.h:429
ThePEG::StandardEventHandler::~StandardEventHandler
virtual ~StandardEventHandler()
Destructor.
ThePEG::StandardEventHandler::theCurrentEventBoost
LorentzRotation theCurrentEventBoost
The boost needed to transform the current collision from the CMS system to the lab system.
Definition:
StandardEventHandler.h:422
ThePEG::StandardEventHandler::performCollision
tCollPtr performCollision()
For the sub-procss and phase-space point selected in the previous call to dSigDR, produce the first s...
ThePEG::StandardEventHandler::xCombs
XVector & xCombs()
Return the vector of StandardXComb objects.
Definition:
StandardEventHandler.h:287
ThePEG::StandardEventHandler::addME
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.
ThePEG::StandardEventHandler::dofinish
virtual void dofinish()
Finalize this object.
ThePEG::StandardEventHandler::XSelector
Selector< StdXCombPtr > XSelector
A weighted list of pointers to StandardXComb objects.
Definition:
StandardEventHandler.h:52
ThePEG::StandardEventHandler::statistics
virtual void statistics(ostream &) const
Write out accumulated statistics about intergrated cross sections and stuff.
ThePEG::StandardEventHandler::select
virtual void select(tXCombPtr newXComb)
Change the XComb object.
ThePEG::StandardEventHandler::histogramScale
virtual CrossSection histogramScale() const
Histogram scale.
ThePEG::StandardEventHandler::setIncomingB
void setIncomingB(PDPtr)
Helper function for the interface.
ThePEG::StandardEventHandler::dSigDR
virtual CrossSection dSigDR(const vector< double > &r)
Return the cross section for the chosen phase space point.
ThePEG::StandardEventHandler::subProcesses
const SubHandlerList & subProcesses() const
Access the list of sub-process handlers.
Definition:
StandardEventHandler.h:299
ThePEG::StandardEventHandler::doinit
virtual void doinit()
Initialize this object after the setup phase before saving an EventGenerator to disk.
ThePEG::StandardEventHandler::subProcesses
SubHandlerList & subProcesses()
Access the list of sub-process handlers.
Definition:
StandardEventHandler.h:304
ThePEG::StandardEventHandler::setScale
void setScale(Energy2)
Set information about the current sub-process.
ThePEG::StandardEventHandler::integratedXSecErr
virtual CrossSection integratedXSecErr() const
The estimated error int total integrated cross section of the processes generated in this run.
ThePEG::StandardEventHandler::persistentOutput
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
ThePEG::StandardEventHandler::select
tStdXCombPtr select(int bin, double &weight)
Select an StandardXComb.
ThePEG::StandardEventHandler::clean
virtual void clean()
Throw away the last generated event before generating a new one.
ThePEG::StandardEventHandler::XSVector
vector< CrossSection > XSVector
A vector of cross sections.
Definition:
StandardEventHandler.h:58
ThePEG::StandardEventHandler::theIncomingA
PDPtr theIncomingA
The first of the incoming particle types.
Definition:
StandardEventHandler.h:385
ThePEG::StandardEventHandler::collisionCuts
bool collisionCuts
True if cuts on collision objects should be performed.
Definition:
StandardEventHandler.h:405
ThePEG::StandardEventHandler::reject
void reject(double weight)
Reject a (partially) generated event.
ThePEG::StandardEventHandler::setIncomingA
void setIncomingA(PDPtr)
Helper function for the interface.
ThePEG::StandardEventHandler::theSubProcesses
SubHandlerList theSubProcesses
The list of SubProcessHandlers.
Definition:
StandardEventHandler.h:395
ThePEG::StandardEventHandler::currentEventBoost
const LorentzRotation & currentEventBoost() const
Return the boost needed to transform the current event from the CMS system to the lab system.
Definition:
StandardEventHandler.h:177
ThePEG::StandardEventHandler::theCuts
CutsPtr theCuts
The kinematical cuts used for this collision handler.
Definition:
StandardEventHandler.h:400
ThePEG::StandardEventHandler::integratedXSec
virtual CrossSection integratedXSec() const
The estimated total integrated cross section of the processes generated in this run.
ThePEG::StandardEventHandler::cuts
tCutsPtr cuts() const
Return a reference to the Cuts of this EventHandler.
Definition:
StandardEventHandler.h:187
ThePEG::StandardEventHandler::theIncomingB
PDPtr theIncomingB
The second of the incoming particle types.
Definition:
StandardEventHandler.h:390
ThePEG::StandardEventHandler::xCombs
const XVector & xCombs() const
Return the vector of StandardXComb objects.
Definition:
StandardEventHandler.h:166
ThePEG::StandardEventHandler::theXCombs
XVector theXCombs
The StandardXComb objects.
Definition:
StandardEventHandler.h:410
ThePEG::StandardEventHandler::sampler
tSamplerPtr sampler()
Return the sampler assigned to this event handler.
Definition:
StandardEventHandler.h:96
ThePEG::StandardEventHandler::theMaxDims
vector< int > theMaxDims
The number of degrees of freedom needed to generate the phase space for the different bins.
Definition:
StandardEventHandler.h:416
ThePEG::StandardEventHandler::initStandardEventHandler
static ClassDescription< StandardEventHandler > initStandardEventHandler
Standard Initialization object.
Definition:
StandardEventHandler.h:445
ThePEG::StandardEventHandler::sampler
tcSamplerPtr sampler() const
Return the sampler assigned to this event handler.
Definition:
StandardEventHandler.h:101
ThePEG::StandardEventHandler::nDim
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...
Definition:
StandardEventHandler.h:211
ThePEG::StandardEventHandler::Init
static void Init()
Standard Init function used to initialize the interface.
ThePEG::StandardEventHandler::fullclone
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
ThePEG::StandardEventHandler::theLumiDim
int theLumiDim
The number of phase space dimensions used by the luminosity function.
Definition:
StandardEventHandler.h:435
ThePEG::StandardEventHandler::initGroups
virtual void initGroups()
Initialize groups of StepHandlers.
ThePEG::StandardEventHandler::integratedXSecErrNoReweight
virtual CrossSection integratedXSecErrNoReweight() const
The estimated error int total integrated cross section of the processes generated in this run,...
ThePEG::StandardEventHandler::XVector
vector< StdXCombPtr > XVector
A vector of pointers to StandardXComb objects.
Definition:
StandardEventHandler.h:55
ThePEG::StandardEventHandler::initialize
virtual void initialize()
Initialize this event handler and all related objects needed to generate events.
ThePEG::StandardEventHandler::generateEvent
virtual EventPtr generateEvent()
Generate an event.
ThePEG::StandardEventHandler::dSigDR
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.
ThePEG::StandardEventHandler::continueEvent
virtual EventPtr continueEvent()
Continue generating an event if the generation has been stopped before finishing.
ThePEG::StandardEventHandler::operator=
const StandardEventHandler & operator=(const StandardEventHandler &)=delete
Private and non-existent assignment operator.
ThePEG::StandardEventHandler::doinitrun
virtual void doinitrun()
Initialize this object.
ThePEG::StandardEventHandler::reweight
void reweight(double factor) const
Reweight a partially generated event.
ThePEG::StandardEventHandler::nBins
int nBins() const
Return the number of separate bins of StandardXComb objects to sample.
ThePEG::StandardEventHandler::doupdate
virtual void doupdate()
Check sanity of the object during the setup phase.
ThePEG::StandardEventHandler::lumiDim
int lumiDim() const
The number of phase space dimensions used by the luminosity function.
Definition:
StandardEventHandler.h:205
ThePEG::StandardEventHandler::StandardEventHandler
StandardEventHandler()
Default constructor.
ThePEG::StandardEventHandler::MEXMap
map< tMEPtr, XVector > MEXMap
Map of pointers to StandardXComb objects indexed by pointers to the corresponding MEBase object.
Definition:
StandardEventHandler.h:62
ThePEG::StandardEventHandler::currentEventBoost
LorentzRotation & currentEventBoost()
Return the boost needed to transform the current collision from the CMS system to the lab system.
Definition:
StandardEventHandler.h:277
ThePEG::StandardEventHandler::SubHandlerList
vector< SubHdlPtr > SubHandlerList
A vector of SubProcessHandlers.
Definition:
StandardEventHandler.h:49
ThePEG::StandardEventHandler::persistentInput
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
ThePEG::StandardEventHandler::integratedXSecNoReweight
virtual CrossSection integratedXSecNoReweight() const
The estimated total integrated cross section of the processes generated in this run,...
ThePEG::StandardEventHandler::xSecStats
XSecStat xSecStats
The overall cross section statistics.
Definition:
StandardEventHandler.h:440
ThePEG::XSecStat
XSecStat is a concrete helper class used to collect statistics about the cross section for a specific...
Definition:
XSecStat.h:36
ThePEG
This is the main namespace within which all identifiers in ThePEG are declared.
Definition:
FactoryBase.h:28
ThePEG::BaseClassTrait
BaseClassTraits describes the base classes of the templated class.
Definition:
ClassTraits.h:156
ThePEG::BaseClassTrait::NthBase
int NthBase
The type of the BaseN'th base class (int means there are no further base classes).
Definition:
ClassTraits.h:161
ThePEG::ClassTraitsBase::className
static string className()
Return the name of class T.
Definition:
ClassTraits.h:66
ThePEG::ClassTraitsType
ClassTraitsType is an empty, non-polymorphic, base class.
Definition:
ClassTraits.h:30
Generated on Thu Jun 20 2024 14:47:00 for ThePEG by
1.9.6