ATLAS Offline Software
Loading...
Searching...
No Matches
DiTauSelectionTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TAUANALYSISTOOLS_DITAUSELECTIONTOOL_H
6#define TAUANALYSISTOOLS_DITAUSELECTIONTOOL_H
7
8/*
9 author: Dirk Duschinger
10 mail: dirk.duschinger@cern.ch
11 contact email: antonio.de.maria@cern.ch
12*/
13
14// Framework include(s):
22
23// Local include(s):
27
28// ROOT include(s):
29#include "TH1F.h"
30#include "TFile.h"
31
32namespace TauAnalysisTools
33{
34
43
45 public virtual IDiTauSelectionTool,
47{
50 friend class DiTauSelectionCut;
51 friend class DiTauSelectionCutPt;
57
62
63public:
65 DiTauSelectionTool( const std::string& name );
66
67 virtual ~DiTauSelectionTool();
68
70 virtual StatusCode initialize() override;
71
73 virtual const asg::AcceptInfo& getAcceptInfo() const override;
74
76 virtual asg::AcceptData accept( const xAOD::IParticle* p ) const override;
77
79 virtual asg::AcceptData accept( const xAOD::DiTauJet& tau ) const override;
80
82 virtual void setOutFile( TFile* fOutFile ) override;
83
85 virtual void writeControlHistograms() override;
86
87private:
88
89 // Execute at each event
90 virtual StatusCode beginEvent() override;
91
92 template<typename T, typename U>
93 void FillRegionVector(std::vector<T>& vRegion, U tMin, U tMax) const;
94 template<typename T, typename U>
95 void FillValueVector(std::vector<T>& vRegion, U tVal) const;
96 template<typename T>
97 void PrintConfigRegion(const std::string& sCutName, std::vector<T>& vRegion) const;
98 template<typename T>
99 void PrintConfigValue(const std::string& sCutName, std::vector<T>& vRegion) const;
100 template<typename T>
101 void PrintConfigValue(const std::string& sCutName, T& sVal) const;
102
103 // vector of transverse momentum cut regions
104 std::vector<float> m_vPtRegion;
105 // vector of absolute eta cut regions
106 std::vector<float> m_vAbsEtaRegion;
107 // vector of number of subjets cut regions
108 std::vector<float> m_vNSubjetsRegion;
109 // vector of absolute charge requirements
110 std::vector<int> m_vAbsCharges;
111 // vector of OmniScore cut regions
112 std::vector<float> m_vOmniScoreRegion;
113 // OmniID working point
114 std::string m_sOmniIDWP;
115
116 bool m_useOmniScore=false;
117
118 Gaudi::Property<std::string> m_sConfigPath{this, "ConfigPath", ""};
119 Gaudi::Property<int> m_iSelectionCuts{this, "SelectionCuts", NoDiTauCut};
120 Gaudi::Property<float> m_dPtMin{this, "PtMin", NAN};
121 Gaudi::Property<float> m_dPtMax{this, "PtMax", NAN};
122 Gaudi::Property<float> m_dAbsEtaMin{this, "AbsEtaMin", NAN};
123 Gaudi::Property<float> m_dAbsEtaMax{this, "AbsEtaMax", NAN};
124 Gaudi::Property<float> m_dNSubjetsMin{this, "NSubjetsMin", NAN};
125 Gaudi::Property<float> m_dNSubjetsMax{this, "NSubjetsMax", NAN};
126 Gaudi::Property<float> m_iAbsCharge{this, "AbsCharge", NAN};
127 Gaudi::Property<float> m_dOmniScoreMin{this, "OmniScoreMin", NAN};
128 Gaudi::Property<float> m_dOmniScoreMax{this, "OmniScoreMax", NAN};
129 Gaudi::Property<int> m_iOmniIDWP{this, "OmniIDWP", 0};
130
131 Gaudi::Property<std::vector<float>> m_vecPtRegion{this, "PtRegion", {}};
132 Gaudi::Property<std::vector<float>> m_vecAbsEtaRegion{this, "AbsEtaRegion",{}};
133 Gaudi::Property<std::vector<float>> m_vecNSubjetsRegion{this, "NSubjetsRegion", {}};
134 Gaudi::Property<std::vector<int>> m_vecAbsCharges{this, "AbsCharges", {}};
135 Gaudi::Property<std::vector<float>> m_vecOmniScoreRegion{this, "OmniScoreRegion", {}};
136
137protected:
139 std::shared_ptr<TH1F> m_hCutFlow;
140
141private:
142
143 std::map<DiTauSelectionCuts, std::unique_ptr<TauAnalysisTools::DiTauSelectionCut>> m_cMap;
144
146 int convertStrToOmniIDWP(const std::string& sOmniIDWP) const;
147 std::string convertOmniIDWPToStr(int iOmniIDWP) const;
148
149protected:
150
151 Gaudi::Property<bool> m_bCreateControlPlots{this, "CreateControlPlots", false};
152 SG::ReadDecorHandleKey<xAOD::DiTauJetContainer> m_OmniScoreDecorKey {this, "OmniScoreDecorName", "", "Name of OmniScore decoration"};
153
156
157
158}; // class DiTauSelectionTool
159
160} // namespace TauAnalysisTools
161
162#endif // TAUANALYSISTOOLS_DITAUSELECTIONTOOL_H
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
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.
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
std::map< DiTauSelectionCuts, std::unique_ptr< TauAnalysisTools::DiTauSelectionCut > > m_cMap
friend class DiTauSelectionCut
need to define cut classes to be friends to access protected variables, needed for access of cut thre...
Gaudi::Property< std::vector< float > > m_vecAbsEtaRegion
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< std::string > m_sConfigPath
SG::ReadDecorHandleKey< xAOD::DiTauJetContainer > m_OmniScoreDecorKey
virtual StatusCode beginEvent() override
Function called when a new events is loaded.
Gaudi::Property< std::vector< float > > m_vecNSubjetsRegion
int convertStrToOmniIDWP(const std::string &sOmniIDWP) const
Gaudi::Property< std::vector< int > > m_vecAbsCharges
void FillValueVector(std::vector< T > &vRegion, U tVal) const
void FillRegionVector(std::vector< T > &vRegion, U tMin, U tMax) const
void PrintConfigRegion(const std::string &sCutName, std::vector< T > &vRegion) const
virtual ASG_TOOL_CLASS2(DiTauSelectionTool, IAsgSelectionTool, TauAnalysisTools::IDiTauSelectionTool) public ~DiTauSelectionTool()
Create a proper constructor for Athena.
virtual const asg::AcceptInfo & getAcceptInfo() const override
Get an object describing the "selection steps" of the tool.
Gaudi::Property< std::vector< float > > m_vecPtRegion
std::string convertOmniIDWPToStr(int iOmniIDWP) const
Gaudi::Property< std::vector< float > > m_vecOmniScoreRegion
void PrintConfigValue(const std::string &sCutName, std::vector< T > &vRegion) const
virtual void writeControlHistograms() override
Write control histograms to output file.
asg::AcceptInfo m_aAccept
Object used to store selection information.
virtual void setOutFile(TFile *fOutFile) override
Set output file for control histograms.
virtual StatusCode initialize() override
Function initialising the tool.
Interface for tau selector tool.
Base class for dual-use tools that provide file metadata access.
Class providing the definition of the 4-vector interface.
DiTauJet_v1 DiTauJet
Definition of the current version.
Definition DiTauJet.h:17