ATLAS Offline Software
TauWPDecorator.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TAURECTOOLS_TAUWPDECORATOR_H
6 #define TAURECTOOLS_TAUWPDECORATOR_H
7 
9 
10 #include "xAODTau/TauDefs.h"
13 
14 #include <utility>
15 #include <memory>
16 #include <vector>
17 #include <map>
18 
19 class TH2;
20 
35  public:
36 
38 
39 
40  TauWPDecorator(const std::string& name="TauWPDecorator");
41 
44 
46  virtual StatusCode initialize() override;
47 
49  virtual StatusCode execute(xAOD::TauJet& tau) const override;
50 
51  private:
52 
57  StatusCode retrieveHistos(int nProng);
58 
63  StatusCode storeLimits(int nProng);
64 
73  double transformScore(double score, double cutLow, double effLow, double cutHigh, double effHigh) const;
74 
75  bool m_useAbsEta;
76  bool m_defineWPs;
77 
78  std::string m_scoreName;
79  std::string m_scoreNameTrans;
80 
81  std::string m_file0p;
82  std::string m_file1p;
83  std::string m_file2p;
84  std::string m_file3p;
85 
86  std::vector<int> m_EDMWPs;
87  std::vector<float> m_EDMWPEffs0p;
88  std::vector<float> m_EDMWPEffs1p;
89  std::vector<float> m_EDMWPEffs2p;
90  std::vector<float> m_EDMWPEffs3p;
91 
92  std::vector<std::string> m_decorWPs;
93  std::vector<SG::AuxElement::Accessor<char>> m_charDecors;
94  std::vector<float> m_decorWPEffs0p;
95  std::vector<float> m_decorWPEffs1p;
96  std::vector<float> m_decorWPEffs2p;
97  std::vector<float> m_decorWPEffs3p;
98 
100  "averageInteractionsPerCrossingKey",
101  "EventInfo.averageInteractionsPerCrossing",
102  "Decoration for Average Interaction Per Crossing"};
103 
104  typedef std::pair<double, std::shared_ptr<TH2> > m_pair_t;
105 
106  std::shared_ptr<std::vector<m_pair_t>> m_hists0p;
107  std::shared_ptr<std::vector<m_pair_t>> m_hists1p;
108  std::shared_ptr<std::vector<m_pair_t>> m_hists2p;
109  std::shared_ptr<std::vector<m_pair_t>> m_hists3p;
110 
111  std::map<int, double> m_xMin;
112  std::map<int, double> m_yMin;
113  std::map<int, double> m_xMax;
114  std::map<int, double> m_yMax;
115 };
116 
117 #endif // TAURECTOOLS_TAUWPDECORATOR_H
TauWPDecorator
Implementation of tool to decorate flattened BDT score and working points.
Definition: TauWPDecorator.h:34
TauWPDecorator::m_charDecors
std::vector< SG::AuxElement::Accessor< char > > m_charDecors
Definition: TauWPDecorator.h:93
TauWPDecorator::m_yMax
std::map< int, double > m_yMax
Map of n-prong and the maximum value of y variables.
Definition: TauWPDecorator.h:114
ASG_TOOL_CLASS2
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Definition: AsgToolMacros.h:77
TauRecToolBase.h
TauRecToolBase
The base class for all tau tools.
Definition: TauRecToolBase.h:21
TauWPDecorator::m_xMax
std::map< int, double > m_xMax
Map of n-prong and the maximum value of x variables.
Definition: TauWPDecorator.h:113
TauWPDecorator::~TauWPDecorator
~TauWPDecorator()
Destructor.
Definition: TauWPDecorator.cxx:41
TauWPDecorator::transformScore
double transformScore(double score, double cutLow, double effLow, double cutHigh, double effHigh) const
Obtain the flattened score.
Definition: TauWPDecorator.cxx:145
TauWPDecorator::initialize
virtual StatusCode initialize() override
Initialization of this tool.
Definition: TauWPDecorator.cxx:152
TauWPDecorator::m_file3p
std::string m_file3p
Calibration file name of 3-prong taus.
Definition: TauWPDecorator.h:84
TauWPDecorator::m_EDMWPEffs3p
std::vector< float > m_EDMWPEffs3p
Efficiency of each WP in EDM for 3-prong taus.
Definition: TauWPDecorator.h:90
TauWPDecorator::m_hists1p
std::shared_ptr< std::vector< m_pair_t > > m_hists1p
Efficiency and corresponding score distributions of 1-prong taus.
Definition: TauWPDecorator.h:107
TauWPDecorator::m_useAbsEta
bool m_useAbsEta
Whether we are flatterning electron veto WP.
Definition: TauWPDecorator.h:75
ReadDecorHandleKey.h
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
TauWPDecorator::m_aveIntPerXKey
SG::ReadDecorHandleKey< xAOD::EventInfo > m_aveIntPerXKey
Definition: TauWPDecorator.h:99
TauDefs.h
TauWPDecorator::m_scoreName
std::string m_scoreName
Name of the original score.
Definition: TauWPDecorator.h:78
TauWPDecorator::TauWPDecorator
TauWPDecorator(const std::string &name="TauWPDecorator")
Constructor.
Definition: TauWPDecorator.cxx:15
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TauWPDecorator::m_EDMWPEffs1p
std::vector< float > m_EDMWPEffs1p
Efficiency of each WP in EDM for 1-prong taus.
Definition: TauWPDecorator.h:88
TauWPDecorator::m_hists0p
std::shared_ptr< std::vector< m_pair_t > > m_hists0p
Efficiency and corresponding score distributions of 0-prong taus.
Definition: TauWPDecorator.h:106
xAOD::TauJet_v3
Class describing a tau jet.
Definition: TauJet_v3.h:41
TauWPDecorator::m_xMin
std::map< int, double > m_xMin
Map of n-prong and the minimum value of x variables.
Definition: TauWPDecorator.h:111
TauWPDecorator::storeLimits
StatusCode storeLimits(int nProng)
Obtain the limit of the dependent variables.
Definition: TauWPDecorator.cxx:99
TauWPDecorator::m_hists2p
std::shared_ptr< std::vector< m_pair_t > > m_hists2p
Efficiency and corresponding score distributions of 2-prong taus.
Definition: TauWPDecorator.h:108
TauWPDecorator::m_EDMWPEffs2p
std::vector< float > m_EDMWPEffs2p
Efficiency of each WP in EDM for 2-prong taus.
Definition: TauWPDecorator.h:89
TauWPDecorator::m_decorWPEffs0p
std::vector< float > m_decorWPEffs0p
Efficiency of each WP to be docorated for 0-prong taus.
Definition: TauWPDecorator.h:94
TauWPDecorator::m_scoreNameTrans
std::string m_scoreNameTrans
Name of the transformed score.
Definition: TauWPDecorator.h:79
TH2
Definition: rootspy.cxx:373
TauWPDecorator::m_decorWPs
std::vector< std::string > m_decorWPs
Vector of WPs not in the EDM (to be decorated)
Definition: TauWPDecorator.h:92
TauWPDecorator::execute
virtual StatusCode execute(xAOD::TauJet &tau) const override
Executation of this tool.
Definition: TauWPDecorator.cxx:192
TauWPDecorator::m_decorWPEffs3p
std::vector< float > m_decorWPEffs3p
Efficiency of each WP to be docorated for 3-prong taus.
Definition: TauWPDecorator.h:97
TauWPDecorator::m_yMin
std::map< int, double > m_yMin
Map of n-prong and the minimum value of y variables.
Definition: TauWPDecorator.h:112
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TauWPDecorator::m_EDMWPs
std::vector< int > m_EDMWPs
Vector of WPs in the EDM.
Definition: TauWPDecorator.h:86
TauWPDecorator::m_EDMWPEffs0p
std::vector< float > m_EDMWPEffs0p
Efficiency of each WP in EDM for 0-prong taus.
Definition: TauWPDecorator.h:87
TauWPDecorator::m_decorWPEffs1p
std::vector< float > m_decorWPEffs1p
Efficiency of each WP to be docorated for 1-prong taus.
Definition: TauWPDecorator.h:95
ITauToolBase
The base class for all tau tools.
Definition: ITauToolBase.h:30
EventInfo.h
xAOD::score
@ score
Definition: TrackingPrimitives.h:513
TauWPDecorator::m_defineWPs
bool m_defineWPs
Whether to decorate the WPs.
Definition: TauWPDecorator.h:76
TauWPDecorator::m_file0p
std::string m_file0p
Calibration file name of 0-prong taus.
Definition: TauWPDecorator.h:81
TauWPDecorator::m_file1p
std::string m_file1p
Calibration file name of 1-prong taus.
Definition: TauWPDecorator.h:82
TauWPDecorator::m_file2p
std::string m_file2p
Calibration file name of 2-prong taus.
Definition: TauWPDecorator.h:83
SG::ReadDecorHandleKey
Property holding a SG store/key/clid/attr name from which a ReadDecorHandle is made.
Definition: StoreGate/StoreGate/ReadDecorHandleKey.h:85
TauWPDecorator::m_hists3p
std::shared_ptr< std::vector< m_pair_t > > m_hists3p
Efficiency and corresponding score distributions of 3-prong taus.
Definition: TauWPDecorator.h:109
TauWPDecorator::retrieveHistos
StatusCode retrieveHistos(int nProng)
Retrieve the histograms containing BDT/RNN score distributions as a function of dependent variables.
Definition: TauWPDecorator.cxx:45
TauWPDecorator::m_decorWPEffs2p
std::vector< float > m_decorWPEffs2p
Efficiency of each WP to be docorated for 2-prong taus.
Definition: TauWPDecorator.h:96
TauWPDecorator::m_pair_t
std::pair< double, std::shared_ptr< TH2 > > m_pair_t
Definition: TauWPDecorator.h:104