ATLAS Offline Software
TauTruthDecorationsAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 
8 #ifndef TAU_ANALYSIS_ALGORITHMS__TAU_TRUTH_DECORATIONS_ALG_H
9 #define TAU_ANALYSIS_ALGORITHMS__TAU_TRUTH_DECORATIONS_ALG_H
10 
16 
17 
18 namespace CP
19 {
21 
23  {
25  public:
27  StatusCode initialize () override;
28  StatusCode execute (const EventContext &ctx) const override;
29 
31  private:
32  SG::ReadHandleKey<xAOD::TauJetContainer> m_tausKey { this, "taus", "", "the input tau jet container" };
33 
35  private:
36  Gaudi::Property<std::vector<std::string>> m_doubleDecorations {this, "doubleDecorations", {}, "the list decorations with type double to copy"};
37  Gaudi::Property<std::vector<std::string>> m_floatDecorations {this, "floatDecorations", {}, "the list decorations with type float to copy"};
38  Gaudi::Property<std::vector<std::string>> m_intDecorations {this, "intDecorations", {}, "the list decorations with type int to copy"};
39  Gaudi::Property<std::vector<std::string>> m_unsignedIntDecorations {this, "unsignedIntDecorations", {}, "the list decorations with type unsigned int to copy"};
40  Gaudi::Property<std::vector<std::string>> m_charDecorations {this, "charDecorations", {}, "the list decorations with type char to copy"};
41  Gaudi::Property<std::string> m_prefix {this, "prefix", "truth_", "the prefix to be added to all output decorations"};
42 
43  // the mapping of double to float is intentional to save disk space
44  std::unordered_map<std::unique_ptr<SG::ConstAccessor<double>>, SG::WriteDecorHandleKey<xAOD::TauJetContainer>> m_doubleWriteHandleKeys;
45  std::unordered_map<std::unique_ptr<SG::ConstAccessor<float>>, SG::WriteDecorHandleKey<xAOD::TauJetContainer>> m_floatWriteHandleKeys;
46  std::unordered_map<std::unique_ptr<SG::ConstAccessor<int>>, SG::WriteDecorHandleKey<xAOD::TauJetContainer>> m_intWriteHandleKeys;
47  std::unordered_map<std::unique_ptr<SG::ConstAccessor<unsigned int>>, SG::WriteDecorHandleKey<xAOD::TauJetContainer>> m_unsignedIntWriteHandleKeys;
48  std::unordered_map<std::unique_ptr<SG::ConstAccessor<char>>, SG::WriteDecorHandleKey<xAOD::TauJetContainer>> m_charWriteHandleKeys;
49 
51  this, "decayModeDecoration", "truth_DecayMode", "the decoration for the tau decay mode"};
53  this, "particleTypeDecoration", "truth_ParticleType", "the decoration for the tau particle type"};
54 
56  this, "partonTruthLabelIDDecoration", "truth_PartonTruthLabelID", "the decoration for the tau parton truth label ID from the linked jet"};
57  };
58 }
59 
60 #endif
CP::TauTruthDecorationsAlg::m_doubleWriteHandleKeys
std::unordered_map< std::unique_ptr< SG::ConstAccessor< double > >, SG::WriteDecorHandleKey< xAOD::TauJetContainer > > m_doubleWriteHandleKeys
Definition: TauTruthDecorationsAlg.h:44
SG::WriteDecorHandleKey
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Definition: StoreGate/StoreGate/WriteDecorHandleKey.h:89
CP::TauTruthDecorationsAlg::m_truthDecayModeKey
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_truthDecayModeKey
Definition: TauTruthDecorationsAlg.h:50
PropertyWrapper.h
CP::TauTruthDecorationsAlg::m_doubleDecorations
Gaudi::Property< std::vector< std::string > > m_doubleDecorations
the decoration for the tau scale factor
Definition: TauTruthDecorationsAlg.h:36
CP::TauTruthDecorationsAlg::m_unsignedIntDecorations
Gaudi::Property< std::vector< std::string > > m_unsignedIntDecorations
Definition: TauTruthDecorationsAlg.h:39
CP::TauTruthDecorationsAlg::m_prefix
Gaudi::Property< std::string > m_prefix
Definition: TauTruthDecorationsAlg.h:41
CP::TauTruthDecorationsAlg::m_unsignedIntWriteHandleKeys
std::unordered_map< std::unique_ptr< SG::ConstAccessor< unsigned int > >, SG::WriteDecorHandleKey< xAOD::TauJetContainer > > m_unsignedIntWriteHandleKeys
Definition: TauTruthDecorationsAlg.h:47
CP::TauTruthDecorationsAlg::initialize
StatusCode initialize() override
Definition: TauTruthDecorationsAlg.cxx:30
CP::TauTruthDecorationsAlg::m_truthParticleTypeKey
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_truthParticleTypeKey
Definition: TauTruthDecorationsAlg.h:52
CP::TauTruthDecorationsAlg::m_floatWriteHandleKeys
std::unordered_map< std::unique_ptr< SG::ConstAccessor< float > >, SG::WriteDecorHandleKey< xAOD::TauJetContainer > > m_floatWriteHandleKeys
Definition: TauTruthDecorationsAlg.h:45
CP::TauTruthDecorationsAlg::m_charWriteHandleKeys
std::unordered_map< std::unique_ptr< SG::ConstAccessor< char > >, SG::WriteDecorHandleKey< xAOD::TauJetContainer > > m_charWriteHandleKeys
Definition: TauTruthDecorationsAlg.h:48
CP::TauTruthDecorationsAlg::m_floatDecorations
Gaudi::Property< std::vector< std::string > > m_floatDecorations
Definition: TauTruthDecorationsAlg.h:37
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
CP
Select isolated Photons, Electrons and Muons.
Definition: Control/xAODRootAccess/xAODRootAccess/TEvent.h:49
CP::TauTruthDecorationsAlg::execute
StatusCode execute(const EventContext &ctx) const override
Definition: TauTruthDecorationsAlg.cxx:78
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ReadHandleKey.h
Property holding a SG store/key/clid from which a ReadHandle is made.
CP::TauTruthDecorationsAlg::m_intDecorations
Gaudi::Property< std::vector< std::string > > m_intDecorations
Definition: TauTruthDecorationsAlg.h:38
CP::TauTruthDecorationsAlg
an algorithm to decorate truth matched information
Definition: TauTruthDecorationsAlg.h:23
TauJetContainer.h
columnar::final
CM final
Definition: ColumnAccessor.h:106
EL::AnaReentrantAlgorithm::AnaReentrantAlgorithm
AnaReentrantAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
constructor with parameters
Definition: AnaReentrantAlgorithm.cxx:29
EL::AnaReentrantAlgorithm
the base class for EventLoop reentrant algorithms
Definition: AnaReentrantAlgorithm.h:51
CP::TauTruthDecorationsAlg::m_intWriteHandleKeys
std::unordered_map< std::unique_ptr< SG::ConstAccessor< int > >, SG::WriteDecorHandleKey< xAOD::TauJetContainer > > m_intWriteHandleKeys
Definition: TauTruthDecorationsAlg.h:46
WriteDecorHandleKey.h
CP::TauTruthDecorationsAlg::m_tausKey
SG::ReadHandleKey< xAOD::TauJetContainer > m_tausKey
the tau collection we run on
Definition: TauTruthDecorationsAlg.h:32
AnaReentrantAlgorithm.h
CP::TauTruthDecorationsAlg::m_partonTruthLabelIDKey
SG::WriteDecorHandleKey< xAOD::TauJetContainer > m_partonTruthLabelIDKey
Definition: TauTruthDecorationsAlg.h:55
CP::TauTruthDecorationsAlg::m_charDecorations
Gaudi::Property< std::vector< std::string > > m_charDecorations
Definition: TauTruthDecorationsAlg.h:40