ATLAS Offline Software
Loading...
Searching...
No Matches
TauSelectionTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TAUANALYSISTOOLS_TAUSELECTIONTOOL_H
6#define TAUANALYSISTOOLS_TAUSELECTIONTOOL_H
7
8/*
9 author: Dirk Duschinger
10 mail: dirk.duschinger@cern.ch
11*/
12
13// Framework include(s):
20
21// Local include(s):
26
27// EDM include(s):
30
31// ROOT include(s):
32#include "TH1F.h"
33#include "TFile.h"
34
35namespace TauAnalysisTools
36{
37
39class TauSelectionCut;
50
51
52class TauSelectionTool : public virtual IAsgSelectionTool,
53 public virtual ITauSelectionTool,
55{
58 friend class TauSelectionCut;
59 friend class TauSelectionCutPt;
69
74
75 // declaration of classes as friends to access private member variables
77
78public:
80 TauSelectionTool( const std::string& name );
81
82 virtual ~TauSelectionTool();
83
85 virtual StatusCode initialize() override;
86
88 virtual const asg::AcceptInfo& getAcceptInfo() const override;
89
91 virtual asg::AcceptData accept( const xAOD::IParticle* p ) const override;
92
94 virtual asg::AcceptData accept( const xAOD::TauJet& tau ) const override;
95
97 virtual void setOutFile( TFile* fOutFile ) override;
98
100 virtual void writeControlHistograms() override;
101
102private:
103
104 // Execute at each event
105 virtual StatusCode beginEvent() override;
106
107 template<typename T, typename U>
108 void FillRegionVector(std::vector<T>& vRegion, U tMin, U tMax) const;
109 template<typename T, typename U>
110 void FillValueVector(std::vector<T>& vRegion, U tVal) const;
111 template<typename T>
112 void PrintConfigRegion(const std::string& sCutName, std::vector<T>& vRegion) const;
113 template<typename T>
114 void PrintConfigValue(const std::string& sCutName, std::vector<T>& vRegion) const;
115 template<typename T>
116 void PrintConfigValue(const std::string& sCutName, T& sVal) const;
117
118 // vector of transverse momentum cut regions
119 std::vector<float> m_vPtRegion;
120 // vector of absolute eta cut regions
121 std::vector<float> m_vAbsEtaRegion;
122 // vector of absolute charge requirements
123 std::vector<int> m_vAbsCharges;
124 // vector of number of track requirements
125 std::vector<unsigned> m_vNTracks;
126 // vector of JetRNNSigTrans cut regions
127 std::vector<float> m_vJetRNNSigTransRegion;
128 // vector of GNTauSigTrans cut regions
129 std::vector<float> m_vGNTauSigTransRegion;
130 // JetID working point
131 std::string m_sJetIDWP;
132 bool m_useGNTau=false;
133 // vector of EleRNN cut regions
134 std::vector<float> m_vEleRNNSigTransRegion;
135 // EleID working point
136 std::string m_sEleIDWP;
137
138 // properties
139 Gaudi::Property<int> m_iSelectionCuts{this, "SelectionCuts", NoCut};
140 Gaudi::Property<float> m_dPtMin{this, "PtMin", NAN};
141 Gaudi::Property<float> m_dAbsEtaMin{this, "AbsEtaMin", NAN};
142 Gaudi::Property<float> m_dAbsEtaMax{this, "AbsEtaMax", NAN};
143 Gaudi::Property<float> m_iAbsCharge{this, "AbsCharge", NAN};
144 Gaudi::Property<float> m_dJetRNNSigTransMin{this, "JetRNNSigTransMin", NAN};
145 Gaudi::Property<float> m_dGNTauSigTransMin{this, "GNTauSigTransMin", NAN};
146 Gaudi::Property<float> m_iNTrack{this, "NTrack", NAN};
147 Gaudi::Property<float> m_dEleRNNSigTransMin{this, "EleRNNSigTransMin", NAN};
148 Gaudi::Property<int> m_iJetIDWP{this, "JetIDWP", 1}; // this corresponds to JETIDNONE
149 Gaudi::Property<int> m_iEleIDWP{this, "EleIDWP", 0};
150 Gaudi::Property<int> m_iEleIDVersion{this, "EleIDVersion", 1};
151 Gaudi::Property<bool> m_bMuonOLR{this, "MuonOLR", false};
152
153 Gaudi::Property<std::vector<float>> m_vecAbsEtaRegion{this, "AbsEtaRegion",{}};
154 Gaudi::Property<std::vector<int>> m_vecAbsCharges{this, "AbsCharges", {}};
155 Gaudi::Property<std::vector<unsigned>> m_vecNTracks{this, "NTracks", {}};
156
157protected:
159 std::shared_ptr<TH1F> m_hCutFlow;
160
161private:
162
163 Gaudi::Property<std::string> m_sConfigPath{this, "ConfigPath", "TauAnalysisTools/"+std::string(sSharedFilesVersion)+"/Selection/recommended_selection_r22.conf"};
164 SG::ReadHandleKey<xAOD::MuonContainer> m_muonContainerKey {this, "MuonContainerName", "Muons", "Muon container name"};
165 SG::ReadHandleKey<xAOD::TauJetContainer> m_tauContainerKey {this, "TauContainerName", "TauJets", "Tau container name"};
166 SG::ReadDecorHandleKey<xAOD::TauJetContainer> m_eVetoDecorKey {this, "eVetoDecorName", "", "Name of eVeto decoration"};
167 SG::ReadDecorHandleKey<xAOD::TauJetContainer> m_GNTauDecorKey {this, "GNTauDecorName", "", "Name of GnTauID decoration"};
168
169 std::map<SelectionCuts, std::unique_ptr<TauAnalysisTools::TauSelectionCut>> m_cMap;
170
172 int convertStrToJetIDWP(const std::string& sJetIDWP) const;
173 int convertStrToEleIDWP(const std::string& sEleIDWP) const;
174
175protected:
176
177 Gaudi::Property<bool> m_bCreateControlPlots{this, "CreateControlPlots", false};
178
181
182
183}; // class TauSelectionTool
184
185} // namespace TauAnalysisTools
186
187#endif // TAUANALYSISTOOLS_TAUSELECTIONTOOL_H
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
static const char *const sSharedFilesVersion
Version of the calibration files.
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Property holding a SG store/key/clid from which a ReadHandle is made.
Interface for tau selector tool.
friend class TauSelectionCut
need to define cut classes to be friends to access protected variables, needed for access of cut thre...
void FillValueVector(std::vector< T > &vRegion, U tVal) const
virtual StatusCode beginEvent() override
Function called when a new events is loaded.
SG::ReadDecorHandleKey< xAOD::TauJetContainer > m_GNTauDecorKey
Gaudi::Property< float > m_dAbsEtaMax
std::vector< float > m_vJetRNNSigTransRegion
void FillRegionVector(std::vector< T > &vRegion, U tMin, U tMax) const
Gaudi::Property< std::string > m_sConfigPath
Gaudi::Property< std::vector< float > > m_vecAbsEtaRegion
Gaudi::Property< float > m_iNTrack
Gaudi::Property< int > m_iEleIDVersion
void PrintConfigRegion(const std::string &sCutName, std::vector< T > &vRegion) const
SG::ReadDecorHandleKey< xAOD::TauJetContainer > m_eVetoDecorKey
Gaudi::Property< float > m_dEleRNNSigTransMin
int convertStrToJetIDWP(const std::string &sJetIDWP) const
SG::ReadHandleKey< xAOD::TauJetContainer > m_tauContainerKey
virtual void setOutFile(TFile *fOutFile) override
Set output file for control histograms.
Gaudi::Property< std::vector< unsigned > > m_vecNTracks
asg::AcceptInfo m_aAccept
Object used to store selection information.
Gaudi::Property< float > m_dAbsEtaMin
SG::ReadHandleKey< xAOD::MuonContainer > m_muonContainerKey
Gaudi::Property< float > m_dPtMin
std::vector< float > m_vEleRNNSigTransRegion
std::map< SelectionCuts, std::unique_ptr< TauAnalysisTools::TauSelectionCut > > m_cMap
virtual StatusCode initialize() override
Function initialising the tool.
TauSelectionTool(const std::string &name)
Constructor for standalone usage.
int convertStrToEleIDWP(const std::string &sEleIDWP) const
virtual const asg::AcceptInfo & getAcceptInfo() const override
Get an object describing the "selection steps" of the tool.
virtual void writeControlHistograms() override
Write control histograms to output file.
Gaudi::Property< bool > m_bCreateControlPlots
virtual asg::AcceptData accept(const xAOD::IParticle *p) const override
Get the decision using a generic IParticle pointer.
Gaudi::Property< int > m_iSelectionCuts
std::vector< float > m_vGNTauSigTransRegion
Gaudi::Property< float > m_dGNTauSigTransMin
Gaudi::Property< std::vector< int > > m_vecAbsCharges
void PrintConfigValue(const std::string &sCutName, std::vector< T > &vRegion) const
ASG_TOOL_CLASS2(TauSelectionTool, IAsgSelectionTool, TauAnalysisTools::ITauSelectionTool) friend class TauEfficiencyCorrectionsTool
Create a proper constructor for Athena.
Gaudi::Property< float > m_dJetRNNSigTransMin
Gaudi::Property< float > m_iAbsCharge
Base class for dual-use tools that provide file metadata access.
Class providing the definition of the 4-vector interface.
TauJet_v3 TauJet
Definition of the current "tau version".