ATLAS Offline Software
LikelihoodMultiDTool.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_LIKELIHOODMULTIDTOOL_H
6 #define JETTAGTOOLS_LIKELIHOODMULTIDTOOL_H
7 /******************************************************
8  @class LikelihoodMultiDTool
9  DESCRIPTION:
10  Helper class for likelihood calculations
11 ********************************************************/
12 
14 #include <string>
15 #include <vector>
16 #include <map>
17 
19 
21 
22 class ITHistSvc;
23 class TH1;
24 
25 namespace Analysis
26 {
27 
28 static const InterfaceID IID_LikelihoodMultiDTool("Analysis::LikelihoodMultiDTool", 1, 0);
29 
31 {
32 
33  public:
34 
35  LikelihoodMultiDTool(const std::string&,const std::string&,const IInterface*);
36  virtual ~LikelihoodMultiDTool();
37 
42 
43  static const InterfaceID& interfaceID() { return IID_LikelihoodMultiDTool; };
44 
45  void prepareHistosFromFile(const std::string& refFileName);
46  TH1* retrieveHistoFromFile(const std::string& refFileName,
47  const std::string& histoName, const std::string& jetPrefix);
48  void setLhVariableValue(std::vector<Slice>& value);
50  std::vector<double> calculateLikelihood();
51  const std::vector<double>& tagLikelihood();
52  void printStatus();
53  double getEff(const std::string& , const std::string& , const std::string&);
54  void addLhVariableToUse(const std::string&);
55  inline void resetLhVariableToUse() { m_useTheseLhVariables.clear(); }
56  void setInterpolFlag(bool f) {m_DoInterpol = f;}
58 
59  private:
60 
61  ITHistSvc* m_histoSvc;
62 
63  // Filled once at the beginning of an run
64  //std::vector<std::string> m_allLhVariables; //!< names of all likelihood variables in the histogram file
65  std::vector<std::string> m_useTheseLhVariables;
66 
71  std::vector< std::map<std::string, TH1*>* > m_mapOfAllHistos;
72 
76  std::map<std::string, HistoLimits> m_histoLimitsMap1D;
77  std::map<std::string, HistoLimits> m_histoLimitsMap2D;
78  std::map<std::string, HistoLimits> m_histoLimitsMap3D;
79 
80  // Filled once per event
86  std::vector<Slice> m_lhVariableValues;
87 
90  std::vector<double> m_likelihoodVector;
91 
93  int m_nhis1D;
94  int m_nhis2D;
95  int m_nhis3D;
96 
97  //
100 
101  unsigned int m_nbHypotheses; // nb of hypotheses (default 2: b | u)
102 
103  // for soft-mu:
106 
107 };
108 
109 }
110 #endif
111 
Analysis::LikelihoodMultiDTool::m_normProb
bool m_normProb
Definition: LikelihoodMultiDTool.h:105
Analysis::LikelihoodMultiDTool
Definition: LikelihoodMultiDTool.h:31
Analysis::LikelihoodMultiDTool::tagLikelihood
const std::vector< double > & tagLikelihood()
Definition: LikelihoodMultiDTool.cxx:410
Analysis::LikelihoodMultiDTool::m_useTheseLhVariables
std::vector< std::string > m_useTheseLhVariables
names of lh variables which one wants to use (subset of m_allLhVariables)
Definition: LikelihoodMultiDTool.h:65
Analysis::LikelihoodMultiDTool::finalize
StatusCode finalize()
AlgTool finalize method.
Definition: LikelihoodMultiDTool.cxx:70
Analysis::LikelihoodMultiDTool::retrieveHistoFromFile
TH1 * retrieveHistoFromFile(const std::string &refFileName, const std::string &histoName, const std::string &jetPrefix)
Definition: LikelihoodMultiDTool.cxx:188
Analysis::LikelihoodMultiDTool::LikelihoodMultiDTool
LikelihoodMultiDTool(const std::string &, const std::string &, const IInterface *)
Definition: LikelihoodMultiDTool.cxx:25
Analysis::LikelihoodMultiDTool::m_nSmooth1D
int m_nSmooth1D
Definition: LikelihoodMultiDTool.h:104
Analysis::LikelihoodMultiDTool::initialize
StatusCode initialize()
AlgTool initailize method.
Definition: LikelihoodMultiDTool.cxx:57
athena.value
value
Definition: athena.py:124
Analysis::LikelihoodMultiDTool::m_mapOfAllHistos
std::vector< std::map< std::string, TH1 * > * > m_mapOfAllHistos
For every histogram input file this vector contains a map with the names of the histograms as a key a...
Definition: LikelihoodMultiDTool.h:71
diffConfigs.refFileName
refFileName
Definition: diffConfigs.py:47
Analysis::LikelihoodMultiDTool::defineNbHypotheses
void defineNbHypotheses(int n)
Definition: LikelihoodMultiDTool.h:57
Analysis::LikelihoodMultiDTool::interfaceID
static const InterfaceID & interfaceID()
Definition: LikelihoodMultiDTool.h:43
Analysis::LikelihoodMultiDTool::m_nhis1D
int m_nhis1D
for debugging:
Definition: LikelihoodMultiDTool.h:93
beamspotman.n
n
Definition: beamspotman.py:731
Analysis::LikelihoodMultiDTool::printStatus
void printStatus()
Definition: LikelihoodMultiDTool.cxx:415
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
Analysis::LikelihoodMultiDTool::calculateLikelihood
std::vector< double > calculateLikelihood()
Definition: LikelihoodMultiDTool.cxx:263
hist_file_dump.f
f
Definition: hist_file_dump.py:135
Analysis::LikelihoodMultiDTool::~LikelihoodMultiDTool
virtual ~LikelihoodMultiDTool()
Definition: LikelihoodMultiDTool.cxx:51
Analysis::LikelihoodMultiDTool::m_nhis3D
int m_nhis3D
Definition: LikelihoodMultiDTool.h:95
Analysis::LikelihoodMultiDTool::setInterpolFlag
void setInterpolFlag(bool f)
Definition: LikelihoodMultiDTool.h:56
Analysis::LikelihoodMultiDTool::m_histoLimitsMap3D
std::map< std::string, HistoLimits > m_histoLimitsMap3D
Definition: LikelihoodMultiDTool.h:78
HistoLimits.h
Analysis::LikelihoodMultiDTool::addLhVariableToUse
void addLhVariableToUse(const std::string &)
Definition: LikelihoodMultiDTool.cxx:466
Analysis
The namespace of all packages in PhysicsAnalysis/JetTagging.
Definition: BTaggingCnvAlg.h:20
Analysis::LikelihoodMultiDTool::m_histoLimitsMap1D
std::map< std::string, HistoLimits > m_histoLimitsMap1D
To hold the histo limits.
Definition: LikelihoodMultiDTool.h:76
Analysis::LikelihoodMultiDTool::prepareHistosFromFile
void prepareHistosFromFile(const std::string &refFileName)
Definition: LikelihoodMultiDTool.cxx:75
Analysis::LikelihoodMultiDTool::m_histoSvc
ITHistSvc * m_histoSvc
Definition: LikelihoodMultiDTool.h:61
Analysis::LikelihoodMultiDTool::getEff
double getEff(const std::string &, const std::string &, const std::string &)
Definition: LikelihoodMultiDTool.cxx:421
Analysis::LikelihoodMultiDTool::m_nhis2D
int m_nhis2D
Definition: LikelihoodMultiDTool.h:94
Analysis::Slice
Definition: LikelihoodComponents.h:32
Analysis::LikelihoodMultiDTool::m_WriteSmoothedHistos
bool m_WriteSmoothedHistos
Definition: LikelihoodMultiDTool.h:99
Analysis::LikelihoodMultiDTool::m_DoInterpol
bool m_DoInterpol
Definition: LikelihoodMultiDTool.h:98
Analysis::LikelihoodMultiDTool::m_nbHypotheses
unsigned int m_nbHypotheses
Definition: LikelihoodMultiDTool.h:101
AthAlgTool
Definition: AthAlgTool.h:26
Analysis::LikelihoodMultiDTool::m_lhVariableValues
std::vector< Slice > m_lhVariableValues
Contains the value of the likelihood variable with the key std::string.
Definition: LikelihoodMultiDTool.h:86
Analysis::LikelihoodMultiDTool::setLhVariableValue
void setLhVariableValue(std::vector< Slice > &value)
Definition: LikelihoodMultiDTool.cxx:251
Analysis::LikelihoodMultiDTool::m_histoLimitsMap2D
std::map< std::string, HistoLimits > m_histoLimitsMap2D
Definition: LikelihoodMultiDTool.h:77
Analysis::LikelihoodMultiDTool::resetLhVariableToUse
void resetLhVariableToUse()
Definition: LikelihoodMultiDTool.h:55
Analysis::LikelihoodMultiDTool::m_likelihoodVector
std::vector< double > m_likelihoodVector
Contains the combined likelihood for each input file category.
Definition: LikelihoodMultiDTool.h:90
LikelihoodComponents.h