|
ATLAS Offline Software
|
Go to the documentation of this file.
41 const HepMC::FourVector *position) :
46 m_killsPrimary(killsPrimary),
78 return m_parent.momentum().mag2();
82 return m_parent.momentum().perp2();
86 return m_parent.ekin();
90 return m_parent.pdgCode();
94 return m_parent.status();
98 return getHepMCTruthParticle(m_parent);
106 return m_parent.id();
120 m_parent.setBarcode( newBC );
129 return updateHepMCTruthParticle(m_parent, &m_parent);
133 return m_children[
index]->momentum().mag2();
137 return m_children[
index]->momentum().perp2();
141 return m_children[
index]->ekin();
146 return m_children[
index]->pdgCode();
170 return updateHepMCTruthParticle( *sec, &m_parent );
176 auto* truthBinding =
particle.getTruthBinding();
177 HepMC::GenParticlePtr currentGenParticle = truthBinding ? truthBinding->getCurrentGenParticle() :
nullptr;
180 if (currentGenParticle) {
181 return currentGenParticle;
190 auto* truthBinding =
particle.getTruthBinding();
194 truthBinding->setCurrentGenParticle(newGenParticle);
196 auto parentTruthBinding =
parent ?
parent->getTruthBinding() :
nullptr;
197 auto primaryGenParticle = parentTruthBinding ? parentTruthBinding->getPrimaryGenParticle() :
nullptr;
198 auto generationZeroGenParticle = newGenParticle;
199 truthBinding =
new TruthBinding( newGenParticle, primaryGenParticle, generationZeroGenParticle );
200 particle.setTruthBinding(truthBinding);
207 return newGenParticle;
215 const ISF::TruthBinding *parentAfterIncidentTruthBinding = m_parent.getTruthBinding();
216 auto parentAfterIncidentGenParticle = (parentAfterIncidentTruthBinding) ? parentAfterIncidentTruthBinding->
getCurrentGenParticle() :
nullptr;
221 if (parentAfterIncidentGenParticle) {
eventIndex = parentAfterIncidentGenParticle->parent_event()->event_number(); }
225 if (parentBeforeIncidentHMPL) {
226 delete parentBeforeIncidentHMPL;
228 if (!parentAfterIncidentGenParticle) {
234 m_parent.setId(parentAfterIncidentID);
235 m_parent.setParticleLink(parentAfterIncidentHMPL);
240 unsigned short numSec = numberOfChildren();
241 for (
unsigned short i=0;
i<numSec;
i++) {
245 if (!childTruthBinding) {
248 auto parentTruthBinding = m_parent.getTruthBinding();
249 if (parentTruthBinding) {
254 childTruthBinding =
new TruthBinding(
nullptr,
nullptr,
nullptr );
263 if (childGenParticle) {
eventIndex = childGenParticle->parent_event()->event_number(); }
270 if (!childGenParticle) {
276 child->
setId(childID);
int parentPdgCode() const override final
Return the PDG Code of the parent particle.
bool suggest_barcode(T &p, int i)
void updateChildParticleProperties()
Update the id and particleLink properties of the child particles (to be called after registerTruthInc...
double childP2(unsigned short index) const override final
Return p^2 of the i-th child particle.
HepMC::GenParticlePtr parentParticleAfterIncident(int newBC) override final
Return the parent particle after the TruthIncident vertex (and give it a new barcode)
HepMC::GenParticlePtr updateHepMCTruthParticle(ISF::ISFParticle &particle, ISF::ISFParticle *parent=nullptr) const
convert ISFParticle to GenParticle and attach to ISFParticle's TruthBinding
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
int physicsProcessCode() const override final
Return specific physics process code of the truth incident (eg ionisation, bremsstrahlung,...
int childPdgCode(unsigned short index) const override final
Return the PDG Code of the i-th child particle.
double childPt2(unsigned short index) const override final
Return pT^2 of the i-th child particle.
ISF::ISFParticle & m_parent
void setTruthBinding(TruthBinding *truth)
bool parentSurvivesIncident() const override final
Return a boolean whether or not the parent particle survives the incident.
constexpr int SIM_STATUS_INCREMENT
Constant defining the barcode threshold for regenerated particles, i.e. particles surviving an intera...
const HepMC::FourVector & position() const override final
Return HepMC position of the truth vertex.
HepMC::GenParticlePtr getCurrentGenParticle()
pointer to the particle in the simulation truth
GenParticle * GenParticlePtr
int childBarcode(unsigned short) const override final
Return the barcode of the i-th child particle (if defined as part of the TruthIncident) otherwise ret...
int physicsProcessCategory() const override final
Return category of the physics process represented by the truth incident (eg hadronic,...
void setParticleLink(const HepMcParticleLink *partLink)
a link optimized in size for a GenParticle in a McEventCollection
std::vector< ISF::ISFParticle * > ISFParticleVector
ISFParticle vector.
double parentP2() const override final
Return p^2 of the parent particle.
void setId(int id)
set a new unique ID
double childEkin(unsigned short index) const override final
Return Ekin of the i-th child particle.
double parentPt2() const override final
Return pT^2 of the parent particle.
int parentUniqueID() override final
Return the unique ID of the parent particle.
HepMC::GenParticlePtr parentParticle() override final
Return the parent particle as a HepMC particle type (usually only called for particles that will ente...
constexpr int UNDEFINED_ID
index_type eventIndex() const
Return the event number of the referenced GenEvent.
constexpr int SIM_STATUS_THRESHOLD
Constant definiting the status threshold for simulated particles, eg. can be used to separate generat...
Eigen::Matrix< double, 3, 1 > Vector3D
const HepMcParticleLink * getParticleLink() const
HepMcParticleLink accessors.
const HepMC::FourVector * m_position
GenParticlePtr newGenParticlePtr(const HepMC::FourVector &mom=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), int pid=0, int status=0)
void updateParentAfterIncidentProperties()
Update the id and particleLink properties of the parentAfterIncident (to be called after registerTrut...
int parentBarcode() override final
Return the barcode of the parent particle.
HepMC::GenParticlePtr childParticle(unsigned short index, int bc) override final
Return the i-th child as a HepMC particle type and assign the given Barcode to the simulator particle...
TruthBinding * childTruthBinding(HepMC::GenParticlePtr childP)
Create a TruthBinding for a child particle.
void setBarcode(int bc)
set a new barcode
double parentEkin() const override final
Return Ekin of the parent particle.
int parentStatus() override final
virtual ~ISFTruthIncident()
const TruthBinding * getTruthBinding() const
pointer to the simulation truth - optional, can be 0
const ISFParticleVector & m_children
HepMC::GenParticlePtr getHepMCTruthParticle(ISF::ISFParticle &particle) const
return attached truth particle
thread_local event_number_t eventIndex