 |
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::WriteHandleKey< xAOD::TruthParticleContainer > | m_outputParticlesKey {this, "NewParticleKey", "", "WriteHandleKey for new TruthParticleContainer"} |
|
SG::WriteHandleKey< xAOD::TruthVertexContainer > | m_outputVerticesKey {this, "NewVertexKey", "", "WriteHandleKey for new TruthVertexContainer"} |
|
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > | m_originDecoratorKey {this, "classifierParticleOrigin", "TruthParticles.classifierParticleOrigin","Name of the decoration which records the particle origin as determined by the MCTruthClassifier"} |
|
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > | m_typeDecoratorKey {this, "classifierParticleType", "TruthParticles.classifierParticleType","Name of the decoration which records the particle type as determined by the MCTruthClassifier"} |
|
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > | m_outcomeDecoratorKey {this, "classifierParticleOutCome", "TruthParticles.classifierParticleOutCome","Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"} |
|
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > | m_classificationDecoratorKey {this, "Classification", "TruthParticles.Classification","Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"} |
|
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > | m_motherIDDecoratorKey {this, "motherID", "TruthParticles.motherID","Name of the decoration which records the ID of the particle's mother"} |
|
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > | m_daughterIDDecoratorKey {this, "daughterID", "TruthParticles.daughterID","Name of the decoration which records the ID of the particle's daughter"} |
|
Gaudi::Property< std::string > | m_collectionName {this, "NewCollectionName", "", "New collection name stem"} |
| < Output collection name stem More...
|
|
Gaudi::Property< int > | m_generations {this, "Generations", -1, "Number of generations after the particle in question to keep (-1 for all)"} |
| < Number of generations after the particle in question to keep 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 85 of file TruthDecayCollectionMaker.cxx.
88 const EventContext& ctx = Gaudi::Hive::currentContext();
92 if (!truthParticles.isValid()) {
94 return StatusCode::FAILURE;
99 ATH_CHECK(newParticlesWriteHandle.record(std::make_unique<xAOD::TruthParticleContainer>(),
100 std::make_unique<xAOD::TruthParticleAuxContainer>()));
104 ATH_CHECK(newVerticesWriteHandle.record(std::make_unique<xAOD::TruthVertexContainer>(),
105 std::make_unique<xAOD::TruthVertexAuxContainer>()));
111 std::vector<int> seen_particles;
113 for (
const auto *
part : *truthParticles){
119 return StatusCode::SUCCESS;
◆ addTruthParticle()
Definition at line 122 of file TruthDecayCollectionMaker.cxx.
130 for (
size_t p=0;
p<part_cont->
size();++
p){
152 xTruthParticle->
setM(old_part.
m());
153 xTruthParticle->
setPx(old_part.
px());
154 xTruthParticle->
setPy(old_part.
py());
155 xTruthParticle->
setPz(old_part.
pz());
156 xTruthParticle->
setE(old_part.
e());
163 int my_index = part_cont->
size()-1;
170 (*vert_cont)[vert_index]->addIncomingParticleLink( eltp );
178 typeDecorator(*xTruthParticle) = classifierParticleTypeAcc.withDefault (old_part, 0);
179 originDecorator(*xTruthParticle) = classifierParticleOriginAcc.withDefault (old_part, 0);
180 outcomeDecorator(*xTruthParticle) = classifierParticleOutComeAcc.withDefault (old_part, 0);
181 classificationDecorator(*xTruthParticle) = ClassificationAcc.withDefault (old_part, 0);
◆ addTruthVertex()
Definition at line 187 of file TruthDecayCollectionMaker.cxx.
197 int my_index = vert_cont->
size()-1;
202 xTruthVertex->
setX(old_vert.
x());
203 xTruthVertex->
setY(old_vert.
y());
204 xTruthVertex->
setZ(old_vert.
z());
205 xTruthVertex->
setT(old_vert.
t());
219 (*part_cont)[part_index]->setProdVtxLink( eltv );
◆ id_ok()
◆ initialize()
StatusCode DerivationFramework::TruthDecayCollectionMaker::initialize |
( |
| ) |
|
Definition at line 41 of file TruthDecayCollectionMaker.cxx.
51 ATH_MSG_FATAL(
"No base name provided for the new truth particle/vertex containers");
52 return StatusCode::FAILURE;
62 ATH_MSG_FATAL(
"No PDG IDs provided, not keeping b- or c-hadrons or BSM particles -- what do you want?");
63 return StatusCode::FAILURE;
80 return StatusCode::SUCCESS;
◆ m_classificationDecoratorKey
◆ m_collectionName
Gaudi::Property<std::string> DerivationFramework::TruthDecayCollectionMaker::m_collectionName {this, "NewCollectionName", "", "New collection name stem"} |
|
private |
◆ 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_originDecoratorKey
◆ 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_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
void setBarcode(int value)
Set barcode.
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.
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.
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.
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
Gaudi::Property< std::string > m_collectionName
< Output collection name stem
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::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
void setId(int value)
Obsolete function Set vertex ID code HepMC2 id == HepMC3 status, i.e.
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 setBarcode(int value)
Set barcode.
@ polarizationTheta
Polarization in ( )
Gaudi::Property< int > m_generations
< Number of generations after the particle in question to keep
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
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.
bool isHadron() const
Whether the particle is a hadron.
void setX(float value)
Set the x displacement of the vertex.