thepeg
is hosted by
Hepforge
,
IPPP Durham
ThePEG
2.2.1
EventRecord
Event.h
1
// -*- C++ -*-
2
//
3
// Event.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_Event_H
10
#define ThePEG_Event_H
11
// This is the decalaration of the Event class.
12
13
#include "Particle.h"
14
#include "
StandardSelectors.h
"
15
#include "SubProcess.h"
16
#include "ThePEG/Utilities/Named.h"
17
18
namespace
ThePEG
{
19
36
class
Event
:
public
EventRecordBase
,
public
Named
{
37
38
public
:
39
43
friend
class
EventHandler
;
45
friend
class
Collision
;
46
48
typedef
map<tcColinePtr, int>
ColourLineMap
;
49
50
public
:
51
65
Event
(
const
PPair
& newIncoming,
tcEventBasePtr
newHandler =
tcEventBasePtr
(),
66
string
newName =
""
,
long
newNumber = -1,
double
weight
= 1.0);
67
71
Event
(
const
Event
&);
72
76
~Event
();
77
82
EventPtr
clone
()
const
;
83
84
public
:
85
90
tcEventBasePtr
handler
()
const
{
return
theHandler
; }
91
102
template
<
class
OutputIterator>
103
void
select
(OutputIterator r,
const
SelectorBase
& s)
const
;
104
110
template
<
class
OutputIterator>
111
void
selectFinalState
(OutputIterator r)
const
{
112
select
(r,
SelectFinalState
());
113
}
114
120
template
<
class
Container>
121
void
getFinalState
(Container & c)
const
{
122
selectFinalState
(
inserter
(c));
123
}
124
129
tPVector
getFinalState
()
const
{
130
tPVector
ret;
131
selectFinalState
(back_inserter(ret));
132
return
ret;
133
}
134
139
tCollPtr
primaryCollision
()
const
{
140
return
collisions
().empty() ?
tCollPtr
() :
tCollPtr
(
collisions
()[0]);
141
}
142
146
const
CollisionVector
&
collisions
()
const
{
return
theCollisions
; }
147
152
tSubProPtr
primarySubProcess
()
const
;
153
158
const
PPair
&
incoming
()
const
{
return
theIncoming
; }
159
161
165
tCollPtr
newCollision
();
166
172
tStepPtr
newStep
();
173
177
void
transform
(
const
LorentzRotation
&);
178
183
long
number
()
const
{
return
theNumber
; }
184
188
int
colourLineIndex
(
tcColinePtr
)
const
;
189
196
void
removeDecay
(
tPPtr
);
197
203
void
removeParticle
(
tPPtr
);
204
208
void
cleanSteps
();
209
211
215
double
weight
()
const
{
return
theWeight
; }
216
221
double
optionalWeight
(
const
string
&
name
)
const
;
222
226
const
map<string,double>&
optionalWeights
()
const
{
return
theOptionalWeights
; }
227
231
void
printGraphviz
()
const
;
232
236
void
weight
(
double
w) {
theWeight
= w; }
237
241
void
optionalWeight
(
const
string
& name,
double
value);
242
246
map<string,double>&
optionalWeights
() {
return
theOptionalWeights
; }
247
251
void
setInfo
(
tcEventBasePtr
newHandler,
string
newName,
252
long
newNumber,
double
weight
);
253
257
void
addCollision
(
tCollPtr
c);
258
262
void
primaryCollision
(
tCollPtr
c);
263
264
protected
:
265
269
template
<
class
Iterator>
270
void
addParticles
(Iterator first, Iterator last) {
271
while
( first != last )
addParticle
(*first++);
272
}
273
277
void
addParticle
(
tPPtr
p);
278
284
void
addSubProcess
(
tSubProPtr
p) {
285
if
( p )
allSubProcesses
.insert(p);
286
}
287
291
void
removeSubProcess
(
tSubProPtr
p) {
allSubProcesses
.erase(p); }
292
298
void
addStep
(
tStepPtr
s) {
299
if
( s )
allSteps
.insert(s);
300
}
301
305
void
removeEntry
(
tPPtr
p);
306
314
void
rebind
(
const
EventTranslationMap
& trans);
315
316
public
:
317
321
void
persistentOutput
(
PersistentOStream
&)
const
;
322
326
void
persistentInput
(
PersistentIStream
&,
int
);
327
331
static
void
Init
();
332
333
private
:
334
338
PPair
theIncoming
;
339
343
CollisionVector
theCollisions
;
344
348
StepSet
allSteps
;
349
353
SubProcessSet
allSubProcesses
;
354
358
ParticleSet
allParticles
;
359
364
tcEventBasePtr
theHandler
;
365
369
mutable
ColourLineMap
theColourLines
;
370
374
long
theNumber
;
375
379
double
theWeight
;
380
384
map<string,double>
theOptionalWeights
;
385
389
long
theParticleNumber
;
390
391
public
:
392
397
virtual
void
debugme
()
const
;
398
399
private
:
400
404
static
ClassDescription<Event>
initEvent
;
405
410
Event
() : theNumber(-1), theWeight(1.0), theParticleNumber(0) {}
411
416
friend
struct
ClassTraits
<
Event
>;
417
421
Event
&
operator=
(
const
Event
&) =
delete
;
422
423
};
424
426
ostream &
operator<<
(ostream &,
const
Event
&);
427
429
void
printGraphviz
(ostream &,
tcEventPtr
);
430
435
template
<>
436
struct
BaseClassTrait
<
Event
,1>:
public
ClassTraitsType
{
438
typedef
EventRecordBase
NthBase;
439
};
440
443
template
<>
444
struct
ClassTraits
<
Event
>:
public
ClassTraitsBase
<Event> {
446
static
string
className() {
return
"ThePEG::Event"
; }
448
static
TPtr create() {
return
TPtr::Create(
Event
()); }
449
};
450
453
}
454
455
#include "Collision.h"
456
457
inline
ThePEG::tSubProPtr
ThePEG::Event::primarySubProcess
()
const
{
458
return
collisions
().empty() ?
ThePEG::tSubProPtr
() :
459
ThePEG::tSubProPtr
(
primaryCollision
()->
primarySubProcess
());
460
}
461
462
namespace
ThePEG
{
463
template
<
class
OutputIterator>
464
void
Event::select
(OutputIterator r,
const
SelectorBase
& s)
const
{
465
if
( s.
allCollisions
() ) {
466
for
( CollisionVector::const_iterator it =
theCollisions
.begin();
467
it !=
theCollisions
.end(); ++it ) (**it).select(r, s);
468
}
else
{
469
primaryCollision
()->select(r, s);
470
}
471
}
472
}
473
474
#endif
/* ThePEG_Event_H */
ThePEG::Event::persistentOutput
void persistentOutput(PersistentOStream &) const
Standard function for writing to a persistent stream.
ThePEG::Event::primaryCollision
tCollPtr primaryCollision() const
Return a pointer to the primary Collision in this Event.
Definition:
Event.h:139
ThePEG::PersistentIStream
PersistentIStream is used to read persistent objects from a stream where they were previously written...
Definition:
PersistentIStream.h:48
ThePEG::Event::addStep
void addStep(tStepPtr s)
Add a new Step to this Collision.
Definition:
Event.h:298
ThePEG::Event::getFinalState
tPVector getFinalState() const
Extract all final state particles in this Event.
Definition:
Event.h:129
ThePEG::Event::primarySubProcess
tSubProPtr primarySubProcess() const
Return a pointer to the primary SubProcess in the prinmary Collision in this Event.
Definition:
Event.h:457
ThePEG::Event::removeParticle
void removeParticle(tPPtr)
Remove the given Particle from the Collision.
ThePEG::EventHandler
The EventHandler is the base class used to implement event handlers in ThePEG.
Definition:
EventHandler.h:63
ThePEG::Event::allParticles
ParticleSet allParticles
A set of all particles in this Event.
Definition:
Event.h:358
ThePEG::Base
Define the base class from which all (polymorphic) classes in ThePEG are derived. ...
Definition:
ThePEG.h:54
ThePEG::ClassTraitsType
ClassTraitsType is an empty, non-polymorphic, base class.
Definition:
ClassTraits.h:30
ThePEG::Event::selectFinalState
void selectFinalState(OutputIterator r) const
Extract all final state particles in this Event.
Definition:
Event.h:111
ThePEG::Event
The Event class contains all Particles produced in the generation of an event.
Definition:
Event.h:36
ThePEG::SelectorBase
Classes derived from the SelectorBase class are used to extract particles from an Event with Event::s...
Definition:
SelectorBase.h:45
ThePEG::ClassDescription
A concreate implementation of ClassDescriptionBase describing a concrete class with persistent data...
Definition:
ClassDescription.h:339
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::TransientConstRCPtr
TransientConstRCPtr is a simple wrapper around a bare const pointer which can be assigned to and from...
Definition:
RCPtr.h:696
ThePEG::tcEventBasePtr
Ptr< EventRecordBase >::transient_const_pointer tcEventBasePtr
Alias for a transient pointer to const EventRecordBase.
Definition:
EventConfig.h:49
ThePEG::LorentzRotation
The LorentzRotation class combine a SpinOneLorentzRotation and a spin SpinHalfLorentzRotation to prov...
Definition:
LorentzRotation.h:27
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::Event::removeDecay
void removeDecay(tPPtr)
Remove (recursively) the decay products from a given Particle and add the particle to the list of fin...
ThePEG::Event::theNumber
long theNumber
The number assigned to this Event.
Definition:
Event.h:374
ThePEG::Rebinder
Rebinder is a class associating pairs of pointers to objects.
Definition:
Rebinder.h:27
ThePEG::Event::addSubProcess
void addSubProcess(tSubProPtr p)
Add a new SubProcess to this Event.
Definition:
Event.h:284
ThePEG::Event::theParticleNumber
long theParticleNumber
Counter to keep track of particle numbering.
Definition:
Event.h:389
ThePEG::Event::Init
static void Init()
Standard Init function.
ThePEG
This is the main namespace within which all identifiers in ThePEG are declared.
Definition:
FactoryBase.h:28
ThePEG::Named
The Named class is a simple concrete base class to used by classes of objects with a name...
Definition:
Named.h:24
ThePEG::inserter
std::insert_iterator< Cont > inserter(Cont &c)
Return an insert iterator for a given container.
Definition:
std.h:140
ThePEG::Event::theWeight
double theWeight
The weight associated with this event.
Definition:
Event.h:379
ThePEG::Event::incoming
const PPair & incoming() const
Return a reference to the pair of colliding particles in the primary Collision of this Event...
Definition:
Event.h:158
ThePEG::Event::clone
EventPtr clone() const
Returns a full clone of this Event.
ThePEG::Event::allSteps
StepSet allSteps
A set of all particles in this Event.
Definition:
Event.h:348
ThePEG::Event::select
void select(OutputIterator r, const SelectorBase &s) const
Extract particles from this event which satisfies the requirements given by an object of the Selector...
Definition:
Event.h:464
ThePEG::Event::operator=
Event & operator=(const Event &)=delete
The assignment operator is private and not implemented.
ThePEG::Event::collisions
const CollisionVector & collisions() const
Return a possibly empty list of collisions in this Event.
Definition:
Event.h:146
ThePEG::Event::weight
void weight(double w)
Set the weight associated with this event.
Definition:
Event.h:236
ThePEG::Event::cleanSteps
void cleanSteps()
Remove all steps which have no new particles introduced in them.
ThePEG::ParticleSet
set< PPtr, less< PPtr > > ParticleSet
A set of pointers to Particle.
Definition:
EventConfig.h:76
ThePEG::Event::ColourLineMap
map< tcColinePtr, int > ColourLineMap
Map colour lines to indices.
Definition:
Event.h:48
ThePEG::Event::getFinalState
void getFinalState(Container &c) const
Extract all final state particles in this Event.
Definition:
Event.h:121
ThePEG::Event::theCollisions
CollisionVector theCollisions
A vector of collisions in this Event.
Definition:
Event.h:343
ThePEG::Event::theIncoming
PPair theIncoming
The pair of colliding particles.
Definition:
Event.h:338
ThePEG::Event::persistentInput
void persistentInput(PersistentIStream &, int)
Standard functions for reading from a persistent stream.
ThePEG::tSubProPtr
ThePEG::Ptr< SubProcess >::transient_pointer tSubProPtr
Alias for a transient pointer to SubProcess .
Definition:
Pointers.h:86
ThePEG::Event::theColourLines
ColourLineMap theColourLines
Map of all registered colour lines to their index numbers.
Definition:
Event.h:369
ThePEG::Event::colourLineIndex
int colourLineIndex(tcColinePtr) const
Return the index of the given colour line.
ThePEG::PPair
pair< PPtr, PPtr > PPair
A pair of pointers to Particle objects.
Definition:
Containers.h:127
ThePEG::Pointer::RCPtr
RCPtr is a reference counted (smart) pointer.
Definition:
RCPtr.h:60
ThePEG::Event::optionalWeights
const map< string, double > & optionalWeights() const
Return the optional named weights associated to this event.
Definition:
Event.h:226
ThePEG::Event::removeEntry
void removeEntry(tPPtr p)
Remove a given Particle entry.
ThePEG::Named::name
const string & name() const
Return name.
Definition:
Named.h:42
ThePEG::Event::Event
Event()
Private default constructor must only be used by the PersistentIStream class via the ClassTraits<Even...
Definition:
Event.h:410
ThePEG::Event::optionalWeights
map< string, double > & optionalWeights()
Access the optional named weights associated to this event.
Definition:
Event.h:246
ThePEG::Event::transform
void transform(const LorentzRotation &)
Transform all particles in this Event.
ThePEG::Event::theHandler
tcEventBasePtr theHandler
A pointer to the EventHandler which performed the generation of this Event.
Definition:
Event.h:364
ThePEG::Event::setInfo
void setInfo(tcEventBasePtr newHandler, string newName, long newNumber, double weight)
Set event info.
ThePEG::tCollPtr
ThePEG::Ptr< Collision >::transient_pointer tCollPtr
Alias for a transient pointer to Collision .
Definition:
Pointers.h:84
ThePEG::Collision
This is the decalaration of the Collision class.
Definition:
Collision.h:34
ThePEG::SelectorBase::allCollisions
virtual bool allCollisions() const
Return ture if all collisions should be considered.
Definition:
SelectorBase.h:104
ThePEG::Event::debugme
virtual void debugme() const
Print out debugging information for this object on std::cerr.
ThePEG::Event::handler
tcEventBasePtr handler() const
Return a pointer to the EventHandler which produced this Event.
Definition:
Event.h:90
ThePEG::CollisionVector
vector< CollPtr > CollisionVector
A vector of pointers to Collision.
Definition:
EventConfig.h:88
ThePEG::Event::addCollision
void addCollision(tCollPtr c)
Add a collision to this Event.
ThePEG::Event::allSubProcesses
SubProcessSet allSubProcesses
A set of all sub-processes in this Event.
Definition:
Event.h:353
ThePEG::Event::addParticles
void addParticles(Iterator first, Iterator last)
Add a range of particles to this Collision.
Definition:
Event.h:270
ThePEG::ClassTraits
The default concrete implementation of ClassTraitsBase.
Definition:
ClassTraits.h:134
ThePEG::Event::optionalWeight
double optionalWeight(const string &name) const
Return an optional named weight associated to this event.
ThePEG::operator<<
vector< T > & operator<<(vector< T > &tv, const U &u)
Overload the left shift operator for vector to push_back objects to a vector.
Definition:
Containers.h:179
ThePEG::Event::initEvent
static ClassDescription< Event > initEvent
Describe concrete class with persistent data.
Definition:
Event.h:404
ThePEG::Event::newStep
tStepPtr newStep()
Create a new Step in the current Collision, which is a copy of the last Step (if any) and return a po...
ThePEG::Event::newCollision
tCollPtr newCollision()
Create a new Collision in this event and return a pointer to it.
ThePEG::Event::theOptionalWeights
map< string, double > theOptionalWeights
Optional named weights.
Definition:
Event.h:384
ThePEG::Event::weight
double weight() const
Return the weight associated with this event.
Definition:
Event.h:215
ThePEG::Event::printGraphviz
void printGraphviz() const
Print this Event in Graphviz format on the standard output.
ThePEG::tPVector
vector< tPPtr > tPVector
A vector of transient pointers to Particle objects.
Definition:
Containers.h:82
StandardSelectors.h
This file contains declarations of standard selector classes.
ThePEG::StepSet
set< StepPtr, less< StepPtr > > StepSet
A set of pointers to Step.
Definition:
EventConfig.h:90
ThePEG::Event::rebind
void rebind(const EventTranslationMap &trans)
Rebind to cloned objects.
ThePEG::BaseClassTrait
BaseClassTraits describes the base classes of the templated class.
Definition:
ClassTraits.h:156
ThePEG::Event::number
long number() const
Return the number assigned to this Event.
Definition:
Event.h:183
ThePEG::SelectFinalState
ParticleSelector< FinalStateSelector > SelectFinalState
Typedef to declare a selector used to extract all final state particles from an event.
Definition:
StandardSelectors.h:94
ThePEG::Event::removeSubProcess
void removeSubProcess(tSubProPtr p)
Remove a SubProcess from this Event.
Definition:
Event.h:291
ThePEG::Event::~Event
~Event()
The destructor.
ThePEG::Event::addParticle
void addParticle(tPPtr p)
Add a particle to this Collision.
ThePEG::ClassTraitsBase
The templated ClassTraitsBase class defines a set of default information about classes used by ThePEG...
Definition:
ClassTraits.h:52
ThePEG::SubProcessSet
set< SubProPtr, less< SubProPtr > > SubProcessSet
A set of pointers to SubProcess.
Definition:
EventConfig.h:92
Generated on Sat Apr 11 2020 14:31:17 for ThePEG by
1.8.13