thepeg
is hosted by
Hepforge
,
IPPP Durham
ThePEG
2.3.0
EventRecord
Step.h
1
// -*- C++ -*-
2
//
3
// Step.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_BasicStep_H
10
#define ThePEG_BasicStep_H
11
// This is the declaration of the Step class.
12
13
#include "ThePEG/EventRecord/Particle.h"
14
#include "
ThePEG/EventRecord/StandardSelectors.h
"
15
16
namespace
ThePEG
{
17
34
class
Step
:
public
EventRecordBase
{
35
36
public
:
37
39
friend
class
Collision
;
41
friend
class
Event
;
42
43
public
:
44
51
Step
(
tCollPtr
newCollision =
tCollPtr
(),
52
tcEventBasePtr
newHandler =
tcEventBasePtr
())
53
:
theCollision
(newCollision),
theHandler
(newHandler) {}
54
58
Step
(
const
Step
&);
59
63
~Step
();
64
69
tcEventBasePtr
handler
()
const
{
return
theHandler
; }
70
74
tCollPtr
collision
()
const
{
return
theCollision
; }
75
84
template
<
typename
OutputIterator>
85
void
select
(OutputIterator r,
const
SelectorBase
& s)
const
;
86
92
template
<
typename
OutputIterator>
93
void
selectFinalState
(OutputIterator r)
const
{
94
select
(r,
SelectFinalState
());
95
}
96
101
tPVector
getFinalState
()
const
{
102
tPVector
ret;
103
selectFinalState
(back_inserter(ret));
104
return
ret;
105
}
106
112
template
<
typename
PIterator>
113
static
vector<tPVector>
getSinglets
(PIterator first, PIterator last) {
114
tParticleSet
left
(first, last);
115
return
getSinglets
(
left
);
116
}
117
121
const
ParticleSet
&
all
()
const
{
return
allParticles
; }
122
126
const
ParticleSet
&
particles
()
const
{
return
theParticles
; }
127
131
const
ParticleSet
&
intermediates
()
const
{
return
theIntermediates
; }
132
137
const
SubProcessVector
&
subProcesses
()
const
{
138
return
theSubProcesses
;
139
}
140
147
const
PPair
&
incoming
()
const
;
148
153
tPPtr
find
(
tcPPtr
p)
const
{
154
tPPtr
r = const_ptr_cast<tPPtr>(p);
155
if
( !
member
(
all
(), r) )
return
tPPtr
();
156
return
r;
157
}
158
159
168
tPPtr
copyParticle
(
tcPPtr
p);
169
177
bool
setCopy
(
tcPPtr
pold,
tPPtr
pnew);
178
188
tPPtr
insertCopy
(
tcPPtr
p);
189
201
bool
addDecayProduct
(
tcPPtr
parent,
tPPtr
child,
bool
fixColour =
true
);
202
216
template
<
typename
CIterator>
217
bool
addDecayProduct
(
tcPPtr
parent,
218
CIterator firstChild, CIterator lastChild,
219
bool
fixColour =
true
) {
220
for
( ; firstChild != lastChild; ++firstChild )
221
if
( !
addDecayProduct
(parent, *firstChild, fixColour) )
return
false
;
222
return
true
;
223
}
224
231
void
addDecayNoCheck
(
tPPtr
parent,
tPPtr
child);
232
239
void
addDecayProduct
(
tPPtr
child);
240
245
bool
removeDecayProduct
(
tcPPtr
parent,
tPPtr
child);
246
251
template
<
typename
CIterator>
252
bool
removeDecayProduct
(
tcPPtr
parent,
253
CIterator firstChild, CIterator lastChild) {
254
bool
success =
true
;
255
for
( ; firstChild != lastChild; ++firstChild )
256
if
( !
removeDecayProduct
(parent, *firstChild) ) success =
false
;
257
return
success;
258
}
259
270
template
<
typename
Iterator>
271
bool
addDecayProduct
(Iterator firstParent, Iterator lastParent,
tPPtr
child,
272
bool
checkfinal =
true
);
273
282
template
<
typename
PIterator,
typename
CIterator>
283
bool
addDecayProduct
(PIterator firstParent, PIterator lastParent,
284
CIterator firstChild, CIterator lastChild);
285
294
void
fixColourFlow
();
295
303
tPPtr
colourNeighbour
(
tcPPtr
particle,
bool
anti =
false
)
const
;
304
312
tPPtr
antiColourNeighbour
(
tcPPtr
particle)
const
;
313
320
template
<
typename
Iterator>
321
void
addParticles
(Iterator first, Iterator last);
322
329
void
addParticle
(
tPPtr
p);
330
339
template
<
typename
Iterator>
340
void
addIntermediates
(Iterator first, Iterator last);
341
350
void
addIntermediate
(
tPPtr
p);
351
358
void
insertIntermediate
(
tPPtr
p,
tPPtr
parent,
tPPtr
child);
359
365
void
addSubProcess
(
tSubProPtr
);
366
371
void
removeSubProcess
(
tSubProPtr
);
372
378
void
removeParticle
(
tPPtr
p);
379
383
bool
nullStep
()
const
;
384
391
template
<
typename
Cont>
392
tParticleSet
getCurrent
(
const
Cont & c)
const
{
393
return
getCurrent
(c.begin(), c.end());
394
}
395
402
template
<
typename
Iterator>
403
tParticleSet
getCurrent
(Iterator first, Iterator last)
const
;
404
408
StepPtr
clone
()
const
;
409
410
public
:
411
415
void
persistentOutput
(
PersistentOStream
&)
const
;
419
void
persistentInput
(
PersistentIStream
&,
int
);
420
424
static
void
Init
();
425
426
protected
:
427
432
static
vector<tPVector>
getSinglets
(
tParticleSet
&);
433
438
void
removeEntry
(
tPPtr
p);
439
446
void
rebind
(
const
EventTranslationMap
& trans);
447
453
template
<
typename
Inserter,
typename
PPo
int
er>
454
void
addIfFinal
(Inserter o, PPointer p);
455
456
private
:
457
461
Step
&
operator=
(
const
Step
&) =
delete
;
462
466
void
collision
(
tCollPtr
c) {
theCollision
= c; }
467
471
void
handler
(
tcEventBasePtr
sh) {
theHandler
= sh; }
472
473
private
:
474
478
ParticleSet
theParticles
;
479
483
ParticleSet
theIntermediates
;
484
488
SubProcessVector
theSubProcesses
;
489
493
ParticleSet
allParticles
;
494
498
tCollPtr
theCollision
;
499
503
tcEventBasePtr
theHandler
;
504
505
public
:
506
511
virtual
void
debugme
()
const
;
512
513
private
:
514
518
static
ClassDescription<Step>
initStep
;
519
520
};
521
523
ostream &
operator<<
(ostream &,
const
Step
&);
524
526
ThePEG_DECLARE_CLASS_TRAITS(
Step
,
EventRecordBase
);
529
}
530
531
#include "Collision.h"
532
533
inline
const
ThePEG::PPair
&
ThePEG::Step::incoming
()
const
{
534
return
collision
()->incoming();
535
}
536
537
#ifndef ThePEG_TEMPLATES_IN_CC_FILE
538
#include "Step.tcc"
539
#endif
540
541
#endif
/* ThePEG_BasicStep_H */
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::Event
The Event class contains all Particles produced in the generation of an event.
Definition:
Event.h:37
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::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::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::Step::~Step
~Step()
The destructor.
ThePEG::Step::allParticles
ParticleSet allParticles
The set of all particles available in this step.
Definition:
Step.h:493
ThePEG::Step::addParticle
void addParticle(tPPtr p)
Add a particle to this step.
ThePEG::Step::addIntermediate
void addIntermediate(tPPtr p)
Add an intermediate particle in this Step.
ThePEG::Step::select
void select(OutputIterator r, const SelectorBase &s) const
Extract particles from this Step which satisfies the requirements given by an object of the SelectorB...
ThePEG::Step::getCurrent
tParticleSet getCurrent(Iterator first, Iterator last) const
Get final state particles.
ThePEG::Step::handler
void handler(tcEventBasePtr sh)
Setup pointer to the step handler.
Definition:
Step.h:471
ThePEG::Step::persistentOutput
void persistentOutput(PersistentOStream &) const
Standard function for writing to a persistent stream.
ThePEG::Step::addDecayProduct
void addDecayProduct(tPPtr child)
Add a particle to this Step.
ThePEG::Step::insertIntermediate
void insertIntermediate(tPPtr p, tPPtr parent, tPPtr child)
Add an intermediate particle.
ThePEG::Step::removeParticle
void removeParticle(tPPtr p)
Remove (recursively) the given Particle from the Step.
ThePEG::Step::theIntermediates
ParticleSet theIntermediates
The set of all intermediate particle in this step.
Definition:
Step.h:483
ThePEG::Step::Init
static void Init()
Standard Init function.
ThePEG::Step::all
const ParticleSet & all() const
A reference to the set of all particles in this step.
Definition:
Step.h:121
ThePEG::Step::collision
tCollPtr collision() const
Return a pointer to the Collision to which this step belongs.
Definition:
Step.h:74
ThePEG::Step::clone
StepPtr clone() const
Return a clone of this step.
ThePEG::Step::addDecayProduct
bool addDecayProduct(PIterator firstParent, PIterator lastParent, CIterator firstChild, CIterator lastChild)
Add the children as a decay products of all the listed particles.
ThePEG::Step::copyParticle
tPPtr copyParticle(tcPPtr p)
Copy a particle.
ThePEG::Step::theParticles
ParticleSet theParticles
The set of all outgoing particle in this step.
Definition:
Step.h:478
ThePEG::Step::colourNeighbour
tPPtr colourNeighbour(tcPPtr particle, bool anti=false) const
Return the (anti-)colour neighbour of the given particle if one exists in the final state of this Ste...
ThePEG::Step::removeDecayProduct
bool removeDecayProduct(tcPPtr parent, CIterator firstChild, CIterator lastChild)
Remove children form the given parent.
Definition:
Step.h:252
ThePEG::Step::fixColourFlow
void fixColourFlow()
Fix the colour flow of particles which have been added to this step and which have not already had th...
ThePEG::Step::addSubProcess
void addSubProcess(tSubProPtr)
Add a sub-process.
ThePEG::Step::addDecayNoCheck
void addDecayNoCheck(tPPtr parent, tPPtr child)
Add a particle to this Step.
ThePEG::Step::removeSubProcess
void removeSubProcess(tSubProPtr)
Remove a sub-process.
ThePEG::Step::nullStep
bool nullStep() const
Return true if no new particles were introduced in this step.
ThePEG::Step::addDecayProduct
bool addDecayProduct(Iterator firstParent, Iterator lastParent, tPPtr child, bool checkfinal=true)
Add decay product.
ThePEG::Step::theCollision
tCollPtr theCollision
Pointer to the collision to which this step belongs.
Definition:
Step.h:498
ThePEG::Step::getSinglets
static vector< tPVector > getSinglets(tParticleSet &)
Used internally by the public getSinglets(...);.
ThePEG::Step::intermediates
const ParticleSet & intermediates() const
A reference to the set of intermediate particles in this step.
Definition:
Step.h:131
ThePEG::Step::addDecayProduct
bool addDecayProduct(tcPPtr parent, tPPtr child, bool fixColour=true)
Add decay product.
ThePEG::Step::addParticles
void addParticles(Iterator first, Iterator last)
Add a range of particles to this Step.
ThePEG::Step::subProcesses
const SubProcessVector & subProcesses() const
A reference to the vector of sub-processes introduced in this step.
Definition:
Step.h:137
ThePEG::Step::rebind
void rebind(const EventTranslationMap &trans)
Rebind to cloned objects.
ThePEG::Step::incoming
const PPair & incoming() const
Returns the colliding particles in the collision to which this step belongs.
Definition:
Step.h:533
ThePEG::Step::handler
tcEventBasePtr handler() const
Return a pointer to the step handler which performed the generation of this step.
Definition:
Step.h:69
ThePEG::Step::theSubProcesses
SubProcessVector theSubProcesses
The vector of all sub-processes introduced in this step.
Definition:
Step.h:488
ThePEG::Step::collision
void collision(tCollPtr c)
Setup pointer to the Collision.
Definition:
Step.h:466
ThePEG::Step::getCurrent
tParticleSet getCurrent(const Cont &c) const
Get final state particles.
Definition:
Step.h:392
ThePEG::Step::initStep
static ClassDescription< Step > initStep
Describe concrete class with persistent data.
Definition:
Step.h:518
ThePEG::Step::removeEntry
void removeEntry(tPPtr p)
Remove a particle entry from the step.
ThePEG::Step::addIfFinal
void addIfFinal(Inserter o, PPointer p)
Get final state particles.
ThePEG::Step::find
tPPtr find(tcPPtr p) const
Get mutable particle.
Definition:
Step.h:153
ThePEG::Step::addDecayProduct
bool addDecayProduct(tcPPtr parent, CIterator firstChild, CIterator lastChild, bool fixColour=true)
Add decay products.
Definition:
Step.h:217
ThePEG::Step::antiColourNeighbour
tPPtr antiColourNeighbour(tcPPtr particle) const
Return the anti-colour neighbour of the given particle if one exists in the final state of this Step.
ThePEG::Step::Step
Step(const Step &)
The copy constructor.
ThePEG::Step::getFinalState
tPVector getFinalState() const
Extract all final state particles in this Step.
Definition:
Step.h:101
ThePEG::Step::addIntermediates
void addIntermediates(Iterator first, Iterator last)
Add a range of intermediate particles in this step.
ThePEG::Step::operator=
Step & operator=(const Step &)=delete
Assignement is not allowed.
ThePEG::Step::persistentInput
void persistentInput(PersistentIStream &, int)
Standard function for reading from a persistent stream.
ThePEG::Step::insertCopy
tPPtr insertCopy(tcPPtr p)
Insert a copy.
ThePEG::Step::setCopy
bool setCopy(tcPPtr pold, tPPtr pnew)
Make particles copies of eachother.
ThePEG::Step::debugme
virtual void debugme() const
Print out debugging information for this object on std::cerr.
ThePEG::Step::Step
Step(tCollPtr newCollision=tCollPtr(), tcEventBasePtr newHandler=tcEventBasePtr())
Standard constructor.
Definition:
Step.h:51
ThePEG::Step::particles
const ParticleSet & particles() const
A reference to the set of outgoing particles in this step.
Definition:
Step.h:126
ThePEG::Step::selectFinalState
void selectFinalState(OutputIterator r) const
Extract all final state particles in this Step.
Definition:
Step.h:93
ThePEG::Step::getSinglets
static vector< tPVector > getSinglets(PIterator first, PIterator last)
Return a vector of particle vectors with colour-connected partons, where each particle vector is in a...
Definition:
Step.h:113
ThePEG::Step::removeDecayProduct
bool removeDecayProduct(tcPPtr parent, tPPtr child)
Remove the child form the given parent.
ThePEG::Step::theHandler
tcEventBasePtr theHandler
Pointer ot the step handler which performed this step.
Definition:
Step.h:503
ThePEG
This is the main namespace within which all identifiers in ThePEG are declared.
Definition:
FactoryBase.h:28
ThePEG::tPPtr
ThePEG::Ptr< Particle >::transient_pointer tPPtr
Alias for a transient pointer to Particle .
Definition:
Pointers.h:67
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::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::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::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::tCollPtr
ThePEG::Ptr< Collision >::transient_pointer tCollPtr
Alias for a transient pointer to Collision .
Definition:
Pointers.h:84
ThePEG::left
ostream & left(ostream &os)
Stream manipulator setting an ostream to left-adjust its ouput.
Definition:
std.h:161
ThePEG::Base
Define the base class from which all (polymorphic) classes in ThePEG are derived.
Definition:
ThePEG.h:54
Generated on Thu Jun 20 2024 14:47:00 for ThePEG by
1.9.6