ATLAS Offline Software
Loading...
Searching...
No Matches
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
15ISF::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),
44 Amg::Vector3D(px,py,pz),
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
86ISF::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}
#define ATH_MSG_VERBOSE(x)
#define y
#define x
#define z
The generic ISF particle definition,.
Definition ISFParticle.h:42
const TruthBinding * getTruthBinding() const
pointer to the simulation truth - optional, can be 0
double charge() const
charge of the particle
const HepMcParticleLink * getParticleLink() const
HepMcParticleLink accessors.
double timeStamp() const
Timestamp of the ISFParticle.
int pdgCode() const
PDG value.
double mass() const
mass of the particle
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.
virtual StatusCode finalize() override
virtual StatusCode initialize() override
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.
ParticleHelper(const std::string &t, const std::string &n, const IInterface *p)
Constructor.
Eigen::Matrix< double, 3, 1 > Vector3D
int barcode(const T *p)
Definition Barcode.h:16
int uniqueID(const T &p)
int status(const T &p)