ATLAS Offline Software
Loading...
Searching...
No Matches
ISF::ISFParticle Class Reference

The generic ISF particle definition,. More...

#include <ISFParticle.h>

Collaboration diagram for ISF::ISFParticle:

Public Member Functions

 ISFParticle ()=delete
 disallow default constructor
 ISFParticle (const Amg::Vector3D &pos, const Amg::Vector3D &mom, double mass, double charge, int pdgCode, int status, double time, const ISFParticle &parent, int id, int barcode=HepMC::UNDEFINED_ID, TruthBinding *truth=nullptr, const HepMcParticleLink *partLink=nullptr)
 use this constructor whenever possible
 ISFParticle (const HepGeom::Point3D< double > &pos, const HepGeom::Vector3D< double > &mom, double mass, double charge, int pdgCode, int status, double time, const ISFParticle &parent, int id, int barcode=HepMC::UNDEFINED_ID, TruthBinding *truth=nullptr, const HepMcParticleLink *partLink=nullptr)
 CLHEP-compatible constructor.
 ISFParticle (const Amg::Vector3D &pos, const Amg::Vector3D &mom, double mass, double charge, int pdgCode, int status, double time, const DetRegionSvcIDPair &origin, int id, int barcode=HepMC::UNDEFINED_ID, TruthBinding *truth=nullptr, const HepMcParticleLink *partLink=nullptr)
 this constructor should only be used for event read-in
 ISFParticle (const ISFParticle &isfp)
 Copy constructor.
 ISFParticle (ISFParticle &&isfp)
 Move copy constructor.
 ~ISFParticle ()
 Destructor.
ISFParticleoperator= (const ISFParticle &rhs)
 Assignment operator.
ISFParticleoperator= (ISFParticle &&rhs)
 Move assignment operator.
bool operator== (const ISFParticle &rhs) const
 Comparisons.
bool isEqual (const ISFParticle &rhs) const
bool isIdent (const ISFParticle &rhs) const
const Amg::Vector3Dmomentum () const
 The current momentum vector of the ISFParticle.
const Amg::Vector3Dposition () const
 The current position of the ISFParticle.
void updatePosition (const Amg::Vector3D &position)
 Update the position of the ISFParticle.
void updateMomentum (const Amg::Vector3D &momentum)
 Update the momentum of the ISFParticle.
double mass () const
 mass of the particle
double charge () const
 charge of the particle
double timeStamp () const
 Timestamp of the ISFParticle.
int pdgCode () const
 PDG value.
double ekin () const
 Kinetic energy.
const ParticleHistoryhistory () const
 the particle's full history
AtlasDetDescr::AtlasRegion originGeoID () const
 the sub-detector ID the particle's originates from
SimSvcID originSimID () const
 the simulation service the particle originates from
AtlasDetDescr::AtlasRegion prevGeoID () const
 previous geoID that the particle was simulated in
SimSvcID prevSimID () const
 the simulation service that previously treated this particle
AtlasDetDescr::AtlasRegion nextGeoID () const
 next geoID the particle will be simulated in
SimSvcID nextSimID () const
 the next simulation service the particle will be sent to
void setNextGeoID (AtlasDetDescr::AtlasRegion geoID)
 register the next AtlasDetDescr::AtlasRegion
void setNextSimID (SimSvcID simID)
 register the next SimSvcID
int barcode () const
 the barcode
void setBarcode (int bc)
 set a new barcode
int id () const
 unique ID
void setId (int id)
 set a new unique ID
const TruthBindinggetTruthBinding () const
 pointer to the simulation truth - optional, can be 0
TruthBindinggetTruthBinding ()
void setTruthBinding (TruthBinding *truth)
const HepMcParticleLinkgetParticleLink () const
 HepMcParticleLink accessors.
void setParticleLink (const HepMcParticleLink *partLink)
ParticleOrder getOrder () const
 return the particle order (eg used to assure ID->Calo->MS simulation order)
void setOrder (ParticleOrder order)
const ParticleUserInformationgetUserInformation () const
 get/set ParticleUserInformation
ParticleUserInformationgetUserInformation ()
void setUserInformation (ParticleUserInformation *userInfo)
MsgStream & dump (MsgStream &out) const
 Dump methods to be used by the overloaded stream operator (inheritance!)
std::ostream & dump (std::ostream &out) const
void setStatus (int a)
int status () const

Private Attributes

Amg::Vector3D m_position
Amg::Vector3D m_momentum
double m_mass
double m_charge
int m_pdgCode
int m_status
double m_tstamp
ParticleHistory m_history
int m_barcode
 barcode TODO remove in favour of m_status + m_uid
int m_uid
TruthBindingm_truth
 < unique ID
ParticleOrder m_order
 particle simulation order
ParticleUserInformationm_userInfo
 user information stored with the ISFParticle
const HepMcParticleLinkm_partLink

Detailed Description

The generic ISF particle definition,.

Author
Andreas.Salzburger -at- cern.ch , Elmar.Ritsch -at- cern.ch

Definition at line 42 of file ISFParticle.h.

Constructor & Destructor Documentation

◆ ISFParticle() [1/6]

ISF::ISFParticle::ISFParticle ( )
delete

disallow default constructor

◆ ISFParticle() [2/6]

ISF::ISFParticle::ISFParticle ( const Amg::Vector3D & pos,
const Amg::Vector3D & mom,
double mass,
double charge,
int pdgCode,
int status,
double time,
const ISFParticle & parent,
int id,
int barcode = HepMC::UNDEFINED_ID,
TruthBinding * truth = nullptr,
const HepMcParticleLink * partLink = nullptr )

use this constructor whenever possible

Definition at line 9 of file ISFParticle.cxx.

21 :
22 m_position(pos),
23 m_momentum(mom),
24 m_mass(mass),
28 m_tstamp(time),
29 m_history(parent.history()),
30 m_barcode(barcode), // TODO drop this soon
31 m_uid(id),
32 m_truth(truth),
34 m_userInfo(nullptr),
35 m_partLink(partLink)
36{
37
38}
TruthBinding * m_truth
< unique ID
Amg::Vector3D m_momentum
ParticleOrder m_order
particle simulation order
int barcode() const
the barcode
double charge() const
charge of the particle
const HepMcParticleLink * m_partLink
Amg::Vector3D m_position
int m_barcode
barcode TODO remove in favour of m_status + m_uid
ParticleHistory m_history
ParticleUserInformation * m_userInfo
user information stored with the ISFParticle
int pdgCode() const
PDG value.
double mass() const
mass of the particle
int status() const
const ParticleOrder DefaultParticleOrder

◆ ISFParticle() [3/6]

ISF::ISFParticle::ISFParticle ( const HepGeom::Point3D< double > & pos,
const HepGeom::Vector3D< double > & mom,
double mass,
double charge,
int pdgCode,
int status,
double time,
const ISFParticle & parent,
int id,
int barcode = HepMC::UNDEFINED_ID,
TruthBinding * truth = nullptr,
const HepMcParticleLink * partLink = nullptr )

CLHEP-compatible constructor.

Definition at line 40 of file ISFParticle.cxx.

52 :
53 m_position( pos.x(), pos.y(), pos.z()),
54 m_momentum( mom.x(), mom.y(), mom.z()),
55 m_mass(mass),
59 m_tstamp(time),
60 m_history(parent.history()),
61 m_barcode(barcode), // TODO drop this soon
62 m_uid(id),
63 m_truth(truth),
65 m_userInfo(nullptr),
66 m_partLink(partLink)
67{
68
69}

◆ ISFParticle() [4/6]

ISF::ISFParticle::ISFParticle ( const Amg::Vector3D & pos,
const Amg::Vector3D & mom,
double mass,
double charge,
int pdgCode,
int status,
double time,
const DetRegionSvcIDPair & origin,
int id,
int barcode = HepMC::UNDEFINED_ID,
TruthBinding * truth = nullptr,
const HepMcParticleLink * partLink = nullptr )

this constructor should only be used for event read-in

Definition at line 71 of file ISFParticle.cxx.

83 :
84 m_position(pos),
85 m_momentum(mom),
86 m_mass(mass),
90 m_tstamp(time),
91 m_history(1, origin),
92 m_barcode(barcode), // TODO drop this soon
93 m_uid(id),
94 m_truth(truth),
96 m_userInfo(nullptr),
97 m_partLink(partLink)
98{
99
100}

◆ ISFParticle() [5/6]

ISF::ISFParticle::ISFParticle ( const ISFParticle & isfp)

Copy constructor.

Definition at line 102 of file ISFParticle.cxx.

102 :
103 m_position(isfp.position()),
104 m_momentum(isfp.momentum()),
105 m_mass(isfp.mass()),
106 m_charge(isfp.charge()),
107 m_pdgCode(isfp.pdgCode()),
108 m_status(isfp.status()),
109 m_tstamp(isfp.timeStamp()),
110 m_history(isfp.history()),
111 m_barcode(isfp.barcode()), // TODO drop this soon
112 m_uid(isfp.id()),
113 m_truth(nullptr),
115 m_userInfo(nullptr)
116{
117 const TruthBinding *truth = isfp.getTruthBinding();
118 if (truth) {
119 m_truth = new TruthBinding(*truth);
120 }
121 m_partLink = ((isfp.getParticleLink()) ? new HepMcParticleLink(*isfp.getParticleLink()) : nullptr);
122}

◆ ISFParticle() [6/6]

ISF::ISFParticle::ISFParticle ( ISFParticle && isfp)

Move copy constructor.

Definition at line 124 of file ISFParticle.cxx.

124 :
125 m_position(isfp.position()),
126 m_momentum(isfp.momentum()),
127 m_mass(isfp.mass()),
128 m_charge(isfp.charge()),
129 m_pdgCode(isfp.pdgCode()),
130 m_status(isfp.status()),
131 m_tstamp(isfp.timeStamp()),
132 m_history(isfp.history()),
133 m_barcode(isfp.barcode()), // TODO drop this soon
134 m_uid(isfp.id()),
135 m_truth(isfp.getTruthBinding()),
136 m_order(isfp.getOrder()),
137 m_userInfo(isfp.getUserInformation()),
138 m_partLink(isfp.getParticleLink())
139{
140}

◆ ~ISFParticle()

ISF::ISFParticle::~ISFParticle ( )

Destructor.

Definition at line 142 of file ISFParticle.cxx.

142 {
143 delete m_truth;
144 delete m_userInfo;
145 if (m_partLink) delete m_partLink;
146}

Member Function Documentation

◆ barcode()

int ISF::ISFParticle::barcode ( ) const

the barcode

◆ charge()

double ISF::ISFParticle::charge ( ) const

charge of the particle

◆ dump() [1/2]

MsgStream & ISF::ISFParticle::dump ( MsgStream & out) const

Dump methods to be used by the overloaded stream operator (inheritance!)

◆ dump() [2/2]

std::ostream & ISF::ISFParticle::dump ( std::ostream & out) const

◆ ekin()

double ISF::ISFParticle::ekin ( ) const

Kinetic energy.

◆ getOrder()

ParticleOrder ISF::ISFParticle::getOrder ( ) const

return the particle order (eg used to assure ID->Calo->MS simulation order)

◆ getParticleLink()

const HepMcParticleLink * ISF::ISFParticle::getParticleLink ( ) const
inline

HepMcParticleLink accessors.

Definition at line 172 of file ISFParticle.h.

172{return m_partLink;};

◆ getTruthBinding() [1/2]

TruthBinding * ISF::ISFParticle::getTruthBinding ( )

◆ getTruthBinding() [2/2]

const TruthBinding * ISF::ISFParticle::getTruthBinding ( ) const

pointer to the simulation truth - optional, can be 0

◆ getUserInformation() [1/2]

ParticleUserInformation * ISF::ISFParticle::getUserInformation ( )

◆ getUserInformation() [2/2]

const ParticleUserInformation * ISF::ISFParticle::getUserInformation ( ) const

◆ history()

const ParticleHistory & ISF::ISFParticle::history ( ) const

the particle's full history

◆ id()

int ISF::ISFParticle::id ( ) const

unique ID

◆ isEqual()

bool ISF::ISFParticle::isEqual ( const ISFParticle & rhs) const

Definition at line 208 of file ISFParticle.cxx.

209{
210 double epsilon = 1e-6;
211
212 bool pass = true;
213 pass &= m_position == rhs.position();
214 pass &= m_momentum == rhs.momentum();
215 pass &= std::fabs(m_mass-rhs.mass()) < epsilon;
216 pass &= std::fabs(m_charge-rhs.charge()) < epsilon;
217 pass &= m_pdgCode == rhs.pdgCode();
218 pass &= m_status == rhs.status();
219 pass &= std::fabs(m_tstamp-rhs.timeStamp()) < epsilon;
220 pass &= m_history == rhs.history();
221 pass &= m_barcode == rhs.barcode(); // TODO drop this soon
222 pass &= m_uid == rhs.id();
223 {
224 const auto rhsTruthPtr = rhs.getTruthBinding();
225 if (m_truth && rhsTruthPtr) {
226 pass &= *m_truth == *rhsTruthPtr;
227 } else {
228 pass &= m_truth == rhsTruthPtr; // must be both nullptr to pass
229 }
230 }
231
232 {
233 const auto rhsUserInfoPtr = rhs.getUserInformation();
234 if (m_userInfo && rhsUserInfoPtr) {
235 pass &= *m_userInfo == *rhsUserInfoPtr;
236 } else {
237 pass &= m_userInfo == rhsUserInfoPtr; // must be both nullptr to pass
238 }
239 }
240
241 {
242 const auto rhsPartLinkPtr = rhs.getParticleLink();
243 if(m_partLink && rhsPartLinkPtr) {
244 pass &= *m_partLink == *rhsPartLinkPtr;
245 } else {
246 pass &= m_partLink == rhsPartLinkPtr; // must be both nullptr to pass
247 }
248 }
249 return pass;
250}

◆ isIdent()

bool ISF::ISFParticle::isIdent ( const ISFParticle & rhs) const

Definition at line 252 of file ISFParticle.cxx.

253{
254 bool pass = true;
255 pass &= m_position == rhs.position();
256 pass &= m_momentum == rhs.momentum();
257 pass &= m_mass == rhs.mass();
258 pass &= m_charge == rhs.charge();
259 pass &= m_pdgCode == rhs.pdgCode();
260 pass &= m_status == rhs.status();
261 pass &= m_tstamp == rhs.timeStamp();
262 pass &= m_history == rhs.history();
263 pass &= m_barcode == rhs.barcode(); // TODO drop this soon
264 pass &= m_uid == rhs.id();
265 pass &= m_truth && rhs.getTruthBinding();
266 pass &= m_userInfo == rhs.getUserInformation();
267 pass &= m_partLink == rhs.getParticleLink();
268 return pass;
269}

◆ mass()

double ISF::ISFParticle::mass ( ) const

mass of the particle

◆ momentum()

const Amg::Vector3D & ISF::ISFParticle::momentum ( ) const

The current momentum vector of the ISFParticle.

◆ nextGeoID()

AtlasDetDescr::AtlasRegion ISF::ISFParticle::nextGeoID ( ) const

next geoID the particle will be simulated in

◆ nextSimID()

SimSvcID ISF::ISFParticle::nextSimID ( ) const

the next simulation service the particle will be sent to

◆ operator=() [1/2]

ISF::ISFParticle & ISF::ISFParticle::operator= ( const ISFParticle & rhs)

Assignment operator.

Definition at line 149 of file ISFParticle.cxx.

150{
151
152 if (this != &rhs) {
153 m_position = rhs.position();
154 m_momentum = rhs.momentum();
155 m_mass = rhs.mass();
156 m_charge = rhs.charge();
157 m_pdgCode = rhs.pdgCode();
158 m_status = rhs.status();
159 m_tstamp = rhs.timeStamp();
160 m_history = rhs.history();
161 m_barcode = rhs.barcode(); // TODO drop this soon
162 m_uid = rhs.id();
163
164 delete m_truth;
165 m_truth = nullptr;
166
167 const TruthBinding *rhsTruth = rhs.getTruthBinding();
168 if (rhsTruth) {
169 m_truth = new TruthBinding(*rhsTruth);
170 }
171 m_partLink = ((rhs.getParticleLink()) ? new HepMcParticleLink(*rhs.getParticleLink()): nullptr);
172
173 delete m_userInfo;
174 m_userInfo = nullptr;
175 }
176
177 return *this;
178}

◆ operator=() [2/2]

ISF::ISFParticle & ISF::ISFParticle::operator= ( ISF::ISFParticle && rhs)

Move assignment operator.

Definition at line 181 of file ISFParticle.cxx.

182{
183 m_position = rhs.position();
184 m_momentum = rhs.momentum();
185 m_mass = rhs.mass();
186 m_charge = rhs.charge();
187 m_pdgCode = rhs.pdgCode();
188 m_status = rhs.status();
189 m_tstamp = rhs.timeStamp();
190 m_history = rhs.history();
191 m_barcode = rhs.barcode(); // TODO drop this soon
192 m_uid = rhs.id();
193 delete m_truth;
194 m_truth = rhs.getTruthBinding();
195 delete m_userInfo;
197 if (m_partLink) delete m_partLink;
199
200 return *this;
201}
const TruthBinding * getTruthBinding() const
pointer to the simulation truth - optional, can be 0
const HepMcParticleLink * getParticleLink() const
HepMcParticleLink accessors.
int id() const
unique ID
const ParticleUserInformation * getUserInformation() const
get/set ParticleUserInformation
const ParticleHistory & history() const
the particle's full history
const Amg::Vector3D & momentum() const
The current momentum vector of the ISFParticle.
double timeStamp() const
Timestamp of the ISFParticle.
const Amg::Vector3D & position() const
The current position of the ISFParticle.

◆ operator==()

bool ISF::ISFParticle::operator== ( const ISFParticle & rhs) const

Comparisons.

Definition at line 203 of file ISFParticle.cxx.

204{
205 return isEqual(rhs);
206}
bool isEqual(const ISFParticle &rhs) const

◆ originGeoID()

AtlasDetDescr::AtlasRegion ISF::ISFParticle::originGeoID ( ) const

the sub-detector ID the particle's originates from

◆ originSimID()

SimSvcID ISF::ISFParticle::originSimID ( ) const

the simulation service the particle originates from

◆ pdgCode()

int ISF::ISFParticle::pdgCode ( ) const

PDG value.

◆ position()

const Amg::Vector3D & ISF::ISFParticle::position ( ) const

The current position of the ISFParticle.

◆ prevGeoID()

AtlasDetDescr::AtlasRegion ISF::ISFParticle::prevGeoID ( ) const

previous geoID that the particle was simulated in

◆ prevSimID()

SimSvcID ISF::ISFParticle::prevSimID ( ) const

the simulation service that previously treated this particle

◆ setBarcode()

void ISF::ISFParticle::setBarcode ( int bc)

set a new barcode

◆ setId()

void ISF::ISFParticle::setId ( int id)

set a new unique ID

◆ setNextGeoID()

void ISF::ISFParticle::setNextGeoID ( AtlasDetDescr::AtlasRegion geoID)

register the next AtlasDetDescr::AtlasRegion

◆ setNextSimID()

void ISF::ISFParticle::setNextSimID ( SimSvcID simID)

register the next SimSvcID

◆ setOrder()

void ISF::ISFParticle::setOrder ( ParticleOrder order)

◆ setParticleLink()

void ISF::ISFParticle::setParticleLink ( const HepMcParticleLink * partLink)
inline

Definition at line 173 of file ISFParticle.h.

173{m_partLink=partLink;};

◆ setStatus()

void ISF::ISFParticle::setStatus ( int a)
inline

Definition at line 188 of file ISFParticle.h.

188{ m_status=a; }
static Double_t a

◆ setTruthBinding()

void ISF::ISFParticle::setTruthBinding ( TruthBinding * truth)

◆ setUserInformation()

void ISF::ISFParticle::setUserInformation ( ParticleUserInformation * userInfo)

◆ status()

int ISF::ISFParticle::status ( ) const
inline

Definition at line 189 of file ISFParticle.h.

189{ return m_status;}

◆ timeStamp()

double ISF::ISFParticle::timeStamp ( ) const

Timestamp of the ISFParticle.

◆ updateMomentum()

void ISF::ISFParticle::updateMomentum ( const Amg::Vector3D & momentum)

Update the momentum of the ISFParticle.

◆ updatePosition()

void ISF::ISFParticle::updatePosition ( const Amg::Vector3D & position)

Update the position of the ISFParticle.

Member Data Documentation

◆ m_barcode

int ISF::ISFParticle::m_barcode
private

barcode TODO remove in favour of m_status + m_uid

Definition at line 200 of file ISFParticle.h.

◆ m_charge

double ISF::ISFParticle::m_charge
private

Definition at line 195 of file ISFParticle.h.

◆ m_history

ParticleHistory ISF::ISFParticle::m_history
private

Definition at line 199 of file ISFParticle.h.

◆ m_mass

double ISF::ISFParticle::m_mass
private

Definition at line 194 of file ISFParticle.h.

◆ m_momentum

Amg::Vector3D ISF::ISFParticle::m_momentum
private

Definition at line 193 of file ISFParticle.h.

◆ m_order

ParticleOrder ISF::ISFParticle::m_order
private

particle simulation order

Definition at line 203 of file ISFParticle.h.

◆ m_partLink

const HepMcParticleLink* ISF::ISFParticle::m_partLink
private

Definition at line 205 of file ISFParticle.h.

◆ m_pdgCode

int ISF::ISFParticle::m_pdgCode
private

Definition at line 196 of file ISFParticle.h.

◆ m_position

Amg::Vector3D ISF::ISFParticle::m_position
private

Definition at line 192 of file ISFParticle.h.

◆ m_status

int ISF::ISFParticle::m_status
private

Definition at line 197 of file ISFParticle.h.

◆ m_truth

TruthBinding* ISF::ISFParticle::m_truth
private

< unique ID

Definition at line 202 of file ISFParticle.h.

◆ m_tstamp

double ISF::ISFParticle::m_tstamp
private

Definition at line 198 of file ISFParticle.h.

◆ m_uid

int ISF::ISFParticle::m_uid
private

Definition at line 201 of file ISFParticle.h.

◆ m_userInfo

ParticleUserInformation* ISF::ISFParticle::m_userInfo
private

user information stored with the ISFParticle

Definition at line 204 of file ISFParticle.h.


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