 |
ATLAS Offline Software
|
#include <TruthDecayCollectionMaker.h>
|
int | addTruthParticle (const EventContext &ctx, const xAOD::TruthParticle &old_part, xAOD::TruthParticleContainer *part_cont, xAOD::TruthVertexContainer *vert_cont, std::vector< int > &seen_particles, const int generations=-1) const |
|
int | addTruthVertex (const EventContext &, const xAOD::TruthVertex &old_vert, xAOD::TruthParticleContainer *part_cont, xAOD::TruthVertexContainer *vert_cont, std::vector< int > &seen_particles, const int generations=-1) const |
|
bool | id_ok (const xAOD::TruthParticle &part) const |
|
|
Gaudi::Property< std::vector< int > > | m_pdgIdsToKeep {this, "PDGIDsToKeep", {}, "PDG IDs of particles to build the collection from"} |
| < List of PDG IDs to build this collection from More...
|
|
Gaudi::Property< bool > | m_keepBHadrons {this, "KeepBHadrons", false, "Keep b-hadrons (easier than by PDG ID)"} |
| < Option to keep all b-hadrons (better than giving PDG IDs) More...
|
|
Gaudi::Property< bool > | m_keepCHadrons {this, "KeepCHadrons", false, "Keep c-hadrons (easier than by PDG ID)"} |
| < Option to keep all c-hadrons (better than giving PDG IDs) More...
|
|
Gaudi::Property< bool > | m_keepBSM {this, "KeepBSM", false, "Keep BSM particles (easier than by PDG ID)"} |
| < Option to keep all BSM particles (better than giving PDG IDs) More...
|
|
Gaudi::Property< bool > | m_rejectHadronChildren {this, "RejectHadronChildren", false, "Drop hadron descendants"} |
| < Option to reject hadron descendants More...
|
|
SG::ReadHandleKey< xAOD::TruthParticleContainer > | m_particlesKey {this, "ParticlesKey", "TruthParticles", "ReadHandleKey for input TruthParticleContainer"} |
|
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > | m_originAccessorKey {this, "Input_classifierParticleOrigin", m_particlesKey, "classifierParticleOrigin","Name of the decoration which records the particle origin as determined by the MCTruthClassifier"} |
|
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > | m_typeAccessorKey {this, "Input_classifierParticleType", m_particlesKey, "classifierParticleType","Name of the decoration which records the particle type as determined by the MCTruthClassifier"} |
|
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > | m_outcomeAccessorKey {this, "Input_classifierParticleOutCome", m_particlesKey, "classifierParticleOutCome","Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"} |
|
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > | m_classificationAccessorKey {this, "Input_Classification", m_particlesKey, "Classification","Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"} |
|
SG::WriteHandleKey< xAOD::TruthVertexContainer > | m_outputVerticesKey {this, "NewVertexKey", "", "WriteHandleKey for new TruthVertexContainer"} |
|
SG::WriteHandleKey< xAOD::TruthParticleContainer > | m_outputParticlesKey {this, "NewParticleKey", "", "WriteHandleKey for new TruthParticleContainer"} |
|
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > | m_originDecoratorKey {this, "classifierParticleOrigin", m_outputParticlesKey, "classifierParticleOrigin","Name of the decoration which records the particle origin as determined by the MCTruthClassifier"} |
| FIXME Using WriteDecorHandles for decorations on a Container created in the current algorithm is unnecessary. More...
|
|
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > | m_typeDecoratorKey {this, "classifierParticleType", m_outputParticlesKey, "classifierParticleType","Name of the decoration which records the particle type as determined by the MCTruthClassifier"} |
|
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > | m_outcomeDecoratorKey {this, "classifierParticleOutCome", m_outputParticlesKey, "classifierParticleOutCome","Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"} |
|
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > | m_classificationDecoratorKey {this, "Classification", m_outputParticlesKey, "Classification","Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"} |
|
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > | m_motherIDDecoratorKey {this, "motherID", m_outputParticlesKey, "motherID","Name of the decoration which records the ID of the particle's mother"} |
|
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > | m_daughterIDDecoratorKey {this, "daughterID", m_outputParticlesKey, "daughterID","Name of the decoration which records the ID of the particle's daughter"} |
|
Gaudi::Property< int > | m_generations {this, "Generations", -1, "Number of generations after the particle in question to keep (-1 for all)"} |
| ^^^^ These should be replaced by SG::Accessor. More...
|
|
Definition at line 26 of file TruthDecayCollectionMaker.h.
◆ TruthDecayCollectionMaker()
DerivationFramework::TruthDecayCollectionMaker::TruthDecayCollectionMaker |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~TruthDecayCollectionMaker()
DerivationFramework::TruthDecayCollectionMaker::~TruthDecayCollectionMaker |
( |
| ) |
|
◆ addBranches()
StatusCode DerivationFramework::TruthDecayCollectionMaker::addBranches |
( |
| ) |
const |
|
virtual |
Definition at line 80 of file TruthDecayCollectionMaker.cxx.
83 const EventContext& ctx = Gaudi::Hive::currentContext();
87 if (!truthParticles.isValid()) {
89 return StatusCode::FAILURE;
94 ATH_CHECK(newParticlesWriteHandle.record(std::make_unique<xAOD::TruthParticleContainer>(),
95 std::make_unique<xAOD::TruthParticleAuxContainer>()));
99 ATH_CHECK(newVerticesWriteHandle.record(std::make_unique<xAOD::TruthVertexContainer>(),
100 std::make_unique<xAOD::TruthVertexAuxContainer>()));
106 std::vector<int> seen_particles;
108 for (
const auto *
part : *truthParticles){
114 return StatusCode::SUCCESS;
◆ addTruthParticle()
Definition at line 117 of file TruthDecayCollectionMaker.cxx.
125 for (
size_t p=0;
p<part_cont->
size();++
p){
147 xTruthParticle->
setM(old_part.
m());
148 xTruthParticle->
setPx(old_part.
px());
149 xTruthParticle->
setPy(old_part.
py());
150 xTruthParticle->
setPz(old_part.
pz());
151 xTruthParticle->
setE(old_part.
e());
158 int my_index = part_cont->
size()-1;
165 (*vert_cont)[vert_index]->addIncomingParticleLink( eltp );
173 typeDecorator(*xTruthParticle) = classifierParticleTypeAcc.withDefault (old_part, 0);
174 originDecorator(*xTruthParticle) = classifierParticleOriginAcc.withDefault (old_part, 0);
175 outcomeDecorator(*xTruthParticle) = classifierParticleOutcomeAcc.withDefault (old_part, 0);
176 classificationDecorator(*xTruthParticle) = ClassificationAcc.withDefault (old_part, 0);
◆ addTruthVertex()
Definition at line 182 of file TruthDecayCollectionMaker.cxx.
192 int my_index = vert_cont->
size()-1;
197 xTruthVertex->
setX(old_vert.
x());
198 xTruthVertex->
setY(old_vert.
y());
199 xTruthVertex->
setZ(old_vert.
z());
200 xTruthVertex->
setT(old_vert.
t());
214 (*part_cont)[part_index]->setProdVtxLink( eltv );
◆ id_ok()
◆ initialize()
StatusCode DerivationFramework::TruthDecayCollectionMaker::initialize |
( |
| ) |
|
Definition at line 42 of file TruthDecayCollectionMaker.cxx.
63 ATH_MSG_FATAL(
"No PDG IDs provided, not keeping b- or c-hadrons or BSM particles -- what do you want?");
64 return StatusCode::FAILURE;
75 return StatusCode::SUCCESS;
◆ m_classificationAccessorKey
◆ m_classificationDecoratorKey
◆ m_daughterIDDecoratorKey
◆ m_generations
Gaudi::Property<int> DerivationFramework::TruthDecayCollectionMaker::m_generations {this, "Generations", -1, "Number of generations after the particle in question to keep (-1 for all)"} |
|
private |
◆ m_keepBHadrons
Gaudi::Property<bool> DerivationFramework::TruthDecayCollectionMaker::m_keepBHadrons {this, "KeepBHadrons", false, "Keep b-hadrons (easier than by PDG ID)"} |
|
private |
◆ m_keepBSM
Gaudi::Property<bool> DerivationFramework::TruthDecayCollectionMaker::m_keepBSM {this, "KeepBSM", false, "Keep BSM particles (easier than by PDG ID)"} |
|
private |
◆ m_keepCHadrons
Gaudi::Property<bool> DerivationFramework::TruthDecayCollectionMaker::m_keepCHadrons {this, "KeepCHadrons", false, "Keep c-hadrons (easier than by PDG ID)"} |
|
private |
◆ m_motherIDDecoratorKey
◆ m_originAccessorKey
◆ m_originDecoratorKey
FIXME Using WriteDecorHandles for decorations on a Container created in the current algorithm is unnecessary.
Definition at line 63 of file TruthDecayCollectionMaker.h.
◆ m_outcomeAccessorKey
◆ m_outcomeDecoratorKey
◆ m_outputParticlesKey
◆ m_outputVerticesKey
◆ m_particlesKey
◆ m_pdgIdsToKeep
Gaudi::Property<std::vector<int> > DerivationFramework::TruthDecayCollectionMaker::m_pdgIdsToKeep {this, "PDGIDsToKeep", {}, "PDG IDs of particles to build the collection from"} |
|
private |
◆ m_rejectHadronChildren
Gaudi::Property<bool> DerivationFramework::TruthDecayCollectionMaker::m_rejectHadronChildren {this, "RejectHadronChildren", false, "Drop hadron descendants"} |
|
private |
◆ m_typeAccessorKey
◆ m_typeDecoratorKey
The documentation for this class was generated from the following files:
size_t nOutgoingParticles() const
Get the number of outgoing particles.
void setStatus(int value)
Set status code.
Gaudi::Property< bool > m_rejectHadronChildren
< Option to reject hadron descendants
std::string find(const std::string &s)
return a remapped string
float pz() const
The z component of the particle's momentum.
void setE(float value)
Set the energy of the particle.
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_outputParticlesKey
bool setPolarizationParameter(float value, PolParam parameter)
Set method for polarization parameter values.
bool valid() const
Check if the stored values are valid.
Gaudi::Property< bool > m_keepBSM
< Option to keep all BSM particles (better than giving PDG IDs)
Polarization polarization() const
Retrieve a full Polarization with a single call.
float px() const
The x component of the particle's momentum.
void setT(float value)
Set the vertex time.
void setPx(float value)
Set the x component of the particle's momentum.
Gaudi::Property< bool > m_keepBHadrons
< Option to keep all b-hadrons (better than giving PDG IDs)
float py() const
The y component of the particle's momentum.
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_outcomeAccessorKey
void addOutgoingParticleLink(const TPLink_t &link)
Add one outgoing particle.
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
void setY(float value)
Set the y displacement of the vertex.
bool is_same_particle(const T1 &p1, const T2 &p2)
Method to establish if two particles in the GenEvent actually represent the same particle.
float y() const
Vertex y displacement.
int generations(const T &p)
Method to return how many interactions a particle has undergone during simulation (only to be used in...
float t() const
Vertex time.
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_originAccessorKey
bool hasDecayVtx() const
Check for a decay vertex on this particle.
Gaudi::Property< bool > m_keepCHadrons
< Option to keep all c-hadrons (better than giving PDG IDs)
void setM(float value)
Also store the mass.
int addTruthVertex(const EventContext &, const xAOD::TruthVertex &old_vert, xAOD::TruthParticleContainer *part_cont, xAOD::TruthVertexContainer *vert_cont, std::vector< int > &seen_particles, const int generations=-1) const
virtual double e() const override final
The total energy of the particle.
Handle class for reading a decoration on an object.
int addTruthParticle(const EventContext &ctx, const xAOD::TruthParticle &old_part, xAOD::TruthParticleContainer *part_cont, xAOD::TruthVertexContainer *vert_cont, std::vector< int > &seen_particles, const int generations=-1) const
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_typeDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_motherIDDecoratorKey
Class describing a truth particle in the MC record.
Handle class for adding a decoration to an object.
TruthParticle_v1 TruthParticle
Typedef to implementation.
void setPy(float value)
Set the y component of the particle's momentum.
SG::WriteHandleKey< xAOD::TruthVertexContainer > m_outputVerticesKey
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
TruthVertex_v1 TruthVertex
Typedef to implementation.
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_classificationDecoratorKey
ElementLink implementation for ROOT usage.
const TruthVertex_v1 * decayVtx() const
The decay vertex of this particle.
Class describing a truth vertex in the MC record.
void setPdgId(int pid)
Set PDG ID code.
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_classificationAccessorKey
void setUid(int value)
Set unique ID.
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_particlesKey
value_type push_back(value_type pElem)
Add an element to the end of the collection.
bool id_ok(const xAOD::TruthParticle &part) const
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_typeAccessorKey
bool polarizationParameter(float &value, PolParam parameter) const
Accessor for polarization parameters.
float x() const
Vertex x displacement.
void setZ(float value)
Set the vertex's longitudinal distance from the origin.
int status() const
Status code.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
void setUid(int value)
Set the vertex unique ID.
@ polarizationTheta
Polarization in ( )
Gaudi::Property< int > m_generations
^^^^ These should be replaced by SG::Accessor.
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_outcomeDecoratorKey
@ polarizationPhi
Polarization in ( )
float z() const
Vertex longitudinal distance along the beam line form the origin.
void setPz(float value)
Set the z component of the particle's momentum.
void setDecayVtxLink(const ElementLink< TruthVertexContainer > &link)
Set the decay vertex of the particle.
Gaudi::Property< std::vector< int > > m_pdgIdsToKeep
< List of PDG IDs to build this collection from
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_originDecoratorKey
FIXME Using WriteDecorHandles for decorations on a Container created in the current algorithm is unne...
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_daughterIDDecoratorKey
int pdgId() const
PDG ID code.
size_type size() const noexcept
Returns the number of elements in the collection.
const TruthParticle_v1 * outgoingParticle(size_t index) const
Get one of the outgoing particles.
virtual double m() const override final
The mass of the particle.
void setStatus(int value)
Set the vertex status.
bool isHadron() const
Whether the particle is a hadron.
void setX(float value)
Set the x displacement of the vertex.