ATLAS Offline Software
NewLikelihoodTool.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef JETTAGTOOLS_NEWLIKELIHOODMULTIDTOOL_H
6 #define JETTAGTOOLS_NEWLIKELIHOODMULTIDTOOL_H
7 /******************************************************
8  @class NewLikelihoodTool
9  DESCRIPTION:
10  Helper class for likelihood calculations
11 ********************************************************/
12 
16 #include <string>
17 #include <vector>
18 
19 class TH1;
20 
21 namespace Analysis {
22 
23 static const InterfaceID IID_NewLikelihoodTool("Analysis::NewLikelihoodTool", 1, 0);
24 
25 class NewLikelihoodTool : public AthAlgTool {
26 
27  public:
28 
29  NewLikelihoodTool(const std::string&,const std::string&,const IInterface*);
30  virtual ~NewLikelihoodTool() = default;
31 
32  virtual StatusCode initialize() override;
33 
34  static const InterfaceID& interfaceID() { return IID_NewLikelihoodTool; };
35 
36  void defineHypotheses(const std::vector<std::string>&);
37 
38  void defineHistogram(const std::string& hname);
39  TH1* prepareHistogram(const std::string& hypo, const std::string& hname) const;
40  void smoothAndNormalizeHistogram(TH1* histo, const std::string& hname) const;
41 
42  std::vector<double> calculateLikelihood(const std::vector<Slice>& lhVariableValues) const;
43 
44  void printStatus() const;
45 
46  // helper functions:
47  double getEff(const std::string& hypo, const std::string& histo, const std::string& suffix) const;
48  std::vector<std::string> gradeList(const std::string& hname) const;
49 
50  private:
51 
52  std::string m_taggerName; // tagger this tool refers to
53  std::vector<std::string> m_hypotheses; // likelihood hypotheses: usually B or U
54 
56  SG::ReadCondHandleKey<JetTagCalibCondData> m_readKey{this, "HistosKey", "JetTagCalibHistosKey", "Key of input (derived) JetTag calibration data"};
57 
62  std::vector<std::string> m_vetoSmoothingOf;
63 
64  std::vector<std::string> m_histograms;
65 
66 };
67 
68 }
69 #endif
70 
Analysis::NewLikelihoodTool::m_readKey
SG::ReadCondHandleKey< JetTagCalibCondData > m_readKey
Key of calibration data:
Definition: NewLikelihoodTool.h:56
Analysis::NewLikelihoodTool::m_histograms
std::vector< std::string > m_histograms
Definition: NewLikelihoodTool.h:64
hotSpotInTAG.suffix
string suffix
Definition: hotSpotInTAG.py:186
dqt_zlumi_pandas.hname
string hname
Definition: dqt_zlumi_pandas.py:279
JetTagCalibCondData.h
Analysis::NewLikelihoodTool::smoothAndNormalizeHistogram
void smoothAndNormalizeHistogram(TH1 *histo, const std::string &hname) const
Definition: NewLikelihoodTool.cxx:158
Analysis::NewLikelihoodTool::~NewLikelihoodTool
virtual ~NewLikelihoodTool()=default
Analysis::NewLikelihoodTool::m_smoothNTimes
int m_smoothNTimes
Definition: NewLikelihoodTool.h:61
Analysis::NewLikelihoodTool::prepareHistogram
TH1 * prepareHistogram(const std::string &hypo, const std::string &hname) const
Definition: NewLikelihoodTool.cxx:101
Analysis::NewLikelihoodTool::m_hypotheses
std::vector< std::string > m_hypotheses
Definition: NewLikelihoodTool.h:53
Analysis::NewLikelihoodTool::printStatus
void printStatus() const
Definition: NewLikelihoodTool.cxx:54
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Analysis::NewLikelihoodTool::m_taggerName
std::string m_taggerName
Definition: NewLikelihoodTool.h:52
AthAlgTool.h
Analysis::NewLikelihoodTool::defineHistogram
void defineHistogram(const std::string &hname)
Analysis::NewLikelihoodTool::m_normalizedProb
bool m_normalizedProb
Treatment of histograms:
Definition: NewLikelihoodTool.h:59
Analysis::NewLikelihoodTool::defineHypotheses
void defineHypotheses(const std::vector< std::string > &)
Definition: NewLikelihoodTool.cxx:50
Analysis::NewLikelihoodTool::m_vetoSmoothingOf
std::vector< std::string > m_vetoSmoothingOf
Definition: NewLikelihoodTool.h:62
Analysis::NewLikelihoodTool::m_interpolate
bool m_interpolate
Definition: NewLikelihoodTool.h:60
Analysis
The namespace of all packages in PhysicsAnalysis/JetTagging.
Definition: BTaggingCnvAlg.h:20
Analysis::NewLikelihoodTool::initialize
virtual StatusCode initialize() override
Definition: NewLikelihoodTool.cxx:45
Analysis::NewLikelihoodTool::interfaceID
static const InterfaceID & interfaceID()
Definition: NewLikelihoodTool.h:34
Analysis::NewLikelihoodTool::getEff
double getEff(const std::string &hypo, const std::string &histo, const std::string &suffix) const
Definition: NewLikelihoodTool.cxx:393
SG::ReadCondHandleKey
Definition: ReadCondHandleKey.h:20
Analysis::NewLikelihoodTool::calculateLikelihood
std::vector< double > calculateLikelihood(const std::vector< Slice > &lhVariableValues) const
Definition: NewLikelihoodTool.cxx:224
Analysis::NewLikelihoodTool::NewLikelihoodTool
NewLikelihoodTool(const std::string &, const std::string &, const IInterface *)
Definition: NewLikelihoodTool.cxx:20
Analysis::NewLikelihoodTool::gradeList
std::vector< std::string > gradeList(const std::string &hname) const
Definition: NewLikelihoodTool.cxx:62
AthAlgTool
Definition: AthAlgTool.h:26
plotBeamSpotCompare.histo
histo
Definition: plotBeamSpotCompare.py:415
Analysis::NewLikelihoodTool
Definition: NewLikelihoodTool.h:25
LikelihoodComponents.h