ATLAS Offline Software
MSVtxPlotComparison.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "MSVtxPlotComparison.h"
6 #include "PlotAnnotations.h"
7 
9 
10 MSVtxPlotComparison::MSVtxPlotComparison(const std::vector<std::string> &datapaths, const std::vector<std::string> &labels, const std::string &pltdir) :
11  m_datapaths(datapaths), m_labels(labels), m_makeRatioPlots(m_datapaths.size()==2),
12  m_plotdir(pltdir),
13  m_plotdir_truthVtx(m_plotdir+"truthVtx/"),
14  m_plotdir_recoVtx(m_plotdir+"recoVtx/"),
15  m_plotdir_recoVtxHits(m_plotdir_recoVtx+"hits/"),
16  m_plotdir_vtxResiduals(m_plotdir+"vtxResiduals/"),
17  m_plotdir_inputObjects(m_plotdir+"inputObjects/"),
18  m_plotdir_vtxEfficiency(m_plotdir+"vtxEfficiency/"),
19  m_plotdir_vtxFakeRate(m_plotdir+"vtxFakeRate/")
20  {}
21 
22 
24 
25 
27  // Generates a series of comparison plots, stored in the output directory `m_plotdir` as a root file and a pdf figure.
28  // When only two data paths are passed, a ratio plot is also drawn.
29 
30  setup();
31  setPlotStyle();
32 
33  // get list of histogram keys from one of the input files
34  std::unique_ptr<TFile> file_0(TFile::Open(TString(m_datapaths[0]+"Histograms.root"), "read"));
35  TIter keyIter(file_0->GetListOfKeys());
36 
37  // loop over the keys and call the appropriate comparison maker
38  TKey* key{nullptr};
39  while ((key = (TKey*)keyIter())) {
40  TClass *objectClass = gROOT->GetClass(key->GetClassName());
41  if (ignorePlot(key)) continue;
42  if (isTH1(objectClass)) makeTH1Comparison(key);
43  if (isTEfficiency(objectClass)) makeTEfficiencyComparison(key);
44  }
45 
46  m_output_file->Write();
47  m_output_file->Close();
48 
49  return;
50 }
51 
52 
54  // set up the output directories, the output root file, and canvas.
55  gSystem->mkdir(m_plotdir, kTRUE);
56  gSystem->mkdir(m_plotdir_truthVtx, kTRUE);
57  gSystem->mkdir(m_plotdir_recoVtx, kTRUE);
58  gSystem->mkdir(m_plotdir_recoVtxHits, kTRUE);
59  gSystem->mkdir(m_plotdir_vtxResiduals, kTRUE);
60  gSystem->mkdir(m_plotdir_inputObjects, kTRUE);
61  gSystem->mkdir(m_plotdir_vtxEfficiency, kTRUE);
62  gSystem->mkdir(m_plotdir_vtxFakeRate, kTRUE);
63  m_c = std::make_unique<TCanvas>();
64  m_output_file = std::make_unique<TFile>(m_plotdir+"Histograms.root", "recreate");
65 
66  return;
67 }
68 
69 
71  gROOT->SetStyle("ATLAS");
72  TStyle* plotStyle = gROOT->GetStyle("ATLAS");
73  plotStyle->SetOptTitle(0);
74  plotStyle->SetHistLineWidth(1.);
75  plotStyle->cd();
76  gROOT->ForceStyle();
77 
78  return;
79 }
80 
81 
82 // Comparison functions for TH1 //
83 
85  // Finds the name and axis labels for the passed key which is assumed to belong to a TH1 object
86  // Then calls the TH1 comparison maker to produce the plots
87 
88  TH1 *h = static_cast<TH1*>(key->ReadObj());
89 
90  std::unique_ptr<PlotInfo<THStack>> hstackInfo = getTHStackPlotInfo(h);
91  drawTHStack(hstackInfo);
92 
93  return;
94 }
95 
96 
97 std::unique_ptr<MSVtxPlotComparison::PlotInfo<THStack>> MSVtxPlotComparison::getTHStackPlotInfo(const TH1* h){
98  // Extracts the histogram with `name` form the Histograms.root files for each passed data path and adds them to a THStack object.
99 
100  const TString name(h->GetName());
101  TString xlabel(h->GetXaxis()->GetTitle());
102  TString ylabel(h->GetYaxis()->GetTitle());
103 
104  // create a named THStack and the legend
105  auto hstack = std::make_unique<THStack>(name, name);
106  TLegend* legend = makeLegend();
107  legend->SetNColumns(2);
108 
109  // loop on TH1 histograms and add them to the THStack and legend
110  double maxy{0.};
111  for (unsigned int i=0; i<m_datapaths.size(); ++i){
112  // retrieve histogram and set drawing style
113  std::unique_ptr<TFile> file(TFile::Open(TString(m_datapaths[i]+"Histograms.root"), "read"));
114  TH1* h = static_cast<TH1*>(file->Get(name));
115  h->SetDirectory(0); // histogram doesn't belong to any directory now to avoid clashing memory management with the smart pointer file
116  h->SetLineColor(m_colors[i]);
117  h->SetLineStyle(1);
118  // add to THStack and legend
119  hstack->Add(h);
120  legend->AddEntry(h, m_labels[i].c_str(), "L");
121  // update maximal y value
122  maxy = h->GetMaximum() > maxy ? h->GetMaximum() : maxy;
123  }
124 
125  return std::make_unique<PlotInfo<THStack>>(std::move(hstack), legend, maxy, xlabel, ylabel);
126 }
127 
128 
129 void MSVtxPlotComparison::drawTHStack(std::unique_ptr<PlotInfo<THStack>> &hstackInfo){
130  // The results are saved to the output directory in the `m_output_file` and as a pdf figure.
131  m_output_file->cd(); // needed here as previously histograms are loaded from input files
132  if (m_makeRatioPlots) drawTHStackRatioPlot(hstackInfo);
133  else drawTHStackPlot(hstackInfo);
134 
135  m_c->SaveAs(getTHStackplotpath(TString(hstackInfo->plot->GetName()))+".pdf");
136  m_c->Clear();
137 
138  return;
139 }
140 
141 
142 void MSVtxPlotComparison::drawTHStackPlot(std::unique_ptr<PlotInfo<THStack>> &hstackInfo){
143  // Draws the THStack plot to the currently active pad and writes it to the m_output_file root file.
144  // adjust maximum for sufficient space for annotations and draw annotations
145 
146  // required to set a new pad for the full canvas in order for style settings to apply
148 
149  hstackInfo->plot->Draw("nostack");
150  // adjust maximum for sufficient space for annotations and draw annotations
151  const TString name(hstackInfo->plot->GetName());
152  double maxy_factor{1.4};
153 // TODO: fix this
154  // if (name.Contains("log")){
155  // gPad->SetLogy();
156  // maxy_factor = 4;
157  // }
158  hstackInfo->plot->SetMaximum(maxy_factor*hstackInfo->maxy);
159  // axis labels
160  hstackInfo->plot->GetXaxis()->SetTitle(hstackInfo->xlabel);
161  hstackInfo->plot->GetYaxis()->SetTitle(hstackInfo->ylabel);
162  // annotations
163  hstackInfo->legend->Draw();
165  drawATLASlabel("Simulation Internal");
166 
167  hstackInfo->plot->Write();
168 // TODO: adjust this when the above is fixed
169  // gPad->SetLogy(0); // reset log scale for next plots
170 
171  return;
172 }
173 
174 
176  // Creates two pads to draw the THStack plot and its ratio to.
177  // The ratio is formed as the second/first histograms in the THStack.
178 
179  // create pads
180  double x1{0.}, x2{1.};
181  double y1{0.3}, y2{1.};
182  double gap{0.05};
183  TPad* padPlot = new TPad("padPlot", "padPlot", x1, y1, x2, y2);
184  TPad* padRatio = new TPad("padRatio", "padRatio", x1, 0., x2, y1-gap);
185  double axisRescaling = (y2-y1)/(y1-gap);
186 
187  // draw THStack in upper pad
188  padPlot->SetBottomMargin(0);
189  padPlot->Draw();
190  padPlot->cd();
191  TString xlabel_original = hstackInfo->xlabel;
192  hstackInfo->xlabel = TString("");
193  drawTHStackPlot(hstackInfo);
194  // remove first y axis label for the upper plot as it gets cut off
195  hstackInfo->plot->GetYaxis()->ChangeLabel(1, -1, -1, -1, -1, -1, " ");
196  // compute and draw the ratio plot
197  m_c->cd();
198  padRatio->SetTopMargin(0);
199  padRatio->SetBottomMargin(0.45);
200  padRatio->Draw();
201  padRatio->cd();
202 
203  std::vector<TH1*> hists{};
204  for(TObject *obj : *(hstackInfo->plot->GetHists())) hists.push_back((TH1*)obj);
205  TGraphAsymmErrors* ratio = getRatio(hists[1], hists[0]);
206  TGraphAsymmErrors* denomErrNorm = getNormalisedGraph(new TGraphAsymmErrors(hists[0]));
207  drawRatio(ratio, denomErrNorm, xlabel_original, hstackInfo->plot->GetXaxis(), hstackInfo->plot->GetYaxis(), axisRescaling);
208 
209  return;
210 }
211 
212 
213 const TString MSVtxPlotComparison::getTHStackplotpath(const TString &name){
214  // choose plot path based on the name
215  TString plotpath{};
216  if (name.Contains("truth")) plotpath = m_plotdir_truthVtx+name;
217  // else if (name.Contains("reco")) plotpath = m_plotdir_recoVtx+name;
218  else if (name.Contains("MDT") || name.Contains("RPC") || name.Contains("TGC")) plotpath = m_plotdir_recoVtxHits+name;
219  else if (name.Contains("delta")) plotpath = m_plotdir_vtxResiduals+name;
220  else if (name.Contains("obj")) plotpath = m_plotdir_inputObjects+name;
221  else plotpath = m_plotdir_recoVtx+name;
222 
223  return plotpath;
224 }
225 
226 
227 // Comparison functions for TEfficiency //
228 
230  // Finds the name and axis labels for the passed key which is assumed to belong to a TEfficiency object
231  // Then calls the TEfficiency comparison maker to produce the plots
232 
233  TEfficiency *h = static_cast<TEfficiency*>(key->ReadObj());
234 
235  std::unique_ptr<PlotInfo<TMultiGraph>> mgInfo = getTMultigraphPlotInfo(h);
236  drawTMultigraph(mgInfo);
237 
238  return;
239 }
240 
241 
242 std::unique_ptr<MSVtxPlotComparison::PlotInfo<TMultiGraph>> MSVtxPlotComparison::getTMultigraphPlotInfo(TEfficiency *h){
243  // Extracts the histogram with `name` form the Histograms.root files for each passed data path to draw and adds them to a TMultiGraph object.
244 
245  const TString name(h->GetName());
246  h->Draw();
247  gPad->Update();
248  const TString xlabel(h->GetPaintedGraph()->GetXaxis()->GetTitle());
249  const TString ylabel(h->GetPaintedGraph()->GetYaxis()->GetTitle());
250  m_c->Clear(); // needed to clear the canvas after drawing the TEfficiency object
251 
252  // create a named multigraph and the legend
253  auto mg = std::make_unique<TMultiGraph>(name, name);
254  TLegend* legend = makeLegend();
255  legend->SetNColumns(2);
256 
257  // loop on histograms and add them to the multigraph and legend
258  double maxy{0.};
259  for (unsigned int i=0; i<m_datapaths.size(); ++i){
260  // retrieve histogram and set drawing style
261  std::unique_ptr<TFile> file(TFile::Open(TString(m_datapaths[i]+"Histograms.root"), "read"));
262  TEfficiency* h = static_cast<TEfficiency*>(file->Get(name));
263  h->SetLineColor(m_colors[i]);
264  h->SetLineStyle(1);
265  h->SetMarkerColor(m_colors[i]);
266  h->SetMarkerStyle(m_markers[i]);
267  h->SetMarkerSize(0.5);
268  // add to multigraph and legend
269  h->Draw();
270  gPad->Update();
271  TGraphAsymmErrors* g = h->GetPaintedGraph();
272  mg->Add(g, "PEZ"); // draw markers and no vertical lines on the error bars
273  legend->AddEntry(h, m_labels[i].c_str(), "PEL"); // draw marker, vertical error bar and line in legend
274  maxy = getMaxy(g, maxy);
275  m_c->Clear(); // needed to clear the canvas after drawing the TEfficiency object
276  }
277 
278  return std::make_unique<PlotInfo<TMultiGraph>>(std::move(mg), legend, maxy, xlabel, ylabel);
279 }
280 
281 
283  // The results are saved to the output directory in the `m_output_file` and as a pdf figure.
284  m_output_file->cd();
286  else drawTMultigraphPlot(mgInfo);
287 
288  m_c->SaveAs(getTMultigraphplotpath(TString(mgInfo->plot->GetName()))+".pdf");
289  m_c->Clear();
290  return;
291 }
292 
293 
295  // Draws the TMultiGraph plot to the currently active pad and writes it to the `m_output_file` root file.
296 
297  // required to set a new pad for the full canvas in order for style settings to apply
299 
300  mgInfo->plot->Draw("AP");
301  // adjust maximum for sufficient space for annotations and draw annotations
302  mgInfo->plot->GetYaxis()->SetRangeUser(0, 1.4*mgInfo->maxy);
303  // axis labels
304  mgInfo->plot->GetXaxis()->SetTitle(mgInfo->xlabel);
305  mgInfo->plot->GetYaxis()->SetTitle(mgInfo->ylabel);
306  // annotations
307  mgInfo->legend->Draw();
308  const TString name(mgInfo->plot->GetName());
309  if (name.Contains("_Lxy_")) drawDetectorBoundaryLines("Lxy", 1.1*mgInfo->maxy);
310  if (name.Contains("_z_")) drawDetectorBoundaryLines("z", 1.1*mgInfo->maxy);
312  drawATLASlabel("Simulation Internal");
313 
314  mgInfo->plot->Write();
315 
316  return;
317 }
318 
319 
321  // Creates two pads to draw the TMultiGraph plot and its ratio to.
322  // The ratio is formed between the first and second graph in the TMultiGraph.
323 
324  // create pads
325  double x1{0.}, x2{1.};
326  double y1{0.3}, y2{1.};
327  double gap{0.05};
328  TPad* padPlot = new TPad("padPlot", "padPlot", x1, y1, x2, y2);
329  TPad* padRatio = new TPad("padRatio", "padRatio", x1, 0., x2, y1-gap);
330  double axisRescaling = (y2-y1)/(y1-gap);
331 
332  // draw TMultiGraph in upper pad
333  padPlot->SetBottomMargin(0);
334  padPlot->Draw();
335  padPlot->cd();
336  TString xlabel_original = mgInfo->xlabel;
337  mgInfo->xlabel = TString("");
338  drawTMultigraphPlot(mgInfo);
339  // remove first y axis label for the upper plot as it gets cut off
340  mgInfo->plot->GetYaxis()->ChangeLabel(1, -1, -1, -1, -1, -1, " ");
341 
342  // compute and draw the ratio plot
343  m_c->cd();
344  padRatio->SetTopMargin(0);
345  padRatio->SetBottomMargin(0.45);
346  padRatio->Draw();
347  padRatio->cd();
348 
349  std::vector<TGraphAsymmErrors*> efficiencies;
350  for(TObject *obj : *(mgInfo->plot->GetListOfGraphs())) efficiencies.push_back((TGraphAsymmErrors*)obj);
351  TGraphAsymmErrors* ratio = getRatio(efficiencies[1], efficiencies[0]);
352  TGraphAsymmErrors* denomErrNorm = getNormalisedGraph(efficiencies[0]);
353  drawRatio(ratio, denomErrNorm, xlabel_original, mgInfo->plot->GetXaxis(), mgInfo->plot->GetYaxis(), axisRescaling);
354 
355  return;
356 }
357 
358 
359 const TString MSVtxPlotComparison::getTMultigraphplotpath(const TString &name){
360  // choose plot path based on the name
361  TString plotpath{};
362  if (name.Contains("eff_")) plotpath = m_plotdir_vtxEfficiency+name;
363  else if (name.Contains("frate_")) plotpath = m_plotdir_vtxFakeRate+name;
364  else plotpath = m_plotdir_recoVtx+name;
365 
366  return plotpath;
367 }
368 
369 
370 // ratio computation and drawing functions //
371 
372 TGraphAsymmErrors* MSVtxPlotComparison::getRatio(const TH1* num, const TH1* denom){
373  // returns ratio of two TH1 histograms as a TGraphAsymmErrors object by treating the histograms as two Poisson means.
374 // TODO: suppress warnings from TGraphAsymmErrors::Divide
375  TGraphAsymmErrors* ratio = new TGraphAsymmErrors(num, denom, "pois"); // prints warning when denom is zero, in which case no ratio is computed
376 
377  return ratio;
378 }
379 
380 
381 TGraphAsymmErrors* MSVtxPlotComparison::getRatio(const TGraphAsymmErrors* num, const TGraphAsymmErrors* denom){
382  // returns ratio of two TEfficiency histograms as a TGraphAsymmErrors object with manual ratio and error computation.
383  TGraphAsymmErrors* ratio = new TGraphAsymmErrors();
384 
385  // can only compute the ratio for points where the denominator is non-zero and denominator and numerator values exist
386  for (Int_t i=0; i<denom->GetN(); ++i){
387  if (denom->GetPointY(i) <= 0.0) continue;
388  Int_t num_idx = getPointIdx(num, denom->GetPointX(i));
389  if (num_idx < 0) continue;
390 
391  Double_t ratio_val = num->GetPointY(num_idx)/denom->GetPointY(i);
392  Double_t error_low = num->GetErrorYlow(num_idx)/denom->GetPointY(i);
393  Double_t error_up = num->GetErrorYhigh(num_idx)/denom->GetPointY(i);
394 
395  ratio->AddPoint(denom->GetPointX(i), ratio_val);
396  ratio->SetPointError(ratio->GetN()-1, denom->GetErrorXlow(i), denom->GetErrorXhigh(i), error_low, error_up);
397  }
398 
399  return ratio;
400 }
401 
402 
403 void MSVtxPlotComparison::drawRatio(TGraphAsymmErrors* ratio, TGraphAsymmErrors* denomErrNorm, const TString &xlabel, const TAxis* plotXaxis, const TAxis* plotYaxis, double axisRescaling){
404  // Draw the ratio plot to the currently active pad.
405  // The error on the ratio is assumed to be numeratorError/denominator while denominatorError/denominator is shows as a shaded band around a ratio of 1.
406 
407  TMultiGraph* mg = new TMultiGraph();
408 
409  // add ratio
410  ratio->SetLineColor(m_colors[1]);
411  ratio->SetMarkerColor(m_colors[1]);
412  ratio->SetMarkerStyle(m_markers[1]);
413  ratio->SetMarkerSize(0.5);
414  mg->Add(ratio, "PEZ"); // draw markers and no vertical lines on the error bars
415  // add error band for the denominator error
416  denomErrNorm->SetFillColorAlpha(m_colors[0], 0.3);
417  denomErrNorm->SetFillStyle(1001);
418  mg->Add(denomErrNorm, "2");
419 
420  mg->Draw("AP");
421 
422  // axis formatting: scale to pad size
423  // import x axis attributes and limits from the original plot
424  mg->GetXaxis()->ImportAttributes(plotXaxis);
425  mg->GetXaxis()->SetLimits(plotXaxis->GetXmin(), plotXaxis->GetXmax());
426  mg->GetXaxis()->SetTitle(xlabel);
427  mg->GetXaxis()->SetTitleSize(axisRescaling*plotXaxis->GetTitleSize());
428  mg->GetXaxis()->SetTickLength(axisRescaling*plotXaxis->GetTickLength());
429  mg->GetXaxis()->SetLabelSize(axisRescaling*plotXaxis->GetLabelSize());
430 
431  mg->GetYaxis()->SetRangeUser(-0.2, 2.2);
432  mg->GetYaxis()->SetTitle(TString::Format("#frac{%s}{%s}", m_labels[1].c_str(), m_labels[0].c_str()).Data());
433  mg->GetYaxis()->SetTitleOffset(0.5);
434  mg->GetYaxis()->SetTitleSize(axisRescaling*plotYaxis->GetTitleSize());
435  mg->GetYaxis()->SetLabelSize(axisRescaling*plotYaxis->GetLabelSize());
436 
437  // draw horizontal lines
438  const std::vector<double> vlines{1.};
439  for (double height : vlines) {
440  TLine* l = new TLine(mg->GetXaxis()->GetXmin(), height, mg->GetXaxis()->GetXmax(), height);
441  l->SetLineColor(m_colors[8]);
442  l->SetLineStyle(7);
443  l->Draw();
444  }
445 
446  return;
447 }
448 
449 
450 // helper functions //
451 
452 Bool_t MSVtxPlotComparison::isTH1(const TClass *objectClass){
453  // returns true if the object class is a TH1 object
454  Bool_t isfromTH1 = objectClass->InheritsFrom("TH1");
455  Bool_t isNotTH2 = !objectClass->InheritsFrom("TH2");
456  Bool_t isNotTHStack = !objectClass->InheritsFrom("THStack");
457  return isfromTH1 && isNotTH2 && isNotTHStack;
458 }
459 
460 
461 Bool_t MSVtxPlotComparison::isTEfficiency(const TClass *objectClass){
462  // returns true if the object class is a TEfficiency object
463  return objectClass->InheritsFrom("TEfficiency");
464 }
465 
466 
468  // Specifies conditions to ignore certain plots:
469  // stacked plots for efficiency numerator, denominator
470  TObject *h = key->ReadObj();
471  const TString name(h->GetName());
472 
473  return name.Contains("Reco") || name.Contains("Truth") || name.Contains("stack");
474 }
475 
476 
478  // creates and moves to a single pad for the full canvas
479  TPad *pad = new TPad("fullCanvas", "fullCanvas", 0, 0, 1, 1);
480  pad->Draw();
481  pad->cd();
482 
483  return;
484 }
485 
486 
487 Int_t MSVtxPlotComparison::getPointIdx(const TGraphAsymmErrors* graph, double x){
488  // Returns the index of the point in graph at position x
489  // if x is not contained in the graph, returns -1
490  Double_t *xs = graph->GetX();
491  for (Int_t i=0; i<graph->GetN(); ++i) if (std::abs(xs[i]-x) <= 1e-6) return i;
492  return -1;
493 }
494 
495 
496 TGraphAsymmErrors* MSVtxPlotComparison::getNormalisedGraph(const TGraphAsymmErrors* graph){
497  // returns a TGraphAsymmErrors object with unit y values and the y error normalized to the y value at the point.
498  TGraphAsymmErrors* graphErrNorm = new TGraphAsymmErrors();
499  for (Int_t i=0; i<graph->GetN(); ++i){
500  if (graph->GetPointY(i) == 0) continue;
501  graphErrNorm->AddPoint(graph->GetPointX(i), 1.);
502  graphErrNorm->SetPointError(i, graph->GetErrorXlow(i), graph->GetErrorXhigh(i), graph->GetErrorYlow(i)/graph->GetPointY(i), graph->GetErrorYhigh(i)/graph->GetPointY(i));
503  graphErrNorm->SetPoint(i, graph->GetPointX(i), 1.); // need to set point again to avoid ROOT overwriting the point value to (0,0)
504  }
505 
506  return graphErrNorm;
507 
508 }
MSVtxPlotComparison.h
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
sTgcDigitEffiDump.efficiencies
list efficiencies
translate the station name indices into the string staiton name
Definition: sTgcDigitEffiDump.py:23
MSVtxPlotComparison::getNormalisedGraph
TGraphAsymmErrors * getNormalisedGraph(const TGraphAsymmErrors *graph)
Definition: MSVtxPlotComparison.cxx:496
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
MSVtxPlotComparison::isTEfficiency
Bool_t isTEfficiency(const TClass *objectClass)
Definition: MSVtxPlotComparison.cxx:461
MSVtxPlotComparison::ignorePlot
Bool_t ignorePlot(TKey *key)
Definition: MSVtxPlotComparison.cxx:467
MuonVertexValidationMacroPlotAnnotations::getMaxy
double getMaxy(const TGraphAsymmErrors *graph, double current_max)
Definition: PlotAnnotations.cxx:103
MSVtxPlotComparison::drawTMultigraph
void drawTMultigraph(std::unique_ptr< PlotInfo< TMultiGraph >> &mgInfo)
Definition: MSVtxPlotComparison.cxx:282
MSVtxPlotComparison::m_c
std::unique_ptr< TCanvas > m_c
Definition: MSVtxPlotComparison.h:97
MSVtxPlotComparison::makeTH1Comparison
void makeTH1Comparison(TKey *key)
Definition: MSVtxPlotComparison.cxx:84
MSVtxPlotComparison::drawTMultigraphPlot
void drawTMultigraphPlot(std::unique_ptr< PlotInfo< TMultiGraph >> &mgInfo)
Definition: MSVtxPlotComparison.cxx:294
python.SystemOfUnits.mg
int mg
Definition: SystemOfUnits.py:171
Data
@ Data
Definition: BaseObject.h:11
MSVtxPlotComparison::makeTEfficiencyComparison
void makeTEfficiencyComparison(TKey *key)
Definition: MSVtxPlotComparison.cxx:229
StateLessPT_NewConfig.Format
Format
Definition: StateLessPT_NewConfig.py:146
plotBeamSpotCompare.x2
x2
Definition: plotBeamSpotCompare.py:218
MSVtxPlotComparison::isTH1
Bool_t isTH1(const TClass *objectClass)
Definition: MSVtxPlotComparison.cxx:452
MSVtxPlotComparison::m_plotdir_inputObjects
TString m_plotdir_inputObjects
Definition: MSVtxPlotComparison.h:93
MuonVertexValidationMacroPlotAnnotations::drawATLASlabel
void drawATLASlabel(const char *text, double x, double y, double textsize)
Definition: PlotAnnotations.cxx:23
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
MSVtxPlotComparison::~MSVtxPlotComparison
virtual ~MSVtxPlotComparison()
x
#define x
CaloSwCorrections.gap
def gap(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:212
MSVtxPlotComparison::m_plotdir_recoVtxHits
TString m_plotdir_recoVtxHits
Definition: MSVtxPlotComparison.h:91
makeTRTBarrelCans.y1
tuple y1
Definition: makeTRTBarrelCans.py:15
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
beamspotnt.labels
list labels
Definition: bin/beamspotnt.py:1447
MSVtxPlotComparison::m_labels
std::vector< std::string > m_labels
Definition: MSVtxPlotComparison.h:86
MuonVertexValidationMacroPlotAnnotations::drawDetectorRegionLabel
void drawDetectorRegionLabel(const char *name, const char *customlabel, double x, double y, double textsize)
Definition: PlotAnnotations.cxx:35
MSVtxPlotComparison::m_markers
static constexpr std::array m_markers
Definition: MSVtxPlotComparison.h:114
lumiFormat.i
int i
Definition: lumiFormat.py:85
MSVtxPlotComparison::MSVtxPlotComparison
MSVtxPlotComparison(const std::vector< std::string > &datapaths, const std::vector< std::string > &labels, const std::string &pltdir)
Definition: MSVtxPlotComparison.cxx:10
MSVtxPlotComparison::setPlotStyle
void setPlotStyle()
Definition: MSVtxPlotComparison.cxx:70
MSVtxPlotComparison::m_colors
const std::array< Int_t, 10 > m_colors
Definition: MSVtxPlotComparison.h:113
PlotAnnotations.h
h
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
MSVtxPlotComparison::m_plotdir_vtxFakeRate
TString m_plotdir_vtxFakeRate
Definition: MSVtxPlotComparison.h:95
makeTRTBarrelCans.y2
tuple y2
Definition: makeTRTBarrelCans.py:18
MSVtxPlotComparison::makeComparison
void makeComparison()
Definition: MSVtxPlotComparison.cxx:26
MuonVertexValidationMacroPlotAnnotations::drawDetectorBoundaryLines
void drawDetectorBoundaryLines(const char *bin_var, double y_max)
Definition: PlotAnnotations.cxx:84
file
TFile * file
Definition: tile_monitor.h:29
MSVtxPlotComparison::drawTHStackRatioPlot
void drawTHStackRatioPlot(std::unique_ptr< PlotInfo< THStack >> &hstackInfo)
Definition: MSVtxPlotComparison.cxx:175
MSVtxPlotComparison::setup
void setup()
Definition: MSVtxPlotComparison.cxx:53
MSVtxPlotComparison::drawTHStackPlot
void drawTHStackPlot(std::unique_ptr< PlotInfo< THStack >> &hstackInfo)
Definition: MSVtxPlotComparison.cxx:142
MakeTH3DFromTH2Ds.hists
hists
Definition: MakeTH3DFromTH2Ds.py:72
MSVtxPlotComparison::m_plotdir_vtxResiduals
TString m_plotdir_vtxResiduals
Definition: MSVtxPlotComparison.h:92
MuonVertexValidationMacroPlotAnnotations::makeLegend
TLegend * makeLegend(double lower_x, double lower_y, double upper_x, double upper_y, double textsize)
Definition: PlotAnnotations.cxx:13
MSVtxPlotComparison::m_makeRatioPlots
bool m_makeRatioPlots
Definition: MSVtxPlotComparison.h:87
MSVtxPlotComparison::getTMultigraphPlotInfo
std::unique_ptr< MSVtxPlotComparison::PlotInfo< TMultiGraph > > getTMultigraphPlotInfo(TEfficiency *h)
Definition: MSVtxPlotComparison.cxx:242
MSVtxPlotComparison::m_output_file
std::unique_ptr< TFile > m_output_file
Definition: MSVtxPlotComparison.h:96
MSVtxPlotComparison::getPointIdx
Int_t getPointIdx(const TGraphAsymmErrors *graph, double x)
Definition: MSVtxPlotComparison.cxx:487
compute_lumi.denom
denom
Definition: compute_lumi.py:76
trigbs_pickEvents.num
num
Definition: trigbs_pickEvents.py:76
MSVtxPlotComparison::PlotInfo
Definition: MSVtxPlotComparison.h:45
plotBeamSpotVxVal.legend
legend
Definition: plotBeamSpotVxVal.py:98
MSVtxPlotComparison::m_plotdir_recoVtx
TString m_plotdir_recoVtx
Definition: MSVtxPlotComparison.h:90
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
MSVtxPlotComparison::getTHStackPlotInfo
std::unique_ptr< MSVtxPlotComparison::PlotInfo< THStack > > getTHStackPlotInfo(const TH1 *h)
Definition: MSVtxPlotComparison.cxx:97
MSVtxPlotComparison::m_plotdir
TString m_plotdir
Definition: MSVtxPlotComparison.h:88
MSVtxPlotComparison::m_plotdir_vtxEfficiency
TString m_plotdir_vtxEfficiency
Definition: MSVtxPlotComparison.h:94
MSVtxPlotComparison::drawTHStack
void drawTHStack(std::unique_ptr< PlotInfo< THStack >> &hstackInfo)
Definition: MSVtxPlotComparison.cxx:129
MSVtxPlotComparison::drawTMultigraphRatioPlot
void drawTMultigraphRatioPlot(std::unique_ptr< PlotInfo< TMultiGraph >> &mgInfo)
Definition: MSVtxPlotComparison.cxx:320
MSVtxPlotComparison::drawRatio
void drawRatio(TGraphAsymmErrors *ratio, TGraphAsymmErrors *denomErrNorm, const TString &xlabel, const TAxis *plotXaxis, const TAxis *plotYaxis, double axisRescaling)
Definition: MSVtxPlotComparison.cxx:403
MSVtxPlotComparison::m_plotdir_truthVtx
TString m_plotdir_truthVtx
Definition: MSVtxPlotComparison.h:89
python.compareTCTs.ratio
ratio
Definition: compareTCTs.py:295
MSVtxPlotComparison::getTMultigraphplotpath
const TString getTMultigraphplotpath(const TString &name)
Definition: MSVtxPlotComparison.cxx:359
MSVtxPlotComparison::getRatio
TGraphAsymmErrors * getRatio(const TH1 *num, const TH1 *denom)
Definition: MSVtxPlotComparison.cxx:372
MSVtxPlotComparison::makeSinglePad
void makeSinglePad()
Definition: MSVtxPlotComparison.cxx:477
MSVtxPlotComparison::getTHStackplotpath
const TString getTHStackplotpath(const TString &name)
Definition: MSVtxPlotComparison.cxx:213
python.PyAthena.obj
obj
Definition: PyAthena.py:132
MSVtxPlotComparison::m_datapaths
std::vector< std::string > m_datapaths
Definition: MSVtxPlotComparison.h:85
MuonVertexValidationMacroPlotAnnotations
Definition: PlotAnnotations.cxx:11
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37