ATLAS Offline Software
LikelihoodMultiDTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
8 
9 #include "GaudiKernel/DataObject.h"
10 #include "GaudiKernel/MsgStream.h"
12 #include <string>
13 #include <utility>
14 #include <vector>
15 #include <cmath>
16 
17 #include "GaudiKernel/ITHistSvc.h"
18 #include "TH1.h"
19 #include "TH2.h"
20 #include "TH3.h"
21 
22 namespace Analysis
23 {
24 
25  LikelihoodMultiDTool::LikelihoodMultiDTool(const std::string& t, const std::string& n, const IInterface* p) :
26  AthAlgTool(t,n,p),
27  m_histoSvc(0),
28  //m_allLhVariables(std::vector<std::string>()),
29  m_useTheseLhVariables(std::vector<std::string>()),
30  m_mapOfAllHistos(std::vector<std::map<std::string, TH1*>* >()),
31  m_histoLimitsMap1D(std::map< std::string, HistoLimits>() ),
32  m_histoLimitsMap2D(std::map< std::string, HistoLimits>() ),
33  m_histoLimitsMap3D(std::map< std::string, HistoLimits>() ),
34  m_lhVariableValues(std::vector<Slice> ()),
35  m_likelihoodVector(std::vector<double>()),
36  m_nhis1D(0),
37  m_nhis2D(0),
38  m_nhis3D(0),
39  m_DoInterpol(false),
40  m_WriteSmoothedHistos(false),
41  m_nbHypotheses(2),
42  m_nSmooth1D(1),
43  m_normProb(true)
44  {
45  declareInterface<LikelihoodMultiDTool>(this);
46  declareProperty("WriteSmoothedHistos", m_WriteSmoothedHistos);
47  declareProperty("NSmooth1D", m_nSmooth1D);
48  declareProperty("NormalizeProb", m_normProb);
49  }
50 
52  {
53  for (std::vector< std::map<std::string, TH1*>* >::iterator itr = m_mapOfAllHistos.begin();
54  itr != m_mapOfAllHistos.end(); ++itr) delete (*itr);
55  }
56 
58  {
59 
60  StatusCode sc = service("THistSvc", m_histoSvc);
61  if (sc.isFailure())
62  {
63  ATH_MSG_FATAL("THistSvc not found!");
64  return StatusCode::FAILURE;
65  }
66  //
67  return StatusCode::SUCCESS;
68  }
69 
71  {
72  return StatusCode::SUCCESS;
73  }
74 
76  MsgStream mlog(msgSvc(),name());
77  ATH_MSG_DEBUG("refFileName = "<<refFileName);
78  // the tmpHistoMap belongs to m_mapOfAllHistos and is deleted at the end in the destructor of LikelihoodMultiDTool()
79  std::map<std::string, TH1*>* tmpHistoMap = new std::map<std::string, TH1*>();
80  // loop on requested histos:
82  itr != m_useTheseLhVariables.end() ; ++itr ) {
83  std::string histoName = *itr;
84  std::vector<std::string> grades;
85  // parse histo name to extract words separated by _ sign:
86  // first word is the histo base name, following ones are the grades
87  // first word is jet category, 2nd is the histo base name, following ones are the grades
88  std::vector<std::string> words;
89 
90  ATH_MSG_DEBUG("decoding histoName = "<<histoName);
91 
92  const std::string delim("_");
93  std::string::size_type sPos, sEnd, sLen;
94  sPos = histoName.find_first_not_of(delim);
95  while ( sPos != std::string::npos ) {
96  sEnd = histoName.find_first_of(delim, sPos);
97  if(sEnd==std::string::npos) sEnd = histoName.length();
98  sLen = sEnd - sPos;
99  std::string word = histoName.substr(sPos,sLen);
100 
101  ATH_MSG_DEBUG(" -> word = "<<word);
102 
103  words.push_back(word);
104  sPos = histoName.find_first_not_of(delim, sEnd);
105  }
106  // first treat cases with a single or no grade:
107  int nGrade = words.size() - 2;
108  TH1* histoSum(0);
109  if(nGrade==0) {
110  ATH_MSG_DEBUG("Histo "<<histoName<<" has "<<nGrade<<" grade: direct retrieval");
111  histoSum = this->retrieveHistoFromFile(refFileName, words[1], words[0]);
112  } else if(nGrade==1) {
113  ATH_MSG_DEBUG("Histo "<<histoName<<" has "<<nGrade<<" grade: direct retrieval");
114  histoSum = this->retrieveHistoFromFile(refFileName, words[1]+"_"+words[2], words[0]);
115  } else {
116  // for many grades, get individual histos and sum them up:
117  ATH_MSG_DEBUG("Histo "<<histoName<<" has "<<nGrade<<" grades:");
118  for(int i=1;i<=nGrade;i++) {
119  ATH_MSG_DEBUG(" -> retrieving histo for grade "<<i<<" : "<<words[1]<<" "<<words[i+1]);
120  TH1* histo = this->retrieveHistoFromFile(refFileName, words[1]+"_"+words[i+1], words[0]);
121  ATH_MSG_DEBUG(" #entries= "<<histo->GetEntries());
122  if(1==i) {
123  histoSum = histo;
124  } else {
125  histoSum->Add(histo,1.);
126  }
127  ATH_MSG_DEBUG(" #entries for Sum= "<<histoSum->GetEntries());
128  }
129  }
130  if(histoSum) {
131  // smooth and normalize:
132  double norm = histoSum->Integral();
133  if(norm) {
134  if(1==histoSum->GetDimension() && m_nSmooth1D) {
135  if(histoName.find("N2T")==std::string::npos){ // do not smooth N2T
136  if(norm>10000)histoSum->Smooth(m_nSmooth1D);
137  else histoSum->Smooth((int)(m_nSmooth1D*100./sqrt(norm)));
138  }
139  }
140  if(2==histoSum->GetDimension()) {
141  int m2d=3;
142  if(refFileName.find("Bkg/")!=std::string::npos) m2d=5;
143  bool debug = mlog.level()<=MSG::DEBUG ? true : false;
144  // do not smooth Sip3D for the time being
145  if(histoName.find("Sip3D")==std::string::npos) HistoHelperRoot::smoothASH2D(dynamic_cast<TH2*>(histoSum), m2d, m2d, debug);
146  }
147  if(3==histoSum->GetDimension()) {
148  int m3d1=3;
149  int m3d3=2;
150  bool debug = mlog.level()<=MSG::DEBUG ? true : false;
151  HistoHelperRoot::smoothASH3D(dynamic_cast<TH3*>(histoSum), m3d1, m3d1, m3d3, debug);
152  }
153  norm = histoSum->Integral();
154  histoSum->Scale(1./norm);
155  } else {
156  ATH_MSG_WARNING("Histo "<<histoName<<" is empty!");
157  }
158  // store: if >= 2 grades in one histo, the histoName is the name of the first Grade
159  // Change LV 2005/10/09: if >=2 grades, insert a copy for each grade:
160  std::string namemap = histoName;
161  if (nGrade == 0) {
162  namemap = words[0]+"_"+words[1];
163  ATH_MSG_VERBOSE("Inserting as " << namemap);
164  tmpHistoMap->insert(std::pair<std::string, TH1*>(namemap, histoSum));
165  }
166  for(int i=1;i<=nGrade;i++) {
167  namemap = words[0] + "_" + words[1] + "_" + words[i+1];
168  ATH_MSG_VERBOSE("Inserting as " << namemap);
169  tmpHistoMap->insert(std::pair<std::string, TH1*>(namemap, histoSum));
170  }
171  // Also for control, store the smoothed histograms in a file
172  if (m_WriteSmoothedHistos) {
173  std::string namedir = refFileName; namedir = namedir.substr((namedir.erase(namedir.size()-1,1)).rfind('/')+1)+"/";
174  std::string namehis = histoSum->GetName();
175  ATH_MSG_VERBOSE("Registering smoothed histogram in " << namedir);
176  TH1* histoSumClone = (TH1*)histoSum->Clone();
177  StatusCode sc = m_histoSvc->regHist("/ControlFile/"+namedir+namehis, histoSumClone);
178  if (sc.isFailure()) {
179  ATH_MSG_ERROR("Cannot store the smoothed histogram in the control file !");
180  }
181  }
182  }
183  }
184  ATH_MSG_DEBUG("I found "<<m_nhis1D<<" 1D histos, "<<m_nhis2D<<" 2D histos and "<<m_nhis3D<<" 3D histos");
185  if (m_nhis1D+m_nhis2D+m_nhis3D) m_mapOfAllHistos.push_back(tmpHistoMap);
186  }
187 
189  const std::string& histoName,
190  const std::string& jetPrefix) {
191  std::string fullPath(refFileName+histoName);
192  ATH_MSG_VERBOSE("Retrieving histo: " << fullPath);
193  bool is1D = false, is2D = false, is3D = false;
194  TH1* tmphisto(0);
195  StatusCode sc = m_histoSvc->regHist(fullPath);
196  if(sc.isFailure()) {};
197  sc = m_histoSvc->getHist(fullPath,tmphisto);
198  int dim = 0;
199  if (sc.isSuccess()) {
200  dim = tmphisto->GetDimension();
201  if (dim == 1) {
202  is1D = true;
203  m_nhis1D++;
204  } else if (dim == 2) {
205  is2D = true;
206  m_nhis2D++;
207  } else if (dim == 3) {
208  is3D = true;
209  m_nhis3D++;
210  } else {
211  ATH_MSG_DEBUG("cannot retrieve histo " << fullPath << " Unexpected dimension "<< dim);
212  return tmphisto;
213  }
214  } else {
215  ATH_MSG_DEBUG("I COULD NOT RETRIEVE HISTO: " << fullPath);
216  return tmphisto;
217  }
219  unsigned int bins = (tmphisto->GetXaxis())->GetNbins();
220  double minx = (tmphisto->GetXaxis())->GetXmin();
221  double maxx = (tmphisto->GetXaxis())->GetXmax();
222  if (is1D) {
223  m_histoLimitsMap1D[jetPrefix+"_"+histoName] = HistoLimits(bins, minx, maxx);
224  ATH_MSG_DEBUG("Histo "<< jetPrefix+"_"+histoName << " properties: ");
225  ATH_MSG_DEBUG(bins <<" bins X between " << minx <<" and " << maxx);
226  } else if (is2D) {
227  unsigned int binsy = (tmphisto->GetYaxis())->GetNbins();
228  double miny = (tmphisto->GetYaxis())->GetXmin();
229  double maxy = (tmphisto->GetYaxis())->GetXmax();
230  m_histoLimitsMap2D[jetPrefix+"_"+histoName] = HistoLimits(bins, minx, maxx, binsy, miny, maxy);
231  ATH_MSG_DEBUG("Histo "<< jetPrefix+"_"+histoName << " properties: ");
232  ATH_MSG_DEBUG(bins <<" bins X between " << minx <<" and " << maxx );
233  ATH_MSG_DEBUG(binsy <<" bins Y between " << miny <<" and " << maxy);
234  } else if (is3D) {
235  unsigned int binsy = (tmphisto->GetYaxis())->GetNbins();
236  double miny = (tmphisto->GetYaxis())->GetXmin();
237  double maxy = (tmphisto->GetYaxis())->GetXmax();
238  unsigned int binsz = (tmphisto->GetZaxis())->GetNbins();
239  double minz = (tmphisto->GetZaxis())->GetXmin();
240  double maxz = (tmphisto->GetZaxis())->GetXmax();
241  m_histoLimitsMap3D[jetPrefix+"_"+histoName] = HistoLimits(bins, minx, maxx, binsy, miny, maxy, binsz, minz, maxz);
242 
243  ATH_MSG_DEBUG("Histo "<< jetPrefix+"_"+histoName << " properties: ");
244  ATH_MSG_DEBUG(bins <<" bins X between " << minx <<" and " << maxx);
245  ATH_MSG_DEBUG(binsy <<" bins Y between " << miny <<" and " << maxy);
246  ATH_MSG_DEBUG(binsz <<" bins Z between " << minz <<" and " << maxz);
247  }
248  return tmphisto;
249  }
250 
252  {
254  }
256  {
257  std::vector<Slice> tmpVector;
258  tmpVector.push_back(value);
259  setLhVariableValue(tmpVector);
260  }
261 
262 
264  m_likelihoodVector.clear();
265  std::vector<double> probDensityPerEventClassAllVariables;
266  ATH_MSG_VERBOSE("The sizes of the maps "<<m_mapOfAllHistos.size()<<" "<<m_nbHypotheses);
267  probDensityPerEventClassAllVariables.resize(m_nbHypotheses);
268  for (unsigned int i = 0 ; i < m_nbHypotheses; ++i) {
269  probDensityPerEventClassAllVariables[i]=1.;
270  }
271 
272  // Loop on Tracks in the Jet (IP) / Vertices in the Jet (SV)
273  for (unsigned int iel = 0; iel<m_lhVariableValues.size(); iel++) {
274  int ncompo = m_lhVariableValues[iel].composites.size();
275  ATH_MSG_VERBOSE("-- element "<<iel<<" "<<m_lhVariableValues[iel].name<<" has "<<ncompo<<" composites.");
276  // Loop on variables that make up the Tag, e.g.
277  // one 1D for IP2D, one 2D for IP3D, one 1D and one 2D for SV1, one 3D for SV2
278  for (int icompo = 0;icompo<ncompo;icompo++) {
279  double sum(0.);
280  std::vector<double> tmpVector;
281  std::string histName = m_lhVariableValues[iel].composites[icompo].name;
282  int idim = m_lhVariableValues[iel].composites[icompo].atoms.size();
283  ATH_MSG_VERBOSE(" -- composite "<<icompo<<" histo= "<<histName<<" dim= "<<idim);
284  if (idim == 1) {
285  const HistoLimits& histoLimits = (*(m_histoLimitsMap1D.find(histName))).second;
286  // Loop on Hypotheses : b or light for the time being...
287  for (std::vector< std::map<std::string, TH1*>* >::iterator
288  itr2 = m_mapOfAllHistos.begin() ;
289  itr2 != m_mapOfAllHistos.end() ; ++itr2 ) {
290  if( (*itr2)->find(histName) != (*itr2)->end() ) {
291  TH1* tmpHisto = (*((*itr2)->find(histName))).second;
292  double value = m_lhVariableValues[iel].composites[icompo].atoms[0].value;
293  int bin((tmpHisto->GetXaxis())->FindBin(value));
294  double tmp(0);
295  if(!m_DoInterpol) {
296  if(value>= histoLimits.xmax) bin = histoLimits.bins;
297  if(value<= histoLimits.xmin) bin = 1;
298  tmp = tmpHisto->GetBinContent(bin);
299  }
300  else {
301  tmp = HistoHelperRoot::Interpol1d(value,dynamic_cast<TH1*>(tmpHisto));
302  }
303  ATH_MSG_VERBOSE(" (1D) value= "<<value<<" bin= "<<bin<< " f = "<<tmp);
304  if (!m_normProb) {
305  double binw = tmpHisto->GetBinWidth(bin);
306  if(binw != 0.)tmp /= binw;
307  else ATH_MSG_ERROR("Bin width is 0.");
308  ATH_MSG_VERBOSE(" (1D) value= "<<value<<" bin= "<<bin<<" binw= "<<binw<< " f = "<<tmp);
309  }
310  tmpVector.push_back(tmp);
311  sum += tmp;
312  }
313  }
314  } else if (idim == 2) {
315  const HistoLimits& histoLimits = (*(m_histoLimitsMap2D.find(histName))).second;
316  for (std::vector< std::map<std::string, TH1*>* >::iterator
317  itr2 = m_mapOfAllHistos.begin() ;
318  itr2 != m_mapOfAllHistos.end() ; ++itr2 ) {
319  if( (*itr2)->find(histName) != (*itr2)->end() ) {
320  TH1* tmpHisto = (*((*itr2)->find(histName))).second;
321  ATH_MSG_VERBOSE("tmpHisto="<<tmpHisto);
322  double valuex = m_lhVariableValues[iel].composites[icompo].atoms[0].value;
323  double valuey = m_lhVariableValues[iel].composites[icompo].atoms[1].value;
324  int binx((tmpHisto->GetXaxis())->FindBin(valuex));
325  int biny((tmpHisto->GetYaxis())->FindBin(valuey));
326  if(valuex>= histoLimits.xmax) binx = histoLimits.bins;
327  if(valuex<= histoLimits.xmin) binx = 1;
328  if(valuey>= histoLimits.ymax) biny = histoLimits.binsy;
329  if(valuey<= histoLimits.ymin) biny = 1;
330  double tmp(tmpHisto->GetBinContent(binx,biny));
331  ATH_MSG_VERBOSE(" (2D) value= "<<valuex<<" "<<valuey<<" bin= "<<binx<<" "<<biny<< " f = "<<tmp);
332  if (!m_normProb) {
333  double binw = tmpHisto->GetXaxis()->GetBinWidth(binx) * tmpHisto->GetYaxis()->GetBinWidth(biny);
334  if(binw != 0.)tmp /= binw;
335  else ATH_MSG_ERROR("Bin area is 0.");
336  ATH_MSG_VERBOSE(" (2D) value= "<<valuex<<" "<<valuey<<" bin= "<<binx<<" "<<biny<<" binw= "<<binw<< " f = "<<tmp);
337  }
338  tmpVector.push_back(tmp);
339  sum += tmp;
340  }
341  }
342  } else if (idim == 3) {
343  const HistoLimits& histoLimits = (*(m_histoLimitsMap3D.find(histName))).second;
344  for (std::vector< std::map<std::string, TH1*>* >::iterator
345  itr2 = m_mapOfAllHistos.begin() ;
346  itr2 != m_mapOfAllHistos.end() ; ++itr2 ) {
347  if( (*itr2)->find(histName) != (*itr2)->end() ) {
348  TH1* tmpHisto = (*((*itr2)->find(histName))).second;
349  double valuex = m_lhVariableValues[iel].composites[icompo].atoms[0].value;
350  double valuey = m_lhVariableValues[iel].composites[icompo].atoms[1].value;
351  double valuez = m_lhVariableValues[iel].composites[icompo].atoms[2].value;
352  int binx((tmpHisto->GetXaxis())->FindBin(valuex));
353  int biny((tmpHisto->GetYaxis())->FindBin(valuey));
354  int binz((tmpHisto->GetZaxis())->FindBin(valuez));
355  if(valuex>= histoLimits.xmax) binx = histoLimits.bins;
356  if(valuex<= histoLimits.xmin) binx = 1;
357  if(valuey>= histoLimits.ymax) biny = histoLimits.binsy;
358  if(valuey<= histoLimits.ymin) biny = 1;
359  if(valuez>= histoLimits.zmax) binz = histoLimits.binsz;
360  if(valuez<= histoLimits.zmin) binz = 1;
361  double tmpNoInt(tmpHisto->GetBinContent(binx,biny,binz));
362  double tmp(HistoHelperRoot::Interpol3d(valuex,valuey,valuez,dynamic_cast<TH3*>(tmpHisto)));
363  ATH_MSG_VERBOSE(" (3D) value= "<<valuex<<" "<<valuey<<" "<<valuez <<" bin= "<<binx<<" "<<biny<<" "<<binz<<" binContent = "<<tmp<< " binContentNoInt = "<< tmpNoInt);
364  if (!m_normProb) {
365  double binw =
366  tmpHisto->GetXaxis()->GetBinWidth(binx) *
367  tmpHisto->GetYaxis()->GetBinWidth(biny) *
368  tmpHisto->GetZaxis()->GetBinWidth(binz);
369  if(binw != 0.) {
370  tmpNoInt /= binw;
371  tmp /= binw;
372  }
373  else ATH_MSG_ERROR("Bin volume is 0.");
374  ATH_MSG_VERBOSE(" (3D) value= "<<valuex<<" "<<valuey<<" "<<valuez <<" bin= "<<binx<<" "<<biny<<" "<<binz<<" binw= "<<binw<<" binContent = "<<tmp<< " binContentNoInt = "<< tmpNoInt);
375  }
376  if (m_DoInterpol) {
377  tmpVector.push_back(tmp);
378  sum += tmp;
379  } else {
380  tmpVector.push_back(tmpNoInt);
381  sum += tmpNoInt;
382  }
383  }
384  }
385  } else {
386  ATH_MSG_WARNING("No more that 3D pdf for the time being !");
387  }
388  unsigned int classCount(0);
389  for (std::vector<double>::iterator itr3 = tmpVector.begin(); itr3 != tmpVector.end(); ++itr3) {
390  if (sum != 0.) {
391  ATH_MSG_VERBOSE("pb + pu = "<<sum);
392  double p = (*itr3);
393  if (m_normProb) p /= sum;
394  probDensityPerEventClassAllVariables[classCount] *= p;
395  } else {
396  ATH_MSG_WARNING("Empty bins for all hypothesis... The discriminating variables are not taken into account in this jet");
397  ATH_MSG_WARNING("Check your inputs");
398  }
399  ATH_MSG_VERBOSE(" probDensity= "<<probDensityPerEventClassAllVariables[classCount]<<" ic= "<<classCount);
400  classCount++;
401  }
402  ATH_MSG_VERBOSE(" Final probDensity= "<<probDensityPerEventClassAllVariables);
403  }
404  }
405  ATH_MSG_VERBOSE(" Ending ...");
406  m_likelihoodVector=probDensityPerEventClassAllVariables;
407  return m_likelihoodVector;
408  }
409 
410  const std::vector<double>& LikelihoodMultiDTool::tagLikelihood()
411  {
412  return m_likelihoodVector;
413  }
414 
416  {
417  unsigned int num = m_mapOfAllHistos.size();
418  ATH_MSG_INFO("Currently I hold histos of " << num << " input files");
419  }
420 
421  double LikelihoodMultiDTool::getEff(const std::string& refFileName, const std::string& histoName, const std::string& mode)
422  {
423  //
424  StatusCode scs = SUCCESS, scg = SUCCESS;
425  std::string fullPathSel(refFileName+histoName+"Eff"+mode);
426  std::string fullPathGen(refFileName+histoName+"Norm"+mode);
427  ATH_MSG_VERBOSE("Retrieving histo for efficiency computation: " << fullPathSel);
428  ATH_MSG_VERBOSE("Retrieving histo for efficiency computation: " << fullPathGen);
429  TH1 *sel(0), *gen(0);
430  scs = m_histoSvc->regHist(fullPathSel);
431  scg = m_histoSvc->regHist(fullPathGen);
432  if (scs.isSuccess() && scg.isSuccess()) {
433  scs = m_histoSvc->getHist(fullPathSel,sel);
434  scg = m_histoSvc->getHist(fullPathGen,gen);
435  if (sel && gen && scs.isSuccess() && scg.isSuccess()) {
436  double nsel = sel->GetEntries(); // I need also the over/under flow for the efficiency !!!
437  double ngen = gen->GetEntries();
438  if (ngen != 0) {
439  ATH_MSG_VERBOSE("N RecSvx = " << nsel << " in a total of "<< ngen << " jets.");
440  return nsel/ngen;
441  } else {
442  ATH_MSG_ERROR("Pb in computing Svx efficiency " << nsel << " "<< ngen);
443  return 0.;
444  }
445  }
446  } else {
447  // already there...
448  scs = m_histoSvc->getHist(fullPathSel,sel);
449  scg = m_histoSvc->getHist(fullPathGen,gen);
450  if (sel && gen && scs.isSuccess() && scg.isSuccess()) {
451  double nsel = sel->GetEntries();
452  double ngen = gen->GetEntries();
453  if (ngen != 0) {
454  ATH_MSG_VERBOSE("N RecSvx = " << nsel << " in a total of "<< ngen << " jets.");
455  return nsel/ngen;
456  } else {
457  ATH_MSG_ERROR("Pb in computing Svx efficiency " << nsel << " "<< ngen);
458  return 0.;
459  }
460  }
461  }
462  ATH_MSG_ERROR("Pb in computing Svx efficiency ");
463  return 0.;
464  }
465 
467  m_useTheseLhVariables.push_back(var);
468  }
469 
470 }
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
beamspotnt.var
var
Definition: bin/beamspotnt.py:1394
Analysis::LikelihoodMultiDTool::m_normProb
bool m_normProb
Definition: LikelihoodMultiDTool.h:105
PlotCalibFromCool.norm
norm
Definition: PlotCalibFromCool.py:100
HistoHelperRoot.h
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
yodamerge_tmp.dim
dim
Definition: yodamerge_tmp.py:239
Analysis::LikelihoodMultiDTool::tagLikelihood
const std::vector< double > & tagLikelihood()
Definition: LikelihoodMultiDTool.cxx:410
Analysis::HistoLimits
Definition: HistoLimits.h:19
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
AddEmptyComponent.histName
string histName
Definition: AddEmptyComponent.py:64
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Analysis::HistoHelperRoot::Interpol1d
static double Interpol1d(double, TH1 *)
Definition: HistoHelperRoot.cxx:545
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::HistoHelperRoot::smoothASH3D
static void smoothASH3D(TH3 *, int m1=3, int m2=3, int m3=2, bool debug=false)
Definition: HistoHelperRoot.cxx:324
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
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::HistoLimits::zmin
double zmin
Definition: HistoLimits.h:36
CscCalibQuery.fullPath
string fullPath
Definition: CscCalibQuery.py:360
Analysis::LikelihoodMultiDTool::initialize
StatusCode initialize()
AlgTool initailize method.
Definition: LikelihoodMultiDTool.cxx:57
Analysis::HistoLimits::binsz
unsigned int binsz
Definition: HistoLimits.h:35
Analysis::HistoHelperRoot::smoothASH2D
static void smoothASH2D(TH2 *, int m1=3, int m2=3, bool debug=false)
Definition: HistoHelperRoot.cxx:190
bin
Definition: BinsDiffFromStripMedian.h:43
Analysis::HistoLimits::xmin
double xmin
Definition: HistoLimits.h:32
Analysis::HistoLimits::ymin
double ymin
Definition: HistoLimits.h:34
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
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
LikelihoodMultiDTool.h
master.gen
gen
Definition: master.py:32
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
Analysis::HistoLimits::bins
unsigned int bins
Definition: HistoLimits.h:30
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
Analysis::LikelihoodMultiDTool::m_nhis1D
int m_nhis1D
for debugging:
Definition: LikelihoodMultiDTool.h:93
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
convertTimingResiduals.sum
sum
Definition: convertTimingResiduals.py:55
python.InDetPriVxFinderConfig.mlog
mlog
Definition: InDetPriVxFinderConfig.py:139
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
lumiFormat.i
int i
Definition: lumiFormat.py:85
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
vector
Definition: MultiHisto.h:13
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
sel
sel
Definition: SUSYToolsTester.cxx:97
Analysis::LikelihoodMultiDTool::calculateLikelihood
std::vector< double > calculateLikelihood()
Definition: LikelihoodMultiDTool.cxx:263
Preparation.mode
mode
Definition: Preparation.py:94
Analysis::LikelihoodMultiDTool::~LikelihoodMultiDTool
virtual ~LikelihoodMultiDTool()
Definition: LikelihoodMultiDTool.cxx:51
plotting.yearwise_luminosity_vs_mu.bins
bins
Definition: yearwise_luminosity_vs_mu.py:30
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
Analysis::LikelihoodMultiDTool::m_nhis3D
int m_nhis3D
Definition: LikelihoodMultiDTool.h:95
Analysis::LikelihoodMultiDTool::m_histoLimitsMap3D
std::map< std::string, HistoLimits > m_histoLimitsMap3D
Definition: LikelihoodMultiDTool.h:78
Analysis::HistoLimits::xmax
double xmax
Definition: HistoLimits.h:32
Analysis::HistoHelperRoot::Interpol3d
static double Interpol3d(double, double, double, TH3 *)
Definition: HistoHelperRoot.cxx:615
Analysis::LikelihoodMultiDTool::addLhVariableToUse
void addLhVariableToUse(const std::string &)
Definition: LikelihoodMultiDTool.cxx:466
trigbs_pickEvents.num
num
Definition: trigbs_pickEvents.py:76
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
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
plotBeamSpotVxVal.bin
int bin
Definition: plotBeamSpotVxVal.py:83
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::HistoLimits::binsy
unsigned int binsy
Definition: HistoLimits.h:33
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
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
DEBUG
#define DEBUG
Definition: page_access.h:11
JetTagCalibConfig.grades
grades
Definition: JetTagCalibConfig.py:19
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::HistoLimits::ymax
double ymax
Definition: HistoLimits.h:34
Analysis::LikelihoodMultiDTool::m_nbHypotheses
unsigned int m_nbHypotheses
Definition: LikelihoodMultiDTool.h:101
AthAlgTool
Definition: AthAlgTool.h:26
plotBeamSpotCompare.histo
histo
Definition: plotBeamSpotCompare.py:415
checkFileSG.words
words
Definition: checkFileSG.py:76
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::HistoLimits::zmax
double zmax
Definition: HistoLimits.h:36
Analysis::LikelihoodMultiDTool::m_histoLimitsMap2D
std::map< std::string, HistoLimits > m_histoLimitsMap2D
Definition: LikelihoodMultiDTool.h:77
Analysis::LikelihoodMultiDTool::m_likelihoodVector
std::vector< double > m_likelihoodVector
Contains the combined likelihood for each input file category.
Definition: LikelihoodMultiDTool.h:90