|
ATLAS Offline Software
|
#include <TruthBornLeptonCollectionMaker.h>
|
| TruthBornLeptonCollectionMaker (const std::string &t, const std::string &n, const IInterface *p) |
|
| ~TruthBornLeptonCollectionMaker () |
|
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 |
|
|
SG::ReadHandleKey< xAOD::TruthParticleContainer > | m_particlesKey {this, "ParticlesKey", "TruthParticles", "Name of TruthParticle key for input"} |
| < Input particle collection key More...
|
|
SG::WriteHandleKey< xAOD::TruthParticleContainer > | m_collectionName {this, "NewCollectionName", "", "Name of TruthParticle key for output"} |
|
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > | m_originDecoratorKey {this, "classifierParticleOrigin", "TruthParticles.classifierParticleOrigin", "Particle origin decoration, set at initialisation"} |
|
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > | m_typeDecoratorKey {this, "classifierParticleType","TruthParticles.classifierParticleType", "Particle type decoration, set at initialisation"} |
|
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > | m_outcomeDecoratorKey {this, "classifierParticleOutCome", "TruthParticles.classifierParticleOutCome", "Particle outcome decoration, set at initialisation"} |
|
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > | m_classificationDecoratorKey {this, "Classification", "TruthParticles.Classification", "Classification code decorator, set at initialisation"} |
|
ServiceHandle< StoreGateSvc > | m_metaStore |
| Handle on the metadata store for init. 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 |
|
◆ StoreGateSvc_t
◆ TruthBornLeptonCollectionMaker()
DerivationFramework::TruthBornLeptonCollectionMaker::TruthBornLeptonCollectionMaker |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ ~TruthBornLeptonCollectionMaker()
DerivationFramework::TruthBornLeptonCollectionMaker::~TruthBornLeptonCollectionMaker |
( |
| ) |
|
◆ addBranches()
StatusCode DerivationFramework::TruthBornLeptonCollectionMaker::addBranches |
( |
| ) |
const |
|
virtual |
Pass the thinning service
Implements DerivationFramework::IAugmentationTool.
Definition at line 74 of file TruthBornLeptonCollectionMaker.cxx.
77 const EventContext& ctx = Gaudi::Hive::currentContext();
80 static const bool is_sherpa = [
this]() {
81 bool is_sherpa =
false;
91 if (
m_metaStore->retrieve(truthMetaData).isSuccess() && !truthMetaData->empty()){
93 const std::string gens = truthMetaData->at(0)->generators();
94 is_sherpa = (gens.find(
"sherpa")==std::string::npos &&
95 gens.find(
"Sherpa")==std::string::npos &&
96 gens.find(
"SHERPA")==std::string::npos) ?
false :
true;
99 ATH_MSG_WARNING(
"Found xAODTruthMetaDataContainer empty! Configuring to be NOT Sherpa.");
101 ATH_MSG_INFO(
"From metadata configured: Sherpa? " << is_sherpa);
104 ATH_MSG_WARNING(
"Could not find metadata container in storegate; assuming NOT Sherpa");
111 if (!truthParticles.isValid()) {
113 return StatusCode::FAILURE;
118 ATH_CHECK(newParticlesWriteHandle.record(std::make_unique<xAOD::TruthParticleContainer>(),
119 std::make_unique<xAOD::TruthParticleAuxContainer>()));
135 for (
unsigned int i=0;
i<truthParticles->size(); ++
i) {
138 if (!theParticle)
continue;
139 if (!theParticle->
isLepton())
continue;
154 sherpLepParentUniqueID = cparentUniqueID;
159 if (sherpLepParentUniqueID > 0 && sherpLepParentUniqueID == puniqueID)
continue;
160 }
else if (is_sherpa == 0) {
162 bool physical=
false,has_V=
false;
187 if (!theParticle->
parent())
continue;
195 newParticlesWriteHandle->push_back( xTruthParticle );
197 *xTruthParticle=*theParticle;
199 typeDecorator(*xTruthParticle) = classifierParticleTypeAcc.withDefault(*theParticle, 0);
200 originDecorator(*xTruthParticle) = classifierParticleOriginAcc.withDefault(*theParticle, 0);
201 outcomeDecorator(*xTruthParticle) = classifierParticleOutComeAcc.withDefault(*theParticle, 0);
202 classificationDecorator(*xTruthParticle) = ClassificationAcc.withDefault(*theParticle, 0);
205 return StatusCode::SUCCESS;
◆ 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
◆ hasBareDescendent()
Helper function for finding bare descendents of born leptons.
Definition at line 209 of file TruthBornLeptonCollectionMaker.cxx.
212 if (!
p)
return false;
216 for (
size_t c=0;
c<
p->nChildren();++
c){
217 if (!
p->child(
c))
continue;
218 if (
p->pdgId()!=
p->child(
c)->pdgId())
continue;
◆ initialize()
StatusCode DerivationFramework::TruthBornLeptonCollectionMaker::initialize |
( |
| ) |
|
◆ 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
◆ m_detStore
◆ m_evtStore
◆ m_metaStore
◆ m_originDecoratorKey
SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthBornLeptonCollectionMaker::m_originDecoratorKey {this, "classifierParticleOrigin", "TruthParticles.classifierParticleOrigin", "Particle origin decoration, set at initialisation"} |
|
private |
◆ m_outcomeDecoratorKey
SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthBornLeptonCollectionMaker::m_outcomeDecoratorKey {this, "classifierParticleOutCome", "TruthParticles.classifierParticleOutCome", "Particle outcome decoration, set at initialisation"} |
|
private |
◆ m_particlesKey
◆ 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.
const TruthParticle_v1 * parent(size_t i=0) const
Retrieve the i-th mother (TruthParticle) of this TruthParticle.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_originDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_outcomeDecoratorKey
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool isW() const
Check if this particle is a W boson.
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
virtual void setOwner(IDataHandleHolder *o)=0
bool isZ() const
Check if this particle is a Z boson.
bool isPhysical(const T &p)
Identify if the particle is physical, i.e. is stable or decayed.
bool isLepton() const
Whether the particle is a lepton.
Class describing a truth particle in the MC record.
Handle class for adding a decoration to an object.
TruthParticle_v1 TruthParticle
Typedef to implementation.
bool hasProdVtx() const
Check for a production vertex on this particle.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
const TruthParticle_v1 * incomingParticle(size_t index) const
Get one of the incoming particles.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_collectionName
virtual void renounce()=0
constexpr int UNDEFINED_ID
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
Class describing a truth vertex in the MC record.
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_typeDecoratorKey
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
bool isHiggs() const
Check if this particle is a Higgs boson.
#define ATH_MSG_WARNING(x)
size_t nIncomingParticles() const
Get the number of incoming particles.
const TruthParticle_v1 * child(size_t i=0) const
Retrieve the i-th mother (TruthParticle) of this TruthParticle.
bool hasBareDescendent(const xAOD::TruthParticle *p) const
Helper function for finding bare descendents of born leptons.
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_classificationDecoratorKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
bool isConditionB(const T &p)
ServiceHandle< StoreGateSvc > m_metaStore
Handle on the metadata store for init.
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.
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_particlesKey
< Input particle collection key