BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
McParticle.cxx
Go to the documentation of this file.
1#include <iostream>
2#include "McTruth/McParticle.h"
3
4namespace Event {
5
6/// Retrieve particle property
8{
9 return m_particleID;
10}
11
12/// Retrieve whether this is a primary particle
14{
15 return (m_statusFlags & PRIMARY)==PRIMARY;
16}
17
18/// Retrieve whether this is a leave particle
20{
21 return (m_statusFlags & LEAF)==LEAF;
22}
23
24/// Retrieve whether decayed from generator
26{
27 return (m_statusFlags & DECAYED)==DECAYED;
28}
29
30/// Retrieve wheter decayed in flight
32{
33 return (m_statusFlags & DECAYFLT)==DECAYFLT;
34}
35
37 StdHepId id,
38 unsigned int flags,
39 const HepLorentzVector& initialMomentum,
40 const HepLorentzVector& finalMomentum,
41 const HepLorentzVector& initialPosition,
42 const HepLorentzVector& finalPosition,
43 const std::string process)
44{
45 initialize(mother, id, flags, initialMomentum, initialPosition,process);
46 //finalize(finalMomentum, finalPosition);
48}
49
51 StdHepId id,
52 unsigned int flags,
53 const HepLorentzVector& initialMomentum,
54 const HepLorentzVector& initialPosition, const std::string process)
55{
56 m_particleID = id;
57 m_statusFlags = flags;
58 m_initialFourMomentum = initialMomentum;
59 m_initialPosition = initialPosition;
60 m_process = process;
61}
62
64 StdHepId id,
65 unsigned int flags,
66 const HepLorentzVector& initialMomentum,
67 const HepLorentzVector& initialPosition, const std::string process)
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}
77
78/*void McParticle::finalize(const HepLorentzVector& finalMomentum,
79 const HepLorentzVector& finalPosition)
80{
81 m_finalFourMomentum = finalMomentum;
82 m_finalPosition = finalPosition;
83}*/
84
85void McParticle::finalize(const HepLorentzVector& finalPosition)
86{
87 m_finalPosition = finalPosition;
88}
89
90void McParticle::setMother(const SmartRef<McParticle> m)
91{
92 m_mother = m;
93}
94
95const HepLorentzVector& McParticle::initialPosition()const
96{
97 return m_initialPosition;
98}
99const HepLorentzVector& McParticle::finalPosition()const
100{
101 return m_finalPosition;
102}
103const HepLorentzVector& McParticle::initialFourMomentum()const
104{
105 return m_initialFourMomentum;
106}
107/*const HepLorentzVector& McParticle::finalFourMomentum()const
108{
109 return m_finalFourMomentum;
110}*/
111
112unsigned int McParticle::statusFlags()const{
113 return m_statusFlags;
114}
115
116/// access to the mother particle
118{
119 return *m_mother;
120}
121
122/// Remove daughters when in prune mode
123void McParticle::removeDaughter(const SmartRef<McParticle> mcPart)
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}
136
137} // namespace Event
void removeDaughter(const SmartRef< McParticle > mcPart)
Used for pruning.
Definition: McParticle.cxx:123
bool primaryParticle() const
Retrieve whether this is a primary particle.
Definition: McParticle.cxx:13
const HepLorentzVector & initialPosition() const
Retrieve pointer to the start, end vertex positions.
Definition: McParticle.cxx:95
void setMother(const SmartRef< McParticle > m)
set the mother particle
Definition: McParticle.cxx:90
const HepLorentzVector & initialFourMomentum() const
Definition: McParticle.cxx:103
const McParticle & mother() const
access to the mother particle
Definition: McParticle.cxx:117
unsigned int statusFlags() const
retrieve all of status flags for const object
Definition: McParticle.cxx:112
void initialize(StdHepId id, unsigned int statusBits, const HepLorentzVector &initialMomentum, const HepLorentzVector &initialPosition, const std::string process="")
Set the initial attributes of the McParticle.
Definition: McParticle.cxx:50
bool decayFromGenerator() const
Decayed from generator.
Definition: McParticle.cxx:25
bool leafParticle() const
Retrieve whether this is a leaf particle.
Definition: McParticle.cxx:19
void finalize(const HepLorentzVector &finalPosition)
Set the final attributes of the McParticle.
Definition: McParticle.cxx:85
bool decayInFlight() const
Decayed in flight.
Definition: McParticle.cxx:31
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="")
Definition: McParticle.cxx:36
const HepLorentzVector & finalPosition() const
Definition: McParticle.cxx:99
StdHepId particleProperty() const
Retrieve particle property.
Definition: McParticle.cxx:7