Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
#include <TruthBornLeptonCollectionMaker.h>
|
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...
|
|
◆ 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 |
Definition at line 73 of file TruthBornLeptonCollectionMaker.cxx.
76 const EventContext& ctx = Gaudi::Hive::currentContext();
79 static const bool is_sherpa = [
this]() {
80 bool is_sherpa =
false;
90 if (
m_metaStore->retrieve(truthMetaData).isSuccess() && !truthMetaData->empty()){
92 const std::string gens = truthMetaData->at(0)->generators();
93 is_sherpa = (gens.find(
"sherpa")==std::string::npos &&
94 gens.find(
"Sherpa")==std::string::npos &&
95 gens.find(
"SHERPA")==std::string::npos) ?
false :
true;
98 ATH_MSG_WARNING(
"Found xAODTruthMetaDataContainer empty! Configuring to be NOT Sherpa.");
100 ATH_MSG_INFO(
"From metadata configured: Sherpa? " << is_sherpa);
103 ATH_MSG_WARNING(
"Could not find metadata container in storegate; assuming NOT Sherpa");
110 if (!truthParticles.isValid()) {
112 return StatusCode::FAILURE;
117 ATH_CHECK(newParticlesWriteHandle.record(std::make_unique<xAOD::TruthParticleContainer>(),
118 std::make_unique<xAOD::TruthParticleAuxContainer>()));
133 for (
unsigned int i=0;
i<truthParticles->size(); ++
i) {
136 if (!theParticle)
continue;
137 if (!theParticle->
isLepton())
continue;
146 bool has_parent_of_same_flavour =
false;
148 for (
size_t p = 0;
p < theParticle->
prodVtx()->nIncomingParticles(); ++
p){
149 if (theParticle->
parent(
p)->
pdg_id() == theParticle->
pdg_id()) has_parent_of_same_flavour =
true;
151 if (has_parent_of_same_flavour)
continue;
154 bool physical =
false, has_V =
false;
184 size_t bad_parent = 0;
186 if (!theParticle->
parent(
p)) { bad_parent++;
continue;}
189 if (bad_parent != 0)
continue;
196 newParticlesWriteHandle->push_back( xTruthParticle );
198 *xTruthParticle=*theParticle;
200 typeDecorator(*xTruthParticle) = classifierParticleTypeAcc.withDefault(*theParticle, 0);
201 originDecorator(*xTruthParticle) = classifierParticleOriginAcc.withDefault(*theParticle, 0);
202 outcomeDecorator(*xTruthParticle) = classifierParticleOutComeAcc.withDefault(*theParticle, 0);
203 classificationDecorator(*xTruthParticle) = ClassificationAcc.withDefault(*theParticle, 0);
206 return StatusCode::SUCCESS;
◆ hasBareDescendent()
Helper function for finding bare descendents of born leptons.
Definition at line 210 of file TruthBornLeptonCollectionMaker.cxx.
213 if (!
p)
return false;
217 for (
size_t c=0;
c<
p->nChildren();++
c){
218 if (!
p->child(
c))
continue;
219 if (
p->pdgId()!=
p->child(
c)->pdgId())
continue;
◆ initialize()
StatusCode DerivationFramework::TruthBornLeptonCollectionMaker::initialize |
( |
| ) |
|
◆ m_classificationDecoratorKey
◆ m_collectionName
◆ 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
The documentation for this class was generated from the following files:
size_t nOutgoingParticles() const
Get the number of outgoing particles.
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_originDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_outcomeDecoratorKey
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.
bool empty() const
Test if the key is blank.
int pdg_id() const
PDG ID code.
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.
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
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.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
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.
bool hasBareDescendent(const xAOD::TruthParticle *p) const
Helper function for finding bare descendents of born leptons.
const TruthParticle_v1 * parent(size_t i) const
Retrieve the i-th mother (TruthParticle) of this TruthParticle.
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_classificationDecoratorKey
bool isConditionB(const T &p)
ServiceHandle< StoreGateSvc > m_metaStore
Handle on the metadata store for init.
const TruthParticle_v1 * outgoingParticle(size_t index) const
Get one of the outgoing particles.
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_particlesKey
< Input particle collection key