ATLAS Offline Software
ISFParticle.icc
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // this file contains all ISFParticle inline methods
6 
7 namespace ISF {
8 
9  // inline methods, nomen est omen
10  //
11  inline const Amg::Vector3D& ISFParticle::position() const { return m_position; }
12  inline const Amg::Vector3D& ISFParticle::momentum() const { return m_momentum; }
13  inline void ISFParticle::updatePosition(const Amg::Vector3D& position) { m_position=position; }
14  inline void ISFParticle::updateMomentum(const Amg::Vector3D& momentum) { m_momentum=momentum; }
15 
16  inline double ISFParticle::mass() const { return m_mass; }
17  inline double ISFParticle::charge() const { return m_charge; }
18  inline double ISFParticle::timeStamp() const { return m_tstamp; }
19  inline int ISFParticle::pdgCode() const { return m_pdgCode; }
20 
21  inline double ISFParticle::ekin() const { return sqrt( m_momentum.mag2() + m_mass*m_mass ) - m_mass; }
22 
23  // history methods
24  //
25  inline const ParticleHistory& ISFParticle::history() const { return m_history; }
26  inline AtlasDetDescr::AtlasRegion ISFParticle::originGeoID() const { return m_history.front().first; }
27  inline SimSvcID ISFParticle::originSimID() const { return m_history.front().second; }
28  inline AtlasDetDescr::AtlasRegion ISFParticle::prevGeoID() const { return (m_history.end()-1)->first; }
29  inline SimSvcID ISFParticle::prevSimID() const { return (m_history.end()-1)->second; }
30  inline AtlasDetDescr::AtlasRegion ISFParticle::nextGeoID() const { return m_history.back().first; }
31  inline SimSvcID ISFParticle::nextSimID() const { return m_history.back().second; }
32  inline void ISFParticle::setNextGeoID( AtlasDetDescr::AtlasRegion geoID) { m_history.back().first = geoID; }
33  inline void ISFParticle::setNextSimID( SimSvcID simID) { m_history.back().second = simID;}
34 
35  // barcode methods
36  //
37  inline int ISFParticle::barcode() const { return m_barcode; } // FIXME barcode-based
38  inline void ISFParticle::setBarcode(int bc) { m_barcode = bc; } // FIXME-barcode-based
39 
40  // id methods
41  //
42  inline int ISFParticle::id() const { return m_uid; }
43  inline void ISFParticle::setId(int id) { m_uid = id; }
44 
45  // truth methods
46  //
47  inline const TruthBinding* ISFParticle::getTruthBinding() const { return m_truth; }
48  inline TruthBinding* ISFParticle::getTruthBinding() { return m_truth; }
49  inline void ISFParticle::setTruthBinding(TruthBinding *truth) { m_truth = truth; }
50 
51  // particle order methods
52  //
53  inline int ISFParticle::getOrder() const { return m_order; }
54  inline void ISFParticle::setOrder( ParticleOrder order ) { m_order = order; }
55 
56  // set ParticleUserInformation
57  inline const ParticleUserInformation *ISFParticle::getUserInformation() const { return m_userInfo; }
58  inline ParticleUserInformation *ISFParticle::getUserInformation() { return m_userInfo; }
59  inline void ISFParticle::setUserInformation(ParticleUserInformation *userInfo)
60  {
61  if ( m_userInfo==0 ) { m_userInfo = userInfo; }
62  else {
63  m_userInfo->setGeneration( userInfo->generation() );
64  m_userInfo->setProcess( userInfo->process() );
65  // don't overwrite barcode
66  }
67  }
68 
69  // printout methods
70  inline MsgStream& ISFParticle::dump( MsgStream& out ) const
71  { out << "ISFP pdg=" << m_pdgCode << " p=" << m_momentum.mag()
72  << " xyz=(" << m_position.x() << "," << m_position.y() << "," << m_position.z() << ")"
73  << " r=" << m_position.perp() << " eta=" << m_position.eta() << " phi=" << m_position.phi()
74  << " status="<< m_status << " id=" << m_uid
75  << " barcode=" << m_barcode << " mass=" << m_mass << " order=" << m_order;
76  if (m_partLink)
77  out << " (" << *m_partLink << ")";
78  else
79  out << " (No assoc. HMPL)";
80  return out;}
81 
82  inline std::ostream& ISFParticle::dump( std::ostream& out ) const
83  { out << "ISFP pdg=" << m_pdgCode << " p=" << m_momentum.mag()
84  << " xyz=(" << m_position.x() << "," << m_position.y() << "," << m_position.z() << ")"
85  << " r=" << m_position.perp() << " eta=" << m_position.eta() << " phi=" << m_position.phi()
86  << " status="<< m_status << " id=" << m_uid
87  << " barcode=" << m_barcode << " mass=" << m_mass << " order=" << m_order;
88  if (m_partLink)
89  out << " (" << *m_partLink << ")";
90  else
91  out << " (No assoc. HMPL)";
92  return out;}
93 
94 } // end ISF namespace