BOSS 7.1.1
BESIII Offline Software System
Loading...
Searching...
No Matches
Event::McParticle Class Reference

#include <McParticle.h>

+ Inheritance diagram for Event::McParticle:

Public Types

enum  StatusBits {
  DECAYED =1 , DECAYFLT =1<<1 , PRIMARY =1<<2 , LEAF = 1<<3 ,
  ERROR = 1<<4
}
 status bits modeled More...
 
typedef int StdHepId
 

Public Member Functions

virtual const CLID & clID () const
 
 McParticle ()
 Constructors.
 
virtual ~McParticle ()
 Destructor.
 
void init (McParticle *mother, StdHepId id, unsigned int statusBits, const HepLorentzVector &initialMomentum, const HepLorentzVector &finalMomentum, const HepLorentzVector &initialPosition, const HepLorentzVector &finalPosition, const std::string process="")
 
void initialize (StdHepId id, unsigned int statusBits, const HepLorentzVector &initialMomentum, const HepLorentzVector &initialPosition, const std::string process="")
 Set the initial attributes of the McParticle.
 
void initialize (McParticle *mother, StdHepId id, unsigned int statusBits, const HepLorentzVector &initialMomentum, const HepLorentzVector &initialPosition, const std::string process="")
 
void finalize (const HepLorentzVector &finalPosition)
 Set the final attributes of the McParticle.
 
StdHepId particleProperty () const
 Retrieve particle property.
 
unsigned int statusFlags () const
 retrieve all of status flags for const object
 
void addStatusFlag (unsigned int flag)
 add a new flag to the status flags
 
bool primaryParticle () const
 Retrieve whether this is a primary particle.
 
bool leafParticle () const
 Retrieve whether this is a leaf particle.
 
bool decayFromGenerator () const
 Decayed from generator.
 
bool decayInFlight () const
 Decayed in flight.
 
void setVertexIndex0 (int index0)
 methods for setting and getting vertex indexes

 
int vertexIndex0 () const
 
void setVertexIndex1 (int index1)
 
int vertexIndex1 () const
 
void setTrackIndex (int trackIndex)
 
int trackIndex () const
 
const HepLorentzVector & initialPosition () const
 Retrieve pointer to the start, end vertex positions.
 
const HepLorentzVector & finalPosition () const
 
const HepLorentzVector & initialFourMomentum () const
 
const McParticlemother () const
 access to the mother particle
 
void setMother (const SmartRef< McParticle > m)
 set the mother particle
 
void addDaughter (const SmartRef< McParticle > d)
 add a daugther particle to this particle
 
void removeDaughter (const SmartRef< McParticle > mcPart)
 Used for pruning.
 
const SmartRefVector< McParticle > & daughterList () const
 access the process name
 

Static Public Member Functions

static const CLID & classID ()
 

Detailed Description

Definition at line 28 of file McParticle.h.

Member Typedef Documentation

◆ StdHepId

Definition at line 30 of file McParticle.h.

Member Enumeration Documentation

◆ StatusBits

status bits modeled

Enumerator
DECAYED 
DECAYFLT 

Decayed by generator.

PRIMARY 

Decayed in flight.

LEAF 

primary particle

ERROR 

this particle is a leaf in the particle tree

Definition at line 34 of file McParticle.h.

34 {
35 DECAYED =1 , //! Decayed by generator
36 DECAYFLT=1<<1, //! Decayed in flight
37 PRIMARY =1<<2, //! primary particle
38 LEAF = 1<<3, //! this particle is a leaf in the particle tree
39 ERROR = 1<<4 //! error
40 //MISSED= 1<<2, //! Does not hit detector
41 //NOINTER =1<<3, //! Traverses detector w/o interacting
42 //STOPPED =1<<4, //! Energy below cut; other bits may say why
43 //INTERACT=1<<5, //! Interacted, no further decision to be made
44 //INTSHDEP=1<<6, //! Interacted, further decision depends on ! selection of shower deposition
45 //PRIMARY =1<<7, //! primary particle
46 //SWERROR =1<<8, //! Error occurred in swimming the track
47 //BCKSPL=1<<9, //! The particle is backsplashed from the CAL back in the TKR region
48 //POSHIT =1<<10, //! The particle released a hit a PositionHit detector
49 //NOTTRACK=1<<11, //! Not tracked by user request
50 //Swum = 1<<12, //! this particle was produced by the swimmer
51 //LEAF = 1<<13 //! this particle is a leaf in the particle tree
52 };
@ PRIMARY
Decayed in flight.
Definition McParticle.h:37
@ ERROR
this particle is a leaf in the particle tree
Definition McParticle.h:39
@ DECAYFLT
Decayed by generator.
Definition McParticle.h:36
@ LEAF
primary particle
Definition McParticle.h:38

Constructor & Destructor Documentation

◆ McParticle()

Event::McParticle::McParticle ( )
inline

Constructors.

Definition at line 58 of file McParticle.h.

58 :
59 m_statusFlags(0)
60 {}

◆ ~McParticle()

virtual Event::McParticle::~McParticle ( )
inlinevirtual

Destructor.

Definition at line 62 of file McParticle.h.

62{}

Member Function Documentation

◆ addDaughter()

void Event::McParticle::addDaughter ( const SmartRef< McParticle > d)
inline

add a daugther particle to this particle

Definition at line 147 of file McParticle.h.

147{m_daughters.push_back(d);};

Referenced by BesMcTruthWriter::AddMother().

◆ addStatusFlag()

void Event::McParticle::addStatusFlag ( unsigned int flag)
inline

add a new flag to the status flags

Definition at line 103 of file McParticle.h.

103{m_statusFlags |= flag;};

Referenced by BesMcTruthWriter::SaveMcParticle(), and McParticleCnv::TObjectToDataObject().

◆ classID()

static const CLID & Event::McParticle::classID ( )
inlinestatic

Definition at line 56 of file McParticle.h.

56{ return CLID_McParticle; }
const CLID & CLID_McParticle

Referenced by clID().

◆ clID()

virtual const CLID & Event::McParticle::clID ( ) const
inlinevirtual

Definition at line 55 of file McParticle.h.

55{ return McParticle::classID(); }
static const CLID & classID()
Definition McParticle.h:56

◆ daughterList()

const SmartRefVector< McParticle > & Event::McParticle::daughterList ( ) const
inline

access the process name

set the initial and final volume identifiers get the initial and final volume identifier access to the list of daughters

Definition at line 164 of file McParticle.h.

164{return m_daughters;};

Referenced by PrintMcInfo::printPartInf(), and PrintMcInfo::printTree().

◆ decayFromGenerator()

bool Event::McParticle::decayFromGenerator ( ) const

Decayed from generator.

Retrieve whether decayed from generator.

Definition at line 25 of file McParticle.cxx.

26{
27 return (m_statusFlags & DECAYED)==DECAYED;
28}

◆ decayInFlight()

bool Event::McParticle::decayInFlight ( ) const

Decayed in flight.

Retrieve wheter decayed in flight.

Definition at line 31 of file McParticle.cxx.

32{
33 return (m_statusFlags & DECAYFLT)==DECAYFLT;
34}

◆ finalize()

void McParticle::finalize ( const HepLorentzVector & finalPosition)

Set the final attributes of the McParticle.

Definition at line 85 of file McParticle.cxx.

86{
87 m_finalPosition = finalPosition;
88}
const HepLorentzVector & finalPosition() const

Referenced by init(), BesMcTruthWriter::SaveMcParticle(), McParticleCnv::TObjectToDataObject(), and McParticleBuilder::unPack().

◆ finalPosition()

const HepLorentzVector & McParticle::finalPosition ( ) const

Definition at line 99 of file McParticle.cxx.

100{
101 return m_finalPosition;
102}

Referenced by finalize(), and init().

◆ init()

void McParticle::init ( McParticle * mother,
StdHepId id,
unsigned int statusBits,
const HepLorentzVector & initialMomentum,
const HepLorentzVector & finalMomentum,
const HepLorentzVector & initialPosition,
const HepLorentzVector & finalPosition,
const std::string process = "" )

completely initialize a newed object. No other way to set most attributes. it will be replaced by the following methods (left here just in the transition)

Definition at line 36 of file McParticle.cxx.

44{
45 initialize(mother, id, flags, initialMomentum, initialPosition,process);
46 //finalize(finalMomentum, finalPosition);
48}
const McParticle & mother() const
access to the mother particle
const HepLorentzVector & initialPosition() const
Retrieve pointer to the start, end vertex positions.
void initialize(StdHepId id, unsigned int statusBits, const HepLorentzVector &initialMomentum, const HepLorentzVector &initialPosition, const std::string process="")
Set the initial attributes of the McParticle.
void finalize(const HepLorentzVector &finalPosition)
Set the final attributes of the McParticle.

◆ initialFourMomentum()

const HepLorentzVector & McParticle::initialFourMomentum ( ) const

Definition at line 103 of file McParticle.cxx.

104{
105 return m_initialFourMomentum;
106}

Referenced by MdcUtilitySvc::getHelixOfMcParticle(), and MdcUtilitySvc::getMomPosOfMcParticle().

◆ initialize() [1/2]

void McParticle::initialize ( McParticle * mother,
StdHepId id,
unsigned int statusBits,
const HepLorentzVector & initialMomentum,
const HepLorentzVector & initialPosition,
const std::string process = "" )

Definition at line 63 of file McParticle.cxx.

68{
69 m_mother = mother;
70 m_particleID = id;
71 m_statusFlags = flags;
72 m_initialFourMomentum = initialMomentum;
73 m_initialPosition = initialPosition;
74 m_process = process;
75 if( mother != this) mother->m_daughters.push_back(this);
76}

◆ initialize() [2/2]

void McParticle::initialize ( StdHepId id,
unsigned int statusBits,
const HepLorentzVector & initialMomentum,
const HepLorentzVector & initialPosition,
const std::string process = "" )

Set the initial attributes of the McParticle.

Definition at line 50 of file McParticle.cxx.

55{
56 m_particleID = id;
57 m_statusFlags = flags;
58 m_initialFourMomentum = initialMomentum;
59 m_initialPosition = initialPosition;
60 m_process = process;
61}

Referenced by init(), BesMcTruthWriter::SaveMcParticle(), McParticleCnv::TObjectToDataObject(), and McParticleBuilder::unPack().

◆ initialPosition()

const HepLorentzVector & McParticle::initialPosition ( ) const

Retrieve pointer to the start, end vertex positions.

Definition at line 95 of file McParticle.cxx.

96{
97 return m_initialPosition;
98}

Referenced by MdcUtilitySvc::getHelixOfMcParticle(), MdcUtilitySvc::getMomPosOfMcParticle(), init(), initialize(), initialize(), and PrintMcInfo::printPartInf().

◆ leafParticle()

bool Event::McParticle::leafParticle ( ) const

Retrieve whether this is a leaf particle.

Retrieve whether this is a leave particle.

Definition at line 19 of file McParticle.cxx.

20{
21 return (m_statusFlags & LEAF)==LEAF;
22}

Referenced by BesMcTruthWriter::AddMother().

◆ mother()

const McParticle & Event::McParticle::mother ( ) const

access to the mother particle

Definition at line 117 of file McParticle.cxx.

118{
119 return *m_mother;
120}

Referenced by QCMCFilter::execute(), QCMCFilter::findD0Decay(), init(), and initialize().

◆ particleProperty()

McParticle::StdHepId Event::McParticle::particleProperty ( ) const

Retrieve particle property.

Definition at line 7 of file McParticle.cxx.

8{
9 return m_particleID;
10}

Referenced by QCMCFilter::execute(), QCMCFilter::findD0Decay(), MdcUtilitySvc::getChargeOfMcParticle(), and PrintMcInfo::printPartInf().

◆ primaryParticle()

bool Event::McParticle::primaryParticle ( ) const

Retrieve whether this is a primary particle.

Retrieve whether this is a primary particle: there's no mother for a primary particle

Definition at line 13 of file McParticle.cxx.

14{
15 return (m_statusFlags & PRIMARY)==PRIMARY;
16}

Referenced by PrintMcInfo::printPartInf(), and PrintMcInfo::printTree().

◆ removeDaughter()

void Event::McParticle::removeDaughter ( const SmartRef< McParticle > mcPart)

Used for pruning.

Remove daughters when in prune mode.

Definition at line 123 of file McParticle.cxx.

124{
125 SmartRefVector<Event::McParticle>::iterator daughtIter;
126 for(daughtIter = m_daughters.begin();daughtIter != m_daughters.end();daughtIter++)
127 {
128 if (mcPart == *daughtIter)
129 {
130 m_daughters.erase(daughtIter);
131 break;
132 }
133 }
134 return;
135}

◆ setMother()

void McParticle::setMother ( const SmartRef< McParticle > m)

set the mother particle

Definition at line 90 of file McParticle.cxx.

91{
92 m_mother = m;
93}

◆ setTrackIndex()

void Event::McParticle::setTrackIndex ( int trackIndex)
inline

Definition at line 128 of file McParticle.h.

128{ m_trackIndex = trackIndex; }
int trackIndex() const
Definition McParticle.h:131

Referenced by BesMcTruthWriter::SaveMcParticle(), McParticleCnv::TObjectToDataObject(), and McParticleBuilder::unPack().

◆ setVertexIndex0()

void Event::McParticle::setVertexIndex0 ( int index0)
inline

methods for setting and getting vertex indexes

Definition at line 119 of file McParticle.h.

119{ m_vertexIndex0 = index0; }

Referenced by BesMcTruthWriter::SaveMcParticle(), McParticleCnv::TObjectToDataObject(), and McParticleBuilder::unPack().

◆ setVertexIndex1()

void Event::McParticle::setVertexIndex1 ( int index1)
inline

Definition at line 123 of file McParticle.h.

123{ m_vertexIndex1 = index1; }

Referenced by BesMcTruthWriter::SaveMcParticle(), McParticleCnv::TObjectToDataObject(), and McParticleBuilder::unPack().

◆ statusFlags()

unsigned int McParticle::statusFlags ( ) const

retrieve all of status flags for const object

Definition at line 112 of file McParticle.cxx.

112 {
113 return m_statusFlags;
114}

◆ trackIndex()

int Event::McParticle::trackIndex ( ) const
inline

Definition at line 131 of file McParticle.h.

131{return m_trackIndex;}

Referenced by PrintMcInfo::execute(), PrintMcInfo::printPartInf(), and setTrackIndex().

◆ vertexIndex0()

int Event::McParticle::vertexIndex0 ( ) const
inline

Definition at line 121 of file McParticle.h.

121{return m_vertexIndex0;}

◆ vertexIndex1()

int Event::McParticle::vertexIndex1 ( ) const
inline

Definition at line 125 of file McParticle.h.

125{return m_vertexIndex1;}

Referenced by BesMcTruthWriter::AddMother().


The documentation for this class was generated from the following files: