thepeg
is hosted by
Hepforge
,
IPPP Durham
ThePEG
2.3.0
EventRecord
Collision.h
1
// -*- C++ -*-
2
//
3
// Collision.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_Collision_H
10
#define ThePEG_Collision_H
11
// This is the decalaration of the Collision class. It
12
13
#include "
EventConfig.h
"
14
#include "Particle.h"
15
#include "
StandardSelectors.h
"
16
#include "
ThePEG/Vectors/LorentzVector.h
"
17
#include "ThePEG/Vectors/LorentzRotation.h"
18
19
namespace
ThePEG
{
20
34
class
Collision
:
public
EventRecordBase
{
35
36
public
:
37
41
friend
class
EventHandler
;
43
friend
class
Event
;
45
friend
class
Step
;
46
47
public
:
48
59
Collision
(
const
PPair
& newIncoming,
tEventPtr
newEvent =
tEventPtr
(),
60
tcEventBasePtr
newHandler =
tcEventBasePtr
())
61
:
theIncoming
(newIncoming),
theEvent
(newEvent),
theHandler
(newHandler) {
62
addParticle
(
incoming
().first);
63
addParticle
(
incoming
().second);
64
}
65
69
~Collision
();
70
71
public
:
72
79
tStepPtr
newStep
(
tcEventBasePtr
newHandler =
tcEventBasePtr
());
80
84
void
addStep
(
tStepPtr
s);
85
90
tcEventBasePtr
handler
()
const
{
return
theHandler
; }
91
96
tEventPtr
event
()
const
{
return
theEvent
; }
97
108
template
<
class
OutputIterator>
109
void
select
(OutputIterator r,
const
SelectorBase
& s)
const
;
110
116
template
<
class
OutputIterator>
117
void
selectFinalState
(OutputIterator r)
const
{
118
select
(r,
SelectFinalState
());
119
}
120
125
tPVector
getFinalState
()
const
{
126
tPVector
ret;
127
selectFinalState
(back_inserter(ret));
128
return
ret;
129
}
130
135
tSubProPtr
primarySubProcess
()
const
{
136
return
subProcesses
().empty()?
SubProPtr
():
subProcesses
().front();
137
}
138
142
const
SubProcessVector
&
subProcesses
()
const
{
143
return
theSubProcesses
;
144
}
145
149
tcStepPtr
finalStep
()
const
{
150
return
steps
().empty()?
tcStepPtr
():
tcStepPtr
(
steps
().back());
151
}
152
156
tStepPtr
finalStep
() {
157
return
steps
().empty()?
StepPtr
():
steps
().back();
158
}
159
163
const
StepVector
&
steps
()
const
{
return
theSteps
; }
164
168
tcStepPtr
step
(
unsigned
int
i)
const
{
169
return
i <
steps
().size()?
tcStepPtr
(
theSteps
[i]):
tcStepPtr
();
170
}
171
177
const
PPair
&
incoming
()
const
{
return
theIncoming
; }
178
185
tParticleSet
getRemnants
()
const
;
186
193
bool
isRemnant
(
tPPtr
p)
const
{
return
member
(
getRemnants
(), p); }
194
196
200
const
LorentzPoint
&
vertex
()
const
{
return
theVertex
; }
201
205
void
vertex
(
const
LorentzPoint
& p) {
theVertex
= p; }
206
210
void
transform
(
const
LorentzRotation
&);
211
216
Energy2
m2
()
const
{
217
return
(
incoming
().first->momentum() +
incoming
().second->momentum() ).m2();
218
}
219
226
void
removeDecay
(
tPPtr
);
227
233
void
removeParticle
(
tPPtr
);
234
238
void
cleanSteps
();
239
243
void
popStep
();
244
246
247
public
:
248
252
void
persistentOutput
(
PersistentOStream
&)
const
;
253
257
void
persistentInput
(
PersistentIStream
&,
int
);
258
262
static
void
Init
();
263
264
protected
:
265
271
void
addSubProcess
(
tSubProPtr
p);
272
276
void
removeSubProcess
(
tSubProPtr
p);
277
281
template
<
class
Iterator>
282
void
addParticles
(Iterator first, Iterator last);
283
287
void
addParticle
(
tPPtr
p);
288
292
void
removeEntry
(
tPPtr
p);
293
295
299
const
ParticleSet
&
all
()
const
{
return
allParticles
; }
300
305
CollPtr
clone
()
const
;
306
314
void
rebind
(
const
EventTranslationMap
& trans);
315
316
private
:
317
321
PPair
theIncoming
;
322
326
StepVector
theSteps
;
327
332
SubProcessVector
theSubProcesses
;
333
337
ParticleSet
allParticles
;
338
342
tEventPtr
theEvent
;
343
348
tcEventBasePtr
theHandler
;
349
353
LorentzPoint
theVertex
;
354
355
private
:
356
360
static
ClassDescription<Collision>
initCollision
;
361
366
Collision
() {}
367
372
friend
struct
ClassTraits
<
Collision
>;
373
377
Collision
&
operator=
(
const
Collision
&) =
delete
;
378
380
friend
ostream &
operator<<
(ostream & os,
const
Collision
& c);
381
382
};
383
385
ostream &
operator<<
(ostream &,
const
Collision
&);
386
387
392
template
<>
393
struct
BaseClassTrait
<
Collision
,1>:
public
ClassTraitsType
{
395
typedef
EventRecordBase
NthBase
;
396
};
397
400
template
<>
401
struct
ClassTraits<Collision>:
public
ClassTraitsBase<Collision> {
403
static
string
className
() {
return
"ThePEG::Collision"
; }
405
static
TPtr
create
() {
return
TPtr::Create
(Collision()); }
406
};
407
410
}
411
412
#ifndef ThePEG_TEMPLATES_IN_CC_FILE
413
#include "Collision.tcc"
414
#endif
415
416
#endif
/* ThePEG_Collision_H */
EventConfig.h
This is the main config header file for the Event classes.
LorentzVector.h
contains the LorentzVector class.
StandardSelectors.h
This file contains declarations of standard selector classes.
ThePEG::ClassDescription
A concreate implementation of ClassDescriptionBase describing a concrete class with persistent data.
Definition:
ClassDescription.h:333
ThePEG::Collision
This is the decalaration of the Collision class.
Definition:
Collision.h:34
ThePEG::Collision::removeParticle
void removeParticle(tPPtr)
Remove (recursively) the given Particle from the Collision.
ThePEG::Collision::select
void select(OutputIterator r, const SelectorBase &s) const
Extract particles from this Collision which satisfies the requirements given by an object of the Sele...
ThePEG::Collision::theHandler
tcEventBasePtr theHandler
A pointer to the EventHandler which performed the generation of this Collision.
Definition:
Collision.h:348
ThePEG::Collision::isRemnant
bool isRemnant(tPPtr p) const
Return true if the given particle is a remnant of the colliding particles.
Definition:
Collision.h:193
ThePEG::Collision::getRemnants
tParticleSet getRemnants() const
Return the set of remnants in this collision.
ThePEG::Collision::transform
void transform(const LorentzRotation &)
Transform all particles in this Collision.
ThePEG::Collision::removeEntry
void removeEntry(tPPtr p)
Remove a given Particle entry.
ThePEG::Collision::persistentOutput
void persistentOutput(PersistentOStream &) const
Standard function for writing to a persistent stream.
ThePEG::Collision::initCollision
static ClassDescription< Collision > initCollision
Describe concrete class with persistent data.
Definition:
Collision.h:360
ThePEG::Collision::cleanSteps
void cleanSteps()
Remove all steps which have no new particles introduced in them.
ThePEG::Collision::removeDecay
void removeDecay(tPPtr)
Remove (recursively) the decay products from a given Particle and add the particle to the list of fin...
ThePEG::Collision::Init
static void Init()
Standard Init function.
ThePEG::Collision::allParticles
ParticleSet allParticles
A set of all particles in this Collision.
Definition:
Collision.h:337
ThePEG::Collision::getFinalState
tPVector getFinalState() const
Extract all final state particles in this Collision.
Definition:
Collision.h:125
ThePEG::Collision::~Collision
~Collision()
The destructor.
ThePEG::Collision::event
tEventPtr event() const
Return a pointer to the Event to which this Collision belongs.
Definition:
Collision.h:96
ThePEG::Collision::clone
CollPtr clone() const
Clone this Collision.
ThePEG::Collision::addParticles
void addParticles(Iterator first, Iterator last)
Add a range of particles to this Collision.
ThePEG::Collision::finalStep
tcStepPtr finalStep() const
Return a const pointer to the last step in this Collission.
Definition:
Collision.h:149
ThePEG::Collision::newStep
tStepPtr newStep(tcEventBasePtr newHandler=tcEventBasePtr())
Create a new step in this collision, which is a copy of the last step (if any) and return a pointer t...
ThePEG::Collision::selectFinalState
void selectFinalState(OutputIterator r) const
Extract all final state particles in this Collision.
Definition:
Collision.h:117
ThePEG::Collision::addParticle
void addParticle(tPPtr p)
Add a particle to this Collision.
ThePEG::Collision::operator=
Collision & operator=(const Collision &)=delete
The assignment operator is private and not implemented.
ThePEG::Collision::theSteps
StepVector theSteps
A vector of all steps in this Collision.
Definition:
Collision.h:326
ThePEG::Collision::primarySubProcess
tSubProPtr primarySubProcess() const
Return a pointer to the primary SubProcess in this Collision.
Definition:
Collision.h:135
ThePEG::Collision::all
const ParticleSet & all() const
Return a reference to the list of all particles in this Collision.
Definition:
Collision.h:299
ThePEG::Collision::addStep
void addStep(tStepPtr s)
Add a new Step to this Collision.
ThePEG::Collision::addSubProcess
void addSubProcess(tSubProPtr p)
Add a new SubProcess to this Collision.
ThePEG::Collision::theIncoming
PPair theIncoming
The pair of colliding particles.
Definition:
Collision.h:321
ThePEG::Collision::handler
tcEventBasePtr handler() const
Return a pointer to the EventHandler which produced this Collision.
Definition:
Collision.h:90
ThePEG::Collision::step
tcStepPtr step(unsigned int i) const
Return a pointer to a given Step in this Collision.
Definition:
Collision.h:168
ThePEG::Collision::persistentInput
void persistentInput(PersistentIStream &, int)
Standard functions for reading from a persistent stream.
ThePEG::Collision::theSubProcesses
SubProcessVector theSubProcesses
A vector of all sub-processes in this Collision.
Definition:
Collision.h:332
ThePEG::Collision::theEvent
tEventPtr theEvent
A pointer to the Event to which this Collision belongs.
Definition:
Collision.h:342
ThePEG::Collision::subProcesses
const SubProcessVector & subProcesses() const
Return the possibly empty list of sub processes in this Collision.
Definition:
Collision.h:142
ThePEG::Collision::vertex
void vertex(const LorentzPoint &p)
Set the vertex position of this Collision.
Definition:
Collision.h:205
ThePEG::Collision::popStep
void popStep()
Remove the last Step in this Collision.
ThePEG::Collision::Collision
Collision(const PPair &newIncoming, tEventPtr newEvent=tEventPtr(), tcEventBasePtr newHandler=tcEventBasePtr())
The standard constructor takes a pair of incoming particles as argument.
Definition:
Collision.h:59
ThePEG::Collision::Collision
Collision()
Private default constructor must only be used by the PersistentIStream class via the ClassTraits<Coll...
Definition:
Collision.h:366
ThePEG::Collision::steps
const StepVector & steps() const
Return the vector of steps in this Collision.
Definition:
Collision.h:163
ThePEG::Collision::removeSubProcess
void removeSubProcess(tSubProPtr p)
Remove a SubProcess from this Collision.
ThePEG::Collision::rebind
void rebind(const EventTranslationMap &trans)
Rebind to cloned objects.
ThePEG::Collision::operator<<
friend ostream & operator<<(ostream &os, const Collision &c)
Output to a standard ostream.
ThePEG::Collision::incoming
const PPair & incoming() const
Return a reference to the pair of colliding particles in this Collision.
Definition:
Collision.h:177
ThePEG::Collision::finalStep
tStepPtr finalStep()
Return a pointer to the last step in this Collission.
Definition:
Collision.h:156
ThePEG::Collision::m2
Energy2 m2() const
Return the total invariant mass squared of the final-state particles in this Collision.
Definition:
Collision.h:216
ThePEG::Collision::theVertex
LorentzPoint theVertex
The vertex position of this Collision.
Definition:
Collision.h:353
ThePEG::Collision::vertex
const LorentzPoint & vertex() const
Return the vertex position of this Collision.
Definition:
Collision.h:200
ThePEG::EventHandler
The EventHandler is the base class used to implement event handlers in ThePEG.
Definition:
EventHandler.h:63
ThePEG::Event
The Event class contains all Particles produced in the generation of an event.
Definition:
Event.h:37
ThePEG::LorentzRotation
The LorentzRotation class combine a SpinOneLorentzRotation and a spin SpinHalfLorentzRotation to prov...
Definition:
LorentzRotation.h:27
ThePEG::LorentzVector< Length >
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::RCPtr::Create
static RCPtr Create()
Allocate and construct an object of class T and return a RCPtr to it.
Definition:
RCPtr.h:120
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::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< 0, 2, 0 >
ThePEG::Rebinder
Rebinder is a class associating pairs of pointers to objects.
Definition:
Rebinder.h:27
ThePEG::SelectorBase
Classes derived from the SelectorBase class are used to extract particles from an Event with Event::s...
Definition:
SelectorBase.h:45
ThePEG::Step
The Step class contains information of all particles present after certain step in the event generati...
Definition:
Step.h:34
ThePEG
This is the main namespace within which all identifiers in ThePEG are declared.
Definition:
FactoryBase.h:28
ThePEG::PPair
pair< PPtr, PPtr > PPair
A pair of pointers to Particle objects.
Definition:
Containers.h:127
ThePEG::tParticleSet
set< tPPtr, less< tPPtr > > tParticleSet
A set of transient pointers to Particle.
Definition:
EventConfig.h:78
ThePEG::tcStepPtr
ThePEG::Ptr< Step >::transient_const_pointer tcStepPtr
Alias for a transient pointer to a const Step .
Definition:
Pointers.h:85
ThePEG::tcEventBasePtr
Ptr< EventRecordBase >::transient_const_pointer tcEventBasePtr
Alias for a transient pointer to const EventRecordBase.
Definition:
EventConfig.h:49
ThePEG::member
bool member(const Container &c, const Key &k)
Check if a given object is a part of a container.
Definition:
std.h:126
ThePEG::ParticleSet
set< PPtr, less< PPtr > > ParticleSet
A set of pointers to Particle.
Definition:
EventConfig.h:76
ThePEG::tEventPtr
ThePEG::Ptr< Event >::transient_pointer tEventPtr
Alias for a transient pointer to Event .
Definition:
Pointers.h:83
ThePEG::StepVector
vector< StepPtr > StepVector
A vector of pointers to Step.
Definition:
EventConfig.h:82
ThePEG::SubProPtr
ThePEG::Ptr< SubProcess >::pointer SubProPtr
Alias for a reference counted pointer to SubProcess .
Definition:
Pointers.h:86
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::StepPtr
ThePEG::Ptr< Step >::pointer StepPtr
Alias for a reference counted pointer to Step .
Definition:
Pointers.h:85
ThePEG::SubProcessVector
vector< SubProPtr > SubProcessVector
A vector of pointers to SubProcess.
Definition:
EventConfig.h:84
ThePEG::tPVector
vector< tPPtr > tPVector
A vector of transient pointers to Particle objects.
Definition:
Containers.h:82
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::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::Base
Define the base class from which all (polymorphic) classes in ThePEG are derived.
Definition:
ThePEG.h:54
ThePEG::ClassTraitsBase::className
static string className()
Return the name of class T.
Definition:
ClassTraits.h:66
ThePEG::ClassTraitsBase::create
static TPtr create()
Create a T object and return a smart pointer to it.
Definition:
ClassTraits.h:60
ThePEG::ClassTraitsBase::TPtr
ThePEG::Ptr< T >::pointer TPtr
Alias for a reference counted pointer to T .
Definition:
ClassTraits.h:54
ThePEG::ClassTraitsType
ClassTraitsType is an empty, non-polymorphic, base class.
Definition:
ClassTraits.h:30
ThePEG::ClassTraits
The default concrete implementation of ClassTraitsBase.
Definition:
ClassTraits.h:134
Generated on Thu Jun 20 2024 14:47:00 for ThePEG by
1.9.6