ATLAS Offline Software
ISFParticle.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ISF_EVENT_ISFPARTICLE_H
6 #define ISF_EVENT_ISFPARTICLE_H
7 
8 // Gaudi Kernel
9 #include "GaudiKernel/MsgStream.h"
10 // Barcode includes
12 // ISF include
13 #include "ISF_Event/TruthBinding.h"
14 #include "ISF_Event/SimSvcID.h"
17 // DetectorDescription
19 // Amg classes
21 // CHLEP classes
22 #include "CLHEP/Geometry/Point3D.h"
23 #include "CLHEP/Geometry/Vector3D.h"
24 // Common classes
26 
27 namespace ISF {
28 
30  typedef std::pair< AtlasDetDescr::AtlasRegion, ISF::SimSvcID > DetRegionSvcIDPair;
32  typedef std::vector< DetRegionSvcIDPair > ParticleHistory;
33 
42  class ISFParticle {
43 
44  public:
46  ISFParticle() = delete;
47 
50  const Amg::Vector3D& mom,
51  double mass,
52  double charge,
53  int pdgCode,
54  int status,
55  double time,
56  const ISFParticle &parent,
57  int id,
59  TruthBinding* truth = nullptr,
60  const HepMcParticleLink * partLink = nullptr );
61 
63  ISFParticle(const HepGeom::Point3D<double>& pos,
64  const HepGeom::Vector3D<double>& mom,
65  double mass,
66  double charge,
67  int pdgCode,
68  int status,
69  double time,
70  const ISFParticle &parent,
71  int id,
73  TruthBinding* truth = nullptr,
74  const HepMcParticleLink * partLink = nullptr );
75 
78  const Amg::Vector3D& mom,
79  double mass,
80  double charge,
81  int pdgCode,
82  int status,
83  double time,
84  const DetRegionSvcIDPair &origin,
85  int id,
87  TruthBinding* truth = nullptr,
88  const HepMcParticleLink * partLink = nullptr );
89 
91  ISFParticle(const ISFParticle& isfp);
92 
94  ISFParticle(ISFParticle&& isfp);
95 
97  ~ISFParticle();
98 
100  ISFParticle& operator=(const ISFParticle& rhs);
101 
104 
106  bool operator==(const ISFParticle& rhs) const;
107  bool isEqual(const ISFParticle& rhs) const;
108  bool isIdent(const ISFParticle& rhs) const;
109 
111  const Amg::Vector3D& momentum() const;
112 
114  const Amg::Vector3D& position() const;
115 
118 
121 
123  double mass() const;
124 
126  double charge() const;
127 
129  double timeStamp() const;
130 
132  int pdgCode() const;
133 
135  double ekin() const;
136 
138  const ParticleHistory& history() const;
154  void setNextSimID(SimSvcID simID);
155 
157  int barcode() const; // FIXME barcode-based
159  void setBarcode(int bc); // FIXME barcode-based
160 
162  int id() const;
164  void setId(int id);
165 
170 
172  inline const HepMcParticleLink* getParticleLink() const {return m_partLink;};
173  inline void setParticleLink(const HepMcParticleLink* partLink) {m_partLink=partLink;};
174 
178 
183 
185  MsgStream& dump(MsgStream& out) const;
186  std::ostream& dump(std::ostream& out) const;
187 
188  void setStatus(int a) { m_status=a; }
189  int status() const { return m_status;}
190 
191  private :
194  double m_mass;
195  double m_charge;
197  int m_status;
198  double m_tstamp;
200  int m_barcode;
201  int m_uid;
206  };
207 
208  // Overload of << operator for MsgStream for debug output
209  //
210  inline MsgStream& operator << ( MsgStream& sl, const ISF::ISFParticle& isfp) { isfp.dump(sl); return sl; }
211  inline std::ostream& operator << ( std::ostream& sl, const ISF::ISFParticle& isfp) { isfp.dump(sl); return sl; }
212 
213 } // end of namespace
214 
215 /* implementation for inlined methods */
216 #include <ISF_Event/ISFParticle.icc>
217 
218 #endif // ISF_EVENT_ISFPARTICLE_H
ISF::ISFParticle::ekin
double ekin() const
Kinetic energy.
ISF::ISFParticle::m_pdgCode
int m_pdgCode
Definition: ISFParticle.h:196
ISF::DetRegionSvcIDPair
std::pair< AtlasDetDescr::AtlasRegion, ISF::SimSvcID > DetRegionSvcIDPair
the datatype to be used to store each individual particle hop
Definition: ISFParticle.h:30
ISF::ISFParticle::setOrder
void setOrder(ParticleOrder order)
ISF::ISFParticle::m_position
Amg::Vector3D m_position
Definition: ISFParticle.h:192
ISF::ISFParticle::m_charge
double m_charge
Definition: ISFParticle.h:195
ISF::ISFParticle::dump
MsgStream & dump(MsgStream &out) const
Dump methods to be used by the overloaded stream operator (inheritance!)
ISF::ISFParticle::getOrder
ParticleOrder getOrder() const
return the particle order (eg used to assure ID->Calo->MS simulation order)
ISF::ISFParticle::updateMomentum
void updateMomentum(const Amg::Vector3D &momentum)
Update the momentum of the ISFParticle.
ISF::ISFParticle::setNextGeoID
void setNextGeoID(AtlasDetDescr::AtlasRegion geoID)
register the next AtlasDetDescr::AtlasRegion
ISF::ISFParticle::isEqual
bool isEqual(const ISFParticle &rhs) const
Definition: ISFParticle.cxx:208
ISF::ISFParticle::setTruthBinding
void setTruthBinding(TruthBinding *truth)
ISFParticle.icc
AtlasRegion.h
ISF::ISFParticle::m_momentum
Amg::Vector3D m_momentum
Definition: ISFParticle.h:193
ISF::TruthBinding
Definition: TruthBinding.h:18
ISF::ISFParticle::getTruthBinding
TruthBinding * getTruthBinding()
ISF::ISFParticle::m_uid
int m_uid
Definition: ISFParticle.h:201
ISF::ISFParticle::m_userInfo
ParticleUserInformation * m_userInfo
user information stored with the ISFParticle
Definition: ISFParticle.h:204
AtlasDetDescr::AtlasRegion
AtlasRegion
Definition: AtlasRegion.h:27
ISF::ISFParticle::m_partLink
const HepMcParticleLink * m_partLink
Definition: ISFParticle.h:205
ISF::ISFParticle::updatePosition
void updatePosition(const Amg::Vector3D &position)
Update the position of the ISFParticle.
ISF::ISFParticle
Definition: ISFParticle.h:42
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
ISF::ISFParticle::m_history
ParticleHistory m_history
Definition: ISFParticle.h:199
ISF::ISFParticle::originSimID
SimSvcID originSimID() const
the simulation service the particle originates from
ISF::ISFParticle::pdgCode
int pdgCode() const
PDG value.
ISF::ISFParticle::m_status
int m_status
Definition: ISFParticle.h:197
ISF::ISFParticle::dump
std::ostream & dump(std::ostream &out) const
ISF::ISFParticle::m_barcode
int m_barcode
barcode TODO remove in favour of m_status + m_uid
Definition: ISFParticle.h:200
ISF::ISFParticle::operator==
bool operator==(const ISFParticle &rhs) const
Comparisons.
Definition: ISFParticle.cxx:203
ISF::ISFParticle::id
int id() const
unique ID
ISF::ISFParticle::barcode
int barcode() const
the barcode
ISF::ISFParticle::position
const Amg::Vector3D & position() const
The current position of the ISFParticle.
ISF::ISFParticle::m_order
ParticleOrder m_order
particle simulation order
Definition: ISFParticle.h:203
ISF::ParticleOrder
int ParticleOrder
particle order definition
Definition: ParticleOrder.h:15
ISF::ParticleHistory
std::vector< DetRegionSvcIDPair > ParticleHistory
the container type to be used for the particle hops
Definition: ISFParticle.h:32
ISF::ISFParticle::m_truth
TruthBinding * m_truth
< unique ID
Definition: ISFParticle.h:202
TruthBinding.h
GeoPrimitives.h
ISF::ISFParticle::setParticleLink
void setParticleLink(const HepMcParticleLink *partLink)
Definition: ISFParticle.h:173
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
ISF::ISFParticle::nextGeoID
AtlasDetDescr::AtlasRegion nextGeoID() const
next geoID the particle will be simulated in
ISF::ISFParticle::m_mass
double m_mass
Definition: ISFParticle.h:194
ISF::ISFParticle::originGeoID
AtlasDetDescr::AtlasRegion originGeoID() const
the sub-detector ID the particle's originates from
ParticleOrder.h
ISF::ISFParticle::operator=
ISFParticle & operator=(const ISFParticle &rhs)
Assignment operator.
Definition: ISFParticle.cxx:149
mc.order
order
Configure Herwig7.
Definition: mc.Herwig7_Dijet.py:12
ISF::ISFParticle::m_tstamp
double m_tstamp
Definition: ISFParticle.h:198
ISF::ParticleUserInformation
Definition: ParticleUserInformation.h:52
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ISF::ISFParticle::setId
void setId(int id)
set a new unique ID
ISF::ISFParticle::setStatus
void setStatus(int a)
Definition: ISFParticle.h:188
HepMC::UNDEFINED_ID
constexpr int UNDEFINED_ID
Definition: MagicNumbers.h:55
ISF::ISFParticle::ISFParticle
ISFParticle()=delete
disallow default constructor
ParticleUserInformation.h
ISF::ISFParticle::timeStamp
double timeStamp() const
Timestamp of the ISFParticle.
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
MagicNumbers.h
ISF::ISFParticle::momentum
const Amg::Vector3D & momentum() const
The current momentum vector of the ISFParticle.
ISF::ISFParticle::setUserInformation
void setUserInformation(ParticleUserInformation *userInfo)
ISF::ISFParticle::setNextSimID
void setNextSimID(SimSvcID simID)
register the next SimSvcID
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
ISF::ISFParticle::charge
double charge() const
charge of the particle
ISF::ISFParticle::history
const ParticleHistory & history() const
the particle's full history
ISF::ISFParticle::isIdent
bool isIdent(const ISFParticle &rhs) const
Definition: ISFParticle.cxx:252
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
ISF::operator<<
MsgStream & operator<<(MsgStream &sl, const ISF::ISFParticle &isfp)
Definition: ISFParticle.h:210
ISF::ISFParticle::getParticleLink
const HepMcParticleLink * getParticleLink() const
HepMcParticleLink accessors.
Definition: ISFParticle.h:172
ISF::ISFParticle::prevSimID
SimSvcID prevSimID() const
the simulation service that previously treated this particle
a
TList * a
Definition: liststreamerinfos.cxx:10
ISF::ISFParticle::nextSimID
SimSvcID nextSimID() const
the next simulation service the particle will be sent to
ISF::ISFParticle::~ISFParticle
~ISFParticle()
Destructor.
Definition: ISFParticle.cxx:142
ISF::SimSvcID
uint8_t SimSvcID
Simulation service ID datatype.
Definition: SimSvcID.h:28
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
ISF
ISFParticleOrderedQueue.
Definition: PrimaryParticleInformation.h:13
ISF::ISFParticle::status
int status() const
Definition: ISFParticle.h:189
ISF::ISFParticle::getUserInformation
ParticleUserInformation * getUserInformation()
ISF::ISFParticle::setBarcode
void setBarcode(int bc)
set a new barcode
SimSvcID.h
ISF::ISFParticle::getUserInformation
const ParticleUserInformation * getUserInformation() const
get/set ParticleUserInformation
ISF::ISFParticle::getTruthBinding
const TruthBinding * getTruthBinding() const
pointer to the simulation truth - optional, can be 0
ISF::ISFParticle::prevGeoID
AtlasDetDescr::AtlasRegion prevGeoID() const
previous geoID that the particle was simulated in
ISF::ISFParticle::mass
double mass() const
mass of the particle