ATLAS Offline Software
TruthCollectionMaker.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef DERIVATIONFRAMEWORK_TRUTHCOLLECTIONMAKER_H
6 #define DERIVATIONFRAMEWORK_TRUTHCOLLECTIONMAKER_H
7 
8 #include <string>
9 
11 #include "Gaudi/Property.h"
13 #include "GaudiKernel/ToolHandle.h"
14 #include "GaudiKernel/ServiceHandle.h"
16 // Handles and keys
20 #include "StoreGate/WriteHandle.h"
21 // Exprssion evaluator
23 
24 // Forward declarations
25 class StoreGateSvc;
26 
27 namespace DerivationFramework {
28 
29  class TruthCollectionMaker : public ExpressionParserUser<AthAlgTool>, public IAugmentationTool {
30  public:
31  TruthCollectionMaker(const std::string& t, const std::string& n, const IInterface* p);
35  virtual StatusCode addBranches() const;
36 
37  private:
38  mutable std::atomic<unsigned int> m_ntotpart, m_npasspart;
39  // R/W handles
41  {this, "ParticlesKey", "TruthParticles", "ReadHandleKey for input TruthParticleContainer"};
43  {this, "NewCollectionName", "OutputTruthCollection", "WriteHandleKey for new TruthParticleContainer"};
44  // Non-handle properties
45  Gaudi::Property<std::string> m_partString
46  {this, "ParticleSelectionString", "", "ExpressionEvaluation string for particle selection"};
47  Gaudi::Property<bool> m_do_compress
48  {this, "Do_Compress", false, "Removes particles with the same pdgId in a decay chain (but keeps first and last)"};
49  Gaudi::Property<bool> m_do_sherpa
50  {this, "Do_Sherpa", false, "Checks if there are truth W bosons in the current record. If not, tries to combine W daughters to create one"};
51  Gaudi::Property<bool> m_keep_navigation_info
52  {this, "KeepNavigationInfo", true, "m_do_sherpa currently only works for W+jets"};
53  // Decor handles
55  {this, "originalTruthParticle", m_outputParticlesKey, "originalTruthParticle", "Name of the decoration linking to the original truth particle"};
57  {this, "classifierParticleOrigin", m_outputParticlesKey, "classifierParticleOrigin", "Name of the decoration which records the particle origin as determined by the MCTruthClassifier"};
59  {this, "classifierParticleType", m_outputParticlesKey, "classifierParticleType", "Name of the decoration which records the particle type as determined by the MCTruthClassifier"};
61  {this, "classifierParticleOutCome", m_outputParticlesKey, "classifierParticleOutCome", "Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"};
63  {this, "Classification", m_outputParticlesKey, "Classification", "Name of the decoration which records the particle classification as determined by the MCTruthClassifier"};
65  {this, "motherID", m_outputParticlesKey, "motherID", "Name of the decoration which records the ID of the particle's mother"};
67  {this, "daughterID", m_outputParticlesKey, "daughterID", "Name of the decoration which records the ID of the particle's daughter"};
69  {this, "TopHadronOriginFlag", m_outputParticlesKey, "TopHadronOriginFlag", "Name of the decoration which records the origin of hadrons from top decays"};
70 
71  // Decorations to be read from elements of the "TruthParticles" container
72  // to be copied onto elements of the output container.
74  {this, "inputClassifierParticleOrigin", m_particlesKey, "classifierParticleOrigin", "Particle origin"};
76  {this, "inputClassifierParticleType", m_particlesKey, "classifierParticleType", "Particle type"};
78  {this, "inputClassifierParticleOutCome", m_particlesKey, "classifierParticleOutCome", "Particle outcome"};
80  {this, "inputClassification", m_particlesKey, "Classification", "Classification code"};
81 
83  };
84 }
85 
86 #endif // DERIVATIONFRAMEWORK_TRUTHCOLLECTIONMAKER_H
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:89
DerivationFramework::TruthCollectionMaker::m_daughterIDDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_daughterIDDecoratorKey
Definition: TruthCollectionMaker.h:67
DerivationFramework::TruthCollectionMaker
Definition: TruthCollectionMaker.h:29
IAugmentationTool.h
ExpressionParserUser.h
TruthParticleContainer.h
DerivationFramework::TruthCollectionMaker::m_do_sherpa
Gaudi::Property< bool > m_do_sherpa
Definition: TruthCollectionMaker.h:50
DerivationFramework::TruthCollectionMaker::m_outcomeDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_outcomeDecoratorKey
Definition: TruthCollectionMaker.h:61
DerivationFramework::TruthCollectionMaker::m_do_compress
Gaudi::Property< bool > m_do_compress
Definition: TruthCollectionMaker.h:48
DerivationFramework::TruthCollectionMaker::m_typeReadDecorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_typeReadDecorKey
Definition: TruthCollectionMaker.h:76
DerivationFramework::TruthCollectionMaker::m_particlesKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_particlesKey
Definition: TruthCollectionMaker.h:41
DerivationFramework::TruthCollectionMaker::addBranches
virtual StatusCode addBranches() const
Pass the thinning service
Definition: TruthCollectionMaker.cxx:96
DerivationFramework::TruthCollectionMaker::m_hadronOriginDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_hadronOriginDecoratorKey
Definition: TruthCollectionMaker.h:69
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
SG::ReadHandleKey< xAOD::TruthParticleContainer >
DerivationFramework::IAugmentationTool
Definition: IAugmentationTool.h:24
DerivationFramework::TruthCollectionMaker::m_npasspart
std::atomic< unsigned int > m_npasspart
Definition: TruthCollectionMaker.h:38
DerivationFramework::TruthCollectionMaker::TruthCollectionMaker
TruthCollectionMaker(const std::string &t, const std::string &n, const IInterface *p)
Definition: TruthCollectionMaker.cxx:29
WriteHandle.h
Handle class for recording to StoreGate.
StoreGateSvc
The Athena Transient Store API.
Definition: StoreGateSvc.h:125
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
WriteDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
DerivationFramework::TruthCollectionMaker::m_classificationDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_classificationDecoratorKey
Definition: TruthCollectionMaker.h:63
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
DerivationFramework::TruthCollectionMaker::m_typeDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_typeDecoratorKey
Definition: TruthCollectionMaker.h:59
DerivationFramework::TruthCollectionMaker::m_originReadDecorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_originReadDecorKey
Definition: TruthCollectionMaker.h:74
DerivationFramework::TruthCollectionMaker::m_ntotpart
std::atomic< unsigned int > m_ntotpart
Definition: TruthCollectionMaker.h:38
DerivationFramework::TruthCollectionMaker::finalize
StatusCode finalize()
Definition: TruthCollectionMaker.cxx:86
DerivationFramework::TruthCollectionMaker::m_linkDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_linkDecoratorKey
Definition: TruthCollectionMaker.h:55
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
ExpressionParserUser
Definition: ExpressionParserUser.h:107
DerivationFramework::TruthCollectionMaker::m_keep_navigation_info
Gaudi::Property< bool > m_keep_navigation_info
Definition: TruthCollectionMaker.h:52
DerivationFramework::TruthCollectionMaker::m_outputParticlesKey
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_outputParticlesKey
Definition: TruthCollectionMaker.h:43
DerivationFramework::TruthCollectionMaker::m_outcomeReadDecorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_outcomeReadDecorKey
Definition: TruthCollectionMaker.h:78
DerivationFramework::TruthCollectionMaker::m_originDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_originDecoratorKey
Definition: TruthCollectionMaker.h:57
DerivationFramework::TruthCollectionMaker::m_metaStore
ServiceHandle< StoreGateSvc > m_metaStore
Handle on the metadata store for init.
Definition: TruthCollectionMaker.h:82
DerivationFramework::TruthCollectionMaker::m_motherIDDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_motherIDDecoratorKey
Definition: TruthCollectionMaker.h:65
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer >
DerivationFramework::TruthCollectionMaker::~TruthCollectionMaker
~TruthCollectionMaker()
Definition: TruthCollectionMaker.cxx:42
DerivationFramework::TruthCollectionMaker::m_classificationReadDecorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_classificationReadDecorKey
Definition: TruthCollectionMaker.h:80
DerivationFramework::TruthCollectionMaker::initialize
StatusCode initialize()
Definition: TruthCollectionMaker.cxx:46
ServiceHandle< StoreGateSvc >
DerivationFramework::TruthCollectionMaker::m_partString
Gaudi::Property< std::string > m_partString
Definition: TruthCollectionMaker.h:46