ATLAS Offline Software
TruthClassDecoratorAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef INDETPHYSVALMONITORING_TruthClassDecoratorAlg_H
6 #define INDETPHYSVALMONITORING_TruthClassDecoratorAlg_H
7 
13 // STL includes
14 #include <string>
17 #include "GaudiKernel/ToolHandle.h"
18 #include "GaudiKernel/EventContext.h"
24 
25 // class to decorate xAOD::TruthParticles with type and origin, required by validation
27 public:
28  TruthClassDecoratorAlg(const std::string& name, ISvcLocator* pSvcLocator);
29  virtual ~TruthClassDecoratorAlg () {/*nop*/
30  };
31  virtual StatusCode initialize() override;
32  virtual StatusCode finalize() override;
33 
34  virtual StatusCode execute(const EventContext &ctx) const override;
35 
36 private:
38  std::vector< SG::WriteDecorHandle<xAOD::TruthParticleContainer,int> > &int_decor) const;
39 
40  PublicToolHandle<IMCTruthClassifier> m_truthClassifier
41  {this,"MCTruthClassifier","MCTruthClassifier/MCTruthClassifier",""};
42  PublicToolHandle<IAthSelectionTool> m_truthSelectionTool
43  {this,"TruthSelectionTool","",""};
44 
47  {this, "TruthParticleContainerName", "TruthParticles", ""};
48 
49  Gaudi::Property<std::string> m_prefix
50  {this, "Prefix", "", "Decoration prefix to avoid clashes."};
51 
52  enum EDecorators {
56  };
57  std::vector<SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> > m_decor;
58 };
59 
60 
61 #endif
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
TruthClassDecoratorAlg::EDecorators
EDecorators
Definition: TruthClassDecoratorAlg.h:52
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
TruthClassDecoratorAlg::m_truthParticleName
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_truthParticleName
TruthParticle container's name needed to create decorators.
Definition: TruthClassDecoratorAlg.h:47
TruthClassDecoratorAlg::TruthClassDecoratorAlg
TruthClassDecoratorAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TruthClassDecoratorAlg.cxx:15
TruthClassDecoratorAlg::kDecorTruthType
@ kDecorTruthType
Definition: TruthClassDecoratorAlg.h:53
TruthParticleContainer.h
TruthClassDecoratorAlg::decorateTruth
bool decorateTruth(const xAOD::TruthParticle &particle, std::vector< SG::WriteDecorHandle< xAOD::TruthParticleContainer, int > > &int_decor) const
Definition: TruthClassDecoratorAlg.cxx:66
IAthSelectionTool.h
TruthClassDecoratorAlg::kDecorTruthOrigin
@ kDecorTruthOrigin
Definition: TruthClassDecoratorAlg.h:54
SG::ReadHandleKey< xAOD::TruthParticleContainer >
TruthClassDecoratorAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: TruthClassDecoratorAlg.cxx:42
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
TruthClassDecoratorAlg::initialize
virtual StatusCode initialize() override
Definition: TruthClassDecoratorAlg.cxx:21
IMCTruthClassifier.h
WriteDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
TruthClassDecoratorAlg::kNDecorators
@ kNDecorators
Definition: TruthClassDecoratorAlg.h:55
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:99
WriteDecorHandle.h
Handle class for adding a decoration to an object.
TruthClassDecoratorAlg::~TruthClassDecoratorAlg
virtual ~TruthClassDecoratorAlg()
Definition: TruthClassDecoratorAlg.h:29
TruthClassDecoratorAlg
Definition: TruthClassDecoratorAlg.h:26
AthReentrantAlgorithm.h
TruthClassDecoratorAlg::m_truthClassifier
PublicToolHandle< IMCTruthClassifier > m_truthClassifier
Definition: TruthClassDecoratorAlg.h:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TruthClassDecoratorAlg::m_decor
std::vector< SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > > m_decor
Definition: TruthClassDecoratorAlg.h:57
TruthClassDecoratorAlg::finalize
virtual StatusCode finalize() override
Definition: TruthClassDecoratorAlg.cxx:35
TruthClassDecoratorAlg::m_truthSelectionTool
PublicToolHandle< IAthSelectionTool > m_truthSelectionTool
Definition: TruthClassDecoratorAlg.h:43
TruthClassDecoratorAlg::m_prefix
Gaudi::Property< std::string > m_prefix
Definition: TruthClassDecoratorAlg.h:50