ATLAS Offline Software
ParticleHelper.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // class header include
6 #include "ParticleHelper.h"
7 
8 // ISF includes
10 
11 // HMPL
13 
15 ISF::ParticleHelper::ParticleHelper(const std::string& t, const std::string& n, const IInterface* p) :
16  base_class(t,n,p)
17 {
18 
19 }
20 
21 
22 // Athena algtool's Hooks
24 {
25  ATH_MSG_VERBOSE("Initializing ...");
26  return StatusCode::SUCCESS;
27 }
28 
29 
32  double px, double py, double pz,
33  double pMass,
34  double pCharge,
35  int pPdgId,
36  int status,
37  double pTime,
38  const ISFParticle &parent,
39  int bc,
40  int id,
41  TruthBinding* tBinding,
42  const HepMcParticleLink * partLink) const {
43  return new ISF::ISFParticle( Amg::Vector3D(x,y,z),
45  pMass,
46  pCharge,
47  pPdgId,
48  status,
49  pTime,
50  parent,
51  bc,
52  id,
53  tBinding,
54  partLink);
55 }
56 
57 
60  const Amg::Vector3D& p,
61  double pMass,
62  double pCharge,
63  int pPdgId,
64  int status,
65  double pTime,
66  const ISFParticle &parent,
67  int bc,
68  int id,
69  TruthBinding* tBinding,
70  const HepMcParticleLink * partLink) const {
71  return new ISF::ISFParticle( x,
72  p,
73  pMass,
74  pCharge,
75  pPdgId,
76  status,
77  pTime,
78  parent,
79  id,
80  bc,
81  tBinding,
82  partLink);
83 }
84 
86 ISF::ISFParticle* ISF::ParticleHelper::createParticle( const HepGeom::Point3D<double>& pos,
87  const HepGeom::Vector3D<double>& mom,
88  double pMass,
89  double pCharge,
90  int pPdgId,
91  int status,
92  double pTime,
93  const ISFParticle &parent,
94  int bc,
95  int id,
96  TruthBinding* tBinding,
97  const HepMcParticleLink * partLink) const {
98  return createParticle( pos.x(), pos.y(), pos.z(),
99  mom.x(), mom.y(), mom.z(),
100  pMass,
101  pCharge,
102  pPdgId,
103  status,
104  pTime,
105  parent,
106  id,
107  bc,
108  tBinding,
109  partLink);
110 }
111 
114  const Amg::Vector3D& updatedPos,
115  const Amg::Vector3D& updatedMom,
116  double deltaTime) const
117 {
118  return new ISF::ISFParticle( updatedPos,
119  updatedMom,
120  origIsp.mass(),
121  origIsp.charge(),
122  origIsp.pdgCode(),
123  HepMC::status(origIsp),
124  origIsp.timeStamp()+deltaTime,
125  origIsp,
126  HepMC::uniqueID(origIsp),
127  HepMC::barcode(origIsp),
128  origIsp.getTruthBinding() ? new TruthBinding(*origIsp.getTruthBinding()) : nullptr,
129  origIsp.getParticleLink() ? new HepMcParticleLink(*origIsp.getParticleLink()) : nullptr);
130 }
131 
134  const HepGeom::Point3D<double>& updatedPos,
135  const HepGeom::Vector3D<double>& updatedMom,
136  double deltaTime) const
137 {
138  return new ISF::ISFParticle( Amg::Vector3D( updatedPos.x(), updatedPos.y(), updatedPos.z()),
139  Amg::Vector3D( updatedMom.x(), updatedPos.x(), updatedPos.z()),
140  origIsp.mass(),
141  origIsp.charge(),
142  origIsp.pdgCode(),
143  HepMC::status(origIsp),
144  origIsp.timeStamp()+deltaTime,
145  origIsp,
146  HepMC::uniqueID(origIsp),
147  HepMC::barcode(origIsp),
148  origIsp.getTruthBinding() ? new TruthBinding(*origIsp.getTruthBinding()) : nullptr,
149  origIsp.getParticleLink() ? new HepMcParticleLink(*origIsp.getParticleLink()) : nullptr);
150 }
151 
152 
154 {
155  ATH_MSG_VERBOSE("Finalizing ...");
156  return StatusCode::SUCCESS;
157 }
test_pyathena.px
px
Definition: test_pyathena.py:18
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ISF::ParticleHelper::initialize
virtual StatusCode initialize() override
Definition: ParticleHelper.cxx:23
ISF::TruthBinding
Definition: TruthBinding.h:18
ISF::ISFParticle
Definition: ISFParticle.h:42
ISF::ISFParticle::pdgCode
int pdgCode() const
PDG value.
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
Analysis::pMass
constexpr double pMass
Definition: JpsiPlus2Tracks.cxx:33
ISF::ParticleHelper::finalize
virtual StatusCode finalize() override
Definition: ParticleHelper.cxx:153
x
#define x
ParticleHelper.h
ISFParticle.h
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
z
#define z
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
ISF::ParticleHelper::updatedParticle
virtual ISFParticle * updatedParticle(const ISFParticle &origIsp, const Amg::Vector3D &updatedPos, const Amg::Vector3D &updatedMom, double deltaTime=0.) const override final
An updated particle (e.g.
Definition: ParticleHelper.cxx:113
HepMC::uniqueID
int uniqueID(const T &p)
Definition: MagicNumbers.h:113
Amg::pz
@ pz
Definition: GeoPrimitives.h:40
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Amg::py
@ py
Definition: GeoPrimitives.h:39
ISF::ISFParticle::timeStamp
double timeStamp() const
Timestamp of the ISFParticle.
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
ISF::ISFParticle::charge
double charge() const
charge of the particle
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
ISF::ISFParticle::getParticleLink
const HepMcParticleLink * getParticleLink() const
HepMcParticleLink accessors.
Definition: ISFParticle.h:172
y
#define y
ISF::ParticleHelper::ParticleHelper
ParticleHelper(const std::string &t, const std::string &n, const IInterface *p)
Constructor.
Definition: ParticleHelper.cxx:15
merge.status
status
Definition: merge.py:17
HepMC::status
int status(const T &p)
Definition: MagicNumbers.h:130
ISF::ISFParticle::getTruthBinding
const TruthBinding * getTruthBinding() const
pointer to the simulation truth - optional, can be 0
ISF::ParticleHelper::createParticle
virtual ISFParticle * createParticle(double x, double y, double z, double px, double py, double pz, double pMass, double pCharge, int pPdgId, int status, double pTime, const ISFParticle &parent, int bc, int id, TruthBinding *tBinding=nullptr, const HepMcParticleLink *partLink=nullptr) const override final
Create a new particle.
Definition: ParticleHelper.cxx:31
ISF::ISFParticle::mass
double mass() const
mass of the particle