ATLAS Offline Software
Loading...
Searching...
No Matches
TauWPDecorator.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 TAURECTOOLS_TAUWPDECORATOR_H
6#define TAURECTOOLS_TAUWPDECORATOR_H
7
11#include "xAODTau/TauDefs.h"
15
16#include <utility>
17#include <memory>
18#include <vector>
19#include <map>
20
21class TH2;
22
35
37 public:
38
40
41
42 TauWPDecorator(const std::string& name="TauWPDecorator");
43
46
48 virtual StatusCode initialize() override;
49
51 virtual StatusCode execute(xAOD::TauJet& tau) const override;
52
53 private:
54
59 StatusCode retrieveHistos(int nProng);
60
65 StatusCode storeLimits(int nProng);
66
75 double transformScore(double score, double cutLow, double effLow, double cutHigh, double effHigh) const;
76
77 Gaudi::Property<bool> m_useAbsEta{this, "UseAbsEta", false, "Whether we are flatterning electron veto WP"};
78 Gaudi::Property<bool> m_defineWPs{this, "DefineWPs", false, "Whether to decorate the WPs"};
79 Gaudi::Property<std::string> m_scoreName{this, "ScoreName", "", "Name of the original score"};
80 Gaudi::Property<std::string> m_scoreNameTrans{this, "NewScoreName", "", "Name of the transformed score"};
81 Gaudi::Property<std::string> m_file0p{this, "flatteningFile0Prong", "", "Calibration file name of 0-prong taus"};
82 Gaudi::Property<std::string> m_file1p{this, "flatteningFile1Prong", "", "Calibration file name of 1-prong taus"};
83 Gaudi::Property<std::string> m_file2p{this, "flatteningFile2Prong", "", "Calibration file name of 2-prong taus"};
84 Gaudi::Property<std::string> m_file3p{this, "flatteningFile3Prong", "", "Calibration file name of 3-prong taus"};
85 Gaudi::Property<std::vector<int>> m_EDMWPs{this, "CutEnumVals", {}, "Vector of WPs in the EDM"};
86 Gaudi::Property<std::vector<float>> m_EDMWPEffs0p{this, "SigEff0P", {}, "Efficiency of each WP in EDM for 0-prong taus"};
87 Gaudi::Property<std::vector<float>> m_EDMWPEffs1p{this, "SigEff1P", {}, "Efficiency of each WP in EDM for 1-prong taus"};
88 Gaudi::Property<std::vector<float>> m_EDMWPEffs2p{this, "SigEff2P", {}, "Efficiency of each WP in EDM for 2-prong taus"};
89 Gaudi::Property<std::vector<float>> m_EDMWPEffs3p{this, "SigEff3P", {}, "Efficiency of each WP in EDM for 3-prong taus"};
90 Gaudi::Property<std::vector<std::string>> m_decorWPs{this, "DecorWPNames", {}, "Name of WPs"};
91 Gaudi::Property<std::vector<float>> m_decorWPEffs0p{this, "DecorWPCutEffs0P", {}, "Efficiency of each WP to be docorated for 0-prong taus"};
92 Gaudi::Property<std::vector<float>> m_decorWPEffs1p{this, "DecorWPCutEffs1P", {}, "Efficiency of each WP to be docorated for 1-prong taus"};
93 Gaudi::Property<std::vector<float>> m_decorWPEffs2p{this, "DecorWPCutEffs2P", {}, "Efficiency of each WP to be docorated for 2-prong taus"};
94 Gaudi::Property<std::vector<float>> m_decorWPEffs3p{this, "DecorWPCutEffs3P", {}, "Efficiency of each WP to be docorated for 3-prong taus"};
95 // for WPs not implemented in the EDM (i.e. not encoded in IsTauFlag)
96 // use Accessors unless necessary
97 std::vector<SG::AuxElement::Accessor<char>> m_charDecors;
98 // when data handles are required (currently in tau trigger offline monitoring), need to use Write(Read)DecorHandleKeys
99 // redundant with above accessors, will be improved in the future but has implications for DAOD workflow
100 Gaudi::Property<std::string> m_tauContainerName{this, "TauContainerName", "", "Name of TauJetContainer, must be set when using "};
101 SG::WriteDecorHandleKeyArray<xAOD::TauJetContainer> m_decorHandleKeys {this, "DecorHandleKeys",{},"Name of WPs to be decorated"};
102
104 "averageInteractionsPerCrossingKey",
105 "EventInfo.averageInteractionsPerCrossing",
106 "Decoration for Average Interaction Per Crossing"};
107
108 typedef std::pair<double, std::shared_ptr<TH2> > m_pair_t;
109
110 std::shared_ptr<std::vector<m_pair_t>> m_hists0p;
111 std::shared_ptr<std::vector<m_pair_t>> m_hists1p;
112 std::shared_ptr<std::vector<m_pair_t>> m_hists2p;
113 std::shared_ptr<std::vector<m_pair_t>> m_hists3p;
114
115 std::map<int, double> m_xMin;
116 std::map<int, double> m_yMin;
117 std::map<int, double> m_xMax;
118 std::map<int, double> m_yMax;
119};
120
121#endif // TAURECTOOLS_TAUWPDECORATOR_H
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
The base class for all tau tools.
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
TauRecToolBase(const std::string &name)
StatusCode storeLimits(int nProng)
Obtain the limit of the dependent variables.
Gaudi::Property< std::string > m_scoreNameTrans
Gaudi::Property< std::vector< float > > m_EDMWPEffs0p
Gaudi::Property< std::vector< float > > m_EDMWPEffs3p
std::map< int, double > m_yMin
Map of n-prong and the minimum value of y variables.
Gaudi::Property< std::vector< float > > m_EDMWPEffs1p
Gaudi::Property< std::string > m_file3p
Gaudi::Property< std::string > m_tauContainerName
Gaudi::Property< std::vector< std::string > > m_decorWPs
double transformScore(double score, double cutLow, double effLow, double cutHigh, double effHigh) const
Obtain the flattened score.
std::shared_ptr< std::vector< m_pair_t > > m_hists1p
Efficiency and corresponding score distributions of 1-prong taus.
Gaudi::Property< std::vector< float > > m_decorWPEffs0p
std::shared_ptr< std::vector< m_pair_t > > m_hists0p
Efficiency and corresponding score distributions of 0-prong taus.
Gaudi::Property< std::vector< int > > m_EDMWPs
Gaudi::Property< std::vector< float > > m_decorWPEffs1p
Gaudi::Property< bool > m_defineWPs
Gaudi::Property< std::vector< float > > m_EDMWPEffs2p
Gaudi::Property< std::string > m_scoreName
virtual StatusCode initialize() override
Initialization of this tool.
Gaudi::Property< std::string > m_file0p
Gaudi::Property< std::string > m_file1p
std::map< int, double > m_yMax
Map of n-prong and the maximum value of y variables.
SG::WriteDecorHandleKeyArray< xAOD::TauJetContainer > m_decorHandleKeys
virtual StatusCode execute(xAOD::TauJet &tau) const override
Executation of this tool.
std::map< int, double > m_xMax
Map of n-prong and the maximum value of x variables.
std::map< int, double > m_xMin
Map of n-prong and the minimum value of x variables.
std::shared_ptr< std::vector< m_pair_t > > m_hists3p
Efficiency and corresponding score distributions of 3-prong taus.
SG::ReadDecorHandleKey< xAOD::EventInfo > m_aveIntPerXKey
std::vector< SG::AuxElement::Accessor< char > > m_charDecors
StatusCode retrieveHistos(int nProng)
Retrieve the histograms containing BDT/RNN score distributions as a function of dependent variables.
std::pair< double, std::shared_ptr< TH2 > > m_pair_t
Gaudi::Property< std::vector< float > > m_decorWPEffs2p
Gaudi::Property< bool > m_useAbsEta
std::shared_ptr< std::vector< m_pair_t > > m_hists2p
Efficiency and corresponding score distributions of 2-prong taus.
~TauWPDecorator()
Destructor.
Gaudi::Property< std::string > m_file2p
TauWPDecorator(const std::string &name="TauWPDecorator")
Constructor.
Gaudi::Property< std::vector< float > > m_decorWPEffs3p
DecorHandleKeyArray< WriteDecorHandle< T, S >, WriteDecorHandleKey< T >, Gaudi::DataHandle::Writer > WriteDecorHandleKeyArray
TauJet_v3 TauJet
Definition of the current "tau version".