ATLAS Offline Software
DiTauSelectionTool.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 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):
16 #include "AsgTools/AnaToolHandle.h"
19 
20 // Local include(s):
22 #include "TauAnalysisTools/Enums.h"
24 
25 // ROOT include(s):
26 #include "TH1F.h"
27 #include "TFile.h"
28 
29 namespace TauAnalysisTools
30 {
31 
33 class DiTauSelectionCut;
34 class DiTauSelectionCutPt;
35 class DiTauSelectionCutAbsEta;
36 class DiTauSelectionCutNSubjets;
37 
38 class DiTauSelectionTool : public virtual IAsgSelectionTool,
39  public virtual IDiTauSelectionTool,
41 {
44  friend class DiTauSelectionCut;
45  friend class DiTauSelectionCutPt;
48 
53 
54 public:
56  DiTauSelectionTool( const std::string& name );
57 
58  virtual ~DiTauSelectionTool();
59 
61  virtual StatusCode initialize() override;
62 
64  virtual const asg::AcceptInfo& getAcceptInfo() const override;
65 
67  virtual asg::AcceptData accept( const xAOD::IParticle* p ) const override;
68 
70  virtual asg::AcceptData accept( const xAOD::DiTauJet& tau ) const override;
71 
73  virtual void setOutFile( TFile* fOutFile ) override;
74 
76  virtual void writeControlHistograms() override;
77 
78 private:
79 
80  // Execute at each event
81  virtual StatusCode beginEvent() override;
82 
83  template<typename T, typename U>
84  void FillRegionVector(std::vector<T>& vRegion, U tMin, U tMax) const;
85  template<typename T, typename U>
86  void FillValueVector(std::vector<T>& vRegion, U tVal) const;
87  template<typename T>
88  void PrintConfigRegion(const std::string& sCutName, std::vector<T>& vRegion) const;
89  template<typename T>
90  void PrintConfigValue(const std::string& sCutName, std::vector<T>& vRegion) const;
91  template<typename T>
92  void PrintConfigValue(const std::string& sCutName, T& sVal) const;
93 
94  // bitmask of tau selection cuts
96  // vector of transverse momentum cut regions
97  std::vector<float> m_vPtRegion;
98  // vector of absolute eta cut regions
99  std::vector<float> m_vAbsEtaRegion;
100  // vector of number of subjets cut regions
101  std::vector<float> m_vNSubjetsRegion;
102 
103  float m_dPtMin;
104  float m_dPtMax;
109 
110 protected:
111  TFile* m_fOutFile;
112  std::shared_ptr<TH1F> m_hCutFlow;
113 
114 private:
115  std::string m_sConfigPath;
116 
117  std::map<DiTauSelectionCuts, std::unique_ptr<TauAnalysisTools::DiTauSelectionCut>> m_cMap;
118 
119  void setupCutFlowHistogram();
120 
121 protected:
123 
126 
127 
128 }; // class DiTauSelectionTool
129 
130 } // namespace TauAnalysisTools
131 
132 #endif // TAUANALYSISTOOLS_DITAUSELECTIONTOOL_H
TauAnalysisTools::DiTauSelectionTool::m_bCreateControlPlots
bool m_bCreateControlPlots
Definition: DiTauSelectionTool.h:122
TauAnalysisTools
Definition: TruthCollectionMakerTau.h:16
Enums.h
TauAnalysisTools::DiTauSelectionTool::m_aAccept
asg::AcceptInfo m_aAccept
Object used to store selection information.
Definition: DiTauSelectionTool.h:125
TauAnalysisTools::DiTauSelectionCut
Definition: DiTauSelectionCuts.h:29
TauAnalysisTools::DiTauSelectionTool::initialize
virtual StatusCode initialize() override
Function initialising the tool.
Definition: DiTauSelectionTool.cxx:57
TauAnalysisTools::IDiTauSelectionTool
Interface for tau selector tool.
Definition: IDiTauSelectionTool.h:34
ASG_TOOL_CLASS2
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Definition: AsgToolMacros.h:77
TauAnalysisTools::DiTauSelectionTool::getAcceptInfo
virtual const asg::AcceptInfo & getAcceptInfo() const override
Get an object describing the "selection steps" of the tool.
Definition: DiTauSelectionTool.cxx:223
TauAnalysisTools::DiTauSelectionTool::m_dPtMin
float m_dPtMin
Definition: DiTauSelectionTool.h:103
TauAnalysisTools::DiTauSelectionTool::writeControlHistograms
virtual void writeControlHistograms() override
Write control histograms to output file.
Definition: DiTauSelectionTool.cxx:320
TauAnalysisTools::DiTauSelectionTool::beginEvent
virtual StatusCode beginEvent() override
Function called when a new events is loaded.
Definition: DiTauSelectionTool.cxx:217
TauAnalysisTools::DiTauSelectionTool::m_iSelectionCuts
int m_iSelectionCuts
Definition: DiTauSelectionTool.h:95
IAsgSelectionTool
Definition: IAsgSelectionTool.h:28
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
IAsgSelectionTool.h
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
TauAnalysisTools::DiTauSelectionTool::m_dNSubjetsMax
float m_dNSubjetsMax
Definition: DiTauSelectionTool.h:107
TauAnalysisTools::DiTauSelectionTool::m_dPtMax
float m_dPtMax
Definition: DiTauSelectionTool.h:104
asg::AcceptInfo
Definition: AcceptInfo.h:28
TauAnalysisTools::DiTauSelectionTool::m_vAbsEtaRegion
std::vector< float > m_vAbsEtaRegion
Definition: DiTauSelectionTool.h:99
TauAnalysisTools::DiTauSelectionTool::m_hCutFlow
std::shared_ptr< TH1F > m_hCutFlow
Definition: DiTauSelectionTool.h:112
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.
TauAnalysisTools::DiTauSelectionCutNSubjets
Definition: DiTauSelectionCuts.h:92
TauAnalysisTools::DiTauSelectionCutPt
Definition: DiTauSelectionCuts.h:68
TauAnalysisTools::DiTauSelectionTool::setupCutFlowHistogram
void setupCutFlowHistogram()
Definition: DiTauSelectionTool.cxx:339
TauAnalysisTools::DiTauSelectionTool::PrintConfigValue
void PrintConfigValue(const std::string &sCutName, std::vector< T > &vRegion) const
Definition: DiTauSelectionTool.cxx:401
TauAnalysisTools::DiTauSelectionTool::FillRegionVector
void FillRegionVector(std::vector< T > &vRegion, U tMin, U tMax) const
Definition: DiTauSelectionTool.cxx:363
AnaToolHandle.h
TauAnalysisTools::DiTauSelectionTool::m_vPtRegion
std::vector< float > m_vPtRegion
Definition: DiTauSelectionTool.h:97
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TauAnalysisTools::DiTauSelectionCutAbsEta
Definition: DiTauSelectionCuts.h:80
TauAnalysisTools::DiTauSelectionTool::m_dAbsEtaMin
float m_dAbsEtaMin
Definition: DiTauSelectionTool.h:105
TauAnalysisTools::DiTauSelectionTool::setOutFile
virtual void setOutFile(TFile *fOutFile) override
Set output file for control histograms.
Definition: DiTauSelectionTool.cxx:314
asg::AsgMetadataTool
Base class for dual-use tools that provide file metadata access.
Definition: AsgMetadataTool.h:48
TauAnalysisTools::DiTauSelectionTool::m_dNSubjetsMin
float m_dNSubjetsMin
Definition: DiTauSelectionTool.h:108
AsgMetadataTool.h
TauAnalysisTools::DiTauSelectionTool::PrintConfigRegion
void PrintConfigRegion(const std::string &sCutName, std::vector< T > &vRegion) const
Definition: DiTauSelectionTool.cxx:390
IDiTauSelectionTool.h
xAOD::DiTauJet_v1
Definition: DiTauJet_v1.h:31
TauAnalysisTools::DiTauSelectionTool::m_cMap
std::map< DiTauSelectionCuts, std::unique_ptr< TauAnalysisTools::DiTauSelectionCut > > m_cMap
Definition: DiTauSelectionTool.h:117
TauAnalysisTools::DiTauSelectionTool::m_dAbsEtaMax
float m_dAbsEtaMax
Definition: DiTauSelectionTool.h:106
TauAnalysisTools::DiTauSelectionTool::m_vNSubjetsRegion
std::vector< float > m_vNSubjetsRegion
Definition: DiTauSelectionTool.h:101
TauAnalysisTools::DiTauSelectionTool
Definition: DiTauSelectionTool.h:41
TauAnalysisTools::DiTauSelectionTool::FillValueVector
void FillValueVector(std::vector< T > &vRegion, U tVal) const
Definition: DiTauSelectionTool.cxx:380
asg::AcceptData
Definition: AcceptData.h:30
TauAnalysisTools::DiTauSelectionTool::accept
virtual asg::AcceptData accept(const xAOD::IParticle *p) const override
Get the decision using a generic IParticle pointer.
Definition: DiTauSelectionTool.cxx:229
HelperFunctions.h
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
TauAnalysisTools::DiTauSelectionTool::m_sConfigPath
std::string m_sConfigPath
Definition: DiTauSelectionTool.h:115
TauAnalysisTools::DiTauSelectionTool::m_fOutFile
TFile * m_fOutFile
Definition: DiTauSelectionTool.h:111