|
ATLAS Offline Software
|
#include <TruthDecayCollectionMaker.h>
|
| TruthDecayCollectionMaker (const std::string &t, const std::string &n, const IInterface *p) |
|
| ~TruthDecayCollectionMaker () |
|
StatusCode | initialize () |
|
virtual StatusCode | addBranches () const |
| Pass the thinning service
More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
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::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
|
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...
|
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
Definition at line 26 of file TruthDecayCollectionMaker.h.
◆ StoreGateSvc_t
◆ 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 |
Pass the thinning service
Implements DerivationFramework::IAugmentationTool.
Definition at line 86 of file TruthDecayCollectionMaker.cxx.
89 const EventContext& ctx = Gaudi::Hive::currentContext();
93 if (!truthParticles.isValid()) {
95 return StatusCode::FAILURE;
100 ATH_CHECK(newParticlesWriteHandle.record(std::make_unique<xAOD::TruthParticleContainer>(),
101 std::make_unique<xAOD::TruthParticleAuxContainer>()));
105 ATH_CHECK(newVerticesWriteHandle.record(std::make_unique<xAOD::TruthVertexContainer>(),
106 std::make_unique<xAOD::TruthVertexAuxContainer>()));
112 std::vector<int> seen_particles;
114 for (
const auto *
part : *truthParticles){
120 return StatusCode::SUCCESS;
◆ addTruthParticle()
Definition at line 123 of file TruthDecayCollectionMaker.cxx.
131 for (
size_t p=0;
p<part_cont->
size();++
p){
153 xTruthParticle->
setM(old_part.
m());
154 xTruthParticle->
setPx(old_part.
px());
155 xTruthParticle->
setPy(old_part.
py());
156 xTruthParticle->
setPz(old_part.
pz());
157 xTruthParticle->
setE(old_part.
e());
164 int my_index = part_cont->
size()-1;
171 (*vert_cont)[vert_index]->addIncomingParticleLink( eltp );
179 typeDecorator(*xTruthParticle) = classifierParticleTypeAcc.withDefault (old_part, 0);
180 originDecorator(*xTruthParticle) = classifierParticleOriginAcc.withDefault (old_part, 0);
181 outcomeDecorator(*xTruthParticle) = classifierParticleOutComeAcc.withDefault (old_part, 0);
182 classificationDecorator(*xTruthParticle) = ClassificationAcc.withDefault (old_part, 0);
◆ addTruthVertex()
Definition at line 188 of file TruthDecayCollectionMaker.cxx.
198 int my_index = vert_cont->
size()-1;
203 xTruthVertex->
setX(old_vert.
x());
204 xTruthVertex->
setY(old_vert.
y());
205 xTruthVertex->
setZ(old_vert.
z());
206 xTruthVertex->
setT(old_vert.
t());
220 (*part_cont)[part_index]->setProdVtxLink( eltv );
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ id_ok()
◆ initialize()
StatusCode DerivationFramework::TruthDecayCollectionMaker::initialize |
( |
| ) |
|
Definition at line 42 of file TruthDecayCollectionMaker.cxx.
52 ATH_MSG_FATAL(
"No base name provided for the new truth particle/vertex containers");
53 return StatusCode::FAILURE;
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;
81 return StatusCode::SUCCESS;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ interfaceID()
static const InterfaceID& DerivationFramework::IAugmentationTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
AlgTool interface methods.
Definition at line 31 of file IAugmentationTool.h.
31 {
return IID_IAugmentationTool; }
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_classificationDecoratorKey
◆ m_collectionName
Gaudi::Property<std::string> DerivationFramework::TruthDecayCollectionMaker::m_collectionName {this, "NewCollectionName", "", "New collection name stem"} |
|
private |
◆ m_daughterIDDecoratorKey
◆ m_detStore
◆ m_evtStore
◆ 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
◆ m_varHandleArraysDeclared
◆ m_vhka
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.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
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.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
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.
virtual void setOwner(IDataHandleHolder *o)=0
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
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
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
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
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.
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.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
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.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
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.