ATLAS Offline Software
MonitoringFile_IDAlignPostProcess.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 // **********************************************************************
6 // $Id: MonitoringFile_IDAlignPostProcess.cxx,v 1.1 2009-04-03 08:48:00 ponyisi Exp $
7 // **********************************************************************
8 
10 
11 
12 
13 #include <TCanvas.h>
14 #include <TF1.h>
15 #include <TH2.h>
16 #include <TH3.h>
17 #include <TKey.h>
18 #include <TMath.h>
19 #include <TProfile.h>
20 
21 #include <iomanip>
22 #include <locale>
23 #include <sstream>
24 #include <string>
25 #include <cmath>
26 #include <vector>
27 
28 namespace dqutils {
29  void
31  fitMergedFile_IDAlignMonManager(const std::string& inFilename, bool /* isIncremental */) {
32  /* std::cout << "\n";
33  std::cout << "Running Inner-Detector alignment-monitoring analysis\n";
34  std::cout << "\nWarning messages from fitting and histogram updating follow:\n\n"; */
35 
36  TFile* f = TFile::Open(inFilename.c_str(), "UPDATE");
37 
38  if (f == 0 || !f->IsOpen()) {
39  //std::cerr << "MonitoringFile::fitMergedFile_IDAlignMonManager(): "
40  //<< "Input file not opened\n";
41  delete f;
42  return;
43  }
44  if (f->GetSize() < 1000.) {
45  //std::cerr << "MonitoringFile::fitMergedFile_IDAlignMonManager(): "
46 // << "MonitoringFile empty\n";
47  delete f;
48  return;
49  }
50 
51  std::string run_dir;
52  TIter next_run(f->GetListOfKeys());
53  TKey* key_run(0);
54  while ((key_run = dynamic_cast<TKey*>(next_run())) != 0) {
55  TObject* obj_run = key_run->ReadObj();
56  TDirectory* tdir_run = dynamic_cast<TDirectory*>(obj_run);
57  if (tdir_run != 0) {
58  std::string tdir_run_name(tdir_run->GetName());
59  if (tdir_run_name.find("run") != std::string::npos) {
60  run_dir = tdir_run_name;
61  // std::cout<<"Run_directory: "<<run_dir<<std::endl;
62  TIter next_perf(tdir_run->GetListOfKeys());
63  TKey* key_perf(0);
64  while ((key_perf = dynamic_cast<TKey*>(next_perf())) != 0) {
65  std::string perf_name(key_perf->GetName());
66  // for hist file with run_directory
67  if (perf_name.find("IDAlignMon") != std::string::npos) {
68  TObject* obj_perf = key_perf->ReadObj();
69  TDirectory* tdir_perf = dynamic_cast<TDirectory*>(obj_perf);
70  if (tdir_perf != 0) {
71  run_dir = run_dir + '/';
72  TIter next_tracks(tdir_perf->GetListOfKeys());
73  TKey* key_tracks(0);
74 
75  while ((key_tracks = dynamic_cast<TKey*>(next_tracks())) != 0) {
76  std::string tracks_name(key_tracks->GetName());
77  //std::cout<<"looking at tracks dir: "<<tracks_name<<std::endl;
78  if (tracks_name.find("Track") != std::string::npos) {
79  //std::cout<<"Found tracks name: "<<tracks_name<<std::endl;
80  TObject* obj = key_tracks->ReadObj();
81  TDirectory* tdir = dynamic_cast<TDirectory*>(obj);
82  if (tdir != 0) {
83  TIter next_module(tdir->GetListOfKeys());
84  TKey* key_module(0);
85  while ((key_module = dynamic_cast<TKey*>(next_module())) != 0) {
86  std::string module_name = key_module->GetName();
87  //std::cout<<"looking at module: "<<module_name<<std::endl;
88  if (module_name.find("Residuals") != std::string::npos) {
89  //std::cout<<"Find Module: "<<module_name<<std::endl;
90  fitMergedFile_IDAlignMonResiduals(f, run_dir, tracks_name);
91  }
92 
93  if (module_name.find("TrackSegments") != std::string::npos) {
94  //std::cout<<"Find Module: "<<module_name<<std::endl;
95  fitMergedFile_IDAlignMonTrackSegments(f, run_dir, tracks_name);
96  }
97  if (module_name.find("GenericTracks") != std::string::npos) {
98  fitMergedFile_IDAlignMonPVbiases(f, run_dir, tracks_name);
99  }
100  //This is not needed. The plots are already in the monitoring file
101  //if (module_name.find("GenericTracks")!=std::string::npos) {
102  //std::cout<<"Find Module: "<<module_name<<std::endl;
103  //fitMergedFile_IDAlignMonGenericTracks( f,run_dir,tracks_name );
104  //}
105  }
106  } else { // This was not a TDirectory, delete it!
107  delete obj;
108  }
109  }
110  }
111  } else { // This was not a TDirectory, delete it!
112  delete obj_perf;
113  }
114  }
115  }
116  }
117  // if without top run_directory
118  else if (tdir_run_name.find("IDAlignMon") != std::string::npos) {
119  //std::cout<<"without run_directory"<<std::endl;
120  TObject* obj_perf = key_run->ReadObj();
121  TDirectory* tdir_perf = dynamic_cast<TDirectory*>(obj_perf);
122  if (tdir_perf != 0) {
123  run_dir = '/';
124  TIter next_tracks(tdir_perf->GetListOfKeys());
125  TKey* key_tracks(0);
126 
127  while ((key_tracks = dynamic_cast<TKey*>(next_tracks())) != 0) {
128  std::string tracks_name(key_tracks->GetName());
129  //std::cout<<"looking at tracks dir: "<<tracks_name<<std::endl;
130  if (tracks_name.find("Tracks") != std::string::npos) {
131  //std::cout<<"Found tracks name: "<<tracks_name<<std::endl;
132  TObject* obj = key_tracks->ReadObj();
133  TDirectory* tdir = dynamic_cast<TDirectory*>(obj);
134  if (tdir != 0) {
135  TIter next_module(tdir->GetListOfKeys());
136  TKey* key_module(0);
137  while ((key_module = dynamic_cast<TKey*>(next_module())) != 0) {
138  std::string module_name = key_module->GetName();
139  //std::cout<<"looking at module: "<<module_name<<std::endl;
140  if (module_name.find("Residuals") != std::string::npos) {
141  //std::cout<<"Find Module: "<<module_name<<std::endl;
142  fitMergedFile_IDAlignMonResiduals(f, run_dir, tracks_name);
143  }
144 
145  if (module_name.find("TrackSegments") != std::string::npos) {
146  //std::cout<<"Find Module: "<<module_name<<std::endl;
147  fitMergedFile_IDAlignMonTrackSegments(f, run_dir, tracks_name);
148  }
149  //This is not needed. The plots are already in the monitoring file
150  //if (module_name.find("GenericTracks")!=std::string::npos) {
151  //std::cout<<"Find Module: "<<module_name<<std::endl;
152  // fitMergedFile_IDAlignMonGenericTracks( f,run_dir,tracks_name );
153  // }
154  }
155  } else {
156  delete obj;
157  }
158  }
159  }
160  } else {
161  delete obj_perf;
162  }
163  }
164  //else
165  //std::cerr<<"directory IDAlignMon doesn't exist !"<<std::endl;
166  } else {
167  delete obj_run;
168  }
169  }
170 
171  f->Close();
172  delete f;
173  //std::cout << "\n";
174  //std::cout << "Finish Inner-Detector alignment-monitoring analysis"<<std::endl;
175  }
176 
177  void
179  fitMergedFile_IDAlignMonTrackSegments(TFile* file, const std::string& run_dir, const std::string& tracksName) {
180  //std::cout << "in fitMergedFile_IDAlignMonTrackSegments " << std::endl;
181 
182  std::string path;
183  path = run_dir + "IDAlignMon/" + tracksName + "/TrackSegments";
184  if (file->cd(path.c_str()) == 0) {
185  //std::cerr << "MonitoringFile::fitMergedFile_IDAlignMonTrackSegments(): "
186  // << "No such directory \"" << path << "\"\n";
187  return;
188  }
189 
190  //The Charge Mis-Indentification Histograms
191  //===========================================
192 
193  unsigned int nChargeHistograms = 4;
194 
195  //The input/source files
196  TH2F* oldChargeHists[4];
197 
198  //The output/destination files
199  TH1F* newChargeHists[4];
200  newChargeHists[0] = NULL;
201  newChargeHists[1] = NULL;
202  newChargeHists[2] = NULL;
203  newChargeHists[3] = NULL;
204 
205  //The names of the input files
206  std::string chargeHistNames[4];
207  chargeHistNames[0] = "delta_chargeVsPtLow";
208  chargeHistNames[1] = "delta_chargeVsPtUp";
209  chargeHistNames[2] = "delta_chargeVsD0";
210  chargeHistNames[3] = "delta_chargeVsZ0";
211 
212  std::string chargeHistTitle[4];
213  chargeHistTitle[0] = "Mis-Id ratio vs pT (Low)";
214  chargeHistTitle[1] = "Mis-Id ratio vs pT (Up)";
215  chargeHistTitle[2] = "Mis-Id ratio vs d_{0}";
216  chargeHistTitle[3] = "Mis-Id ratio vs Z0";
217 
218  std::string chargeHistXAxisTitles[4];
219  chargeHistXAxisTitles[0] = "p_{T} Low (GeV)";
220  chargeHistXAxisTitles[1] = "p_{T} Up (GeV)";
221  chargeHistXAxisTitles[2] = "d_{0} (mm)";
222  chargeHistXAxisTitles[3] = "z_{0} (mm)";
223 
224  //loop over the number of histograms to be created
225  for (unsigned int j = 0; j < nChargeHistograms; ++j) {
226  //We write the hist only if the input exist.
227  if (!CheckHistogram(file, (path + "/" + chargeHistNames[j]).c_str())) continue;
228 
229  //get them
230  oldChargeHists[j] = (TH2F*) (file->Get((path + "/" + chargeHistNames[j]).c_str()));
231 
232  //get binning
233  unsigned int nbinsX = oldChargeHists[j]->GetNbinsX();
234  float LE = oldChargeHists[j]->GetBinLowEdge(1);
235  float UE = oldChargeHists[j]->GetBinLowEdge(nbinsX + 1);
236 
237  //create the new files
238  newChargeHists[j] = new TH1F(("ratio_" + chargeHistNames[j]).c_str(), "", nbinsX, LE, UE);
239 
240  //Fill the new files
241  for (unsigned int xBin = 1; xBin != nbinsX + 1; xBin++) {
242  float ChargeMinus2 = oldChargeHists[j]->GetBinContent(xBin, 2);
243  float ChargePlus2 = oldChargeHists[j]->GetBinContent(xBin, 6);
244  float ChargeCorrect = oldChargeHists[j]->GetBinContent(xBin, 4);
245  float ChargeWrong = ChargeMinus2 + ChargePlus2;
246  if (ChargeCorrect > 0) {
247  newChargeHists[j]->SetBinContent(xBin, (ChargeWrong) / (ChargeCorrect + ChargeWrong));
248  newChargeHists[j]->SetBinError(xBin,
249  1.0 / ChargeCorrect *
250  pow(ChargeWrong * (1.0 + ChargeWrong / ChargeCorrect), 0.5));
251  } else {
252  if (ChargeWrong > 0) newChargeHists[j]->SetBinContent(xBin, 1);
253  else newChargeHists[j]->SetBinContent(xBin, 0);
254  newChargeHists[j]->SetBinError(xBin, 0);
255  }
256  }//Fill the new histograms
257 
258  newChargeHists[j]->SetTitle((chargeHistTitle[j]).c_str());
259  newChargeHists[j]->GetXaxis()->SetTitle((chargeHistXAxisTitles[j]).c_str());
260  }//over charged hists
261 
262 
263  //Write out the charge mis-id histograms
264  file->Write();
265  for (unsigned int j = 0; j < nChargeHistograms; ++j) {
266  //If the original hist dosn't exist, we didnt make a new one,
267  // so we dont write the new one
268  if (!CheckHistogram(file, (path + "/" + chargeHistNames[j]).c_str())) continue;
269 
270  if (newChargeHists[j]) newChargeHists[j]->Write("", TObject::kOverwrite);
271  }
272 
273 
274  //Delta Track Parameter Vs Track Parameter Profiles
275  //==================================================
276 
277  //The input histograms
278  TH2F* oldHists[30 * 3] = {};
279 
280  //The output histograms
281  TH1F* newHists[30 * 3 * 2] = {};
282 
283  //The names of the input files
284  std::string histNames[30];
285  histNames[0] = "delta_d0VsD0";
286  histNames[1] = "delta_d0VsZ0";
287  histNames[2] = "delta_d0VsPhi0";
288  histNames[3] = "delta_d0VsPt";
289  histNames[4] = "delta_d0VsEta";
290 
291  histNames[5] = "delta_eta0VsD0";
292  histNames[6] = "delta_eta0VsZ0";
293  histNames[7] = "delta_eta0VsPhi0";
294  histNames[8] = "delta_eta0VsPt";
295  histNames[9] = "delta_eta0VsEta";
296 
297  histNames[10] = "delta_phi0VsD0";
298  histNames[11] = "delta_phi0VsZ0";
299  histNames[12] = "delta_phi0VsPhi0";
300  histNames[13] = "delta_phi0VsPt";
301  histNames[14] = "delta_phi0VsEta";
302 
303  histNames[15] = "delta_qOverPtVsD0";
304  histNames[16] = "delta_qOverPtVsZ0";
305  histNames[17] = "delta_qOverPtVsPhi0";
306  histNames[18] = "delta_qOverPtVsPt";
307  histNames[19] = "delta_qOverPtVsEta";
308 
309  histNames[20] = "delta_z0VsD0";
310  histNames[21] = "delta_z0VsZ0";
311  histNames[22] = "delta_z0VsPhi0";
312  histNames[23] = "delta_z0VsPt";
313  histNames[24] = "delta_z0VsEta";
314 
315  histNames[25] = "delta_nHitsVsD0";
316  histNames[26] = "delta_nHitsVsZ0";
317  histNames[27] = "delta_nHitsVsPhi0";
318  histNames[28] = "delta_nHitsVsPt";
319  histNames[29] = "delta_nHitsVsEta";
320 
321  std::string histTitles[30];
322  std::string titlePrefix[2] = {
323  "average_", "sigma_"
324  };
325  std::string titlePostfix[3] = {
326  "", "(Positive Tracks)", "(Negative Tracks)"
327  };
328 
329  histTitles[0] = "#Delta d_{0} vs d_{0}^{Upper} ";
330  histTitles[1] = "#Delta d_{0} vs z_{0}^{Upper} ";
331  histTitles[2] = "#Delta d_{0} vs #phi_{0}^{Upper} ";
332  histTitles[3] = "#Delta d_{0} vs p_{T}^{Upper} ";
333  histTitles[4] = "#Delta d_{0} vs #eta^{Upper} ";
334 
335  histTitles[5] = "#Delta #eta vs d_{0}^{Upper} ";
336  histTitles[6] = "#Delta #eta vs z_{0}^{Upper} ";
337  histTitles[7] = "#Delta #eta vs #phi_{0}^{Upper} ";
338  histTitles[8] = "#Delta #eta vs p_{T}^{Upper} ";
339  histTitles[9] = "#Delta #eta vs #eta^{Upper} ";
340 
341  histTitles[10] = "#Delta phi vs d_{0}^{Upper} ";
342  histTitles[11] = "#Delta phi vs z_{0}^{Upper} ";
343  histTitles[12] = "#Delta phi vs phi0^{Upper} ";
344  histTitles[13] = "#Delta phi vs p_{T}^{Upper} ";
345  histTitles[14] = "#Delta phi vs #eta^{Upper} ";
346 
347  histTitles[15] = "#Delta q/p_{T} vs d_{0}^{Upper} ";
348  histTitles[16] = "#Delta q/p_{T} vs z_{0}^{Upper} ";
349  histTitles[17] = "#Delta q/p_{T} vs #phi_{0}^{Upper} ";
350  histTitles[18] = "#Delta q/p_{T} vs p_{T}^{Upper} ";
351  histTitles[19] = "#Delta q/p_{T} vs #eta^{Upper} ";
352 
353  histTitles[20] = "#Delta z_{0} vs d_{0}^{Upper} ";
354  histTitles[21] = "#Delta z_{0} vs z_{0}^{Upper} ";
355  histTitles[22] = "#Delta z_{0} vs #phi_{0}^{Upper} ";
356  histTitles[23] = "#Delta z_{0} vs p_{T}^{Upper} ";
357  histTitles[24] = "#Delta z_{0} vs #eta^{Upper} ";
358 
359  histTitles[25] = "#Delta nHits vs d_{0}^{Upper} ";
360  histTitles[26] = "#Delta nHits vs z_{0}^{Upper} ";
361  histTitles[27] = "#Delta nHits vs #phi_{0}^{Upper} ";
362  histTitles[28] = "#Delta nHits vs p_{T}^{Upper} ";
363  histTitles[29] = "#Delta nHits vs #eta^{Upper} ";
364 
365  std::string histXAxisTitles[5];
366  histXAxisTitles[0] = "d_{0}^{Upper} (mm)";
367  histXAxisTitles[1] = "z_{0}^{Upper} (mm)";
368  histXAxisTitles[2] = "#phi_{0}^{Upper} (rad)";
369  histXAxisTitles[3] = "p_{T}^{Upper} (GeV)";
370  histXAxisTitles[4] = "#eta^{Upper}";
371 
372  std::string histYAxisTitles[6];
373  histYAxisTitles[0] = "#Delta d_{0} (mm)";
374  histYAxisTitles[1] = "#Delta #eta";
375  histYAxisTitles[2] = "#Delta #phi (rad)";
376  histYAxisTitles[3] = "#Delta q/p_{T} (1.0/GeV)";
377  histYAxisTitles[4] = "#Delta z_{0} (mm)";
378  histYAxisTitles[5] = "#Delta nHits";
379 
380  //loop over combined/positive/negative
381  for (unsigned int i = 0; i < 3; ++i) {
382  //loop over the number of profiles to be created
383  for (unsigned int j = 0; j < 30; ++j) {
384  std::string histName;
385 
386  //Charged or Combo?
387  if (i == 0) histName += histNames[j];
388 
389  if (i == 1) histName += histNames[j] + "_p";
390 
391  if (i == 2) histName += histNames[j] + "_n";
392 
393  //We write the hist only if the input exist.
394  if (!CheckHistogram(file, (path + "/" + histName).c_str())) {
395  oldHists[30 * i + j] = 0;
396  continue;
397  }
398 
399  //get them
400  oldHists[30 * i + j] = (TH2F*) (file->Get((path + "/" + histName).c_str()));
401 
402  //get binning
403  unsigned int nbinsX = oldHists[30 * i + j]->GetNbinsX();
404  unsigned int nbinsY = oldHists[30 * i + j]->GetNbinsY();
405  float xLE = oldHists[30 * i + j]->GetXaxis()->GetBinLowEdge(1);
406  float xUE = oldHists[30 * i + j]->GetXaxis()->GetBinLowEdge(nbinsX + 1);
407  float yLE = oldHists[30 * i + j]->GetYaxis()->GetBinLowEdge(1);
408  float yUE = oldHists[30 * i + j]->GetYaxis()->GetBinLowEdge(nbinsY + 1);
409 
410  //std::cout << "i = " << i << std::endl;
411  //std::cout << "j = " << j << std::endl;
412  //loop over Average/Sigma
413  for (unsigned int k = 0; k < 2; ++k) {
414  //std::cout << "k = " << k << std::endl;
415 
416  //create the new files
417  newHists[2 * (30 * i + j) + k] = new TH1F((titlePrefix[k] + histName).c_str(), "", nbinsX, xLE, xUE);
418 
419  //Fill the new histograms
420  fillGaussianMeanOrWidth(oldHists[30 * i + j], newHists[2 * (30 * i + j) + k], yLE, yUE, k);
421 
422  newHists[2 * (30 * i + j) + k]->SetTitle((titlePrefix[k] + histName + titlePostfix[i]).c_str());
423  newHists[2 * (30 * i + j) + k]->GetXaxis()->SetTitle((histXAxisTitles[j % 5]).c_str());
424  if (j < 5) newHists[2 * (30 * i + j) + k]->GetYaxis()->SetTitle((histYAxisTitles[0]).c_str());
425  else if (j < 10) newHists[2 * (30 * i + j) + k]->GetYaxis()->SetTitle((histYAxisTitles[1]).c_str());
426  else if (j < 15) newHists[2 * (30 * i + j) + k]->GetYaxis()->SetTitle((histYAxisTitles[2]).c_str());
427  else if (j < 20) newHists[2 * (30 * i + j) + k]->GetYaxis()->SetTitle((histYAxisTitles[3]).c_str());
428  else if (j < 25) newHists[2 * (30 * i + j) + k]->GetYaxis()->SetTitle((histYAxisTitles[4]).c_str());
429  else if (j < 30) newHists[2 * (30 * i + j) + k]->GetYaxis()->SetTitle((histYAxisTitles[5]).c_str());
430  }//over the mean or the sigma
431  }//over the histgrams (j)
432  }//over the charge (i)
433 
434 
435  //loop over combined/positive/negative
436  for (unsigned int i = 0; i < 3; ++i) {
437  //loop over the number of profiles to be created
438  for (unsigned int j = 0; j < 30; ++j) {
439  //loop over average/mean
440  for (unsigned int k = 0; k < 2; ++k) {
441  std::string histName;
442  if (i == 0) histName = histNames[j];
443 
444  if (i == 1) histName = histNames[j] + "_p";
445 
446  if (i == 2) histName = histNames[j] + "_n";
447 
448  //If the original hist dosn't exist, we didnt make a new one,
449  // so we dont write the new one
450  // if (!CheckHistogram(file,(path+"/"+histName).c_str())){
451  // continue;
452  // }
453  if (oldHists[30 * i + j] == 0) {
454  //std::cout << histName << " not found" << std::endl;
455  continue;
456  }
457 
458  newHists[2 * (30 * i + j) + k]->Write("", TObject::kOverwrite);
459  }
460  }
461  }
462 
463  //Write out the delta trackP vs trackP profiles
464  //20100217 - moved here to avoid file corruption - PUEO
465  file->Write();
466  return;
467  }
468 
470 
471  void
473  fitMergedFile_IDAlignMonResiduals(TFile* f, const std::string& run_dir, const std::string& tracksName) {
474  const float minSiResMeanWindow = -0.1;
475  const float maxSiResMeanWindow = 0.1;
476  const float minSiResWidthWindow = 0.0;
477  const float maxSiResWidthWindow = 0.3;
478  const float minSiPullWidthWindow = 0.0;
479  const float maxSiPullWidthWindow = 2.0;
480 
481  bool doOverlapResiduals = false;
482 
483  std::string path;
484  path = run_dir + "IDAlignMon/" + tracksName + "/Residuals";
485  if (f->cd(path.c_str()) == 0) {
486  //std::cerr << "MonitoringFile::fitMergedFile_IDAlignMonResiduals(): "
487  // << "No such directory \"" << path << "\"\n";
488  return;
489  }
490 
491  TObjArray* plots = new TObjArray[10];//used for performing operations on histos
492 
493  //2d histograms from which the fits/means will be taken - checking they exist
494  if (!CheckHistogram(f, (path + "/si_barrel_pullX").c_str())) return;
495 
496  if (!CheckHistogram(f, (path + "/si_eca_pullX").c_str())) return;
497 
498  if (!CheckHistogram(f, (path + "/si_ecc_pullX").c_str())) return;
499 
500  if (!CheckHistogram(f, (path + "/si_barrel_pullY").c_str())) return;
501 
502  if (!CheckHistogram(f, (path + "/si_eca_pullY").c_str())) return;
503 
504  if (!CheckHistogram(f, (path + "/si_ecc_pullY").c_str())) return;
505 
506  if (!CheckHistogram(f, (path + "/si_barrel_resX").c_str())) return;
507 
508  if (!CheckHistogram(f, (path + "/si_eca_resX").c_str())) return;
509 
510  if (!CheckHistogram(f, (path + "/si_ecc_resX").c_str())) return;
511 
512  if (!CheckHistogram(f, (path + "/si_barrel_resY").c_str())) return;
513 
514  if (!CheckHistogram(f, (path + "/si_eca_resY").c_str())) return;
515 
516  if (!CheckHistogram(f, (path + "/si_ecc_resY").c_str())) return;
517 
518  if (!CheckHistogram(f, (path + "/pix_eca_xresvsmodphi_2d").c_str())) return;
519 
520  if (!CheckHistogram(f, (path + "/pix_eca_yresvsmodphi_2d").c_str())) return;
521 
522  if (!CheckHistogram(f, (path + "/pix_ecc_xresvsmodphi_2d").c_str())) return;
523 
524  if (!CheckHistogram(f, (path + "/pix_ecc_yresvsmodphi_2d").c_str())) return;
525 
526  if (!CheckHistogram(f, (path + "/sct_eca_xresvsmodphi_2d").c_str())) return;
527 
528  if (!CheckHistogram(f, (path + "/sct_ecc_xresvsmodphi_2d").c_str())) return;
529 
530  if (!CheckHistogram(f, (path + "/pix_b0_xresvsmodetaphi_3d").c_str())) return;
531 
532  if (!CheckHistogram(f, (path + "/pix_b1_xresvsmodetaphi_3d").c_str())) return;
533 
534  if (!CheckHistogram(f, (path + "/pix_b2_xresvsmodetaphi_3d").c_str())) return;
535 
536  if (!CheckHistogram(f, (path + "/pix_b3_xresvsmodetaphi_3d").c_str())) return;
537 
538  if (!CheckHistogram(f, (path + "/pix_b0_yresvsmodetaphi_3d").c_str())) return;
539 
540  if (!CheckHistogram(f, (path + "/pix_b1_yresvsmodetaphi_3d").c_str())) return;
541 
542  if (!CheckHistogram(f, (path + "/pix_b2_yresvsmodetaphi_3d").c_str())) return;
543 
544  if (!CheckHistogram(f, (path + "/pix_b3_yresvsmodetaphi_3d").c_str())) return;
545 
546  if (!CheckHistogram(f, (path + "/sct_b0_xresvsmodetaphi_3d").c_str())) return;
547 
548  if (!CheckHistogram(f, (path + "/sct_b1_xresvsmodetaphi_3d").c_str())) return;
549 
550  if (!CheckHistogram(f, (path + "/sct_b2_xresvsmodetaphi_3d").c_str())) return;
551 
552  if (!CheckHistogram(f, (path + "/sct_b3_xresvsmodetaphi_3d").c_str())) return;
553 
554  if (CheckHistogram(f, (path + "/pix_b0_Oxresxvsmodetaphi_3d").c_str())) {
555  doOverlapResiduals = true;
556  if (!CheckHistogram(f, (path + "/pix_b0_Oxresxvsmodetaphi_3d").c_str())) return;
557 
558  if (!CheckHistogram(f, (path + "/pix_b1_Oxresxvsmodetaphi_3d").c_str())) return;
559 
560  if (!CheckHistogram(f, (path + "/pix_b2_Oxresxvsmodetaphi_3d").c_str())) return;
561 
562  if (!CheckHistogram(f, (path + "/pix_b3_Oxresxvsmodetaphi_3d").c_str())) return;
563 
564  if (!CheckHistogram(f, (path + "/pix_b0_Oxresyvsmodetaphi_3d").c_str())) return;
565 
566  if (!CheckHistogram(f, (path + "/pix_b1_Oxresyvsmodetaphi_3d").c_str())) return;
567 
568  if (!CheckHistogram(f, (path + "/pix_b2_Oxresyvsmodetaphi_3d").c_str())) return;
569 
570  if (!CheckHistogram(f, (path + "/pix_b3_Oxresyvsmodetaphi_3d").c_str())) return;
571 
572  if (!CheckHistogram(f, (path + "/pix_b0_Oyresyvsmodetaphi_3d").c_str())) return;
573 
574  if (!CheckHistogram(f, (path + "/pix_b1_Oyresyvsmodetaphi_3d").c_str())) return;
575 
576  if (!CheckHistogram(f, (path + "/pix_b2_Oyresyvsmodetaphi_3d").c_str())) return;
577 
578  if (!CheckHistogram(f, (path + "/pix_b3_Oyresyvsmodetaphi_3d").c_str())) return;
579 
580  if (!CheckHistogram(f, (path + "/pix_b0_Oyresxvsmodetaphi_3d").c_str())) return;
581 
582  if (!CheckHistogram(f, (path + "/pix_b1_Oyresxvsmodetaphi_3d").c_str())) return;
583 
584  if (!CheckHistogram(f, (path + "/pix_b2_Oyresxvsmodetaphi_3d").c_str())) return;
585 
586  if (!CheckHistogram(f, (path + "/pix_b3_Oyresyvsmodetaphi_3d").c_str())) return;
587 
588 
589  if (!CheckHistogram(f, (path + "/sct_b0_Oxresxvsmodetaphi_3d").c_str())) return;
590 
591  if (!CheckHistogram(f, (path + "/sct_b1_Oxresxvsmodetaphi_3d").c_str())) return;
592 
593  if (!CheckHistogram(f, (path + "/sct_b2_Oxresxvsmodetaphi_3d").c_str())) return;
594 
595  if (!CheckHistogram(f, (path + "/sct_b3_Oxresxvsmodetaphi_3d").c_str())) return;
596 
597  if (!CheckHistogram(f, (path + "/sct_b0_Oyresxvsmodetaphi_3d").c_str())) return;
598 
599  if (!CheckHistogram(f, (path + "/sct_b1_Oyresxvsmodetaphi_3d").c_str())) return;
600 
601  if (!CheckHistogram(f, (path + "/sct_b2_Oyresxvsmodetaphi_3d").c_str())) return;
602 
603  if (!CheckHistogram(f, (path + "/sct_b3_Oyresxvsmodetaphi_3d").c_str())) return;
604 
605  //Check if the bowing histograms exist.
606 
607  if (!CheckHistogram(f, (path + "/pix_b0_resXvsetaLumiBlock").c_str())) return;
608 
609  if (!CheckHistogram(f, (path + "/pix_b0_resXvsetaLumiBlock_planars").c_str())) return;
610  }
611  //else std::cout << "no overlap residual histograms found - will not process overlap residuals" << std::endl;
612 
613  //get the 2d histograms from the file
614  TH2F* si_barrel_pullX = (TH2F*) (f->Get((path + "/si_barrel_pullX").c_str()));
615  TH2F* si_eca_pullX = (TH2F*) (f->Get((path + "/si_eca_pullX").c_str()));
616  TH2F* si_ecc_pullX = (TH2F*) (f->Get((path + "/si_ecc_pullX").c_str()));
617  TH2F* si_barrel_pullY = (TH2F*) (f->Get((path + "/si_barrel_pullY").c_str()));
618  TH2F* si_eca_pullY = (TH2F*) (f->Get((path + "/si_eca_pullY").c_str()));
619  TH2F* si_ecc_pullY = (TH2F*) (f->Get((path + "/si_ecc_pullY").c_str()));
620 
621  TH2F* si_barrel_resX = (TH2F*) (f->Get((path + "/si_barrel_resX").c_str()));
622  TH2F* si_eca_resX = (TH2F*) (f->Get((path + "/si_eca_resX").c_str()));
623  TH2F* si_ecc_resX = (TH2F*) (f->Get((path + "/si_ecc_resX").c_str()));
624  TH2F* si_barrel_resY = (TH2F*) (f->Get((path + "/si_barrel_resY").c_str()));
625  TH2F* si_eca_resY = (TH2F*) (f->Get((path + "/si_eca_resY").c_str()));
626  TH2F* si_ecc_resY = (TH2F*) (f->Get((path + "/si_ecc_resY").c_str()));
627 
628  TH2F* pix_eca_xresvsmodphi_2d = (TH2F*) (f->Get((path + "/pix_eca_xresvsmodphi_2d").c_str()));
629  TH2F* pix_eca_yresvsmodphi_2d = (TH2F*) (f->Get((path + "/pix_eca_yresvsmodphi_2d").c_str()));
630  TH2F* pix_ecc_xresvsmodphi_2d = (TH2F*) (f->Get((path + "/pix_ecc_xresvsmodphi_2d").c_str()));
631  TH2F* pix_ecc_yresvsmodphi_2d = (TH2F*) (f->Get((path + "/pix_ecc_yresvsmodphi_2d").c_str()));
632  TH2F* sct_eca_xresvsmodphi_2d = (TH2F*) (f->Get((path + "/sct_eca_xresvsmodphi_2d").c_str()));
633  TH2F* sct_ecc_xresvsmodphi_2d = (TH2F*) (f->Get((path + "/sct_ecc_xresvsmodphi_2d").c_str()));
634 
635  //3-d histograms
636  TH3F* pix_b0_xresvsmodetaphi_3d = (TH3F*) (f->Get((path + "/pix_b0_xresvsmodetaphi_3d").c_str()));
637  TH3F* pix_b1_xresvsmodetaphi_3d = (TH3F*) (f->Get((path + "/pix_b1_xresvsmodetaphi_3d").c_str()));
638  TH3F* pix_b2_xresvsmodetaphi_3d = (TH3F*) (f->Get((path + "/pix_b2_xresvsmodetaphi_3d").c_str()));
639  TH3F* pix_b3_xresvsmodetaphi_3d = (TH3F*) (f->Get((path + "/pix_b3_xresvsmodetaphi_3d").c_str()));
640  TH3F* pix_b0_yresvsmodetaphi_3d = (TH3F*) (f->Get((path + "/pix_b0_yresvsmodetaphi_3d").c_str()));
641  TH3F* pix_b1_yresvsmodetaphi_3d = (TH3F*) (f->Get((path + "/pix_b1_yresvsmodetaphi_3d").c_str()));
642  TH3F* pix_b2_yresvsmodetaphi_3d = (TH3F*) (f->Get((path + "/pix_b2_yresvsmodetaphi_3d").c_str()));
643  TH3F* pix_b3_yresvsmodetaphi_3d = (TH3F*) (f->Get((path + "/pix_b3_yresvsmodetaphi_3d").c_str()));
644  TH3F* sct_b0_xresvsmodetaphi_3d = (TH3F*) (f->Get((path + "/sct_b0_xresvsmodetaphi_3d").c_str()));
645  TH3F* sct_b1_xresvsmodetaphi_3d = (TH3F*) (f->Get((path + "/sct_b1_xresvsmodetaphi_3d").c_str()));
646  TH3F* sct_b2_xresvsmodetaphi_3d = (TH3F*) (f->Get((path + "/sct_b2_xresvsmodetaphi_3d").c_str()));
647  TH3F* sct_b3_xresvsmodetaphi_3d = (TH3F*) (f->Get((path + "/sct_b3_xresvsmodetaphi_3d").c_str()));
648 
649  // Get the 2DProfiles
650 
651  //TProfile2D* m_pix_b0_resXvsetaLumiBlock = (TProfile2D*)
652  // (f->Get((path+"/pix_b0_resXvsetaLumiBlock").c_str()));
653  //TProfile2D* m_pix_b0_resXvsetaLumiBlock_planars = (TProfile2D*)
654  // (f->Get((path+"/pix_b0_resXvsetaLumiBlock_planars").c_str()));
655 
656  //TH1F* m_pix_b0_mag_vs_lb = new TH1F("pix_b0_mag_vs_lb","pix_b0_mag_vs_lb",1024,0,1024);
657  //TH1F* m_pix_b0_base_vs_lb = new TH1F("pix_b0_base_vs_lb","pix_b0_base_vs_lb",1024,0,1024);
658 
659  //MakeBowingFit(m_pix_b0_resXvsetaLumiBlock,m_pix_b0_mag_vs_lb,m_pix_b0_base_vs_lb);
660 
661  // Ideally we would like to clone the existing histograms from the file instead of recreating them here
662  // but there seems to be no way to then persistify the cloned histograms (i.e. write them back to the file)
663  const Int_t nx = 21;
664  TString siliconLayersBarrel[12] = {
665  "Pix L0", "Pix L1", "Pix L2", "Pix L3", "SCT L0 S0", "S1", "SCT L1 S0", "S1", "SCT L2 S0", "S1", "SCT L3 S0", "S1"
666  };
667  TString siliconLayers[nx] = {
668  "Pix L0", "Pix L1", "Pix L2", "SCT L0 S0", "S1", "SCT L1 S0", "S1", "SCT L2 S0", "S1", "SCT L3 S0", "S1",
669  "SCT L4 S0", "S1", "SCT L5 S0", "S1", "SCT L6 S0", "S1", "SCT L7 S0", "S1", "SCT L8 S0", "S1"
670  };
671 
672  //pull width for each layer in Silicon barrel and endcaps
673  TH1F* si_barrel_pullX_width = new TH1F("si_barrel_pullX_width", "Pull X Gaussian Width vs Silicon Barrel Layer", 12,
674  -0.5, 11.5);
675  for (int i = 1; i <= 12; i++) si_barrel_pullX_width->GetXaxis()->SetBinLabel(i, siliconLayersBarrel[i - 1]);
676  si_barrel_pullX_width->GetYaxis()->SetTitle("Pull X Gaussian Width");
677  TH1F* si_eca_pullX_width = new TH1F("si_eca_pullX_width", "Pull X Gaussian Width vs Silicon ECA Layer", 21, -0.5,
678  20.5);
679  for (int i = 1; i <= nx; i++) si_eca_pullX_width->GetXaxis()->SetBinLabel(i, siliconLayers[i - 1]);
680  si_eca_pullX_width->GetYaxis()->SetTitle("Pull X Gaussian Width");
681  TH1F* si_ecc_pullX_width = new TH1F("si_ecc_pullX_width", "Pull X Gaussian Width vs Silicon ECC Layer", 21, -0.5,
682  20.5);
683  for (int i = 1; i <= nx; i++) si_ecc_pullX_width->GetXaxis()->SetBinLabel(i, siliconLayers[i - 1]);
684  si_ecc_pullX_width->GetYaxis()->SetTitle("Pull X Gaussian Width");
685  TH1F* si_barrel_pullY_width = new TH1F("si_barrel_pullY_width", "Pull Y Gaussian Width vs Silicon Barrel Layer", 12,
686  -0.5, 11.5);
687  for (int i = 1; i <= 12; i++) si_barrel_pullY_width->GetXaxis()->SetBinLabel(i, siliconLayersBarrel[i - 1]);
688  si_barrel_pullY_width->GetYaxis()->SetTitle("Pull Y Gaussian Width");
689  TH1F* si_eca_pullY_width = new TH1F("si_eca_pullY_width", "Pull Y Gaussian Width vs Silicon ECA Layer", 21, -0.5,
690  20.5);
691  for (int i = 1; i <= nx; i++) si_eca_pullY_width->GetXaxis()->SetBinLabel(i, siliconLayers[i - 1]);
692  si_eca_pullY_width->GetYaxis()->SetTitle("Pull Y Gaussian Width");
693  TH1F* si_ecc_pullY_width = new TH1F("si_ecc_pullY_width", "Pull Y Gaussian Width vs Silicon ECC Layer", 21, -0.5,
694  20.5);
695  for (int i = 1; i <= nx; i++) si_ecc_pullY_width->GetXaxis()->SetBinLabel(i, siliconLayers[i - 1]);
696  si_ecc_pullY_width->GetYaxis()->SetTitle("Pull Y Gaussian Width");
697  fillGaussianMeanOrWidth(si_barrel_pullX, si_barrel_pullX_width, -6.0, 6.0, 1);
698  fillGaussianMeanOrWidth(si_barrel_pullY, si_barrel_pullY_width, -6.0, 6.0, 1);
699  fillGaussianMeanOrWidth(si_eca_pullX, si_eca_pullX_width, -6.0, 6.0, 1);
700  fillGaussianMeanOrWidth(si_eca_pullY, si_eca_pullY_width, -6.0, 6.0, 1);
701  fillGaussianMeanOrWidth(si_ecc_pullX, si_ecc_pullX_width, -6.0, 6.0, 1);
702  fillGaussianMeanOrWidth(si_ecc_pullY, si_ecc_pullY_width, -6.0, 6.0, 1);
703 
704  //pull mean for each layer in Silicon barrel and endcaps
705  TH1F* si_barrel_pullX_mean = new TH1F("si_barrel_pullX_mean", "Pull X Gaussian Mean vs Silicon Barrel Layer", 12,
706  -0.5, 11.5);
707  for (int i = 1; i <= 12; i++) si_barrel_pullX_mean->GetXaxis()->SetBinLabel(i, siliconLayersBarrel[i - 1]);
708  si_barrel_pullX_mean->GetYaxis()->SetTitle("Pull X Gaussian Mean");
709  TH1F* si_eca_pullX_mean =
710  new TH1F("si_eca_pullX_mean", "Pull X Gaussian Mean vs Silicon ECA Layer", 21, -0.5, 20.5);
711  for (int i = 1; i <= nx; i++) si_eca_pullX_mean->GetXaxis()->SetBinLabel(i, siliconLayers[i - 1]);
712  si_eca_pullX_mean->GetYaxis()->SetTitle("Pull X Gaussian Mean");
713  TH1F* si_ecc_pullX_mean =
714  new TH1F("si_ecc_pullX_mean", "Pull X Gaussian Mean vs Silicon ECC Layer", 21, -0.5, 20.5);
715  for (int i = 1; i <= nx; i++) si_ecc_pullX_mean->GetXaxis()->SetBinLabel(i, siliconLayers[i - 1]);
716  si_ecc_pullX_mean->GetYaxis()->SetTitle("Pull X Gaussian Mean");
717  TH1F* si_barrel_pullY_mean = new TH1F("si_barrel_pullY_mean", "Pull Y Gaussian Mean vs Silicon Barrel Layer", 12,
718  -0.5, 11.5);
719  for (int i = 1; i <= 12; i++) si_barrel_pullY_mean->GetXaxis()->SetBinLabel(i, siliconLayersBarrel[i - 1]);
720  si_barrel_pullY_mean->GetYaxis()->SetTitle("Pull Y Gaussian Mean");
721  TH1F* si_eca_pullY_mean =
722  new TH1F("si_eca_pullY_mean", "Pull Y Gaussian Mean vs Silicon ECA Layer", 21, -0.5, 20.5);
723  for (int i = 1; i <= nx; i++) si_eca_pullY_mean->GetXaxis()->SetBinLabel(i, siliconLayers[i - 1]);
724  si_eca_pullY_mean->GetYaxis()->SetTitle("Pull Y Gaussian Mean");
725  TH1F* si_ecc_pullY_mean =
726  new TH1F("si_ecc_pullY_mean", "Pull Y Gaussian Mean vs Silicon ECC Layer", 21, -0.5, 20.5);
727  for (int i = 1; i <= nx; i++) si_ecc_pullY_mean->GetXaxis()->SetBinLabel(i, siliconLayers[i - 1]);
728  si_ecc_pullY_mean->GetYaxis()->SetTitle("Pull Y Gaussian Mean");
729  fillGaussianMeanOrWidth(si_barrel_pullX, si_barrel_pullX_mean, -6.0, 6.0, 0);
730  fillGaussianMeanOrWidth(si_barrel_pullY, si_barrel_pullY_mean, -6.0, 6.0, 0);
731  fillGaussianMeanOrWidth(si_eca_pullX, si_eca_pullX_mean, -6.0, 6.0, 0);
732  fillGaussianMeanOrWidth(si_eca_pullY, si_eca_pullY_mean, -6.0, 6.0, 0);
733  fillGaussianMeanOrWidth(si_ecc_pullX, si_ecc_pullX_mean, -6.0, 6.0, 0);
734  fillGaussianMeanOrWidth(si_ecc_pullY, si_ecc_pullY_mean, -6.0, 6.0, 0);
735 
736  //residual mean for each layer in Silicon barrel and endcaps
737  TH1F* si_barrel_resX_mean = new TH1F("si_barrel_resX_mean", "Residual X Mean vs Silicon Barrel Layer", 12, -0.5,
738  11.5);
739  for (int i = 1; i <= 12; i++) si_barrel_resX_mean->GetXaxis()->SetBinLabel(i, siliconLayersBarrel[i - 1]);
740  si_barrel_resX_mean->GetYaxis()->SetTitle("Residual X Mean [mm]");
741  TH1F* si_eca_resX_mean = new TH1F("si_eca_resX_mean", "Residual X Mean vs Silicon ECA Layer", 21, -0.5, 20.5);
742  for (int i = 1; i <= nx; i++) si_eca_resX_mean->GetXaxis()->SetBinLabel(i, siliconLayers[i - 1]);
743  si_eca_resX_mean->GetYaxis()->SetTitle("Residual X Mean [mm]");
744  TH1F* si_ecc_resX_mean = new TH1F("si_ecc_resX_mean", "Residual X Mean vs Silicon ECC Layer", 21, -0.5, 20.5);
745  for (int i = 1; i <= nx; i++) si_ecc_resX_mean->GetXaxis()->SetBinLabel(i, siliconLayers[i - 1]);
746  si_ecc_resX_mean->GetYaxis()->SetTitle("Residual X Mean [mm]");
747  TH1F* si_barrel_resY_mean = new TH1F("si_barrel_resY_mean", "Residual Y Mean vs Silicon Barrel Layer", 12, -0.5,
748  11.5);
749  for (int i = 1; i <= 12; i++) si_barrel_resY_mean->GetXaxis()->SetBinLabel(i, siliconLayersBarrel[i - 1]);
750  si_barrel_resY_mean->GetYaxis()->SetTitle("Residual Y Mean [mm]");
751  TH1F* si_eca_resY_mean = new TH1F("si_eca_resY_mean", "Residual Y Mean vs Silicon ECA Layer", 21, -0.5, 20.5);
752  for (int i = 1; i <= nx; i++) si_eca_resY_mean->GetXaxis()->SetBinLabel(i, siliconLayers[i - 1]);
753  si_eca_resY_mean->GetYaxis()->SetTitle("Residual Y Mean [mm]");
754  TH1F* si_ecc_resY_mean = new TH1F("si_ecc_resY_mean", "Residual Y Mean vs Silicon ECC Layer", 21, -0.5, 20.5);
755  for (int i = 1; i <= nx; i++) si_ecc_resY_mean->GetXaxis()->SetBinLabel(i, siliconLayers[i - 1]);
756  si_ecc_resY_mean->GetYaxis()->SetTitle("Residual Y Mean [mm]");
757  meanRMSProjections2D(si_barrel_resX, si_barrel_resX_mean, 2);
758  meanRMSProjections2D(si_barrel_resY, si_barrel_resY_mean, 2);
759  meanRMSProjections2D(si_eca_resX, si_eca_resX_mean, 2);
760  meanRMSProjections2D(si_eca_resY, si_eca_resY_mean, 2);
761  meanRMSProjections2D(si_ecc_resX, si_ecc_resX_mean, 2);
762  meanRMSProjections2D(si_ecc_resY, si_ecc_resY_mean, 2);
763 
764  //residual width for each layer in Silicon barrel and endcaps
765  TH1F* si_barrel_resX_rms =
766  new TH1F("si_barrel_resX_rms", "Residual X Width vs Silicon Barrel Layer", 12, -0.5, 11.5);
767  for (int i = 1; i <= 12; i++) si_barrel_resX_rms->GetXaxis()->SetBinLabel(i, siliconLayersBarrel[i - 1]);
768  si_barrel_resX_rms->GetYaxis()->SetTitle("Residual X Width [mm]");
769  TH1F* si_eca_resX_rms = new TH1F("si_eca_resX_rms", "Residual X Width vs Silicon ECA Layer", 21, -0.5, 20.5);
770  for (int i = 1; i <= nx; i++) si_eca_resX_rms->GetXaxis()->SetBinLabel(i, siliconLayers[i - 1]);
771  si_eca_resX_rms->GetYaxis()->SetTitle("Residual X Width [mm]");
772  TH1F* si_ecc_resX_rms = new TH1F("si_ecc_resX_rms", "Residual X Width vs Silicon ECC Layer", 21, -0.5, 20.5);
773  for (int i = 1; i <= nx; i++) si_ecc_resX_rms->GetXaxis()->SetBinLabel(i, siliconLayers[i - 1]);
774  si_ecc_resX_rms->GetYaxis()->SetTitle("Residual X Width [mm]");
775  TH1F* si_barrel_resY_rms =
776  new TH1F("si_barrel_resY_rms", "Residual Y Width vs Silicon Barrel Layer", 12, -0.5, 11.5);
777  for (int i = 1; i <= 12; i++) si_barrel_resY_rms->GetXaxis()->SetBinLabel(i, siliconLayersBarrel[i - 1]);
778  si_barrel_resY_rms->GetYaxis()->SetTitle("Residual Y Width [mm]");
779  TH1F* si_eca_resY_rms = new TH1F("si_eca_resY_rms", "Residual Y Width vs Silicon ECA Layer", 21, -0.5, 20.5);
780  for (int i = 1; i <= nx; i++) si_eca_resY_rms->GetXaxis()->SetBinLabel(i, siliconLayers[i - 1]);
781  si_eca_resY_rms->GetYaxis()->SetTitle("Residual Y Width [mm]");
782  TH1F* si_ecc_resY_rms = new TH1F("si_ecc_resY_rms", "Residual Y Width vs Silicon ECC Layer", 21, -0.5, 20.5);
783  for (int i = 1; i <= nx; i++) si_ecc_resY_rms->GetXaxis()->SetBinLabel(i, siliconLayers[i - 1]);
784  si_ecc_resY_rms->GetYaxis()->SetTitle("Residual Y Width [mm]");
785  meanRMSProjections2D(si_barrel_resX, si_barrel_resX_rms, 3);
786  meanRMSProjections2D(si_barrel_resY, si_barrel_resY_rms, 3);
787  meanRMSProjections2D(si_eca_resX, si_eca_resX_rms, 3);
788  meanRMSProjections2D(si_eca_resY, si_eca_resY_rms, 3);
789  meanRMSProjections2D(si_ecc_resX, si_ecc_resX_rms, 3);
790  meanRMSProjections2D(si_ecc_resY, si_ecc_resY_rms, 3);
791 
792  //x residual mean as a function of ring in the Pixel barrel
793 
794  TH1F* pix_b0_xresvsmodeta = new TH1F("pix_b0_xresvsmodeta", "X Residual Mean vs Eta-ID Pixel Barrel L0", 20, -10.5,
795  9.5);
796  pix_b0_xresvsmodeta->GetYaxis()->SetTitle("Mean Residual X [mm]");
797  pix_b0_xresvsmodeta->GetXaxis()->SetTitle("Module Eta-ID");
798  TH1F* pix_b1_xresvsmodeta = new TH1F("pix_b1_xresvsmodeta", "X Residual Mean vs Eta-ID Pixel Barrel L1", 13, -6.5,
799  6.5);
800  pix_b1_xresvsmodeta->GetYaxis()->SetTitle("Mean Residual X [mm]");
801  pix_b1_xresvsmodeta->GetXaxis()->SetTitle("Module Eta-ID");
802  TH1F* pix_b2_xresvsmodeta = new TH1F("pix_b2_xresvsmodeta", "X Residual Mean vs Eta-ID Pixel Barrel L2", 13, -6.5,
803  6.5);
804  pix_b2_xresvsmodeta->GetYaxis()->SetTitle("Mean Residual X [mm]");
805  pix_b2_xresvsmodeta->GetXaxis()->SetTitle("Module Eta-ID");
806  TH1F* pix_b3_xresvsmodeta = new TH1F("pix_b3_xresvsmodeta", "X Residual Mean vs Eta-ID Pixel Barrel L3", 13, -6.5,
807  6.5);
808  pix_b3_xresvsmodeta->GetYaxis()->SetTitle("Mean Residual X [mm]");
809  pix_b3_xresvsmodeta->GetXaxis()->SetTitle("Module Eta-ID");
810 
811  meanRMSProjections3D_XY(pix_b0_xresvsmodetaphi_3d, pix_b0_xresvsmodeta, 0, 2);
812  meanRMSProjections3D_XY(pix_b1_xresvsmodetaphi_3d, pix_b1_xresvsmodeta, 0, 2);
813  meanRMSProjections3D_XY(pix_b2_xresvsmodetaphi_3d, pix_b2_xresvsmodeta, 0, 2);
814  meanRMSProjections3D_XY(pix_b3_xresvsmodetaphi_3d, pix_b3_xresvsmodeta, 0, 2);
815  plots->Add(pix_b0_xresvsmodeta);
816  plots->Add(pix_b1_xresvsmodeta);
817  plots->Add(pix_b2_xresvsmodeta);
818  plots->Add(pix_b3_xresvsmodeta);
819  TH1F* pix_b_xresvsmodeta = combineHistos("pix_b_xresvsmodeta", "X Residual Mean vs (Modified) Eta-ID Pixel Barrel",
820  plots, 10);
821  pix_b_xresvsmodeta->GetYaxis()->SetTitle("Mean Residual X [mm]");
822  pix_b_xresvsmodeta->GetXaxis()->SetTitle("(Modified) Eta-ID");
823  plots->Clear();
824 
825  //x residual width as a function of ring in the Pixel barrel
826  TH1F* pix_b0_xresvsmodeta_width = new TH1F("pix_b0_xresvsmodeta_width",
827  "X Residual Width vs Eta-ID Pixel Barrel L0", 20, -10.5, 9.5);
828  pix_b0_xresvsmodeta_width->GetYaxis()->SetTitle("Width Residual X [mm]");
829  pix_b0_xresvsmodeta_width->GetXaxis()->SetTitle("Module Eta-ID");
830  TH1F* pix_b1_xresvsmodeta_width = new TH1F("pix_b1_xresvsmodeta_width",
831  "X Residual Width vs Eta-ID Pixel Barrel L1", 13, -6.5, 6.5);
832  pix_b1_xresvsmodeta_width->GetYaxis()->SetTitle("Width Residual X [mm]");
833  pix_b1_xresvsmodeta_width->GetXaxis()->SetTitle("Module Eta-ID");
834  TH1F* pix_b2_xresvsmodeta_width = new TH1F("pix_b2_xresvsmodeta_width",
835  "X Residual Width vs Eta-ID Pixel Barrel L2", 13, -6.5, 6.5);
836  pix_b2_xresvsmodeta_width->GetYaxis()->SetTitle("Width Residual X [mm]");
837  pix_b2_xresvsmodeta_width->GetXaxis()->SetTitle("Module Eta-ID");
838  TH1F* pix_b3_xresvsmodeta_width = new TH1F("pix_b3_xresvsmodeta_width",
839  "X Residual Width vs Eta-ID Pixel Barrel L3", 13, -6.5, 6.5);
840  pix_b3_xresvsmodeta_width->GetYaxis()->SetTitle("Width Residual X [mm]");
841  pix_b3_xresvsmodeta_width->GetXaxis()->SetTitle("Module Eta-ID");
842  meanRMSProjections3D_XY(pix_b0_xresvsmodetaphi_3d, pix_b0_xresvsmodeta_width, 0, 3);
843  meanRMSProjections3D_XY(pix_b1_xresvsmodetaphi_3d, pix_b1_xresvsmodeta_width, 0, 3);
844  meanRMSProjections3D_XY(pix_b2_xresvsmodetaphi_3d, pix_b2_xresvsmodeta_width, 0, 3);
845  meanRMSProjections3D_XY(pix_b3_xresvsmodetaphi_3d, pix_b3_xresvsmodeta_width, 0, 3);
846  plots->Add(pix_b0_xresvsmodeta_width);
847  plots->Add(pix_b1_xresvsmodeta_width);
848  plots->Add(pix_b2_xresvsmodeta_width);
849  plots->Add(pix_b3_xresvsmodeta_width);
850  TH1F* pix_b_xresvsmodeta_width = combineHistos("pix_b_xresvsmodeta_width",
851  "X Residual Width vs (Modified) Eta-ID Pixel Barrel", plots, 10);
852  pix_b_xresvsmodeta_width->GetYaxis()->SetTitle("Width Residual X [mm]");
853  pix_b_xresvsmodeta_width->GetXaxis()->SetTitle("(Modified) Eta-ID");
854  plots->Clear();
855 
856  //y residual mean as a function of ring in the Pixel barrel
857  TH1F* pix_b0_yresvsmodeta = new TH1F("pix_b0_yresvsmodeta", "Y Residual Mean vs Eta-ID Pixel Barrel L0", 20, -10.5,
858  9.5);
859  pix_b0_yresvsmodeta->GetYaxis()->SetTitle("Mean Residual Y [mm]");
860  pix_b0_yresvsmodeta->GetXaxis()->SetTitle("Module Eta-ID");
861  TH1F* pix_b1_yresvsmodeta = new TH1F("pix_b1_yresvsmodeta", "Y Residual Mean vs Eta-ID Pixel Barrel L1", 13, -6.5,
862  6.5);
863  pix_b1_yresvsmodeta->GetYaxis()->SetTitle("Mean Residual Y [mm]");
864  pix_b1_yresvsmodeta->GetXaxis()->SetTitle("Module Eta-ID");
865  TH1F* pix_b2_yresvsmodeta = new TH1F("pix_b2_yresvsmodeta", "Y Residual Mean vs Eta-ID Pixel Barrel L2", 13, -6.5,
866  6.5);
867  pix_b2_yresvsmodeta->GetYaxis()->SetTitle("Mean Residual Y [mm]");
868  pix_b2_yresvsmodeta->GetXaxis()->SetTitle("Module Eta-ID");
869  TH1F* pix_b3_yresvsmodeta = new TH1F("pix_b3_yresvsmodeta", "Y Residual Mean vs Eta-ID Pixel Barrel L2", 13, -6.5,
870  6.5);
871  pix_b3_yresvsmodeta->GetYaxis()->SetTitle("Mean Residual Y [mm]");
872  pix_b3_yresvsmodeta->GetXaxis()->SetTitle("Module Eta-ID");
873  meanRMSProjections3D_XY(pix_b0_yresvsmodetaphi_3d, pix_b0_yresvsmodeta, 0, 2);
874  meanRMSProjections3D_XY(pix_b1_yresvsmodetaphi_3d, pix_b1_yresvsmodeta, 0, 2);
875  meanRMSProjections3D_XY(pix_b2_yresvsmodetaphi_3d, pix_b2_yresvsmodeta, 0, 2);
876  meanRMSProjections3D_XY(pix_b3_yresvsmodetaphi_3d, pix_b3_yresvsmodeta, 0, 2);
877  plots->Add(pix_b0_yresvsmodeta);
878  plots->Add(pix_b1_yresvsmodeta);
879  plots->Add(pix_b2_yresvsmodeta);
880  plots->Add(pix_b3_yresvsmodeta);
881  TH1F* pix_b_yresvsmodeta = combineHistos("pix_b_yresvsmodeta", "Y Residual Mean vs (Modified) Eta-ID Pixel Barrel",
882  plots, 10);
883  pix_b_yresvsmodeta->GetYaxis()->SetTitle("Mean Residual Y [mm]");
884  pix_b_yresvsmodeta->GetXaxis()->SetTitle("(Modified) Eta-ID");
885  plots->Clear();
886 
887  //y residual width as a function of ring in the Pixel barrel
888  TH1F* pix_b0_yresvsmodeta_width = new TH1F("pix_b0_yresvsmodeta_width",
889  "Y Residual Width vs Eta-ID Pixel Barrel L0", 20, -10.5, 9.5);
890  pix_b0_yresvsmodeta_width->GetYaxis()->SetTitle("Width Residual Y [mm]");
891  pix_b0_yresvsmodeta_width->GetXaxis()->SetTitle("Module Eta-ID");
892  TH1F* pix_b1_yresvsmodeta_width = new TH1F("pix_b1_yresvsmodeta_width",
893  "Y Residual Width vs Eta-ID Pixel Barrel L1", 13, -6.5, 6.5);
894  pix_b1_yresvsmodeta_width->GetYaxis()->SetTitle("Width Residual Y [mm]");
895  pix_b1_yresvsmodeta_width->GetXaxis()->SetTitle("Module Eta-ID");
896  TH1F* pix_b2_yresvsmodeta_width = new TH1F("pix_b2_yresvsmodeta_width",
897  "Y Residual Width vs Eta-ID Pixel Barrel L2", 13, -6.5, 6.5);
898  pix_b2_yresvsmodeta_width->GetYaxis()->SetTitle("Width Residual Y [mm]");
899  pix_b2_yresvsmodeta_width->GetXaxis()->SetTitle("Module Eta-ID");
900  TH1F* pix_b3_yresvsmodeta_width = new TH1F("pix_b3_yresvsmodeta_width",
901  "Y Residual Width vs Eta-ID Pixel Barrel L2", 13, -6.5, 6.5);
902  pix_b3_yresvsmodeta_width->GetYaxis()->SetTitle("Width Residual Y [mm]");
903  pix_b3_yresvsmodeta_width->GetXaxis()->SetTitle("Module Eta-ID");
904 
905  meanRMSProjections3D_XY(pix_b0_yresvsmodetaphi_3d, pix_b0_yresvsmodeta_width, 0, 3);
906  meanRMSProjections3D_XY(pix_b1_yresvsmodetaphi_3d, pix_b1_yresvsmodeta_width, 0, 3);
907  meanRMSProjections3D_XY(pix_b2_yresvsmodetaphi_3d, pix_b2_yresvsmodeta_width, 0, 3);
908  meanRMSProjections3D_XY(pix_b3_yresvsmodetaphi_3d, pix_b3_yresvsmodeta_width, 0, 3);
909  plots->Add(pix_b0_yresvsmodeta_width);
910  plots->Add(pix_b1_yresvsmodeta_width);
911  plots->Add(pix_b2_yresvsmodeta_width);
912  plots->Add(pix_b3_yresvsmodeta_width);
913 
914  TH1F* pix_b_yresvsmodeta_width = combineHistos("pix_b_yresvsmodeta_width",
915  "Y Residual Width vs (Modified) Eta-ID Pixel Barrel", plots, 10);
916  pix_b_yresvsmodeta_width->GetYaxis()->SetTitle("Width Residual Y [mm]");
917  pix_b_yresvsmodeta_width->GetXaxis()->SetTitle("(Modified) Eta-ID");
918  plots->Clear();
919 
920  //x residual mean as a function of stave in the Pixel barrel
921 
922  TH1F* pix_b0_xresvsmodphi = new TH1F("pix_b0_xresvsmodphi", "X Residual Mean vs Phi-ID Pixel Barrel L0", 14, 0, 14);
923  pix_b0_xresvsmodphi->GetYaxis()->SetTitle("Mean Residual X [mm]");
924  pix_b0_xresvsmodphi->GetXaxis()->SetTitle("Module Phi-ID");
925  TH1F* pix_b1_xresvsmodphi =
926  new TH1F("pix_b1_xresvsmodphi", "X Residual Mean vs Phi-ID Pixel Barrel L0", 22, -0, 22);
927  pix_b1_xresvsmodphi->GetYaxis()->SetTitle("Mean Residual X [mm]");
928  pix_b1_xresvsmodphi->GetXaxis()->SetTitle("Module Phi-ID");
929  TH1F* pix_b2_xresvsmodphi = new TH1F("pix_b2_xresvsmodphi", "X Residual Mean vs Phi-ID Pixel Barrel L1", 38, 0, 38);
930  pix_b2_xresvsmodphi->GetYaxis()->SetTitle("Mean Residual X [mm]");
931  pix_b2_xresvsmodphi->GetXaxis()->SetTitle("Module Phi-ID");
932  TH1F* pix_b3_xresvsmodphi = new TH1F("pix_b3_xresvsmodphi", "X Residual Mean vs Phi-ID Pixel Barrel L2", 52, 0, 52);
933  pix_b3_xresvsmodphi->GetYaxis()->SetTitle("Mean Residual X [mm]");
934  pix_b3_xresvsmodphi->GetXaxis()->SetTitle("Module Phi-ID");
935 
936 
937  meanRMSProjections3D_XY(pix_b0_xresvsmodetaphi_3d, pix_b0_xresvsmodphi, 1, 2);
938  meanRMSProjections3D_XY(pix_b1_xresvsmodetaphi_3d, pix_b1_xresvsmodphi, 1, 2);
939  meanRMSProjections3D_XY(pix_b2_xresvsmodetaphi_3d, pix_b2_xresvsmodphi, 1, 2);
940  meanRMSProjections3D_XY(pix_b3_xresvsmodetaphi_3d, pix_b3_xresvsmodphi, 1, 2);
941 
942  plots->Add(pix_b0_xresvsmodphi);
943  plots->Add(pix_b1_xresvsmodphi);
944  plots->Add(pix_b2_xresvsmodphi);
945  plots->Add(pix_b3_xresvsmodphi);
946  TH1F* pix_b_xresvsmodphi = combineHistos("pix_b_xresvsmodphi", "X Residual Mean vs (Modified) Phi-ID Pixel Barrel",
947  plots, 10);
948  pix_b_xresvsmodphi->GetYaxis()->SetTitle("Mean Residual X [mm]");
949  pix_b_xresvsmodphi->GetXaxis()->SetTitle("(Modified) Phi-ID");
950  plots->Clear();
951 
952  //x residual width as a function of stave in the Pixel barrel
953  TH1F* pix_b0_xresvsmodphi_width = new TH1F("pix_b0_xresvsmodphi_width",
954  "X Residual Width vs Phi-ID Pixel Barrel L0", 14, 0, 14);
955  pix_b0_xresvsmodphi_width->GetYaxis()->SetTitle("Width Residual X [mm]");
956  pix_b0_xresvsmodphi_width->GetXaxis()->SetTitle("Module Phi-ID");
957  TH1F* pix_b1_xresvsmodphi_width = new TH1F("pix_b1_xresvsmodphi_width",
958  "X Residual Width vs Phi-ID Pixel Barrel L0", 22, 0., 22);
959  pix_b1_xresvsmodphi_width->GetYaxis()->SetTitle("Width Residual X [mm]");
960  pix_b1_xresvsmodphi_width->GetXaxis()->SetTitle("Module Phi-ID");
961  TH1F* pix_b2_xresvsmodphi_width = new TH1F("pix_b2_xresvsmodphi_width",
962  "X Residual Width vs Phi-ID Pixel Barrel L1", 38, 0, 38);
963  pix_b2_xresvsmodphi_width->GetYaxis()->SetTitle("Width Residual X [mm]");
964  pix_b2_xresvsmodphi_width->GetXaxis()->SetTitle("Module Phi-ID");
965  TH1F* pix_b3_xresvsmodphi_width = new TH1F("pix_b3_xresvsmodphi_width",
966  "X Residual Width vs Phi-ID Pixel Barrel L2", 52, 0, 52);
967  pix_b3_xresvsmodphi_width->GetYaxis()->SetTitle("Width Residual X [mm]");
968  pix_b3_xresvsmodphi_width->GetXaxis()->SetTitle("Module Phi-ID");
969  meanRMSProjections3D_XY(pix_b0_xresvsmodetaphi_3d, pix_b0_xresvsmodphi_width, 1, 3);
970  meanRMSProjections3D_XY(pix_b1_xresvsmodetaphi_3d, pix_b1_xresvsmodphi_width, 1, 3);
971  meanRMSProjections3D_XY(pix_b2_xresvsmodetaphi_3d, pix_b2_xresvsmodphi_width, 1, 3);
972  meanRMSProjections3D_XY(pix_b3_xresvsmodetaphi_3d, pix_b3_xresvsmodphi_width, 1, 3);
973  plots->Add(pix_b0_xresvsmodphi_width);
974  plots->Add(pix_b1_xresvsmodphi_width);
975  plots->Add(pix_b2_xresvsmodphi_width);
976  plots->Add(pix_b3_xresvsmodphi_width);
977  TH1F* pix_b_xresvsmodphi_width = combineHistos("pix_b_xresvsmodphi_width",
978  "X Residual Width vs (Modified) Phi-ID Pixel Barrel", plots, 10);
979  pix_b_xresvsmodphi_width->GetYaxis()->SetTitle("Width Residual X [mm]");
980  pix_b_xresvsmodphi_width->GetXaxis()->SetTitle("(Modified) Phi-ID");
981  plots->Clear();
982 
983  //y residual mean as a function of stave in the Pixel barrel
984  TH1F* pix_b0_yresvsmodphi = new TH1F("pix_b0_yresvsmodphi", "Y Residual Mean vs Phi-ID Pixel Barrel L0", 14, 0, 14);
985  pix_b0_yresvsmodphi->GetYaxis()->SetTitle("Mean Residual Y [mm]");
986  pix_b0_yresvsmodphi->GetXaxis()->SetTitle("Module Phi-ID");
987  TH1F* pix_b1_yresvsmodphi = new TH1F("pix_b1_yresvsmodphi", "Y Residual Mean vs Phi-ID Pixel Barrel L0", 22, 0, 22);
988  pix_b1_yresvsmodphi->GetYaxis()->SetTitle("Mean Residual Y [mm]");
989  pix_b1_yresvsmodphi->GetXaxis()->SetTitle("Module Phi-ID");
990  TH1F* pix_b2_yresvsmodphi = new TH1F("pix_b2_yresvsmodphi", "Y Residual Mean vs Phi-ID Pixel Barrel L1", 38, 0, 38);
991  pix_b2_yresvsmodphi->GetYaxis()->SetTitle("Mean Residual Y [mm]");
992  pix_b2_yresvsmodphi->GetXaxis()->SetTitle("Module Phi-ID");
993  TH1F* pix_b3_yresvsmodphi = new TH1F("pix_b3_yresvsmodphi", "Y Residual Mean vs Phi-ID Pixel Barrel L2", 52, 0, 52);
994  pix_b3_yresvsmodphi->GetYaxis()->SetTitle("Mean Residual Y [mm]");
995  pix_b3_yresvsmodphi->GetXaxis()->SetTitle("Module Phi-ID");
996  meanRMSProjections3D_XY(pix_b0_yresvsmodetaphi_3d, pix_b0_yresvsmodphi, 1, 2);
997  meanRMSProjections3D_XY(pix_b1_yresvsmodetaphi_3d, pix_b1_yresvsmodphi, 1, 2);
998  meanRMSProjections3D_XY(pix_b2_yresvsmodetaphi_3d, pix_b2_yresvsmodphi, 1, 2);
999  meanRMSProjections3D_XY(pix_b3_yresvsmodetaphi_3d, pix_b3_yresvsmodphi, 1, 2);
1000  plots->Add(pix_b0_yresvsmodphi);
1001  plots->Add(pix_b1_yresvsmodphi);
1002  plots->Add(pix_b2_yresvsmodphi);
1003  plots->Add(pix_b3_yresvsmodphi);
1004 
1005  TH1F* pix_b_yresvsmodphi = combineHistos("pix_b_yresvsmodphi", "Y Residual Mean vs (Modified) Phi-ID Pixel Barrel",
1006  plots, 10);
1007  pix_b_yresvsmodphi->GetYaxis()->SetTitle("Mean Residual Y [mm]");
1008  pix_b_yresvsmodphi->GetXaxis()->SetTitle("(Modified) Phi-ID");
1009  plots->Clear();
1010 
1011  //y residual width as a function of stave in the Pixel barrel
1012  TH1F* pix_b0_yresvsmodphi_width = new TH1F("pix_b0_yresvsmodphi_width",
1013  "Y Residual Width vs Phi-ID Pixel Barrel L0", 14, 0, 14);
1014  pix_b0_yresvsmodphi_width->GetYaxis()->SetTitle("Width Residual Y [mm]");
1015  pix_b0_yresvsmodphi_width->GetXaxis()->SetTitle("Module Phi-ID");
1016  TH1F* pix_b1_yresvsmodphi_width = new TH1F("pix_b1_yresvsmodphi_width",
1017  "Y Residual Width vs Phi-ID Pixel Barrel L0", 22, -0, 22);
1018  pix_b1_yresvsmodphi_width->GetYaxis()->SetTitle("Width Residual Y [mm]");
1019  pix_b1_yresvsmodphi_width->GetXaxis()->SetTitle("Module Phi-ID");
1020  TH1F* pix_b2_yresvsmodphi_width = new TH1F("pix_b2_yresvsmodphi_width",
1021  "Y Residual Width vs Phi-ID Pixel Barrel L1", 38, 0, 38);
1022  pix_b2_yresvsmodphi_width->GetYaxis()->SetTitle("Width Residual Y [mm]");
1023  pix_b2_yresvsmodphi_width->GetXaxis()->SetTitle("Module Phi-ID");
1024  TH1F* pix_b3_yresvsmodphi_width = new TH1F("pix_b3_yresvsmodphi_width",
1025  "Y Residual Width vs Phi-ID Pixel Barrel L2", 52, 0, 52);
1026  pix_b3_yresvsmodphi_width->GetYaxis()->SetTitle("Width Residual Y [mm]");
1027  pix_b3_yresvsmodphi_width->GetXaxis()->SetTitle("Module Phi-ID");
1028  meanRMSProjections3D_XY(pix_b0_yresvsmodetaphi_3d, pix_b0_yresvsmodphi_width, 1, 3);
1029  meanRMSProjections3D_XY(pix_b1_yresvsmodetaphi_3d, pix_b1_yresvsmodphi_width, 1, 3);
1030  meanRMSProjections3D_XY(pix_b2_yresvsmodetaphi_3d, pix_b2_yresvsmodphi_width, 1, 3);
1031  meanRMSProjections3D_XY(pix_b3_yresvsmodetaphi_3d, pix_b3_yresvsmodphi_width, 1, 3);
1032  plots->Add(pix_b0_yresvsmodphi_width);
1033  plots->Add(pix_b1_yresvsmodphi_width);
1034  plots->Add(pix_b2_yresvsmodphi_width);
1035  plots->Add(pix_b3_yresvsmodphi_width);
1036  TH1F* pix_b_yresvsmodphi_width = combineHistos("pix_b_yresvsmodphi_width",
1037  "Y Residual Width vs (Modified) Phi-ID Pixel Barrel", plots, 10);
1038  pix_b_yresvsmodphi_width->GetYaxis()->SetTitle("Width Residual Y [mm]");
1039  pix_b_yresvsmodphi_width->GetXaxis()->SetTitle("(Modified) Phi-ID");
1040  plots->Clear();
1041 
1042  //x residual mean as a function of ring in the SCT barrel
1043  TH1F* sct_b0_xresvsmodeta = new TH1F("sct_b0_xresvsmodeta", "X Residual Mean vs Eta-ID SCT Barrel L0", 13, -0.5,
1044  12.5);
1045  pix_b0_xresvsmodeta->GetYaxis()->SetTitle("Mean Residual X [mm]");
1046  pix_b0_xresvsmodeta->GetXaxis()->SetTitle("Module Eta-ID");
1047  TH1F* sct_b1_xresvsmodeta = new TH1F("sct_b1_xresvsmodeta", "X Residual Mean vs Eta-ID SCT Barrel L1", 13, -0.5,
1048  12.5);
1049  sct_b1_xresvsmodeta->GetYaxis()->SetTitle("Mean Residual X [mm]");
1050  sct_b1_xresvsmodeta->GetXaxis()->SetTitle("Module Eta-ID");
1051  TH1F* sct_b2_xresvsmodeta = new TH1F("sct_b2_xresvsmodeta", "X Residual Mean vs Eta-ID SCT Barrel L2", 13, -0.5,
1052  12.5);
1053  sct_b2_xresvsmodeta->GetYaxis()->SetTitle("Mean Residual X [mm]");
1054  sct_b2_xresvsmodeta->GetXaxis()->SetTitle("Module Eta-ID");
1055  TH1F* sct_b3_xresvsmodeta = new TH1F("sct_b3_xresvsmodeta", "X Residual Mean vs Eta-ID SCT Barrel L3", 13, -0.5,
1056  12.5);
1057  sct_b3_xresvsmodeta->GetYaxis()->SetTitle("Mean Residual X [mm]");
1058  sct_b3_xresvsmodeta->GetXaxis()->SetTitle("Module Eta-ID");
1059  meanRMSProjections3D_XY(sct_b0_xresvsmodetaphi_3d, sct_b0_xresvsmodeta, 0, 2);
1060  meanRMSProjections3D_XY(sct_b1_xresvsmodetaphi_3d, sct_b1_xresvsmodeta, 0, 2);
1061  meanRMSProjections3D_XY(sct_b2_xresvsmodetaphi_3d, sct_b2_xresvsmodeta, 0, 2);
1062  meanRMSProjections3D_XY(sct_b3_xresvsmodetaphi_3d, sct_b3_xresvsmodeta, 0, 2);
1063  plots->Add(sct_b0_xresvsmodeta);
1064  plots->Add(sct_b1_xresvsmodeta);
1065  plots->Add(sct_b2_xresvsmodeta);
1066  plots->Add(sct_b3_xresvsmodeta);
1067  TH1F* sct_b_xresvsmodeta = combineHistos("sct_b_xresvsmodeta", "X Residual Mean vs (Modified) Eta-ID SCT Barrel",
1068  plots, 10);
1069  sct_b_xresvsmodeta->GetYaxis()->SetTitle("Mean Residual X [mm]");
1070  sct_b_xresvsmodeta->GetXaxis()->SetTitle("(Modified) Eta-ID");
1071  plots->Clear();
1072 
1073  //x residual width as a function of ring in the SCT barrel
1074  TH1F* sct_b0_xresvsmodeta_width = new TH1F("sct_b0_xresvsmodeta_width", "X Residual Width vs Eta-ID SCT Barrel L0",
1075  13, -0.5, 12.5);
1076  pix_b0_xresvsmodeta_width->GetYaxis()->SetTitle("Width Residual X [mm]");
1077  pix_b0_xresvsmodeta_width->GetXaxis()->SetTitle("Module Eta-ID");
1078  TH1F* sct_b1_xresvsmodeta_width = new TH1F("sct_b1_xresvsmodeta_width", "X Residual Width vs Eta-ID SCT Barrel L1",
1079  13, -0.5, 12.5);
1080  sct_b1_xresvsmodeta_width->GetYaxis()->SetTitle("Width Residual X [mm]");
1081  sct_b1_xresvsmodeta_width->GetXaxis()->SetTitle("Module Eta-ID");
1082  TH1F* sct_b2_xresvsmodeta_width = new TH1F("sct_b2_xresvsmodeta_width", "X Residual Width vs Eta-ID SCT Barrel L2",
1083  13, -0.5, 12.5);
1084  sct_b2_xresvsmodeta_width->GetYaxis()->SetTitle("Width Residual X [mm]");
1085  sct_b2_xresvsmodeta_width->GetXaxis()->SetTitle("Module Eta-ID");
1086  TH1F* sct_b3_xresvsmodeta_width = new TH1F("sct_b3_xresvsmodeta_width", "X Residual Width vs Eta-ID SCT Barrel L3",
1087  13, -0.5, 12.5);
1088  sct_b3_xresvsmodeta_width->GetYaxis()->SetTitle("Width Residual X [mm]");
1089  sct_b3_xresvsmodeta_width->GetXaxis()->SetTitle("Module Eta-ID");
1090  meanRMSProjections3D_XY(sct_b0_xresvsmodetaphi_3d, sct_b0_xresvsmodeta_width, 0, 3);
1091  meanRMSProjections3D_XY(sct_b1_xresvsmodetaphi_3d, sct_b1_xresvsmodeta_width, 0, 3);
1092  meanRMSProjections3D_XY(sct_b2_xresvsmodetaphi_3d, sct_b2_xresvsmodeta_width, 0, 3);
1093  meanRMSProjections3D_XY(sct_b3_xresvsmodetaphi_3d, sct_b3_xresvsmodeta_width, 0, 3);
1094  plots->Add(sct_b0_xresvsmodeta_width);
1095  plots->Add(sct_b1_xresvsmodeta_width);
1096  plots->Add(sct_b2_xresvsmodeta_width);
1097  plots->Add(sct_b3_xresvsmodeta_width);
1098  TH1F* sct_b_xresvsmodeta_width = combineHistos("sct_b_xresvsmodeta_width",
1099  "X Residual Width vs (Modified) Eta-ID SCT Barrel", plots, 10);
1100  sct_b_xresvsmodeta_width->GetYaxis()->SetTitle("Width Residual X [mm]");
1101  sct_b_xresvsmodeta_width->GetXaxis()->SetTitle("(Modified) Eta-ID");
1102  plots->Clear();
1103 
1104  //x residual mean as a function of stave in the SCT barrel
1105  TH1F* sct_b0_xresvsmodphi = new TH1F("sct_b0_xresvsmodphi", "X Residual Mean vs Phi-ID SCT Barrel L0", 32, -0.5,
1106  31.5);
1107  pix_b0_xresvsmodphi->GetYaxis()->SetTitle("Mean Residual X [mm]");
1108  pix_b0_xresvsmodphi->GetXaxis()->SetTitle("Module Phi-ID");
1109  TH1F* sct_b1_xresvsmodphi = new TH1F("sct_b1_xresvsmodphi", "X Residual Mean vs Phi-ID SCT Barrel L1", 40, -0.5,
1110  39.5);
1111  sct_b1_xresvsmodphi->GetYaxis()->SetTitle("Mean Residual X [mm]");
1112  sct_b1_xresvsmodphi->GetXaxis()->SetTitle("Module Phi-ID");
1113  TH1F* sct_b2_xresvsmodphi = new TH1F("sct_b2_xresvsmodphi", "X Residual Mean vs Phi-ID SCT Barrel L2", 48, -0.5,
1114  47.5);
1115  sct_b2_xresvsmodphi->GetYaxis()->SetTitle("Mean Residual X [mm]");
1116  sct_b2_xresvsmodphi->GetXaxis()->SetTitle("Module Phi-ID");
1117  TH1F* sct_b3_xresvsmodphi = new TH1F("sct_b3_xresvsmodphi", "X Residual Mean vs Phi-ID SCT Barrel L3", 56, -0.5,
1118  55.5);
1119  sct_b3_xresvsmodphi->GetYaxis()->SetTitle("Mean Residual X [mm]");
1120  sct_b3_xresvsmodphi->GetXaxis()->SetTitle("Module Phi-ID");
1121  meanRMSProjections3D_XY(sct_b0_xresvsmodetaphi_3d, sct_b0_xresvsmodphi, 1, 2);
1122  meanRMSProjections3D_XY(sct_b1_xresvsmodetaphi_3d, sct_b1_xresvsmodphi, 1, 2);
1123  meanRMSProjections3D_XY(sct_b2_xresvsmodetaphi_3d, sct_b2_xresvsmodphi, 1, 2);
1124  meanRMSProjections3D_XY(sct_b3_xresvsmodetaphi_3d, sct_b3_xresvsmodphi, 1, 2);
1125  plots->Add(sct_b0_xresvsmodphi);
1126  plots->Add(sct_b1_xresvsmodphi);
1127  plots->Add(sct_b2_xresvsmodphi);
1128  plots->Add(sct_b3_xresvsmodphi);
1129  TH1F* sct_b_xresvsmodphi = combineHistos("sct_b_xresvsmodphi", "X Residual Mean vs (Modified) Phi-ID SCT Barrel",
1130  plots, 10);
1131  sct_b_xresvsmodphi->GetYaxis()->SetTitle("Mean Residual X [mm]");
1132  sct_b_xresvsmodphi->GetXaxis()->SetTitle("(Modified) Phi-ID");
1133  plots->Clear();
1134 
1135  //x residual width as a function of stave in the SCT barrel
1136  TH1F* sct_b0_xresvsmodphi_width = new TH1F("sct_b0_xresvsmodphi_width", "X Residual Width vs Phi-ID SCT Barrel L0",
1137  32, -0.5, 31.5);
1138  pix_b0_xresvsmodphi_width->GetYaxis()->SetTitle("Width Residual X [mm]");
1139  pix_b0_xresvsmodphi_width->GetXaxis()->SetTitle("Module Phi-ID");
1140  TH1F* sct_b1_xresvsmodphi_width = new TH1F("sct_b1_xresvsmodphi_width", "X Residual Width vs Phi-ID SCT Barrel L1",
1141  40, -0.5, 39.5);
1142  sct_b1_xresvsmodphi_width->GetYaxis()->SetTitle("Width Residual X [mm]");
1143  sct_b1_xresvsmodphi_width->GetXaxis()->SetTitle("Module Phi-ID");
1144  TH1F* sct_b2_xresvsmodphi_width = new TH1F("sct_b2_xresvsmodphi_width", "X Residual Width vs Phi-ID SCT Barrel L2",
1145  48, -0.5, 47.5);
1146  sct_b2_xresvsmodphi_width->GetYaxis()->SetTitle("Width Residual X [mm]");
1147  sct_b2_xresvsmodphi_width->GetXaxis()->SetTitle("Module Phi-ID");
1148  TH1F* sct_b3_xresvsmodphi_width = new TH1F("sct_b3_xresvsmodphi_width", "X Residual Width vs Phi-ID SCT Barrel L3",
1149  56, -0.5, 55.5);
1150  sct_b3_xresvsmodphi_width->GetYaxis()->SetTitle("Width Residual X [mm]");
1151  sct_b3_xresvsmodphi_width->GetXaxis()->SetTitle("Module Phi-ID");
1152  meanRMSProjections3D_XY(sct_b0_xresvsmodetaphi_3d, sct_b0_xresvsmodphi_width, 1, 3);
1153  meanRMSProjections3D_XY(sct_b1_xresvsmodetaphi_3d, sct_b1_xresvsmodphi_width, 1, 3);
1154  meanRMSProjections3D_XY(sct_b2_xresvsmodetaphi_3d, sct_b2_xresvsmodphi_width, 1, 3);
1155  meanRMSProjections3D_XY(sct_b3_xresvsmodetaphi_3d, sct_b3_xresvsmodphi_width, 1, 3);
1156  plots->Add(sct_b0_xresvsmodphi_width);
1157  plots->Add(sct_b1_xresvsmodphi_width);
1158  plots->Add(sct_b2_xresvsmodphi_width);
1159  plots->Add(sct_b3_xresvsmodphi_width);
1160  TH1F* sct_b_xresvsmodphi_width = combineHistos("sct_b_xresvsmodphi_width",
1161  "X Residual Width vs (Modified) Phi-ID SCT Barrel", plots, 10);
1162  sct_b_xresvsmodphi_width->GetYaxis()->SetTitle("Width Residual X [mm]");
1163  sct_b_xresvsmodphi_width->GetXaxis()->SetTitle("(Modified) Phi-ID");
1164  plots->Clear();
1165 
1166  //residual mean as function of module eta/phi in Silicon endcaps
1167  TH1F* pix_eca_xresvsmodphi = new TH1F("pix_eca_xresvsmodphi",
1168  "X Residual Mean vs (Modified) Module Phi Pixel Endcap A", 165, 0, 165);
1169  pix_eca_xresvsmodphi->GetYaxis()->SetTitle("Mean Residual X [mm]");
1170  pix_eca_xresvsmodphi->GetXaxis()->SetTitle("(Modified) Module Phi-ID");
1171  meanRMSProjections2D(pix_eca_xresvsmodphi_2d, pix_eca_xresvsmodphi, 2);
1172  TH1F* pix_eca_yresvsmodphi = new TH1F("pix_eca_yresvsmodphi",
1173  "Y Residual Mean vs (Modified) Module Phi Pixel Endcap A", 165, 0, 165);
1174  pix_eca_yresvsmodphi->GetYaxis()->SetTitle("Mean Residual Y [mm]");
1175  pix_eca_yresvsmodphi->GetXaxis()->SetTitle("(Modified) Module Phi-ID");
1176  meanRMSProjections2D(pix_eca_yresvsmodphi_2d, pix_eca_yresvsmodphi, 2);
1177  TH1F* pix_ecc_xresvsmodphi = new TH1F("pix_ecc_xresvsmodphi",
1178  "X Residual Mean vs (Modified) Module Phi Pixel Endcap C", 165, 0, 165);
1179  pix_ecc_xresvsmodphi->GetYaxis()->SetTitle("Mean Residual X [mm]");
1180  pix_ecc_xresvsmodphi->GetXaxis()->SetTitle("(Modified) Module Phi-ID");
1181  meanRMSProjections2D(pix_ecc_xresvsmodphi_2d, pix_ecc_xresvsmodphi, 2);
1182  TH1F* pix_ecc_yresvsmodphi = new TH1F("pix_ecc_yresvsmodphi",
1183  "Y Residual Mean vs (Modified) Module Phi Pixel Endcap C", 165, 0, 165);
1184  pix_ecc_yresvsmodphi->GetYaxis()->SetTitle("Mean Residual Y [mm]");
1185  pix_ecc_yresvsmodphi->GetXaxis()->SetTitle("(Modified) Module Phi-ID");
1186  meanRMSProjections2D(pix_ecc_yresvsmodphi_2d, pix_ecc_yresvsmodphi, 2);
1187  TH1F* sct_eca_xresvsmodphi = new TH1F("sct_eca_xresvsmodphi",
1188  "X Residual Mean vs (Modified) Module Phi SCT Endcap A", 558, 0, 558);
1189  sct_eca_xresvsmodphi->GetYaxis()->SetTitle("Mean Residual X [mm]");
1190  sct_eca_xresvsmodphi->GetXaxis()->SetTitle("(Modified) Module Phi-ID");
1191  meanRMSProjections2D(sct_eca_xresvsmodphi_2d, sct_eca_xresvsmodphi, 2);
1192  TH1F* sct_ecc_xresvsmodphi = new TH1F("sct_ecc_xresvsmodphi",
1193  "X Residual Mean vs (Modified) Module Phi SCT Endcap C", 558, 0, 558);
1194  sct_ecc_xresvsmodphi->GetYaxis()->SetTitle("Mean Residual X [mm]");
1195  sct_ecc_xresvsmodphi->GetXaxis()->SetTitle("(Modified) Module Phi-ID");
1196  meanRMSProjections2D(sct_ecc_xresvsmodphi_2d, sct_ecc_xresvsmodphi, 2);
1197 
1198 
1199  //2-d residual map histograms - pixel barrel residual mean
1200  TH2F* pix_b0_xresvsmodetaphi_mean = new TH2F("pix_b0_xresvsmodetaphi_mean",
1201  "X Residual Mean vs Module Eta-Phi-ID Pixel Barrel L0", 20, -10.5, 9.5,
1202  14, 0, 14);
1203  pix_b0_xresvsmodetaphi_mean->GetXaxis()->SetTitle("Module Eta-ID");
1204  pix_b0_xresvsmodetaphi_mean->GetYaxis()->SetTitle("Module Phi-ID");
1205  TH2F* pix_b1_xresvsmodetaphi_mean = new TH2F("pix_b1_xresvsmodetaphi_mean",
1206  "X Residual Mean vs Module Eta-Phi-ID Pixel Barrel L1", 13, -6.5, 6.5,
1207  22, -0.5, 21.5);
1208  pix_b1_xresvsmodetaphi_mean->GetXaxis()->SetTitle("Module Eta-ID");
1209  pix_b1_xresvsmodetaphi_mean->GetYaxis()->SetTitle("Module Phi-ID");
1210  TH2F* pix_b2_xresvsmodetaphi_mean = new TH2F("pix_b2_xresvsmodetaphi_mean",
1211  "X Residual Mean vs Module Eta-Phi-ID Pixel Barrel L2", 13, -6.5, 6.5,
1212  38, -0.5, 37.5);
1213  pix_b2_xresvsmodetaphi_mean->GetXaxis()->SetTitle("Module Eta-ID");
1214  pix_b2_xresvsmodetaphi_mean->GetYaxis()->SetTitle("Module Phi-ID");
1215  TH2F* pix_b3_xresvsmodetaphi_mean = new TH2F("pix_b3_xresvsmodetaphi_mean",
1216  "X Residual Mean vs Module Eta-Phi-ID Pixel Barrel L3", 13, -6.5, 6.5,
1217  52, -0.5, 51.5);
1218  pix_b3_xresvsmodetaphi_mean->GetXaxis()->SetTitle("Module Eta-ID");
1219  pix_b3_xresvsmodetaphi_mean->GetYaxis()->SetTitle("Module Phi-ID");
1220 
1221 
1222 
1223  TH2F* pix_b0_yresvsmodetaphi_mean = new TH2F("pix_b0_yresvsmodetaphi_mean",
1224  "Y Residual Mean vs Module Eta-Phi-ID Pixel Barrel L0", 20, -10.5, 9.5,
1225  14, 0, 14);
1226  pix_b0_yresvsmodetaphi_mean->GetXaxis()->SetTitle("Module Eta-ID");
1227  pix_b0_yresvsmodetaphi_mean->GetYaxis()->SetTitle("Module Phi-ID");
1228  TH2F* pix_b1_yresvsmodetaphi_mean = new TH2F("pix_b1_yresvsmodetaphi_mean",
1229  "Y Residual Mean vs Module Eta-Phi-ID Pixel Barrel L1", 13, -6.5, 6.5,
1230  22, -0.5, 21.5);
1231  pix_b1_yresvsmodetaphi_mean->GetXaxis()->SetTitle("Module Eta-ID");
1232  pix_b1_yresvsmodetaphi_mean->GetYaxis()->SetTitle("Module Phi-ID");
1233  TH2F* pix_b2_yresvsmodetaphi_mean = new TH2F("pix_b2_yresvsmodetaphi_mean",
1234  "Y Residual Mean vs Module Eta-Phi-ID Pixel Barrel L2", 13, -6.5, 6.5,
1235  38, -0.5, 37.5);
1236  pix_b2_yresvsmodetaphi_mean->GetXaxis()->SetTitle("Module Eta-ID");
1237  pix_b2_yresvsmodetaphi_mean->GetYaxis()->SetTitle("Module Phi-ID");
1238  TH2F* pix_b3_yresvsmodetaphi_mean = new TH2F("pix_b3_yresvsmodetaphi_mean",
1239  "Y Residual Mean vs Module Eta-Phi-ID Pixel Barrel L3", 13, -6.5, 6.5,
1240  52, -0.5, 51.5);
1241  pix_b3_yresvsmodetaphi_mean->GetXaxis()->SetTitle("Module Eta-ID");
1242  pix_b3_yresvsmodetaphi_mean->GetYaxis()->SetTitle("Module Phi-ID");
1243  meanRMSProjections3D(pix_b0_xresvsmodetaphi_3d, pix_b0_xresvsmodetaphi_mean, 2);
1244  meanRMSProjections3D(pix_b1_xresvsmodetaphi_3d, pix_b1_xresvsmodetaphi_mean, 2);
1245  meanRMSProjections3D(pix_b2_xresvsmodetaphi_3d, pix_b2_xresvsmodetaphi_mean, 2);
1246  meanRMSProjections3D(pix_b3_xresvsmodetaphi_3d, pix_b3_xresvsmodetaphi_mean, 2);
1247  meanRMSProjections3D(pix_b0_yresvsmodetaphi_3d, pix_b0_yresvsmodetaphi_mean, 2);
1248  meanRMSProjections3D(pix_b1_yresvsmodetaphi_3d, pix_b1_yresvsmodetaphi_mean, 2);
1249  meanRMSProjections3D(pix_b2_yresvsmodetaphi_3d, pix_b2_yresvsmodetaphi_mean, 2);
1250  meanRMSProjections3D(pix_b3_yresvsmodetaphi_3d, pix_b3_yresvsmodetaphi_mean, 2);
1251 
1252  //2-d residual map histograms - pixel barrel residual width
1253  TH2F* pix_b0_xresvsmodetaphi_rms = new TH2F("pix_b0_xresvsmodetaphi_rms",
1254  "X Residual Width vs Module Eta-Phi-ID Pixel Barrel L0", 20, -10.5, 9.5,
1255  14, 0, 14);
1256  pix_b0_xresvsmodetaphi_rms->GetXaxis()->SetTitle("Module Eta-ID");
1257  pix_b0_xresvsmodetaphi_rms->GetYaxis()->SetTitle("Module Phi-ID");
1258  TH2F* pix_b1_xresvsmodetaphi_rms = new TH2F("pix_b1_xresvsmodetaphi_rms",
1259  "X Residual Width vs Module Eta-Phi-ID Pixel Barrel L1", 13, -6.5, 6.5,
1260  22, -0.5, 21.5);
1261  pix_b1_xresvsmodetaphi_rms->GetXaxis()->SetTitle("Module Eta-ID");
1262  pix_b1_xresvsmodetaphi_rms->GetYaxis()->SetTitle("Module Phi-ID");
1263  TH2F* pix_b2_xresvsmodetaphi_rms = new TH2F("pix_b2_xresvsmodetaphi_rms",
1264  "X Residual Width vs Module Eta-Phi-ID Pixel Barrel L2", 13, -6.5, 6.5,
1265  38, -0.5, 37.5);
1266  pix_b2_xresvsmodetaphi_rms->GetXaxis()->SetTitle("Module Eta-ID");
1267  pix_b2_xresvsmodetaphi_rms->GetYaxis()->SetTitle("Module Phi-ID");
1268  TH2F* pix_b3_xresvsmodetaphi_rms = new TH2F("pix_b3_xresvsmodetaphi_rms",
1269  "X Residual Width vs Module Eta-Phi-ID Pixel Barrel L3", 13, -6.5, 6.5,
1270  52, -0.5, 51.5);
1271  pix_b3_xresvsmodetaphi_rms->GetXaxis()->SetTitle("Module Eta-ID");
1272  pix_b3_xresvsmodetaphi_rms->GetYaxis()->SetTitle("Module Phi-ID");
1273  TH2F* pix_b0_yresvsmodetaphi_rms = new TH2F("pix_b0_yresvsmodetaphi_rms",
1274  "Y Residual Width vs Module Eta-Phi-ID Pixel Barrel L0", 20, -10.5, 9.5,
1275  14, 0, 14);
1276  pix_b0_yresvsmodetaphi_rms->GetXaxis()->SetTitle("Module Eta-ID");
1277  pix_b0_yresvsmodetaphi_rms->GetYaxis()->SetTitle("Module Phi-ID");
1278  TH2F* pix_b1_yresvsmodetaphi_rms = new TH2F("pix_b1_yresvsmodetaphi_rms",
1279  "Y Residual Width vs Module Eta-Phi-ID Pixel Barrel L1", 13, -6.5, 6.5,
1280  22, -0.5, 21.5);
1281  pix_b1_yresvsmodetaphi_rms->GetXaxis()->SetTitle("Module Eta-ID");
1282  pix_b1_yresvsmodetaphi_rms->GetYaxis()->SetTitle("Module Phi-ID");
1283  TH2F* pix_b2_yresvsmodetaphi_rms = new TH2F("pix_b2_yresvsmodetaphi_rms",
1284  "Y Residual Width vs Module Eta-Phi-ID Pixel Barrel L2", 13, -6.5, 6.5,
1285  38, -0.5, 37.5);
1286  pix_b2_yresvsmodetaphi_rms->GetXaxis()->SetTitle("Module Eta-ID");
1287  pix_b2_yresvsmodetaphi_rms->GetYaxis()->SetTitle("Module Phi-ID");
1288  TH2F* pix_b3_yresvsmodetaphi_rms = new TH2F("pix_b3_yresvsmodetaphi_rms",
1289  "Y Residual Width vs Module Eta-Phi-ID Pixel Barrel L3", 13, -6.5, 6.5,
1290  52, -0.5, 51.5);
1291  pix_b3_yresvsmodetaphi_rms->GetXaxis()->SetTitle("Module Eta-ID");
1292  pix_b3_yresvsmodetaphi_rms->GetYaxis()->SetTitle("Module Phi-ID");
1293  meanRMSProjections3D(pix_b0_xresvsmodetaphi_3d, pix_b0_xresvsmodetaphi_rms, 3);
1294  meanRMSProjections3D(pix_b1_xresvsmodetaphi_3d, pix_b1_xresvsmodetaphi_rms, 3);
1295  meanRMSProjections3D(pix_b2_xresvsmodetaphi_3d, pix_b2_xresvsmodetaphi_rms, 3);
1296  meanRMSProjections3D(pix_b3_xresvsmodetaphi_3d, pix_b3_xresvsmodetaphi_rms, 3);
1297  meanRMSProjections3D(pix_b0_yresvsmodetaphi_3d, pix_b0_yresvsmodetaphi_rms, 3);
1298  meanRMSProjections3D(pix_b1_yresvsmodetaphi_3d, pix_b1_yresvsmodetaphi_rms, 3);
1299  meanRMSProjections3D(pix_b2_yresvsmodetaphi_3d, pix_b2_yresvsmodetaphi_rms, 3);
1300  meanRMSProjections3D(pix_b3_yresvsmodetaphi_3d, pix_b3_xresvsmodetaphi_rms, 3);
1301 
1302  //2-d residual map histograms - SCT barrel residual means
1303  TH2F* sct_b0_xresvsmodetaphi_mean = new TH2F("sct_b0_xresvsmodetaphi_mean",
1304  "X Residual Mean vs Module Eta-Phi-ID SCT Barrel L0", 13, -6.5, 6.5,
1305  32, -0.5, 31.5);
1306  sct_b0_xresvsmodetaphi_mean->GetXaxis()->SetTitle("Module Eta-ID");
1307  sct_b0_xresvsmodetaphi_mean->GetYaxis()->SetTitle("Module Phi-ID");
1308  TH2F* sct_b1_xresvsmodetaphi_mean = new TH2F("sct_b1_xresvsmodetaphi_mean",
1309  "X Residual Mean vs Module Eta-Phi-ID SCT Barrel L1", 13, -6.5, 6.5,
1310  40, -0.5, 39.5);
1311  sct_b1_xresvsmodetaphi_mean->GetXaxis()->SetTitle("Module Eta-ID");
1312  sct_b1_xresvsmodetaphi_mean->GetYaxis()->SetTitle("Module Phi-ID");
1313  TH2F* sct_b2_xresvsmodetaphi_mean = new TH2F("sct_b2_xresvsmodetaphi_mean",
1314  "X Residual Mean vs Module Eta-Phi-ID SCT Barrel L2", 13, -6.5, 6.5,
1315  48, -0.5, 47.5);
1316  sct_b2_xresvsmodetaphi_mean->GetXaxis()->SetTitle("Module Eta-ID");
1317  sct_b2_xresvsmodetaphi_mean->GetYaxis()->SetTitle("Module Phi-ID");
1318  TH2F* sct_b3_xresvsmodetaphi_mean = new TH2F("sct_b3_xresvsmodetaphi_mean",
1319  "X Residual Mean vs Module Eta-Phi-ID SCT Barrel L3", 13, -6.5, 6.5,
1320  56, -0.5, 55.5);
1321  sct_b3_xresvsmodetaphi_mean->GetXaxis()->SetTitle("Module Eta-ID");
1322  sct_b3_xresvsmodetaphi_mean->GetYaxis()->SetTitle("Module Phi-ID");
1323  meanRMSProjections3D(sct_b0_xresvsmodetaphi_3d, sct_b0_xresvsmodetaphi_mean, 2);
1324  meanRMSProjections3D(sct_b1_xresvsmodetaphi_3d, sct_b1_xresvsmodetaphi_mean, 2);
1325  meanRMSProjections3D(sct_b2_xresvsmodetaphi_3d, sct_b2_xresvsmodetaphi_mean, 2);
1326  meanRMSProjections3D(sct_b3_xresvsmodetaphi_3d, sct_b3_xresvsmodetaphi_mean, 2);
1327 
1328  //2-d residual map histograms - SCT barrel residual widths
1329  TH2F* sct_b0_xresvsmodetaphi_rms = new TH2F("sct_b0_xresvsmodetaphi_rms",
1330  "X Residual Width vs Module Eta-Phi-ID SCT Barrel L0", 13, -6.5, 6.5,
1331  32, -0.5, 31.5);
1332  sct_b0_xresvsmodetaphi_rms->GetXaxis()->SetTitle("Module Eta-ID");
1333  sct_b0_xresvsmodetaphi_rms->GetYaxis()->SetTitle("Module Phi-ID");
1334  TH2F* sct_b1_xresvsmodetaphi_rms = new TH2F("sct_b1_xresvsmodetaphi_rms",
1335  "X Residual Width vs Module Eta-Phi-ID SCT Barrel L1", 13, -6.5, 6.5,
1336  40, -0.5, 39.5);
1337  sct_b1_xresvsmodetaphi_rms->GetXaxis()->SetTitle("Module Eta-ID");
1338  sct_b1_xresvsmodetaphi_rms->GetYaxis()->SetTitle("Module Phi-ID");
1339  TH2F* sct_b2_xresvsmodetaphi_rms = new TH2F("sct_b2_xresvsmodetaphi_rms",
1340  "X Residual Width vs Module Eta-Phi-ID SCT Barrel L2", 13, -6.5, 6.5,
1341  48, -0.5, 47.5);
1342  sct_b2_xresvsmodetaphi_rms->GetXaxis()->SetTitle("Module Eta-ID");
1343  sct_b2_xresvsmodetaphi_rms->GetYaxis()->SetTitle("Module Phi-ID");
1344  TH2F* sct_b3_xresvsmodetaphi_rms = new TH2F("sct_b3_xresvsmodetaphi_rms",
1345  "X Residual Width vs Module Eta-Phi-ID SCT Barrel L3", 13, -6.5, 6.5,
1346  56, -0.5, 55.5);
1347  sct_b3_xresvsmodetaphi_rms->GetXaxis()->SetTitle("Module Eta-ID");
1348  sct_b3_xresvsmodetaphi_rms->GetYaxis()->SetTitle("Module Phi-ID");
1349  meanRMSProjections3D(sct_b0_xresvsmodetaphi_3d, sct_b0_xresvsmodetaphi_rms, 3);
1350  meanRMSProjections3D(sct_b1_xresvsmodetaphi_3d, sct_b1_xresvsmodetaphi_rms, 3);
1351  meanRMSProjections3D(sct_b2_xresvsmodetaphi_3d, sct_b2_xresvsmodetaphi_rms, 3);
1352  meanRMSProjections3D(sct_b3_xresvsmodetaphi_3d, sct_b3_xresvsmodetaphi_rms, 3);
1353 
1354  //histograms showing the distribution of Gaussian fitted residual means for pixel and SCT barrel (should add
1355  // endcaps)
1356  //modules are required to have > 30 hits
1357  TH1F* pix_b0_residualmeans = new TH1F("pix_b0_residualmeans", "Pixel Barrel Layer 0 Mean of Residual Distributions",
1358  100, -0.2, 0.2);
1359  pix_b0_residualmeans->GetXaxis()->SetTitle("Fitted Residual Mean [mm]");
1360  pix_b0_residualmeans->GetYaxis()->SetTitle("Number of Modules/4#mum");
1361  TH1F* pix_b1_residualmeans = new TH1F("pix_b1_residualmeans", "Pixel Barrel Layer 1 Mean of Residual Distributions",
1362  100, -0.2, 0.2);
1363  pix_b1_residualmeans->GetXaxis()->SetTitle("Fitted Residual Mean [mm]");
1364  pix_b1_residualmeans->GetYaxis()->SetTitle("Number of Modules/4#mum");
1365  TH1F* pix_b2_residualmeans = new TH1F("pix_b2_residualmeans", "Pixel Barrel Layer 2 Mean of Residual Distributions",
1366  100, -0.2, 0.2);
1367  pix_b2_residualmeans->GetXaxis()->SetTitle("Fitted Residual Mean [mm]");
1368  pix_b2_residualmeans->GetYaxis()->SetTitle("Number of Modules/4#mum");
1369  TH1F* pix_b3_residualmeans = new TH1F("pix_b3_residualmeans", "Pixel Barrel Layer 3 Mean of Residual Distributions",
1370  100, -0.2, 0.2);
1371  pix_b3_residualmeans->GetXaxis()->SetTitle("Fitted Residual Mean [mm]");
1372  pix_b3_residualmeans->GetYaxis()->SetTitle("Number of Modules/4#mum");
1373  meanRMSProjections3D_DMRPlot(pix_b0_xresvsmodetaphi_3d, pix_b0_residualmeans, 2);
1374  meanRMSProjections3D_DMRPlot(pix_b1_xresvsmodetaphi_3d, pix_b1_residualmeans, 2);
1375  meanRMSProjections3D_DMRPlot(pix_b2_xresvsmodetaphi_3d, pix_b2_residualmeans, 2);
1376  meanRMSProjections3D_DMRPlot(pix_b3_xresvsmodetaphi_3d, pix_b3_residualmeans, 2);
1377 
1378 
1379  TH1F* pix_b_residualmeans = new TH1F("pix_b_residualmeans", "Pixel Barrel Mean of Residual Distributions", 100,
1380  -0.2, 0.2);
1381  pix_b_residualmeans->GetXaxis()->SetTitle("Fitted Residual Mean [mm]");
1382  pix_b_residualmeans->GetYaxis()->SetTitle("Number of Modules/4#mum");
1383  pix_b_residualmeans->Add(pix_b0_residualmeans);
1384  pix_b_residualmeans->Add(pix_b1_residualmeans);
1385  pix_b_residualmeans->Add(pix_b2_residualmeans);
1386  pix_b_residualmeans->Add(pix_b3_residualmeans);
1387 
1388  TH1F* sct_b0_residualmeans = new TH1F("sct_b0_residualmeans", "SCT Barrel Layer 0 Mean of Residual Distributions",
1389  100, -0.2, 0.2);
1390  sct_b0_residualmeans->GetXaxis()->SetTitle("Fitted Residual Mean [mm]");
1391  sct_b0_residualmeans->GetYaxis()->SetTitle("Number of Modules/4#mum");
1392  TH1F* sct_b1_residualmeans = new TH1F("sct_b1_residualmeans", "SCT Barrel Layer 1 Mean of Residual Distributions",
1393  100, -0.2, 0.2);
1394  sct_b1_residualmeans->GetXaxis()->SetTitle("Fitted Residual Mean [mm]");
1395  sct_b1_residualmeans->GetYaxis()->SetTitle("Number of Modules/4#mum");
1396  TH1F* sct_b2_residualmeans = new TH1F("sct_b2_residualmeans", "SCT Barrel Layer 2 Mean of Residual Distributions",
1397  100, -0.2, 0.2);
1398  sct_b2_residualmeans->GetXaxis()->SetTitle("Fitted Residual Mean [mm]");
1399  sct_b2_residualmeans->GetYaxis()->SetTitle("Number of Modules/4#mum");
1400  TH1F* sct_b3_residualmeans = new TH1F("sct_b3_residualmeans", "SCT Barrel Layer 3 Mean of Residual Distributions",
1401  100, -0.2, 0.2);
1402  sct_b3_residualmeans->GetXaxis()->SetTitle("Fitted Residual Mean [mm]");
1403  sct_b3_residualmeans->GetYaxis()->SetTitle("Number of Modules/4#mum");
1404  meanRMSProjections3D_DMRPlot(sct_b0_xresvsmodetaphi_3d, sct_b0_residualmeans, 2);
1405  meanRMSProjections3D_DMRPlot(sct_b1_xresvsmodetaphi_3d, sct_b1_residualmeans, 2);
1406  meanRMSProjections3D_DMRPlot(sct_b2_xresvsmodetaphi_3d, sct_b2_residualmeans, 2);
1407  meanRMSProjections3D_DMRPlot(sct_b3_xresvsmodetaphi_3d, sct_b3_residualmeans, 2);
1408 
1409  TH1F* sct_b_residualmeans = new TH1F("sct_b_residualmeans", "SCT Barrel Mean of Residual Distributions", 100, -0.2,
1410  0.2);
1411  sct_b_residualmeans->GetXaxis()->SetTitle("Fitted Residual Mean [mm]");
1412  sct_b_residualmeans->GetYaxis()->SetTitle("Number of Modules/4#mum");
1413  sct_b_residualmeans->Add(sct_b0_residualmeans);
1414  sct_b_residualmeans->Add(sct_b1_residualmeans);
1415  sct_b_residualmeans->Add(sct_b2_residualmeans);
1416  sct_b_residualmeans->Add(sct_b3_residualmeans);
1417 
1418 
1419  //histograms showing the distribution of the errors on the Gaussian-fitted residual means for Pixel and SCT
1420  //i.e. the error on the residual mean entries for the plots above - this should not be larger than the bin size!
1421  //modules are required to have > 30 hits
1422  TH1F* pix_b0_residualfiterrors = new TH1F("pix_b0_residualfiterrors",
1423  "Pixel Barrel Layer 0 Residual Gaussian Fit Error", 200, 0.0, 0.02);
1424  pix_b0_residualfiterrors->GetXaxis()->SetTitle("Residual Gaus. Fit Error [mm]");
1425  pix_b0_residualfiterrors->GetYaxis()->SetTitle("Number of Modules");
1426  TH1F* pix_b1_residualfiterrors = new TH1F("pix_b1_residualfiterrors",
1427  "Pixel Barrel Layer 1 Residual Gaussian Fit Error", 200, 0.0, 0.02);
1428  pix_b1_residualfiterrors->GetXaxis()->SetTitle("Residual Gaus. Fit Error [mm]");
1429  pix_b1_residualfiterrors->GetYaxis()->SetTitle("Number of Modules");
1430  TH1F* pix_b2_residualfiterrors = new TH1F("pix_b2_residualfiterrors",
1431  "Pixel Barrel Layer 2 Residual Gaussian Fit Error", 200, 0.0, 0.02);
1432  pix_b2_residualfiterrors->GetXaxis()->SetTitle("Residual Gaus. Fit Error [mm]");
1433  pix_b2_residualfiterrors->GetYaxis()->SetTitle("Number of Modules");
1434  TH1F* pix_b3_residualfiterrors = new TH1F("pix_b3_residualfiterrors",
1435  "Pixel Barrel Layer 3 Residual Gaussian Fit Error", 200, 0.0, 0.02);
1436  pix_b3_residualfiterrors->GetXaxis()->SetTitle("Residual Gaus. Fit Error [mm]");
1437  pix_b3_residualfiterrors->GetYaxis()->SetTitle("Number of Modules");
1438  meanRMSProjections3D_DMRPlot(pix_b0_xresvsmodetaphi_3d, pix_b0_residualfiterrors, 5);
1439  meanRMSProjections3D_DMRPlot(pix_b1_xresvsmodetaphi_3d, pix_b1_residualfiterrors, 5);
1440  meanRMSProjections3D_DMRPlot(pix_b2_xresvsmodetaphi_3d, pix_b2_residualfiterrors, 5);
1441  meanRMSProjections3D_DMRPlot(pix_b3_xresvsmodetaphi_3d, pix_b3_residualfiterrors, 5);
1442 
1443  TH1F* pix_b_residualfiterrors = new TH1F("pix_b_residualfiterrors", "Pixel Barrel Residual Gaussian Fit Error", 200,
1444  -0.0, 0.02);
1445  pix_b_residualfiterrors->GetXaxis()->SetTitle("Residual Gaus. Fit Error [mm]");
1446  pix_b_residualfiterrors->GetYaxis()->SetTitle("Number of Modules");
1447  pix_b_residualfiterrors->Add(pix_b0_residualfiterrors);
1448  pix_b_residualfiterrors->Add(pix_b1_residualfiterrors);
1449  pix_b_residualfiterrors->Add(pix_b2_residualfiterrors);
1450  pix_b_residualfiterrors->Add(pix_b3_residualfiterrors);
1451 
1452 
1453 
1454  TH1F* sct_b0_residualfiterrors = new TH1F("sct_b0_residualfiterrors",
1455  "SCT Barrel Layer 0 Residual Gaussian Fit Error", 200, 0.0, 0.02);
1456  sct_b0_residualfiterrors->GetXaxis()->SetTitle("Residual Gaus. Fit Error [mm]");
1457  sct_b0_residualfiterrors->GetYaxis()->SetTitle("Number of Modules");
1458  TH1F* sct_b1_residualfiterrors = new TH1F("sct_b1_residualfiterrors",
1459  "SCT Barrel Layer 1 Residual Gaussian Fit Error", 200, 0.0, 0.02);
1460  sct_b1_residualfiterrors->GetXaxis()->SetTitle("Residual Gaus. Fit Error [mm]");
1461  sct_b1_residualfiterrors->GetYaxis()->SetTitle("Number of Modules");
1462  TH1F* sct_b2_residualfiterrors = new TH1F("sct_b2_residualfiterrors",
1463  "SCT Barrel Layer 2 Residual Gaussian Fit Error", 200, 0.0, 0.02);
1464  sct_b2_residualfiterrors->GetXaxis()->SetTitle("Residual Gaus. Fit Error [mm]");
1465  sct_b2_residualfiterrors->GetYaxis()->SetTitle("Number of Modules");
1466  TH1F* sct_b3_residualfiterrors = new TH1F("sct_b3_residualfiterrors",
1467  "SCT Barrel Layer 3 Residual Gaussian Fit Error", 200, 0.0, 0.02);
1468  sct_b3_residualfiterrors->GetXaxis()->SetTitle("Residual Gaus. Fit Error [mm]");
1469  sct_b3_residualfiterrors->GetYaxis()->SetTitle("Number of Modules");
1470  meanRMSProjections3D_DMRPlot(sct_b0_xresvsmodetaphi_3d, sct_b0_residualfiterrors, 5);
1471  meanRMSProjections3D_DMRPlot(sct_b1_xresvsmodetaphi_3d, sct_b1_residualfiterrors, 5);
1472  meanRMSProjections3D_DMRPlot(sct_b2_xresvsmodetaphi_3d, sct_b2_residualfiterrors, 5);
1473  meanRMSProjections3D_DMRPlot(sct_b3_xresvsmodetaphi_3d, sct_b3_residualfiterrors, 5);
1474 
1475  TH1F* sct_b_residualfiterrors = new TH1F("sct_b_residualfiterrors", "SCT Barrel Residual Gaussian Fit Error", 200,
1476  -0.0, 0.02);
1477  sct_b_residualfiterrors->GetXaxis()->SetTitle("Residual Gaus. Fit Error [mm]");
1478  sct_b_residualfiterrors->GetYaxis()->SetTitle("Number of Modules");
1479  sct_b_residualfiterrors->Add(sct_b0_residualfiterrors);
1480  sct_b_residualfiterrors->Add(sct_b1_residualfiterrors);
1481  sct_b_residualfiterrors->Add(sct_b2_residualfiterrors);
1482  sct_b_residualfiterrors->Add(sct_b3_residualfiterrors);
1483 
1484 
1485  // median suffers from 10micron bin size in residual distributions - means that it can only take discreet values at
1486  // 5 micron intervals
1487  TH1F* pix_b0_residualmedians = new TH1F("pix_b0_residualmedians",
1488  "Pixel Barrel Layer 0 Median of Residual Distributions", 20, -0.1, 0.1);
1489  pix_b0_residualmedians->GetXaxis()->SetTitle("Residual Median [mm]");
1490  pix_b0_residualmedians->GetYaxis()->SetTitle("Number of Modules/10#mum");
1491  TH1F* pix_b1_residualmedians = new TH1F("pix_b1_residualmedians",
1492  "Pixel Barrel Layer 1 Median of Residual Distributions", 20, -0.1, 0.1);
1493  pix_b1_residualmedians->GetXaxis()->SetTitle("Residual Median [mm]");
1494  pix_b1_residualmedians->GetYaxis()->SetTitle("Number of Modules/10#mum");
1495  TH1F* pix_b2_residualmedians = new TH1F("pix_b2_residualmedians",
1496  "Pixel Barrel Layer 2 Median of Residual Distributions", 20, -0.1, 0.1);
1497  pix_b2_residualmedians->GetXaxis()->SetTitle("Residual Median [mm]");
1498  pix_b2_residualmedians->GetYaxis()->SetTitle("Number of Modules/10#mum");
1499  TH1F* pix_b3_residualmedians = new TH1F("pix_b3_residualmedians",
1500  "Pixel Barrel Layer 3 Median of Residual Distributions", 20, -0.1, 0.1);
1501  pix_b3_residualmedians->GetXaxis()->SetTitle("Residual Median [mm]");
1502  pix_b3_residualmedians->GetYaxis()->SetTitle("Number of Modules/10#mum");
1503  meanRMSProjections3D_DMRPlot(pix_b0_xresvsmodetaphi_3d, pix_b0_residualmedians, 6);
1504  meanRMSProjections3D_DMRPlot(pix_b1_xresvsmodetaphi_3d, pix_b1_residualmedians, 6);
1505  meanRMSProjections3D_DMRPlot(pix_b2_xresvsmodetaphi_3d, pix_b2_residualmedians, 6);
1506  meanRMSProjections3D_DMRPlot(pix_b3_xresvsmodetaphi_3d, pix_b3_residualmedians, 6);
1507 
1508  TH1F* pix_b_residualmedians = new TH1F("pix_b_residualmedians", "Pixel Barrel Median of Residual Distributions", 20,
1509  -0.1, 0.1);
1510  pix_b_residualmedians->GetXaxis()->SetTitle("Residual Median [mm]");
1511  pix_b_residualmedians->GetYaxis()->SetTitle("Number of Modules/10#mum");
1512  pix_b_residualmedians->Add(pix_b0_residualmedians);
1513  pix_b_residualmedians->Add(pix_b1_residualmedians);
1514  pix_b_residualmedians->Add(pix_b2_residualmedians);
1515  pix_b_residualmedians->Add(pix_b3_residualmedians);
1516 
1517 
1518 
1519  TH1F* sct_b0_residualmedians = new TH1F("sct_b0_residualmedians",
1520  "SCT Barrel Layer 0 Median of Residual Distributions", 20, -0.1, 0.1);
1521  sct_b0_residualmedians->GetXaxis()->SetTitle("Residual Median [mm]");
1522  sct_b0_residualmedians->GetYaxis()->SetTitle("Number of Modules/10#mum");
1523  TH1F* sct_b1_residualmedians = new TH1F("sct_b1_residualmedians",
1524  "SCT Barrel Layer 1 Median of Residual Distributions", 20, -0.1, 0.1);
1525  sct_b1_residualmedians->GetXaxis()->SetTitle("Residual Median [mm]");
1526  sct_b1_residualmedians->GetYaxis()->SetTitle("Number of Modules/10#mum");
1527  TH1F* sct_b2_residualmedians = new TH1F("sct_b2_residualmedians",
1528  "SCT Barrel Layer 2 Median of Residual Distributions", 20, -0.1, 0.1);
1529  sct_b2_residualmedians->GetXaxis()->SetTitle("Residual Median [mm]");
1530  sct_b2_residualmedians->GetYaxis()->SetTitle("Number of Modules/10#mum");
1531  TH1F* sct_b3_residualmedians = new TH1F("sct_b3_residualmedians",
1532  "SCT Barrel Layer 3 Median of Residual Distributions", 20, -0.1, 0.1);
1533  sct_b3_residualmedians->GetXaxis()->SetTitle("Residual Median [mm]");
1534  sct_b3_residualmedians->GetYaxis()->SetTitle("Number of Modules/10#mum");
1535  meanRMSProjections3D_DMRPlot(sct_b0_xresvsmodetaphi_3d, sct_b0_residualmedians, 6);
1536  meanRMSProjections3D_DMRPlot(sct_b1_xresvsmodetaphi_3d, sct_b1_residualmedians, 6);
1537  meanRMSProjections3D_DMRPlot(sct_b2_xresvsmodetaphi_3d, sct_b2_residualmedians, 6);
1538  meanRMSProjections3D_DMRPlot(sct_b3_xresvsmodetaphi_3d, sct_b3_residualmedians, 6);
1539 
1540  TH1F* sct_b_residualmedians = new TH1F("sct_b_residualmedians", "SCT Barrel Median of Residual Distributions", 20,
1541  -0.1, 0.1);
1542  sct_b_residualmedians->GetXaxis()->SetTitle("Residual Median [mm]");
1543  sct_b_residualmedians->GetYaxis()->SetTitle("Number of Modules/10#mum");
1544  sct_b_residualmedians->Add(sct_b0_residualmedians);
1545  sct_b_residualmedians->Add(sct_b1_residualmedians);
1546  sct_b_residualmedians->Add(sct_b2_residualmedians);
1547  sct_b_residualmedians->Add(sct_b3_residualmedians);
1548 
1549 
1550  //TH2F* pix_b0_xresvsmodetaphi_chi2 = new TH2F("pix_b0_xresvsmodetaphi_chi2","X Residual Fit Chi2/DOF vs Module
1551  // Eta-Phi-ID Pixel Barrel L0",13,-6.5,6.5,22,-0.5,21.5);
1552  //pix_b0_xresvsmodetaphi_chi2->GetXaxis()->SetTitle("Module Eta-ID");
1553  //pix_b0_xresvsmodetaphi_chi2->GetYaxis()->SetTitle("Module Phi-ID");
1554  //meanRMSProjections3D(pix_b0_xresvsmodetaphi_3d,pix_b0_xresvsmodetaphi_chi2,4);
1555 
1556 
1557  //set y-axis minimum range
1558  setMinWindow(si_barrel_pullX_width, minSiPullWidthWindow, maxSiPullWidthWindow);
1559  setMinWindow(si_barrel_pullY_width, minSiPullWidthWindow, maxSiPullWidthWindow);
1560  setMinWindow(si_eca_pullX_width, minSiPullWidthWindow, maxSiPullWidthWindow);
1561  setMinWindow(si_eca_pullY_width, minSiPullWidthWindow, maxSiPullWidthWindow);
1562  setMinWindow(si_ecc_pullX_width, minSiPullWidthWindow, maxSiPullWidthWindow);
1563  setMinWindow(si_ecc_pullY_width, minSiPullWidthWindow, maxSiPullWidthWindow);
1564 
1565  setMinWindow(si_barrel_pullX_mean, minSiResMeanWindow, maxSiResMeanWindow);
1566  setMinWindow(si_barrel_pullY_mean, minSiResMeanWindow, maxSiResMeanWindow);
1567  setMinWindow(si_eca_pullX_mean, minSiResMeanWindow, maxSiResMeanWindow);
1568  setMinWindow(si_eca_pullY_mean, minSiResMeanWindow, maxSiResMeanWindow);
1569  setMinWindow(si_ecc_pullX_mean, minSiResMeanWindow, maxSiResMeanWindow);
1570  setMinWindow(si_ecc_pullY_mean, minSiResMeanWindow, maxSiResMeanWindow);
1571 
1572  setMinWindow(si_barrel_resX_mean, minSiResMeanWindow, maxSiResMeanWindow);
1573  setMinWindow(si_barrel_resY_mean, minSiResMeanWindow, maxSiResMeanWindow);
1574  setMinWindow(si_eca_resX_mean, minSiResMeanWindow, maxSiResMeanWindow);
1575  setMinWindow(si_eca_resY_mean, minSiResMeanWindow, maxSiResMeanWindow);
1576  setMinWindow(si_ecc_resX_mean, minSiResMeanWindow, maxSiResMeanWindow);
1577  setMinWindow(si_ecc_resY_mean, minSiResMeanWindow, maxSiResMeanWindow);
1578 
1579  setMinWindow(si_barrel_resX_rms, minSiResWidthWindow, maxSiResWidthWindow);
1580  setMinWindow(si_barrel_resY_rms, minSiResWidthWindow, maxSiResWidthWindow);
1581  setMinWindow(si_eca_resX_rms, minSiResWidthWindow, maxSiResWidthWindow);
1582  setMinWindow(si_eca_resY_rms, minSiResWidthWindow, maxSiResWidthWindow);
1583  setMinWindow(si_ecc_resX_rms, minSiResWidthWindow, maxSiResWidthWindow);
1584  setMinWindow(si_ecc_resY_rms, minSiResWidthWindow, maxSiResWidthWindow);
1585 
1586  setMinWindow(pix_b_xresvsmodeta, minSiResMeanWindow, maxSiResMeanWindow);
1587  setMinWindow(pix_b_yresvsmodeta, minSiResMeanWindow, maxSiResMeanWindow);
1588  setMinWindow(pix_b_xresvsmodphi, minSiResMeanWindow, maxSiResMeanWindow);
1589  setMinWindow(pix_b_yresvsmodphi, minSiResMeanWindow, maxSiResMeanWindow);
1590  setMinWindow(sct_b_xresvsmodeta, minSiResMeanWindow, maxSiResMeanWindow);
1591  setMinWindow(sct_b_xresvsmodphi, minSiResMeanWindow, maxSiResMeanWindow);
1592 
1593  setMinWindow(pix_b_xresvsmodeta_width, minSiResWidthWindow, maxSiResWidthWindow);
1594  setMinWindow(pix_b_yresvsmodeta_width, minSiResWidthWindow, maxSiResWidthWindow);
1595  setMinWindow(pix_b_xresvsmodphi_width, minSiResWidthWindow, maxSiResWidthWindow);
1596  setMinWindow(pix_b_yresvsmodphi_width, minSiResWidthWindow, maxSiResWidthWindow);
1597  setMinWindow(sct_b_xresvsmodeta_width, minSiResWidthWindow, maxSiResWidthWindow);
1598  setMinWindow(sct_b_xresvsmodphi_width, minSiResWidthWindow, maxSiResWidthWindow);
1599 
1600  setMinWindow(pix_eca_xresvsmodphi, minSiResMeanWindow, maxSiResMeanWindow);
1601  setMinWindow(pix_eca_yresvsmodphi, minSiResMeanWindow, maxSiResMeanWindow);
1602  setMinWindow(pix_ecc_xresvsmodphi, minSiResMeanWindow, maxSiResMeanWindow);
1603  setMinWindow(pix_ecc_yresvsmodphi, minSiResMeanWindow, maxSiResMeanWindow);
1604  setMinWindow(sct_eca_xresvsmodphi, minSiResMeanWindow, maxSiResMeanWindow);
1605  setMinWindow(sct_ecc_xresvsmodphi, minSiResMeanWindow, maxSiResMeanWindow);
1606 
1607 
1608  if (f->cd(path.c_str()) == 0) {
1609  //std::cerr << "MonitoringFile::fitMergedFile_IDAlignMonResiduals(): "
1610  // << "No such directory \"" << path << "\"\n";
1611  return;
1612  }
1613 
1614  //delete the histograms already in the file with these keys so that
1615  //they can be overwritten - we shouldn't have to do this, but seems to
1616  //be necessary
1617  f->Delete("si_barrel_pullX_width;1");
1618 
1619  f->Delete("si_eca_pullX_width;1");
1620  f->Delete("si_ecc_pullX_width;1");
1621  f->Delete("si_barrel_pullY_width;1");
1622  f->Delete("si_eca_pullY_width;1");
1623  f->Delete("si_ecc_pullY_width;1");
1624 
1625  f->Delete("si_barrel_pullX_mean;1");
1626  f->Delete("si_eca_pullX_mean;1");
1627  f->Delete("si_ecc_pullX_mean;1");
1628  f->Delete("si_barrel_pullY_mean;1");
1629  f->Delete("si_eca_pullY_mean;1");
1630  f->Delete("si_ecc_pullY_mean;1");
1631 
1632  f->Delete("si_barrel_resX_mean;1");
1633  f->Delete("si_eca_resX_mean;1");
1634  f->Delete("si_ecc_resX_mean;1");
1635  f->Delete("si_barrel_resY_mean;1");
1636  f->Delete("si_eca_resY_mean;1");
1637  f->Delete("si_ecc_resY_mean;1");
1638 
1639  f->Delete("si_barrel_resX_rms;1");
1640  f->Delete("si_eca_resX_rms;1");
1641  f->Delete("si_ecc_resX_rms;1");
1642  f->Delete("si_barrel_resY_rms;1");
1643  f->Delete("si_eca_resY_rms;1");
1644  f->Delete("si_ecc_resY_rms;1");
1645 
1646  f->Delete("pix_b_xresvsmodeta;1");
1647  f->Delete("pix_b_xresvsmodphi;1");
1648  f->Delete("pix_b_yresvsmodeta;1");
1649  f->Delete("pix_b_yresvsmodphi;1");
1650  f->Delete("pix_eca_xresvsmodphi;1");
1651  f->Delete("pix_ecc_xresvsmodphi;1");
1652  f->Delete("pix_eca_yresvsmodphi;1");
1653  f->Delete("pix_ecc_yresvsmodphi;1");
1654 
1655  f->Delete("pix_b_xresvsmodeta_width;1");
1656  f->Delete("pix_b_yresvsmodeta_width;1");
1657  f->Delete("pix_b_xresvsmodphi_width;1");
1658  f->Delete("pix_b_yresvsmodphi_width;1");
1659  f->Delete("sct_b_xresvsmodeta_width;1");
1660  f->Delete("sct_b_xresvsmodphi_width;1");
1661 
1662  f->Delete("sct_b_xresvsmodeta;1");
1663  f->Delete("sct_b_xresvsmodphi;1");
1664  f->Delete("sct_eca_xresvsmodphi;1");
1665  f->Delete("sct_ecc_xresvsmodphi;1");
1666 
1667  f->Delete("pix_b0_xresvsmodetaphi_mean;1");
1668  f->Delete("pix_b1_xresvsmodetaphi_mean;1");
1669  f->Delete("pix_b2_xresvsmodetaphi_mean;1");
1670  f->Delete("pix_b3_xresvsmodetaphi_mean;1");
1671  f->Delete("pix_b0_yresvsmodetaphi_mean;1");
1672  f->Delete("pix_b1_yresvsmodetaphi_mean;1");
1673  f->Delete("pix_b2_yresvsmodetaphi_mean;1");
1674  f->Delete("pix_b3_yresvsmodetaphi_mean;1");
1675 
1676  f->Delete("pix_b0_xresvsmodetaphi_rms;1");
1677  f->Delete("pix_b1_xresvsmodetaphi_rms;1");
1678  f->Delete("pix_b2_xresvsmodetaphi_rms;1");
1679  f->Delete("pix_b3_xresvsmodetaphi_rms;1");
1680  f->Delete("pix_b0_yresvsmodetaphi_rms;1");
1681  f->Delete("pix_b1_yresvsmodetaphi_rms;1");
1682  f->Delete("pix_b2_yresvsmodetaphi_rms;1");
1683  f->Delete("pix_b3_yresvsmodetaphi_rms;1");
1684 
1685  f->Delete("sct_b0_xresvsmodetaphi_mean;1");
1686  f->Delete("sct_b1_xresvsmodetaphi_mean;1");
1687  f->Delete("sct_b2_xresvsmodetaphi_mean;1");
1688  f->Delete("sct_b3_xresvsmodetaphi_mean;1");
1689 
1690  f->Delete("sct_b0_xresvsmodetaphi_rms;1");
1691  f->Delete("sct_b1_xresvsmodetaphi_rms;1");
1692  f->Delete("sct_b2_xresvsmodetaphi_rms;1");
1693  f->Delete("sct_b3_xresvsmodetaphi_rms;1");
1694 
1695  //writing the histograms to the file
1696  si_barrel_pullX_width->Write("", TObject::kOverwrite);
1697  si_eca_pullX_width->Write("", TObject::kOverwrite);
1698  si_ecc_pullX_width->Write("", TObject::kOverwrite);
1699  si_barrel_pullY_width->Write("", TObject::kOverwrite);
1700  si_eca_pullY_width->Write("", TObject::kOverwrite);
1701  si_ecc_pullY_width->Write("", TObject::kOverwrite);
1702 
1703  si_barrel_pullX_mean->Write("", TObject::kOverwrite);
1704  si_eca_pullX_mean->Write("", TObject::kOverwrite);
1705  si_ecc_pullX_mean->Write("", TObject::kOverwrite);
1706  si_barrel_pullY_mean->Write("", TObject::kOverwrite);
1707  si_eca_pullY_mean->Write("", TObject::kOverwrite);
1708  si_ecc_pullY_mean->Write("", TObject::kOverwrite);
1709 
1710  f->Write();
1711 
1712  si_barrel_resX_mean->Write("", TObject::kOverwrite);
1713  si_eca_resX_mean->Write("", TObject::kOverwrite);
1714  si_ecc_resX_mean->Write("", TObject::kOverwrite);
1715  si_barrel_resY_mean->Write("", TObject::kOverwrite);
1716  si_eca_resY_mean->Write("", TObject::kOverwrite);
1717  si_ecc_resY_mean->Write("", TObject::kOverwrite);
1718 
1719  si_barrel_resX_rms->Write("", TObject::kOverwrite);
1720  si_eca_resX_rms->Write("", TObject::kOverwrite);
1721  si_ecc_resX_rms->Write("", TObject::kOverwrite);
1722  si_barrel_resY_rms->Write("", TObject::kOverwrite);
1723  si_eca_resY_rms->Write("", TObject::kOverwrite);
1724  si_ecc_resY_rms->Write("", TObject::kOverwrite);
1725 
1726  // Q: why do we need to call f->Write() more than once?
1727  // A: Because root is a pile of horse s**t.
1728  f->Write();
1729 
1730  pix_b_xresvsmodeta->Write("", TObject::kOverwrite);
1731  pix_b_xresvsmodphi->Write("", TObject::kOverwrite);
1732  pix_b_yresvsmodeta->Write("", TObject::kOverwrite);
1733  pix_b_yresvsmodphi->Write("", TObject::kOverwrite);
1734  pix_eca_xresvsmodphi->Write("", TObject::kOverwrite);
1735  pix_ecc_xresvsmodphi->Write("", TObject::kOverwrite);
1736  pix_eca_yresvsmodphi->Write("", TObject::kOverwrite);
1737  pix_ecc_yresvsmodphi->Write("", TObject::kOverwrite);
1738 
1739  f->Write();
1740 
1741  sct_b_xresvsmodeta->Write("", TObject::kOverwrite);
1742  sct_b_xresvsmodphi->Write("", TObject::kOverwrite);
1743  sct_eca_xresvsmodphi->Write("", TObject::kOverwrite);
1744  sct_ecc_xresvsmodphi->Write("", TObject::kOverwrite);
1745 
1746  pix_b_xresvsmodeta_width->Write("", TObject::kOverwrite);
1747  pix_b_yresvsmodeta_width->Write("", TObject::kOverwrite);
1748  pix_b_xresvsmodphi_width->Write("", TObject::kOverwrite);
1749  pix_b_yresvsmodphi_width->Write("", TObject::kOverwrite);
1750  sct_b_xresvsmodeta_width->Write("", TObject::kOverwrite);
1751  sct_b_xresvsmodphi_width->Write("", TObject::kOverwrite);
1752 
1753  f->Write();
1754 
1755  pix_b0_xresvsmodetaphi_mean->Write("", TObject::kOverwrite);
1756  pix_b1_xresvsmodetaphi_mean->Write("", TObject::kOverwrite);
1757  pix_b2_xresvsmodetaphi_mean->Write("", TObject::kOverwrite);
1758  pix_b3_xresvsmodetaphi_mean->Write("", TObject::kOverwrite);
1759  pix_b0_yresvsmodetaphi_mean->Write("", TObject::kOverwrite);
1760  pix_b1_yresvsmodetaphi_mean->Write("", TObject::kOverwrite);
1761  pix_b2_yresvsmodetaphi_mean->Write("", TObject::kOverwrite);
1762  pix_b3_yresvsmodetaphi_mean->Write("", TObject::kOverwrite);
1763 
1764  f->Write();
1765 
1766  pix_b0_xresvsmodetaphi_rms->Write("", TObject::kOverwrite);
1767  pix_b1_xresvsmodetaphi_rms->Write("", TObject::kOverwrite);
1768  pix_b2_xresvsmodetaphi_rms->Write("", TObject::kOverwrite);
1769  pix_b3_xresvsmodetaphi_rms->Write("", TObject::kOverwrite);
1770  pix_b0_yresvsmodetaphi_rms->Write("", TObject::kOverwrite);
1771  pix_b1_yresvsmodetaphi_rms->Write("", TObject::kOverwrite);
1772  pix_b2_yresvsmodetaphi_rms->Write("", TObject::kOverwrite);
1773  pix_b3_yresvsmodetaphi_rms->Write("", TObject::kOverwrite);
1774 
1775  //m_pix_b0_xresvsmodetaphi_chi2->Write("",TObject::kOverwrite);
1776 
1777  f->Write();
1778 
1779  sct_b0_xresvsmodetaphi_mean->Write("", TObject::kOverwrite);
1780  sct_b1_xresvsmodetaphi_mean->Write("", TObject::kOverwrite);
1781  sct_b2_xresvsmodetaphi_mean->Write("", TObject::kOverwrite);
1782  sct_b3_xresvsmodetaphi_mean->Write("", TObject::kOverwrite);
1783 
1784  sct_b0_xresvsmodetaphi_rms->Write("", TObject::kOverwrite);
1785  sct_b1_xresvsmodetaphi_rms->Write("", TObject::kOverwrite);
1786  sct_b2_xresvsmodetaphi_rms->Write("", TObject::kOverwrite);
1787  sct_b3_xresvsmodetaphi_rms->Write("", TObject::kOverwrite);
1788 
1789  f->Write();
1790 
1791  pix_b0_residualmeans->Write("", TObject::kOverwrite);
1792  pix_b1_residualmeans->Write("", TObject::kOverwrite);
1793  pix_b2_residualmeans->Write("", TObject::kOverwrite);
1794  pix_b3_residualmeans->Write("", TObject::kOverwrite);
1795  sct_b0_residualmeans->Write("", TObject::kOverwrite);
1796  sct_b1_residualmeans->Write("", TObject::kOverwrite);
1797  sct_b2_residualmeans->Write("", TObject::kOverwrite);
1798  sct_b3_residualmeans->Write("", TObject::kOverwrite);
1799  pix_b_residualmeans->Write("", TObject::kOverwrite);
1800  sct_b_residualmeans->Write("", TObject::kOverwrite);
1801  pix_b_residualmedians->Write("", TObject::kOverwrite);
1802  sct_b_residualmedians->Write("", TObject::kOverwrite);
1803 
1804  f->Write();
1805 
1806  pix_b0_residualfiterrors->Write("", TObject::kOverwrite);
1807  pix_b1_residualfiterrors->Write("", TObject::kOverwrite);
1808  pix_b2_residualfiterrors->Write("", TObject::kOverwrite);
1809  pix_b3_residualfiterrors->Write("", TObject::kOverwrite);
1810  sct_b0_residualfiterrors->Write("", TObject::kOverwrite);
1811  sct_b1_residualfiterrors->Write("", TObject::kOverwrite);
1812  sct_b2_residualfiterrors->Write("", TObject::kOverwrite);
1813  sct_b3_residualfiterrors->Write("", TObject::kOverwrite);
1814  pix_b_residualfiterrors->Write("", TObject::kOverwrite);
1815  sct_b_residualfiterrors->Write("", TObject::kOverwrite);
1816 
1817  f->Write();
1818 
1819  //pix_b0_mag_vs_lb->Write();
1820  //pix_b0_base_vs_lb->Write();
1821 
1822  //f->Write();
1823 
1824 
1825 
1826 
1827 
1828  if (doOverlapResiduals) {
1829  TH3F* pix_b0_Oxresxvsmodetaphi_3d = (TH3F*) (f->Get((path + "/pix_b0_Oxresxvsmodetaphi_3d").c_str()));
1830  TH3F* pix_b1_Oxresxvsmodetaphi_3d = (TH3F*) (f->Get((path + "/pix_b1_Oxresxvsmodetaphi_3d").c_str()));
1831  TH3F* pix_b2_Oxresxvsmodetaphi_3d = (TH3F*) (f->Get((path + "/pix_b2_Oxresxvsmodetaphi_3d").c_str()));
1832  TH3F* pix_b3_Oxresxvsmodetaphi_3d = (TH3F*) (f->Get((path + "/pix_b3_Oxresxvsmodetaphi_3d").c_str()));
1833 
1834  TH3F* pix_b0_Oxresyvsmodetaphi_3d = (TH3F*) (f->Get((path + "/pix_b0_Oxresyvsmodetaphi_3d").c_str()));
1835  TH3F* pix_b1_Oxresyvsmodetaphi_3d = (TH3F*) (f->Get((path + "/pix_b1_Oxresyvsmodetaphi_3d").c_str()));
1836  TH3F* pix_b2_Oxresyvsmodetaphi_3d = (TH3F*) (f->Get((path + "/pix_b2_Oxresyvsmodetaphi_3d").c_str()));
1837  TH3F* pix_b3_Oxresyvsmodetaphi_3d = (TH3F*) (f->Get((path + "/pix_b3_Oxresyvsmodetaphi_3d").c_str()));
1838 
1839  TH3F* pix_b0_Oyresxvsmodetaphi_3d = (TH3F*) (f->Get((path + "/pix_b0_Oyresxvsmodetaphi_3d").c_str()));
1840  TH3F* pix_b1_Oyresxvsmodetaphi_3d = (TH3F*) (f->Get((path + "/pix_b1_Oyresxvsmodetaphi_3d").c_str()));
1841  TH3F* pix_b2_Oyresxvsmodetaphi_3d = (TH3F*) (f->Get((path + "/pix_b2_Oyresxvsmodetaphi_3d").c_str()));
1842  TH3F* pix_b3_Oyresxvsmodetaphi_3d = (TH3F*) (f->Get((path + "/pix_b3_Oyresxvsmodetaphi_3d").c_str()));
1843 
1844  TH3F* pix_b0_Oyresyvsmodetaphi_3d = (TH3F*) (f->Get((path + "/pix_b0_Oyresyvsmodetaphi_3d").c_str()));
1845  TH3F* pix_b1_Oyresyvsmodetaphi_3d = (TH3F*) (f->Get((path + "/pix_b1_Oyresyvsmodetaphi_3d").c_str()));
1846  TH3F* pix_b2_Oyresyvsmodetaphi_3d = (TH3F*) (f->Get((path + "/pix_b2_Oyresyvsmodetaphi_3d").c_str()));
1847  TH3F* pix_b3_Oyresyvsmodetaphi_3d = (TH3F*) (f->Get((path + "/pix_b3_Oyresyvsmodetaphi_3d").c_str()));
1848 
1849  TH3F* sct_b0_Oxresxvsmodetaphi_3d = (TH3F*) (f->Get((path + "/sct_b0_Oxresxvsmodetaphi_3d").c_str()));
1850  TH3F* sct_b1_Oxresxvsmodetaphi_3d = (TH3F*) (f->Get((path + "/sct_b1_Oxresxvsmodetaphi_3d").c_str()));
1851  TH3F* sct_b2_Oxresxvsmodetaphi_3d = (TH3F*) (f->Get((path + "/sct_b2_Oxresxvsmodetaphi_3d").c_str()));
1852  TH3F* sct_b3_Oxresxvsmodetaphi_3d = (TH3F*) (f->Get((path + "/sct_b3_Oxresxvsmodetaphi_3d").c_str()));
1853 
1854  TH3F* sct_b0_Oyresxvsmodetaphi_3d = (TH3F*) (f->Get((path + "/sct_b0_Oyresxvsmodetaphi_3d").c_str()));
1855  TH3F* sct_b1_Oyresxvsmodetaphi_3d = (TH3F*) (f->Get((path + "/sct_b1_Oyresxvsmodetaphi_3d").c_str()));
1856  TH3F* sct_b2_Oyresxvsmodetaphi_3d = (TH3F*) (f->Get((path + "/sct_b2_Oyresxvsmodetaphi_3d").c_str()));
1857  TH3F* sct_b3_Oyresxvsmodetaphi_3d = (TH3F*) (f->Get((path + "/sct_b3_Oyresxvsmodetaphi_3d").c_str()));
1858 
1859 
1860  //XOverlap residual X mean as a function of ring in the pixel barrel (sensitive to ring-expansion,contraction
1861  // distortions)
1862  TH1F* pix_b0_Oxresxvsmodeta_mean = new TH1F("pix_b0_Oxresxvsmodeta_mean",
1863  "X-Overlap X Residual Mean vs Eta-ID Pixel Barrel IBL", 20, -10.5,
1864  9.5);
1865  TH1F* pix_b1_Oxresxvsmodeta_mean = new TH1F("pix_b1_Oxresxvsmodeta_mean",
1866  "X-Overlap X Residual Mean vs Eta-ID Pixel Barrel L0", 13, -6.5, 6.5);
1867  TH1F* pix_b2_Oxresxvsmodeta_mean = new TH1F("pix_b2_Oxresxvsmodeta_mean",
1868  "X-Overlap X Residual Mean vs Eta-ID Pixel Barrel L1", 13, -6.5, 6.5);
1869  TH1F* pix_b3_Oxresxvsmodeta_mean = new TH1F("pix_b3_Oxresxvsmodeta_mean",
1870  "X-Overlap X Residual Mean vs Eta-ID Pixel Barrel L2", 13, -6.5, 6.5);
1871  pix_b0_Oxresxvsmodeta_mean->GetYaxis()->SetTitle("X-Overlap Mean Residual X");
1872  pix_b1_Oxresxvsmodeta_mean->GetYaxis()->SetTitle("X-Overlap Mean Residual X");
1873  pix_b2_Oxresxvsmodeta_mean->GetYaxis()->SetTitle("X-Overlap Mean Residual X");
1874  pix_b3_Oxresxvsmodeta_mean->GetYaxis()->SetTitle("X-Overlap Mean Residual X");
1875  pix_b0_Oxresxvsmodeta_mean->GetXaxis()->SetTitle("Module Eta-ID");
1876  pix_b1_Oxresxvsmodeta_mean->GetXaxis()->SetTitle("Module Eta-ID");
1877  pix_b2_Oxresxvsmodeta_mean->GetXaxis()->SetTitle("Module Eta-ID");
1878  pix_b3_Oxresxvsmodeta_mean->GetXaxis()->SetTitle("Module Eta-ID");
1879  meanRMSProjections3D_XY(pix_b0_Oxresxvsmodetaphi_3d, pix_b0_Oxresxvsmodeta_mean, 0, 2);
1880  meanRMSProjections3D_XY(pix_b1_Oxresxvsmodetaphi_3d, pix_b1_Oxresxvsmodeta_mean, 0, 2);
1881  meanRMSProjections3D_XY(pix_b2_Oxresxvsmodetaphi_3d, pix_b2_Oxresxvsmodeta_mean, 0, 2);
1882  meanRMSProjections3D_XY(pix_b3_Oxresxvsmodetaphi_3d, pix_b3_Oxresxvsmodeta_mean, 0, 2);
1883  plots->Add(pix_b0_Oxresxvsmodeta_mean);
1884  plots->Add(pix_b1_Oxresxvsmodeta_mean);
1885  plots->Add(pix_b2_Oxresxvsmodeta_mean);
1886  plots->Add(pix_b3_Oxresxvsmodeta_mean);
1887  TH1F* pix_b_Oxresxvsmodeta_mean = combineHistos("pix_b_Oxresxvsmodeta_mean",
1888  "X-Overlap X Residual Mean vs (Modified) Eta-ID Pixel Barrel",
1889  plots, 10);
1890  pix_b_Oxresxvsmodeta_mean->GetYaxis()->SetTitle("X-Overlap Mean Residual X");
1891  pix_b_Oxresxvsmodeta_mean->GetXaxis()->SetTitle("(Modified) Module Eta-ID");
1892  plots->Clear();
1893 
1894  //XOverlap residual X width as a function of ring in the pixel barrel (sensitive to ring-expansion,contraction
1895  // distortions)
1896  TH1F* pix_b0_Oxresxvsmodeta_width = new TH1F("pix_b0_Oxresxvsmodeta_width",
1897  "X-Overlap X Residual Width vs Eta-ID Pixel Barrel IBL", 20, -10.5,
1898  9.5);
1899  TH1F* pix_b1_Oxresxvsmodeta_width = new TH1F("pix_b1_Oxresxvsmodeta_width",
1900  "X-Overlap X Residual Width vs Eta-ID Pixel Barrel L0", 13, -6.5,
1901  6.5);
1902  TH1F* pix_b2_Oxresxvsmodeta_width = new TH1F("pix_b2_Oxresxvsmodeta_width",
1903  "X-Overlap X Residual Width vs Eta-ID Pixel Barrel L1", 13, -6.5,
1904  6.5);
1905  TH1F* pix_b3_Oxresxvsmodeta_width = new TH1F("pix_b3_Oxresxvsmodeta_width",
1906  "X-Overlap X Residual Width vs Eta-ID Pixel Barrel L2", 13, -6.5,
1907  6.5);
1908  pix_b0_Oxresxvsmodeta_width->GetYaxis()->SetTitle("X-Overlap Width Residual X");
1909  pix_b1_Oxresxvsmodeta_width->GetYaxis()->SetTitle("X-Overlap Width Residual X");
1910  pix_b2_Oxresxvsmodeta_width->GetYaxis()->SetTitle("X-Overlap Width Residual X");
1911  pix_b2_Oxresxvsmodeta_width->GetYaxis()->SetTitle("X-Overlap Width Residual X");
1912  pix_b0_Oxresxvsmodeta_width->GetXaxis()->SetTitle("Module Eta-ID");
1913  pix_b1_Oxresxvsmodeta_width->GetXaxis()->SetTitle("Module Eta-ID");
1914  pix_b2_Oxresxvsmodeta_width->GetXaxis()->SetTitle("Module Eta-ID");
1915  pix_b2_Oxresxvsmodeta_width->GetXaxis()->SetTitle("Module Eta-ID");
1916  meanRMSProjections3D_XY(pix_b0_Oxresxvsmodetaphi_3d, pix_b0_Oxresxvsmodeta_width, 0, 3);
1917  meanRMSProjections3D_XY(pix_b1_Oxresxvsmodetaphi_3d, pix_b1_Oxresxvsmodeta_width, 0, 3);
1918  meanRMSProjections3D_XY(pix_b2_Oxresxvsmodetaphi_3d, pix_b2_Oxresxvsmodeta_width, 0, 3);
1919  meanRMSProjections3D_XY(pix_b3_Oxresxvsmodetaphi_3d, pix_b3_Oxresxvsmodeta_width, 0, 3);
1920  plots->Add(pix_b0_Oxresxvsmodeta_width);
1921  plots->Add(pix_b1_Oxresxvsmodeta_width);
1922  plots->Add(pix_b2_Oxresxvsmodeta_width);
1923  plots->Add(pix_b3_Oxresxvsmodeta_width);
1924  TH1F* pix_b_Oxresxvsmodeta_width = combineHistos("pix_b_Oxresxvsmodeta_width",
1925  "X-Overlap X Residual Width vs (Modified) Eta-ID Pixel Barrel",
1926  plots, 10);
1927  pix_b_Oxresxvsmodeta_width->GetYaxis()->SetTitle("X-Overlap Width Residual X");
1928  pix_b_Oxresxvsmodeta_width->GetXaxis()->SetTitle("(Modified) Module Eta-ID");
1929  plots->Clear();
1930 
1931  //XOverlap residual Y mean as a function of ring in the pixel barrel (sensitive to ring shear distortions)
1932  TH1F* pix_b0_Oxresyvsmodeta_mean = new TH1F("pix_b0_Oxresyvsmodeta_mean",
1933  "X-Overlap Y Residual Mean vs Eta-ID Pixel Barrel IBL", 20, -10.5,
1934  9.5);
1935  TH1F* pix_b1_Oxresyvsmodeta_mean = new TH1F("pix_b1_Oxresyvsmodeta_mean",
1936  "X-Overlap Y Residual Mean vs Eta-ID Pixel Barrel L0", 13, -6.5, 6.5);
1937  TH1F* pix_b2_Oxresyvsmodeta_mean = new TH1F("pix_b2_Oxresyvsmodeta_mean",
1938  "X-Overlap Y Residual Mean vs Eta-ID Pixel Barrel L1", 13, -6.5, 6.5);
1939  TH1F* pix_b3_Oxresyvsmodeta_mean = new TH1F("pix_b3_Oxresyvsmodeta_mean",
1940  "X-Overlap Y Residual Mean vs Eta-ID Pixel Barrel L2", 13, -6.5, 6.5);
1941  pix_b0_Oxresyvsmodeta_mean->GetYaxis()->SetTitle("X-Overlap Mean Residual Y");
1942  pix_b1_Oxresyvsmodeta_mean->GetYaxis()->SetTitle("X-Overlap Mean Residual Y");
1943  pix_b2_Oxresyvsmodeta_mean->GetYaxis()->SetTitle("X-Overlap Mean Residual Y");
1944  pix_b3_Oxresyvsmodeta_mean->GetYaxis()->SetTitle("X-Overlap Mean Residual Y");
1945  pix_b0_Oxresyvsmodeta_mean->GetXaxis()->SetTitle("Module Eta-ID");
1946  pix_b1_Oxresyvsmodeta_mean->GetXaxis()->SetTitle("Module Eta-ID");
1947  pix_b2_Oxresyvsmodeta_mean->GetXaxis()->SetTitle("Module Eta-ID");
1948  pix_b3_Oxresyvsmodeta_mean->GetXaxis()->SetTitle("Module Eta-ID");
1949  meanRMSProjections3D_XY(pix_b0_Oxresyvsmodetaphi_3d, pix_b0_Oxresyvsmodeta_mean, 0, 2);
1950  meanRMSProjections3D_XY(pix_b1_Oxresyvsmodetaphi_3d, pix_b1_Oxresyvsmodeta_mean, 0, 2);
1951  meanRMSProjections3D_XY(pix_b2_Oxresyvsmodetaphi_3d, pix_b2_Oxresyvsmodeta_mean, 0, 2);
1952  meanRMSProjections3D_XY(pix_b3_Oxresyvsmodetaphi_3d, pix_b3_Oxresyvsmodeta_mean, 0, 2);
1953  plots->Add(pix_b0_Oxresyvsmodeta_mean);
1954  plots->Add(pix_b1_Oxresyvsmodeta_mean);
1955  plots->Add(pix_b2_Oxresyvsmodeta_mean);
1956  plots->Add(pix_b3_Oxresyvsmodeta_mean);
1957 
1958  TH1F* pix_b_Oxresyvsmodeta_mean = combineHistos("pix_b_Oxresyvsmodeta_mean",
1959  "X-Overlap Y Residual Mean vs (Modified) Eta-ID Pixel Barrel",
1960  plots, 10);
1961  pix_b_Oxresyvsmodeta_mean->GetYaxis()->SetTitle("X-Overlap Mean Residual Y");
1962  pix_b_Oxresyvsmodeta_mean->GetXaxis()->SetTitle("(Modified) Module Eta-ID");
1963  plots->Clear();
1964 
1965  //XOverlap residual X width as a function of ring in the pixel barrel (sensitive to ring shear distortions)
1966  TH1F* pix_b0_Oxresyvsmodeta_width = new TH1F("pix_b0_Oxresyvsmodeta_width",
1967  "X-Overlap Y Residual Width vs Eta-ID Pixel Barrel IBL", 20, -10.5,
1968  9.5);
1969  TH1F* pix_b1_Oxresyvsmodeta_width = new TH1F("pix_b1_Oxresyvsmodeta_width",
1970  "X-Overlap Y Residual Width vs Eta-ID Pixel Barrel L0", 13, -6.5,
1971  6.5);
1972  TH1F* pix_b2_Oxresyvsmodeta_width = new TH1F("pix_b2_Oxresyvsmodeta_width",
1973  "X-Overlap Y Residual Width vs Eta-ID Pixel Barrel L1", 13, -6.5,
1974  6.5);
1975  TH1F* pix_b3_Oxresyvsmodeta_width = new TH1F("pix_b3_Oxresyvsmodeta_width",
1976  "X-Overlap Y Residual Width vs Eta-ID Pixel Barrel L2", 13, -6.5,
1977  6.5);
1978  pix_b0_Oxresyvsmodeta_width->GetYaxis()->SetTitle("X-Overlap Width Residual Y");
1979  pix_b1_Oxresyvsmodeta_width->GetYaxis()->SetTitle("X-Overlap Width Residual Y");
1980  pix_b2_Oxresyvsmodeta_width->GetYaxis()->SetTitle("X-Overlap Width Residual Y");
1981  pix_b3_Oxresyvsmodeta_width->GetYaxis()->SetTitle("X-Overlap Width Residual Y");
1982  pix_b0_Oxresyvsmodeta_width->GetXaxis()->SetTitle("Module Eta-ID");
1983  pix_b1_Oxresyvsmodeta_width->GetXaxis()->SetTitle("Module Eta-ID");
1984  pix_b2_Oxresyvsmodeta_width->GetXaxis()->SetTitle("Module Eta-ID");
1985  pix_b3_Oxresyvsmodeta_width->GetXaxis()->SetTitle("Module Eta-ID");
1986  meanRMSProjections3D_XY(pix_b0_Oxresyvsmodetaphi_3d, pix_b0_Oxresyvsmodeta_width, 0, 3);
1987  meanRMSProjections3D_XY(pix_b1_Oxresyvsmodetaphi_3d, pix_b1_Oxresyvsmodeta_width, 0, 3);
1988  meanRMSProjections3D_XY(pix_b2_Oxresyvsmodetaphi_3d, pix_b2_Oxresyvsmodeta_width, 0, 3);
1989  meanRMSProjections3D_XY(pix_b3_Oxresyvsmodetaphi_3d, pix_b3_Oxresyvsmodeta_width, 0, 3);
1990  plots->Add(pix_b0_Oxresyvsmodeta_width);
1991  plots->Add(pix_b1_Oxresyvsmodeta_width);
1992  plots->Add(pix_b2_Oxresyvsmodeta_width);
1993  plots->Add(pix_b3_Oxresyvsmodeta_width);
1994  TH1F* pix_b_Oxresyvsmodeta_width = combineHistos("pix_b_Oxresyvsmodeta_width",
1995  "X-Overlap Y Residual Width vs (Modified) Eta-ID Pixel Barrel",
1996  plots, 10);
1997  pix_b_Oxresyvsmodeta_width->GetYaxis()->SetTitle("X-Overlap Width Residual Y");
1998  pix_b_Oxresyvsmodeta_width->GetXaxis()->SetTitle("(Modified) Module Eta-ID");
1999  plots->Clear();
2000 
2001  //YOverlap residual Y mean as a function of stave in the pixel barrel (sensitive to stave-stretch distortions)
2002  TH1F* pix_b0_Oyresyvsmodphi_mean = new TH1F("pix_b0_Oyresyvsmodphi_mean",
2003  "Y-Overlap Y Residual Mean vs Phi-ID Pixel Barrel IBL", 14, -0.5,
2004  13.5);
2005  TH1F* pix_b1_Oyresyvsmodphi_mean = new TH1F("pix_b1_Oyresyvsmodphi_mean",
2006  "Y-Overlap Y Residual Mean vs Phi-ID Pixel Barrel L0", 22, -0.5,
2007  21.5);
2008  TH1F* pix_b2_Oyresyvsmodphi_mean = new TH1F("pix_b2_Oyresyvsmodphi_mean",
2009  "Y-Overlap Y Residual Mean vs Phi-ID Pixel Barrel L1", 38, -0.5,
2010  37.5);
2011  TH1F* pix_b3_Oyresyvsmodphi_mean = new TH1F("pix_b3_Oyresyvsmodphi_mean",
2012  "Y-Overlap Y Residual Mean vs Phi-ID Pixel Barrel L2", 52, -0.5,
2013  51.5);
2014  pix_b0_Oyresyvsmodphi_mean->GetYaxis()->SetTitle("Y-Overlap Mean Residual Y");
2015  pix_b1_Oyresyvsmodphi_mean->GetYaxis()->SetTitle("Y-Overlap Mean Residual Y");
2016  pix_b2_Oyresyvsmodphi_mean->GetYaxis()->SetTitle("Y-Overlap Mean Residual Y");
2017  pix_b3_Oyresyvsmodphi_mean->GetYaxis()->SetTitle("Y-Overlap Mean Residual Y");
2018  pix_b0_Oyresyvsmodphi_mean->GetXaxis()->SetTitle("Module Phi-ID");
2019  pix_b1_Oyresyvsmodphi_mean->GetXaxis()->SetTitle("Module Phi-ID");
2020  pix_b2_Oyresyvsmodphi_mean->GetXaxis()->SetTitle("Module Phi-ID");
2021  pix_b3_Oyresyvsmodphi_mean->GetXaxis()->SetTitle("Module Phi-ID");
2022  meanRMSProjections3D_XY(pix_b0_Oyresyvsmodetaphi_3d, pix_b0_Oyresyvsmodphi_mean, 1, 2);
2023  meanRMSProjections3D_XY(pix_b1_Oyresyvsmodetaphi_3d, pix_b1_Oyresyvsmodphi_mean, 1, 2);
2024  meanRMSProjections3D_XY(pix_b2_Oyresyvsmodetaphi_3d, pix_b2_Oyresyvsmodphi_mean, 1, 2);
2025  meanRMSProjections3D_XY(pix_b3_Oyresyvsmodetaphi_3d, pix_b3_Oyresyvsmodphi_mean, 1, 2);
2026  plots->Add(pix_b0_Oyresyvsmodphi_mean);
2027  plots->Add(pix_b1_Oyresyvsmodphi_mean);
2028  plots->Add(pix_b2_Oyresyvsmodphi_mean);
2029  plots->Add(pix_b3_Oyresyvsmodphi_mean);
2030  TH1F* pix_b_Oyresyvsmodphi_mean = combineHistos("pix_b_Oyresyvsmodphi_mean",
2031  "Y-Overlap Y Residual Mean vs (Modified) Eta-ID Pixel Barrel",
2032  plots, 10);
2033  pix_b_Oyresyvsmodphi_mean->GetYaxis()->SetTitle("Y-Overlap Mean Residual Y");
2034  pix_b_Oyresyvsmodphi_mean->GetXaxis()->SetTitle("(Modified) Module Phi-ID");
2035  plots->Clear();
2036 
2037  //YOverlap residual Y width as a function of stave in the pixel barrel (sensitive to stave-stretch distortions)
2038  TH1F* pix_b0_Oyresyvsmodphi_width = new TH1F("pix_b0_Oyresyvsmodphi_width",
2039  "Y-Overlap Y Residual Width vs Phi-ID Pixel Barrel IBL", 14, -0.5,
2040  13.5);
2041  TH1F* pix_b1_Oyresyvsmodphi_width = new TH1F("pix_b1_Oyresyvsmodphi_width",
2042  "Y-Overlap Y Residual Width vs Phi-ID Pixel Barrel L0", 22, -0.5,
2043  21.5);
2044  TH1F* pix_b2_Oyresyvsmodphi_width = new TH1F("pix_b2_Oyresyvsmodphi_width",
2045  "Y-Overlap Y Residual Width vs Phi-ID Pixel Barrel L1", 38, -0.5,
2046  37.5);
2047  TH1F* pix_b3_Oyresyvsmodphi_width = new TH1F("pix_b3_Oyresyvsmodphi_width",
2048  "Y-Overlap Y Residual Width vs Phi-ID Pixel Barrel L2", 52, -0.5,
2049  51.5);
2050  pix_b0_Oyresyvsmodphi_width->GetYaxis()->SetTitle("Y-Overlap Width Residual Y");
2051  pix_b1_Oyresyvsmodphi_width->GetYaxis()->SetTitle("Y-Overlap Width Residual Y");
2052  pix_b2_Oyresyvsmodphi_width->GetYaxis()->SetTitle("Y-Overlap Width Residual Y");
2053  pix_b3_Oyresyvsmodphi_width->GetYaxis()->SetTitle("Y-Overlap Width Residual Y");
2054  pix_b0_Oyresyvsmodphi_width->GetXaxis()->SetTitle("Module Phi-ID");
2055  pix_b1_Oyresyvsmodphi_width->GetXaxis()->SetTitle("Module Phi-ID");
2056  pix_b2_Oyresyvsmodphi_width->GetXaxis()->SetTitle("Module Phi-ID");
2057  pix_b3_Oyresyvsmodphi_width->GetXaxis()->SetTitle("Module Phi-ID");
2058  meanRMSProjections3D_XY(pix_b0_Oyresyvsmodetaphi_3d, pix_b0_Oyresyvsmodphi_width, 1, 3);
2059  meanRMSProjections3D_XY(pix_b1_Oyresyvsmodetaphi_3d, pix_b1_Oyresyvsmodphi_width, 1, 3);
2060  meanRMSProjections3D_XY(pix_b2_Oyresyvsmodetaphi_3d, pix_b2_Oyresyvsmodphi_width, 1, 3);
2061  meanRMSProjections3D_XY(pix_b3_Oyresyvsmodetaphi_3d, pix_b3_Oyresyvsmodphi_width, 1, 3);
2062  plots->Add(pix_b0_Oyresyvsmodphi_width);
2063  plots->Add(pix_b1_Oyresyvsmodphi_width);
2064  plots->Add(pix_b2_Oyresyvsmodphi_width);
2065  plots->Add(pix_b3_Oyresyvsmodphi_width);
2066  TH1F* pix_b_Oyresyvsmodphi_width = combineHistos("pix_b_Oyresyvsmodphi_width",
2067  "Y-Overlap Y Residual Width vs (Modified) Eta-ID Pixel Barrel",
2068  plots, 10);
2069  pix_b_Oyresyvsmodphi_width->GetYaxis()->SetTitle("Y-Overlap Width Residual Y");
2070  pix_b_Oyresyvsmodphi_width->GetXaxis()->SetTitle("(Modified) Module Phi-ID");
2071  plots->Clear();
2072 
2073  //YOverlap residual X mean as a function of stave in the pixel barrel (sensitive to stave-shear distortions)
2074  TH1F* pix_b0_Oyresxvsmodphi_mean = new TH1F("pix_b0_Oyresxvsmodphi_mean",
2075  "Y-Overlap X Residual Mean vs Phi-ID Pixel Barrel IBL", 14, -0.5,
2076  13.5);
2077  TH1F* pix_b1_Oyresxvsmodphi_mean = new TH1F("pix_b1_Oyresxvsmodphi_mean",
2078  "Y-Overlap X Residual Mean vs Phi-ID Pixel Barrel L0", 22, -0.5,
2079  21.5);
2080  TH1F* pix_b2_Oyresxvsmodphi_mean = new TH1F("pix_b2_Oyresxvsmodphi_mean",
2081  "Y-Overlap X Residual Mean vs Phi-ID Pixel Barrel L1", 38, -0.5,
2082  37.5);
2083  TH1F* pix_b3_Oyresxvsmodphi_mean = new TH1F("pix_b3_Oyresxvsmodphi_mean",
2084  "Y-Overlap X Residual Mean vs Phi-ID Pixel Barrel L2", 52, -0.5,
2085  51.5);
2086  pix_b0_Oyresxvsmodphi_mean->GetYaxis()->SetTitle("Y-Overlap Mean Residual X");
2087  pix_b1_Oyresxvsmodphi_mean->GetYaxis()->SetTitle("Y-Overlap Mean Residual X");
2088  pix_b2_Oyresxvsmodphi_mean->GetYaxis()->SetTitle("Y-Overlap Mean Residual X");
2089  pix_b3_Oyresxvsmodphi_mean->GetYaxis()->SetTitle("Y-Overlap Mean Residual X");
2090  pix_b0_Oyresxvsmodphi_mean->GetXaxis()->SetTitle("Module Phi-ID");
2091  pix_b1_Oyresxvsmodphi_mean->GetXaxis()->SetTitle("Module Phi-ID");
2092  pix_b2_Oyresxvsmodphi_mean->GetXaxis()->SetTitle("Module Phi-ID");
2093  pix_b3_Oyresxvsmodphi_mean->GetXaxis()->SetTitle("Module Phi-ID");
2094  meanRMSProjections3D_XY(pix_b0_Oyresxvsmodetaphi_3d, pix_b0_Oyresxvsmodphi_mean, 1, 2);
2095  meanRMSProjections3D_XY(pix_b1_Oyresxvsmodetaphi_3d, pix_b1_Oyresxvsmodphi_mean, 1, 2);
2096  meanRMSProjections3D_XY(pix_b2_Oyresxvsmodetaphi_3d, pix_b2_Oyresxvsmodphi_mean, 1, 2);
2097  meanRMSProjections3D_XY(pix_b3_Oyresxvsmodetaphi_3d, pix_b3_Oyresxvsmodphi_mean, 1, 2);
2098  plots->Add(pix_b0_Oyresxvsmodphi_mean);
2099  plots->Add(pix_b1_Oyresxvsmodphi_mean);
2100  plots->Add(pix_b2_Oyresxvsmodphi_mean);
2101  plots->Add(pix_b3_Oyresxvsmodphi_mean);
2102  TH1F* pix_b_Oyresxvsmodphi_mean = combineHistos("pix_b_Oyresxvsmodphi_mean",
2103  "Y-Overlap X Residual Mean vs (Modified) Eta-ID Pixel Barrel",
2104  plots, 10);
2105  pix_b_Oyresxvsmodphi_mean->GetYaxis()->SetTitle("Y-Overlap Mean Residual X");
2106  pix_b_Oyresxvsmodphi_mean->GetXaxis()->SetTitle("(Modified) Module Phi-ID");
2107  plots->Clear();
2108 
2109  //YOverlap residual X width as a function of stave in the pixel barrel (sensitive to stave-shear distortions)
2110 
2111  TH1F* pix_b0_Oyresxvsmodphi_width = new TH1F("pix_b0_Oyresxvsmodphi_width",
2112  "Y-Overlap X Residual Width vs Phi-ID Pixel Barrel IBL", 14, -0.5,
2113  13.5);
2114  TH1F* pix_b1_Oyresxvsmodphi_width = new TH1F("pix_b1_Oyresxvsmodphi_width",
2115  "Y-Overlap X Residual Width vs Phi-ID Pixel Barrel L0", 22, -0.5,
2116  21.5);
2117  TH1F* pix_b2_Oyresxvsmodphi_width = new TH1F("pix_b2_Oyresxvsmodphi_width",
2118  "Y-Overlap X Residual Width vs Phi-ID Pixel Barrel L1", 38, -0.5,
2119  37.5);
2120  TH1F* pix_b3_Oyresxvsmodphi_width = new TH1F("pix_b3_Oyresxvsmodphi_width",
2121  "Y-Overlap X Residual Width vs Phi-ID Pixel Barrel L2", 52, -0.5,
2122  51.5);
2123  pix_b0_Oyresxvsmodphi_width->GetYaxis()->SetTitle("Y-Overlap Width Residual X");
2124  pix_b1_Oyresxvsmodphi_width->GetYaxis()->SetTitle("Y-Overlap Width Residual X");
2125  pix_b2_Oyresxvsmodphi_width->GetYaxis()->SetTitle("Y-Overlap Width Residual X");
2126  pix_b3_Oyresxvsmodphi_width->GetYaxis()->SetTitle("Y-Overlap Width Residual X");
2127  pix_b0_Oyresxvsmodphi_width->GetXaxis()->SetTitle("Module Phi-ID");
2128  pix_b1_Oyresxvsmodphi_width->GetXaxis()->SetTitle("Module Phi-ID");
2129  pix_b2_Oyresxvsmodphi_width->GetXaxis()->SetTitle("Module Phi-ID");
2130  pix_b3_Oyresxvsmodphi_width->GetXaxis()->SetTitle("Module Phi-ID");
2131  meanRMSProjections3D_XY(pix_b0_Oyresxvsmodetaphi_3d, pix_b0_Oyresxvsmodphi_width, 1, 3);
2132  meanRMSProjections3D_XY(pix_b1_Oyresxvsmodetaphi_3d, pix_b1_Oyresxvsmodphi_width, 1, 3);
2133  meanRMSProjections3D_XY(pix_b2_Oyresxvsmodetaphi_3d, pix_b2_Oyresxvsmodphi_width, 1, 3);
2134  meanRMSProjections3D_XY(pix_b3_Oyresxvsmodetaphi_3d, pix_b3_Oyresxvsmodphi_width, 1, 3);
2135  plots->Add(pix_b0_Oyresxvsmodphi_width);
2136  plots->Add(pix_b1_Oyresxvsmodphi_width);
2137  plots->Add(pix_b2_Oyresxvsmodphi_width);
2138  plots->Add(pix_b3_Oyresxvsmodphi_width);
2139  TH1F* pix_b_Oyresxvsmodphi_width = combineHistos("pix_b_Oyresxvsmodphi_width",
2140  "Y-Overlap X Residual Width vs (Modified) Eta-ID Pixel Barrel",
2141  plots, 10);
2142  pix_b_Oyresxvsmodphi_width->GetYaxis()->SetTitle("Y-Overlap Width Residual X");
2143  pix_b_Oyresxvsmodphi_width->GetXaxis()->SetTitle("(Modified) Module Phi-ID");
2144  plots->Clear();
2145 
2146  //XOverlap residual X mean as a function of ring in the SCT barrel (sensitive to ring-expansion,contraction
2147  // distortions)
2148  TH1F* sct_b0_Oxresxvsmodeta_mean = new TH1F("sct_b0_Oxresxvsmodeta_mean",
2149  "X-Overlap X Residual Mean vs Eta-ID SCT Barrel L0", 13, -6.5, 6.5);
2150  TH1F* sct_b1_Oxresxvsmodeta_mean = new TH1F("sct_b1_Oxresxvsmodeta_mean",
2151  "X-Overlap X Residual Mean vs Eta-ID SCT Barrel L1", 13, -6.5, 6.5);
2152  TH1F* sct_b2_Oxresxvsmodeta_mean = new TH1F("sct_b2_Oxresxvsmodeta_mean",
2153  "X-Overlap X Residual Mean vs Eta-ID SCT Barrel L2", 13, -6.5, 6.5);
2154  TH1F* sct_b3_Oxresxvsmodeta_mean = new TH1F("sct_b3_Oxresxvsmodeta_mean",
2155  "X-Overlap X Residual Mean vs Eta-ID SCT Barrel L3", 13, -6.5, 6.5);
2156  sct_b0_Oxresxvsmodeta_mean->GetYaxis()->SetTitle("X-Overlap Mean Residual X");
2157  sct_b1_Oxresxvsmodeta_mean->GetYaxis()->SetTitle("X-Overlap Mean Residual X");
2158  sct_b2_Oxresxvsmodeta_mean->GetYaxis()->SetTitle("X-Overlap Mean Residual X");
2159  sct_b3_Oxresxvsmodeta_mean->GetYaxis()->SetTitle("X-Overlap Mean Residual X");
2160  sct_b0_Oxresxvsmodeta_mean->GetXaxis()->SetTitle("Module Eta-ID");
2161  sct_b1_Oxresxvsmodeta_mean->GetXaxis()->SetTitle("Module Eta-ID");
2162  sct_b2_Oxresxvsmodeta_mean->GetXaxis()->SetTitle("Module Eta-ID");
2163  sct_b3_Oxresxvsmodeta_mean->GetXaxis()->SetTitle("Module Eta-ID");
2164  meanRMSProjections3D_XY(sct_b0_Oxresxvsmodetaphi_3d, sct_b0_Oxresxvsmodeta_mean, 0, 2);
2165  meanRMSProjections3D_XY(sct_b1_Oxresxvsmodetaphi_3d, sct_b1_Oxresxvsmodeta_mean, 0, 2);
2166  meanRMSProjections3D_XY(sct_b2_Oxresxvsmodetaphi_3d, sct_b2_Oxresxvsmodeta_mean, 0, 2);
2167  meanRMSProjections3D_XY(sct_b3_Oxresxvsmodetaphi_3d, sct_b3_Oxresxvsmodeta_mean, 0, 2);
2168  plots->Add(sct_b0_Oxresxvsmodeta_mean);
2169  plots->Add(sct_b1_Oxresxvsmodeta_mean);
2170  plots->Add(sct_b2_Oxresxvsmodeta_mean);
2171  plots->Add(sct_b3_Oxresxvsmodeta_mean);
2172  TH1F* sct_b_Oxresxvsmodeta_mean = combineHistos("sct_b_Oxresxvsmodeta_mean",
2173  "X-Overlap X Residual Mean vs (Modified) Eta-ID SCT Barrel",
2174  plots, 10);
2175  sct_b_Oxresxvsmodeta_mean->GetYaxis()->SetTitle("X-Overlap Mean Residual X");
2176  sct_b_Oxresxvsmodeta_mean->GetXaxis()->SetTitle("(Modified) Module Eta-ID");
2177  plots->Clear();
2178 
2179 
2180  //XOverlap residual X width as a function of ring in the SCT barrel (sensitive to ring-expansion,contraction
2181  // distortions)
2182  TH1F* sct_b0_Oxresxvsmodeta_width = new TH1F("sct_b0_Oxresxvsmodeta_width",
2183  "X-Overlap X Residual Width vs Eta-ID SCT Barrel L0", 13, -6.5, 6.5);
2184  TH1F* sct_b1_Oxresxvsmodeta_width = new TH1F("sct_b1_Oxresxvsmodeta_width",
2185  "X-Overlap X Residual Width vs Eta-ID SCT Barrel L1", 13, -6.5, 6.5);
2186  TH1F* sct_b2_Oxresxvsmodeta_width = new TH1F("sct_b2_Oxresxvsmodeta_width",
2187  "X-Overlap X Residual Width vs Eta-ID SCT Barrel L2", 13, -6.5, 6.5);
2188  TH1F* sct_b3_Oxresxvsmodeta_width = new TH1F("sct_b3_Oxresxvsmodeta_width",
2189  "X-Overlap X Residual Width vs Eta-ID SCT Barrel L3", 13, -6.5, 6.5);
2190  sct_b0_Oxresxvsmodeta_width->GetYaxis()->SetTitle("X-Overlap Width Residual X");
2191  sct_b1_Oxresxvsmodeta_width->GetYaxis()->SetTitle("X-Overlap Width Residual X");
2192  sct_b2_Oxresxvsmodeta_width->GetYaxis()->SetTitle("X-Overlap Width Residual X");
2193  sct_b3_Oxresxvsmodeta_width->GetYaxis()->SetTitle("X-Overlap Width Residual X");
2194  sct_b0_Oxresxvsmodeta_width->GetXaxis()->SetTitle("Module Eta-ID");
2195  sct_b1_Oxresxvsmodeta_width->GetXaxis()->SetTitle("Module Eta-ID");
2196  sct_b2_Oxresxvsmodeta_width->GetXaxis()->SetTitle("Module Eta-ID");
2197  sct_b3_Oxresxvsmodeta_width->GetXaxis()->SetTitle("Module Eta-ID");
2198  meanRMSProjections3D_XY(sct_b0_Oxresxvsmodetaphi_3d, sct_b0_Oxresxvsmodeta_width, 0, 3);
2199  meanRMSProjections3D_XY(sct_b1_Oxresxvsmodetaphi_3d, sct_b1_Oxresxvsmodeta_width, 0, 3);
2200  meanRMSProjections3D_XY(sct_b2_Oxresxvsmodetaphi_3d, sct_b2_Oxresxvsmodeta_width, 0, 3);
2201  meanRMSProjections3D_XY(sct_b3_Oxresxvsmodetaphi_3d, sct_b3_Oxresxvsmodeta_width, 0, 3);
2202  plots->Add(sct_b0_Oxresxvsmodeta_width);
2203  plots->Add(sct_b1_Oxresxvsmodeta_width);
2204  plots->Add(sct_b2_Oxresxvsmodeta_width);
2205  plots->Add(sct_b3_Oxresxvsmodeta_width);
2206  TH1F* sct_b_Oxresxvsmodeta_width = combineHistos("sct_b_Oxresxvsmodeta_width",
2207  "X-Overlap X Residual Width vs (Modified) Eta-ID SCT Barrel",
2208  plots, 10);
2209  sct_b_Oxresxvsmodeta_width->GetYaxis()->SetTitle("X-Overlap Width Residual X");
2210  sct_b_Oxresxvsmodeta_width->GetXaxis()->SetTitle("(Modified) Module Eta-ID");
2211  plots->Clear();
2212 
2213 
2214  //YOverlap residual X mean as a function of stave in the SCT barrel (sensitive to stave shear distortions)
2215  TH1F* sct_b0_Oyresxvsmodphi_mean = new TH1F("sct_b0_Oyresxvsmodphi_mean",
2216  "Y-Overlap X Residual Mean vs Phi-ID SCT Barrel L0", 32, -0.5, 31.5);
2217  TH1F* sct_b1_Oyresxvsmodphi_mean = new TH1F("sct_b1_Oyresxvsmodphi_mean",
2218  "Y-Overlap X Residual Mean vs Phi-ID SCT Barrel L1", 40, -0.5, 39.5);
2219  TH1F* sct_b2_Oyresxvsmodphi_mean = new TH1F("sct_b2_Oyresxvsmodphi_mean",
2220  "Y-Overlap X Residual Mean vs Phi-ID SCT Barrel L2", 48, -0.5, 47.5);
2221  TH1F* sct_b3_Oyresxvsmodphi_mean = new TH1F("sct_b3_Oyresxvsmodphi_mean",
2222  "Y-Overlap X Residual Mean vs Phi-ID SCT Barrel L3", 56, -0.5, 55.5);
2223  sct_b0_Oyresxvsmodphi_mean->GetYaxis()->SetTitle("Y-Overlap Mean Residual X");
2224  sct_b1_Oyresxvsmodphi_mean->GetYaxis()->SetTitle("Y-Overlap Mean Residual X");
2225  sct_b2_Oyresxvsmodphi_mean->GetYaxis()->SetTitle("Y-Overlap Mean Residual X");
2226  sct_b3_Oyresxvsmodphi_mean->GetYaxis()->SetTitle("Y-Overlap Mean Residual X");
2227  sct_b0_Oyresxvsmodphi_mean->GetXaxis()->SetTitle("Module Phi-ID");
2228  sct_b1_Oyresxvsmodphi_mean->GetXaxis()->SetTitle("Module Phi-ID");
2229  sct_b2_Oyresxvsmodphi_mean->GetXaxis()->SetTitle("Module Phi-ID");
2230  sct_b3_Oyresxvsmodphi_mean->GetXaxis()->SetTitle("Module Phi-ID");
2231  meanRMSProjections3D_XY(sct_b0_Oyresxvsmodetaphi_3d, sct_b0_Oyresxvsmodphi_mean, 1, 2);
2232  meanRMSProjections3D_XY(sct_b1_Oyresxvsmodetaphi_3d, sct_b1_Oyresxvsmodphi_mean, 1, 2);
2233  meanRMSProjections3D_XY(sct_b2_Oyresxvsmodetaphi_3d, sct_b2_Oyresxvsmodphi_mean, 1, 2);
2234  meanRMSProjections3D_XY(sct_b3_Oyresxvsmodetaphi_3d, sct_b3_Oyresxvsmodphi_mean, 1, 2);
2235  plots->Add(sct_b0_Oyresxvsmodphi_mean);
2236  plots->Add(sct_b1_Oyresxvsmodphi_mean);
2237  plots->Add(sct_b2_Oyresxvsmodphi_mean);
2238  plots->Add(sct_b3_Oyresxvsmodphi_mean);
2239  TH1F* sct_b_Oyresxvsmodphi_mean = combineHistos("sct_b_Oyresxvsmodphi_mean",
2240  "Y-Overlap X Residual Mean vs (Modified) Phi-ID SCT Barrel",
2241  plots, 10);
2242  sct_b_Oyresxvsmodphi_mean->GetYaxis()->SetTitle("Y-Overlap Mean Residual X");
2243  sct_b_Oyresxvsmodphi_mean->GetXaxis()->SetTitle("(Modified) Module Phi-ID");
2244  plots->Clear();
2245 
2246  //YOverlap residual X width as a function of stave in the SCT barrel (sensitive to stave shear distortions)
2247  TH1F* sct_b0_Oyresxvsmodphi_width = new TH1F("sct_b0_Oyresxvsmodphi_width",
2248  "Y-Overlap X Residual Width vs Phi-ID SCT Barrel L0", 32, -0.5,
2249  31.5);
2250  TH1F* sct_b1_Oyresxvsmodphi_width = new TH1F("sct_b1_Oyresxvsmodphi_width",
2251  "Y-Overlap X Residual Width vs Phi-ID SCT Barrel L1", 40, -0.5,
2252  39.5);
2253  TH1F* sct_b2_Oyresxvsmodphi_width = new TH1F("sct_b2_Oyresxvsmodphi_width",
2254  "Y-Overlap X Residual Width vs Phi-ID SCT Barrel L2", 48, -0.5,
2255  47.5);
2256  TH1F* sct_b3_Oyresxvsmodphi_width = new TH1F("sct_b3_Oyresxvsmodphi_width",
2257  "Y-Overlap X Residual Width vs Phi-ID SCT Barrel L3", 56, -0.5,
2258  55.5);
2259  sct_b0_Oyresxvsmodphi_width->GetYaxis()->SetTitle("Y-Overlap Width Residual X");
2260  sct_b1_Oyresxvsmodphi_width->GetYaxis()->SetTitle("Y-Overlap Width Residual X");
2261  sct_b2_Oyresxvsmodphi_width->GetYaxis()->SetTitle("Y-Overlap Width Residual X");
2262  sct_b3_Oyresxvsmodphi_width->GetYaxis()->SetTitle("Y-Overlap Width Residual X");
2263  sct_b0_Oyresxvsmodphi_width->GetXaxis()->SetTitle("Module Phi-ID");
2264  sct_b1_Oyresxvsmodphi_width->GetXaxis()->SetTitle("Module Phi-ID");
2265  sct_b2_Oyresxvsmodphi_width->GetXaxis()->SetTitle("Module Phi-ID");
2266  sct_b3_Oyresxvsmodphi_width->GetXaxis()->SetTitle("Module Phi-ID");
2267  meanRMSProjections3D_XY(sct_b0_Oyresxvsmodetaphi_3d, sct_b0_Oyresxvsmodphi_width, 1, 3);
2268  meanRMSProjections3D_XY(sct_b1_Oyresxvsmodetaphi_3d, sct_b1_Oyresxvsmodphi_width, 1, 3);
2269  meanRMSProjections3D_XY(sct_b2_Oyresxvsmodetaphi_3d, sct_b2_Oyresxvsmodphi_width, 1, 3);
2270  meanRMSProjections3D_XY(sct_b3_Oyresxvsmodetaphi_3d, sct_b3_Oyresxvsmodphi_width, 1, 3);
2271  plots->Add(sct_b0_Oyresxvsmodphi_width);
2272  plots->Add(sct_b1_Oyresxvsmodphi_width);
2273  plots->Add(sct_b2_Oyresxvsmodphi_width);
2274  plots->Add(sct_b3_Oyresxvsmodphi_width);
2275  TH1F* sct_b_Oyresxvsmodphi_width = combineHistos("sct_b_Oyresxvsmodphi_width",
2276  "Y-Overlap X Residual Width vs (Modified) Phi-ID SCT Barrel",
2277  plots, 10);
2278  sct_b_Oyresxvsmodphi_width->GetYaxis()->SetTitle("Y-Overlap Width Residual X");
2279  sct_b_Oyresxvsmodphi_width->GetXaxis()->SetTitle("(Modified) Module Phi-ID");
2280  plots->Clear();
2281 
2282 
2283  //write the overlap histograms to file
2284  pix_b_Oxresxvsmodeta_mean->Write("", TObject::kOverwrite);
2285  pix_b_Oxresxvsmodeta_width->Write("", TObject::kOverwrite);
2286  pix_b_Oxresyvsmodeta_mean->Write("", TObject::kOverwrite);
2287  pix_b_Oxresyvsmodeta_width->Write("", TObject::kOverwrite);
2288  pix_b_Oyresyvsmodphi_mean->Write("", TObject::kOverwrite);
2289  pix_b_Oyresyvsmodphi_width->Write("", TObject::kOverwrite);
2290 
2291  f->Write();
2292 
2293  pix_b_Oyresxvsmodphi_mean->Write("", TObject::kOverwrite);
2294  pix_b_Oyresxvsmodphi_width->Write("", TObject::kOverwrite);
2295  sct_b_Oxresxvsmodeta_mean->Write("", TObject::kOverwrite);
2296  sct_b_Oxresxvsmodeta_width->Write("", TObject::kOverwrite);
2297  sct_b_Oyresxvsmodphi_mean->Write("", TObject::kOverwrite);
2298  sct_b_Oyresxvsmodphi_width->Write("", TObject::kOverwrite);
2299 
2300  f->Write();
2301  }
2302 
2303  return;
2304  }
2305 
2306  void
2308  fitMergedFile_IDAlignMonGenericTracks(TFile* file, const std::string& run_dir, const std::string& tracksName) {
2309  std::string path;
2310  path = run_dir + "IDAlignMon/" + tracksName + "/GenericTracks";
2311  if (file->cd(path.c_str()) == 0) {
2312  //std::cerr << "MonitoringFile::fitMergedFile_IDAlignMonGenericTracks(): "
2313  // << "No such directory \"" << path << "\"\n";
2314  return;
2315  }
2316  //charge Asym vs pt
2317  if (CheckHistogram(file,
2318  (path + "/trk_pT_asym_barrel").c_str()) &&
2320  (path + "/trk_pT_neg_barrel").c_str()) &&
2321  CheckHistogram(file, (path + "/trk_pT_pos_barrel").c_str())) {
2322  TH1F* trk_pT_neg_barrel = (TH1F*) (file->Get((path + "/trk_pT_neg_barrel").c_str())->Clone());
2323  TH1F* trk_pT_pos_barrel = (TH1F*) (file->Get((path + "/trk_pT_pos_barrel").c_str())->Clone());
2324  TH1F* trk_pT_asym_barrel = (TH1F*) (file->Get((path + "/trk_pT_asym_barrel").c_str())->Clone());
2325  ProcessAsymHistograms(trk_pT_neg_barrel, trk_pT_pos_barrel, trk_pT_asym_barrel);
2326  trk_pT_asym_barrel->SetXTitle("p_{T} [GeV]");
2327  trk_pT_asym_barrel->Write("", TObject::kOverwrite);
2328  }
2329  if (CheckHistogram(file,
2330  (path + "/trk_pT_asym_ecc").c_str()) &&
2332  (path + "/trk_pT_neg_ecc").c_str()) &&
2333  CheckHistogram(file, (path + "/trk_pT_pos_ecc").c_str())) {
2334  TH1F* trk_pT_neg_ecc = (TH1F*) (file->Get((path + "/trk_pT_neg_ecc").c_str())->Clone());
2335  TH1F* trk_pT_pos_ecc = (TH1F*) (file->Get((path + "/trk_pT_pos_ecc").c_str())->Clone());
2336  TH1F* trk_pT_asym_ecc = (TH1F*) (file->Get((path + "/trk_pT_asym_ecc").c_str())->Clone());
2337  ProcessAsymHistograms(trk_pT_neg_ecc, trk_pT_pos_ecc, trk_pT_asym_ecc);
2338  trk_pT_asym_ecc->SetXTitle("p_{T} [GeV]");
2339  trk_pT_asym_ecc->Write("", TObject::kOverwrite);
2340  }
2341  if (CheckHistogram(file,
2342  (path + "/trk_pT_asym_eca").c_str()) &&
2344  (path + "/trk_pT_neg_eca").c_str()) &&
2345  CheckHistogram(file, (path + "/trk_pT_pos_eca").c_str())) {
2346  TH1F* trk_pT_neg_eca = (TH1F*) (file->Get((path + "/trk_pT_neg_eca").c_str())->Clone());
2347  TH1F* trk_pT_pos_eca = (TH1F*) (file->Get((path + "/trk_pT_pos_eca").c_str())->Clone());
2348  TH1F* trk_pT_asym_eca = (TH1F*) (file->Get((path + "/trk_pT_asym_eca").c_str())->Clone());
2349  ProcessAsymHistograms(trk_pT_neg_eca, trk_pT_pos_eca, trk_pT_asym_eca);
2350  trk_pT_asym_eca->SetXTitle("p_{T} [GeV]");
2351  trk_pT_asym_eca->Write("", TObject::kOverwrite);
2352  }
2353  if (CheckHistogram(file,
2354  (path + "/trk_pT_asym").c_str()) &&
2355  CheckHistogram(file, (path + "/pT_n").c_str()) && CheckHistogram(file, (path + "/pT_p").c_str())) {
2356  TH1F* trk_pT_neg = (TH1F*) (file->Get((path + "/pT_n").c_str())->Clone());
2357  TH1F* trk_pT_pos = (TH1F*) (file->Get((path + "/pT_p").c_str())->Clone());
2358  TH1F* trk_pT_asym = (TH1F*) (file->Get((path + "/trk_pT_asym").c_str())->Clone());
2359  ProcessAsymHistograms(trk_pT_neg, trk_pT_pos, trk_pT_asym);
2360  trk_pT_asym->SetXTitle("p_{T} [GeV]");
2361  trk_pT_asym->Write("", TObject::kOverwrite);
2362  }
2363 
2364  //charge Asym vs phi
2365  if (CheckHistogram(file,
2366  (path + "/trk_phi0_asym_barrel").c_str()) &&
2368  (path + "/trk_phi0_neg_barrel").c_str()) &&
2369  CheckHistogram(file, (path + "/trk_phi0_pos_barrel").c_str())) {
2370  TH1F* trk_phi0_neg_barrel = (TH1F*) (file->Get((path + "/trk_phi0_neg_barrel").c_str())->Clone());
2371  TH1F* trk_phi0_pos_barrel = (TH1F*) (file->Get((path + "/trk_phi0_pos_barrel").c_str())->Clone());
2372  TH1F* trk_phi0_asym_barrel = (TH1F*) (file->Get((path + "/trk_phi0_asym_barrel").c_str())->Clone());
2373  ProcessAsymHistograms(trk_phi0_neg_barrel, trk_phi0_pos_barrel, trk_phi0_asym_barrel);
2374  trk_phi0_asym_barrel->SetXTitle("track #phi [rad]");
2375  trk_phi0_asym_barrel->Write("", TObject::kOverwrite);
2376  }
2377  if (CheckHistogram(file,
2378  (path + "/trk_phi0_asym_ecc").c_str()) &&
2380  (path + "/trk_phi0_neg_ecc").c_str()) &&
2381  CheckHistogram(file, (path + "/trk_phi0_pos_ecc").c_str())) {
2382  TH1F* trk_phi0_neg_ecc = (TH1F*) (file->Get((path + "/trk_phi0_neg_ecc").c_str())->Clone());
2383  TH1F* trk_phi0_pos_ecc = (TH1F*) (file->Get((path + "/trk_phi0_pos_ecc").c_str())->Clone());
2384  TH1F* trk_phi0_asym_ecc = (TH1F*) (file->Get((path + "/trk_phi0_asym_ecc").c_str())->Clone());
2385  ProcessAsymHistograms(trk_phi0_neg_ecc, trk_phi0_pos_ecc, trk_phi0_asym_ecc);
2386  trk_phi0_asym_ecc->SetXTitle("track #phi [rad]");
2387  trk_phi0_asym_ecc->Write("", TObject::kOverwrite);
2388  }
2389  if (CheckHistogram(file,
2390  (path + "/trk_phi0_asym_eca").c_str()) &&
2392  (path + "/trk_phi0_neg_eca").c_str()) &&
2393  CheckHistogram(file, (path + "/trk_phi0_pos_eca").c_str())) {
2394  TH1F* trk_phi0_neg_eca = (TH1F*) (file->Get((path + "/trk_phi0_neg_eca").c_str())->Clone());
2395  TH1F* trk_phi0_pos_eca = (TH1F*) (file->Get((path + "/trk_phi0_pos_eca").c_str())->Clone());
2396  TH1F* trk_phi0_asym_eca = (TH1F*) (file->Get((path + "/trk_phi0_asym_eca").c_str())->Clone());
2397  ProcessAsymHistograms(trk_phi0_neg_eca, trk_phi0_pos_eca, trk_phi0_asym_eca);
2398  trk_phi0_asym_eca->SetXTitle("track #phi [rad]");
2399  trk_phi0_asym_eca->Write("", TObject::kOverwrite);
2400  }
2401 
2402  //charge Asym vs eta
2403  if (CheckHistogram(file,
2404  (path + "/eta_asym").c_str()) &&
2405  CheckHistogram(file, (path + "/eta_neg").c_str()) && CheckHistogram(file, (path + "/eta_pos").c_str())) {
2406  TH1F* eta_neg = (TH1F*) (file->Get((path + "/eta_neg").c_str())->Clone());
2407  TH1F* eta_pos = (TH1F*) (file->Get((path + "/eta_pos").c_str())->Clone());
2408  TH1F* eta_asym = (TH1F*) (file->Get((path + "/eta_asym").c_str())->Clone());
2409  ProcessAsymHistograms(eta_neg, eta_pos, eta_asym);
2410  eta_asym->SetXTitle("track #eta");
2411  eta_asym->Write("", TObject::kOverwrite);
2412  }
2413 
2414  //charge Asym vs d0 (corrected for vertex)
2415  if (CheckHistogram(file,
2416  (path + "/trk_d0c_asym_barrel").c_str()) &&
2418  (path + "/trk_d0c_neg_barrel").c_str()) &&
2419  CheckHistogram(file, (path + "/trk_d0c_pos_barrel").c_str())) {
2420  TH1F* trk_d0c_neg_barrel = (TH1F*) (file->Get((path + "/trk_d0c_neg_barrel").c_str())->Clone());
2421  TH1F* trk_d0c_pos_barrel = (TH1F*) (file->Get((path + "/trk_d0c_pos_barrel").c_str())->Clone());
2422  TH1F* trk_d0c_asym_barrel = (TH1F*) (file->Get((path + "/trk_d0c_asym_barrel").c_str())->Clone());
2423  ProcessAsymHistograms(trk_d0c_neg_barrel, trk_d0c_pos_barrel, trk_d0c_asym_barrel);
2424  trk_d0c_asym_barrel->SetXTitle("track d_{0} [mm]");
2425  trk_d0c_asym_barrel->Write("", TObject::kOverwrite);
2426  }
2427  if (CheckHistogram(file,
2428  (path + "/trk_d0c_asym_ecc").c_str()) &&
2430  (path + "/trk_d0c_neg_ecc").c_str()) &&
2431  CheckHistogram(file, (path + "/trk_d0c_pos_ecc").c_str())) {
2432  TH1F* trk_d0c_neg_ecc = (TH1F*) (file->Get((path + "/trk_d0c_neg_ecc").c_str())->Clone());
2433  TH1F* trk_d0c_pos_ecc = (TH1F*) (file->Get((path + "/trk_d0c_pos_ecc").c_str())->Clone());
2434  TH1F* trk_d0c_asym_ecc = (TH1F*) (file->Get((path + "/trk_d0c_asym_ecc").c_str())->Clone());
2435  ProcessAsymHistograms(trk_d0c_neg_ecc, trk_d0c_pos_ecc, trk_d0c_asym_ecc);
2436  trk_d0c_asym_ecc->SetXTitle("track d_{0} [mm]");
2437  trk_d0c_asym_ecc->Write("", TObject::kOverwrite);
2438  }
2439  if (CheckHistogram(file,
2440  (path + "/trk_d0c_asym_eca").c_str()) &&
2442  (path + "/trk_d0c_neg_eca").c_str()) &&
2443  CheckHistogram(file, (path + "/trk_d0c_pos_eca").c_str())) {
2444  TH1F* trk_d0c_neg_eca = (TH1F*) (file->Get((path + "/trk_d0c_neg_eca").c_str())->Clone());
2445  TH1F* trk_d0c_pos_eca = (TH1F*) (file->Get((path + "/trk_d0c_pos_eca").c_str())->Clone());
2446  TH1F* trk_d0c_asym_eca = (TH1F*) (file->Get((path + "/trk_d0c_asym_eca").c_str())->Clone());
2447  ProcessAsymHistograms(trk_d0c_neg_eca, trk_d0c_pos_eca, trk_d0c_asym_eca);
2448  trk_d0c_asym_eca->SetXTitle("track d_{0} [mm]");
2449  trk_d0c_asym_eca->Write("", TObject::kOverwrite);
2450  }
2451  if (CheckHistogram(file,
2452  (path + "/trk_d0c_asym").c_str()) &&
2454  (path + "/trk_d0c_neg").c_str()) && CheckHistogram(file, (path + "/trk_d0c_pos").c_str())) {
2455  TH1F* trk_d0c_neg = (TH1F*) (file->Get((path + "/trk_d0c_neg").c_str())->Clone());
2456  TH1F* trk_d0c_pos = (TH1F*) (file->Get((path + "/trk_d0c_pos").c_str())->Clone());
2457  TH1F* trk_d0c_asym = (TH1F*) (file->Get((path + "/trk_d0c_asym").c_str())->Clone());
2458  ProcessAsymHistograms(trk_d0c_neg, trk_d0c_pos, trk_d0c_asym);
2459  trk_d0c_asym->SetXTitle("track d_{0} [mm]");
2460  trk_d0c_asym->Write("", TObject::kOverwrite);
2461  }
2462  //charge Asym vs z0 (corrected for vertex)
2463  if (CheckHistogram(file,
2464  (path + "/trk_z0c_asym_barrel").c_str()) &&
2466  (path + "/trk_z0c_neg_barrel").c_str()) &&
2467  CheckHistogram(file, (path + "/trk_z0c_pos_barrel").c_str())) {
2468  TH1F* trk_z0c_neg_barrel = (TH1F*) (file->Get((path + "/trk_z0c_neg_barrel").c_str())->Clone());
2469  TH1F* trk_z0c_pos_barrel = (TH1F*) (file->Get((path + "/trk_z0c_pos_barrel").c_str())->Clone());
2470  TH1F* trk_z0c_asym_barrel = (TH1F*) (file->Get((path + "/trk_z0c_asym_barrel").c_str())->Clone());
2471  ProcessAsymHistograms(trk_z0c_neg_barrel, trk_z0c_pos_barrel, trk_z0c_asym_barrel);
2472  trk_z0c_asym_barrel->SetXTitle("track z_{0} [mm]");
2473  trk_z0c_asym_barrel->Write("", TObject::kOverwrite);
2474  }
2475  if (CheckHistogram(file,
2476  (path + "/trk_z0c_asym_ecc").c_str()) &&
2478  (path + "/trk_z0c_neg_ecc").c_str()) &&
2479  CheckHistogram(file, (path + "/trk_z0c_pos_ecc").c_str())) {
2480  TH1F* trk_z0c_neg_ecc = (TH1F*) (file->Get((path + "/trk_z0c_neg_ecc").c_str())->Clone());
2481  TH1F* trk_z0c_pos_ecc = (TH1F*) (file->Get((path + "/trk_z0c_pos_ecc").c_str())->Clone());
2482  TH1F* trk_z0c_asym_ecc = (TH1F*) (file->Get((path + "/trk_z0c_asym_ecc").c_str())->Clone());
2483  ProcessAsymHistograms(trk_z0c_neg_ecc, trk_z0c_pos_ecc, trk_z0c_asym_ecc);
2484  trk_z0c_asym_ecc->SetXTitle("track z_{0} [mm]");
2485  trk_z0c_asym_ecc->Write("", TObject::kOverwrite);
2486  }
2487  if (CheckHistogram(file,
2488  (path + "/trk_z0c_asym_eca").c_str()) &&
2490  (path + "/trk_z0c_neg_eca").c_str()) &&
2491  CheckHistogram(file, (path + "/trk_z0c_pos_eca").c_str())) {
2492  TH1F* trk_z0c_neg_eca = (TH1F*) (file->Get((path + "/trk_z0c_neg_eca").c_str())->Clone());
2493  TH1F* trk_z0c_pos_eca = (TH1F*) (file->Get((path + "/trk_z0c_pos_eca").c_str())->Clone());
2494  TH1F* trk_z0c_asym_eca = (TH1F*) (file->Get((path + "/trk_z0c_asym_eca").c_str())->Clone());
2495  ProcessAsymHistograms(trk_z0c_neg_eca, trk_z0c_pos_eca, trk_z0c_asym_eca);
2496  trk_z0c_asym_eca->SetXTitle("track z_{0} [mm]");
2497  trk_z0c_asym_eca->Write("", TObject::kOverwrite);
2498  }
2499  if (CheckHistogram(file,
2500  (path + "/trk_z0c_asym").c_str()) &&
2502  (path + "/trk_z0c_neg").c_str()) && CheckHistogram(file, (path + "/trk_z0c_pos").c_str())) {
2503  TH1F* trk_z0c_neg = (TH1F*) (file->Get((path + "/trk_z0c_neg").c_str())->Clone());
2504  TH1F* trk_z0c_pos = (TH1F*) (file->Get((path + "/trk_z0c_pos").c_str())->Clone());
2505  TH1F* trk_z0c_asym = (TH1F*) (file->Get((path + "/trk_z0c_asym").c_str())->Clone());
2506  ProcessAsymHistograms(trk_z0c_neg, trk_z0c_pos, trk_z0c_asym);
2507  trk_z0c_asym->SetXTitle("track z_{0} [mm]");
2508  trk_z0c_asym->Write("", TObject::kOverwrite);
2509  }
2510  file->Write();
2511  }
2512 
2513  void
2515  fitMergedFile_IDAlignMonPVbiases(TFile* file, const std::string& run_dir, const std::string& tracksName) {
2516  std::string path;
2517  path = run_dir + "IDAlignMon/" + tracksName + "/GenericTracks/PVbiases";
2518  //path= run_dir + "IDAlignMon/InDetTrackParticles_all/GenericTracks";
2519  if (file->cd(path.c_str()) == 0) {
2520  //std::cerr << "MonitoringFile::fitMergedFile_IDAlignMonGenericTracks(): "
2521  // << "No such directory \"" << path << "\"\n";
2522  return;
2523  }
2524 
2525 
2526  //Maps vs phi_vs_eta vs eta
2527  if (CheckHistogram(file,
2528  (path + "/trk_d0_wrtPV_vs_phi_vs_eta_400MeV_600MeV_positive").c_str()) &&
2529  CheckHistogram(file, (path + "/trk_d0_wrtPV_vs_phi_vs_eta_400MeV_600MeV_negative").c_str())) {
2530  TH3F* trk_d0_wrtPV_vs_phi_vs_eta_400MeV_600MeV_positive =
2531  (TH3F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_vs_eta_400MeV_600MeV_positive").c_str())->Clone());
2532  TH3F* trk_d0_wrtPV_vs_phi_vs_eta_400MeV_600MeV_negative =
2533  (TH3F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_vs_eta_400MeV_600MeV_negative").c_str())->Clone());
2534 
2535  TH2F* trk_d0_wrtPV_map_vs_phi_vs_eta_400MeV_600MeV_positive = new TH2F(
2536  "trk_d0_wrtPV_map_vs_phi_vs_eta_400MeV_600MeV_positive",
2537  "map d0 vs phi_vs_eta 400MeV-600MeV positive; #phi; #eta", 20, -3.1, 3.1, 20, -2.5, 2.5);
2538  TH2F* trk_d0_wrtPV_map_vs_phi_vs_eta_400MeV_600MeV_negative = new TH2F(
2539  "trk_d0_wrtPV_map_vs_phi_vs_eta_400MeV_600MeV_negative",
2540  "map d0 vs phi_vs_eta 400MeV-600MeV negative; #phi; #eta", 20, -3.1, 3.1, 20, -2.5, 2.5);
2541 
2542  MakeMap(trk_d0_wrtPV_map_vs_phi_vs_eta_400MeV_600MeV_positive, trk_d0_wrtPV_vs_phi_vs_eta_400MeV_600MeV_positive);
2543  MakeMap(trk_d0_wrtPV_map_vs_phi_vs_eta_400MeV_600MeV_negative, trk_d0_wrtPV_vs_phi_vs_eta_400MeV_600MeV_negative);
2544 
2545  trk_d0_wrtPV_map_vs_phi_vs_eta_400MeV_600MeV_positive->Write("", TObject::kOverwrite);
2546  trk_d0_wrtPV_map_vs_phi_vs_eta_400MeV_600MeV_negative->Write("", TObject::kOverwrite);
2547  }
2548 
2549  if (CheckHistogram(file,
2550  (path + "/trk_d0_wrtPV_vs_phi_vs_eta_600MeV_1GeV_positive").c_str()) &&
2551  CheckHistogram(file, (path + "/trk_d0_wrtPV_vs_phi_vs_eta_600MeV_1GeV_negative").c_str())) {
2552  TH3F* trk_d0_wrtPV_vs_phi_vs_eta_600MeV_1GeV_positive =
2553  (TH3F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_vs_eta_600MeV_1GeV_positive").c_str())->Clone());
2554  TH3F* trk_d0_wrtPV_vs_phi_vs_eta_600MeV_1GeV_negative =
2555  (TH3F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_vs_eta_600MeV_1GeV_negative").c_str())->Clone());
2556 
2557  TH2F* trk_d0_wrtPV_map_vs_phi_vs_eta_600MeV_1GeV_positive = new TH2F(
2558  "trk_d0_wrtPV_map_vs_phi_vs_eta_600MeV_1GeV_positive", "map d0 vs phi_vs_eta 600MeV-1GeV positive; #phi; #eta",
2559  20, -3.1, 3.1, 20, -2.5, 2.5);
2560  TH2F* trk_d0_wrtPV_map_vs_phi_vs_eta_600MeV_1GeV_negative = new TH2F(
2561  "trk_d0_wrtPV_map_vs_phi_vs_eta_600MeV_1GeV_negative", "map d0 vs phi_vs_eta 600MeV-1GeV negative; #phi; #eta",
2562  20, -3.1, 3.1, 20, -2.5, 2.5);
2563 
2564  MakeMap(trk_d0_wrtPV_map_vs_phi_vs_eta_600MeV_1GeV_positive, trk_d0_wrtPV_vs_phi_vs_eta_600MeV_1GeV_positive);
2565  MakeMap(trk_d0_wrtPV_map_vs_phi_vs_eta_600MeV_1GeV_negative, trk_d0_wrtPV_vs_phi_vs_eta_600MeV_1GeV_negative);
2566 
2567  trk_d0_wrtPV_map_vs_phi_vs_eta_600MeV_1GeV_positive->Write("", TObject::kOverwrite);
2568  trk_d0_wrtPV_map_vs_phi_vs_eta_600MeV_1GeV_negative->Write("", TObject::kOverwrite);
2569  }
2570 
2571  if (CheckHistogram(file,
2572  (path + "/trk_d0_wrtPV_vs_phi_vs_eta_1GeV_2GeV_positive").c_str()) &&
2573  CheckHistogram(file, (path + "/trk_d0_wrtPV_vs_phi_vs_eta_1GeV_2GeV_negative").c_str())) {
2574  TH3F* trk_d0_wrtPV_vs_phi_vs_eta_1GeV_2GeV_positive =
2575  (TH3F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_vs_eta_1GeV_2GeV_positive").c_str())->Clone());
2576  TH3F* trk_d0_wrtPV_vs_phi_vs_eta_1GeV_2GeV_negative =
2577  (TH3F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_vs_eta_1GeV_2GeV_negative").c_str())->Clone());
2578 
2579  TH2F* trk_d0_wrtPV_map_vs_phi_vs_eta_1GeV_2GeV_positive = new TH2F(
2580  "trk_d0_wrtPV_map_vs_phi_vs_eta_1GeV_2GeV_positive", "map d0 vs phi_vs_eta 1GeV-2GeV positive; #phi; #eta", 20,
2581  -3.1, 3.1, 20, -2.5, 2.5);
2582  TH2F* trk_d0_wrtPV_map_vs_phi_vs_eta_1GeV_2GeV_negative = new TH2F(
2583  "trk_d0_wrtPV_map_vs_phi_vs_eta_1GeV_2GeV_negative", "map d0 vs phi_vs_eta 1GeV-2GeV negative; #phi; #eta", 20,
2584  -3.1, 3.1, 20, -2.5, 2.5);
2585 
2586  MakeMap(trk_d0_wrtPV_map_vs_phi_vs_eta_1GeV_2GeV_positive, trk_d0_wrtPV_vs_phi_vs_eta_1GeV_2GeV_positive);
2587  MakeMap(trk_d0_wrtPV_map_vs_phi_vs_eta_1GeV_2GeV_negative, trk_d0_wrtPV_vs_phi_vs_eta_1GeV_2GeV_negative);
2588 
2589  trk_d0_wrtPV_map_vs_phi_vs_eta_1GeV_2GeV_positive->Write("", TObject::kOverwrite);
2590  trk_d0_wrtPV_map_vs_phi_vs_eta_1GeV_2GeV_negative->Write("", TObject::kOverwrite);
2591  }
2592 
2593  if (CheckHistogram(file,
2594  (path + "/trk_d0_wrtPV_vs_phi_vs_eta_2GeV_5GeV_positive").c_str()) &&
2595  CheckHistogram(file, (path + "/trk_d0_wrtPV_vs_phi_vs_eta_2GeV_5GeV_negative").c_str())) {
2596  TH3F* trk_d0_wrtPV_vs_phi_vs_eta_2GeV_5GeV_positive =
2597  (TH3F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_vs_eta_2GeV_5GeV_positive").c_str())->Clone());
2598  TH3F* trk_d0_wrtPV_vs_phi_vs_eta_2GeV_5GeV_negative =
2599  (TH3F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_vs_eta_2GeV_5GeV_negative").c_str())->Clone());
2600 
2601  TH2F* trk_d0_wrtPV_map_vs_phi_vs_eta_2GeV_5GeV_positive = new TH2F(
2602  "trk_d0_wrtPV_map_vs_phi_vs_eta_2GeV_5GeV_positive", "map d0 vs phi_vs_eta 2GeV-5GeV positive; #phi; #eta", 20,
2603  -3.1, 3.1, 20, -2.5, 2.5);
2604  TH2F* trk_d0_wrtPV_map_vs_phi_vs_eta_2GeV_5GeV_negative = new TH2F(
2605  "trk_d0_wrtPV_map_vs_phi_vs_eta_2GeV_5GeV_negative", "map d0 vs phi_vs_eta 2GeV-5GeV negative; #phi; #eta", 20,
2606  -3.1, 3.1, 20, -2.5, 2.5);
2607 
2608  MakeMap(trk_d0_wrtPV_map_vs_phi_vs_eta_2GeV_5GeV_positive, trk_d0_wrtPV_vs_phi_vs_eta_2GeV_5GeV_positive);
2609  MakeMap(trk_d0_wrtPV_map_vs_phi_vs_eta_2GeV_5GeV_negative, trk_d0_wrtPV_vs_phi_vs_eta_2GeV_5GeV_negative);
2610 
2611  trk_d0_wrtPV_map_vs_phi_vs_eta_2GeV_5GeV_positive->Write("", TObject::kOverwrite);
2612  trk_d0_wrtPV_map_vs_phi_vs_eta_2GeV_5GeV_negative->Write("", TObject::kOverwrite);
2613  }
2614 
2615  if (CheckHistogram(file,
2616  (path + "/trk_d0_wrtPV_vs_phi_vs_eta_5GeV_10GeV_positive").c_str()) &&
2617  CheckHistogram(file, (path + "/trk_d0_wrtPV_vs_phi_vs_eta_5GeV_10GeV_negative").c_str())) {
2618  TH3F* trk_d0_wrtPV_vs_phi_vs_eta_5GeV_10GeV_positive =
2619  (TH3F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_vs_eta_5GeV_10GeV_positive").c_str())->Clone());
2620  TH3F* trk_d0_wrtPV_vs_phi_vs_eta_5GeV_10GeV_negative =
2621  (TH3F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_vs_eta_5GeV_10GeV_negative").c_str())->Clone());
2622 
2623  TH2F* trk_d0_wrtPV_map_vs_phi_vs_eta_5GeV_10GeV_positive = new TH2F(
2624  "trk_d0_wrtPV_map_vs_phi_vs_eta_5GeV_10GeV_positive", "map d0 vs phi_vs_eta 5GeV-10GeV positive; #phi; #eta",
2625  20, -3.1, 3.1, 20, -2.5, 2.5);
2626  TH2F* trk_d0_wrtPV_map_vs_phi_vs_eta_5GeV_10GeV_negative = new TH2F(
2627  "trk_d0_wrtPV_map_vs_phi_vs_eta_5GeV_10GeV_negative", "map d0 vs phi_vs_eta 5GeV-10GeV negative; #phi; #eta",
2628  20, -3.1, 3.1, 20, -2.5, 2.5);
2629 
2630  MakeMap(trk_d0_wrtPV_map_vs_phi_vs_eta_5GeV_10GeV_positive, trk_d0_wrtPV_vs_phi_vs_eta_5GeV_10GeV_positive);
2631  MakeMap(trk_d0_wrtPV_map_vs_phi_vs_eta_5GeV_10GeV_negative, trk_d0_wrtPV_vs_phi_vs_eta_5GeV_10GeV_negative);
2632 
2633  trk_d0_wrtPV_map_vs_phi_vs_eta_5GeV_10GeV_positive->Write("", TObject::kOverwrite);
2634  trk_d0_wrtPV_map_vs_phi_vs_eta_5GeV_10GeV_negative->Write("", TObject::kOverwrite);
2635  }
2636 
2637  if (CheckHistogram(file,
2638  (path + "/trk_d0_wrtPV_vs_phi_vs_eta_10GeV_positive").c_str()) &&
2639  CheckHistogram(file, (path + "/trk_d0_wrtPV_vs_phi_vs_eta_10GeV_negative").c_str())) {
2640  TH3F* trk_d0_wrtPV_vs_phi_vs_eta_10GeV_positive =
2641  (TH3F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_vs_eta_10GeV_positive").c_str())->Clone());
2642  TH3F* trk_d0_wrtPV_vs_phi_vs_eta_10GeV_negative =
2643  (TH3F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_vs_eta_10GeV_negative").c_str())->Clone());
2644 
2645  TH2F* trk_d0_wrtPV_map_vs_phi_vs_eta_10GeV_positive = new TH2F("trk_d0_wrtPV_map_vs_phi_vs_eta_10GeV_positive",
2646  "map d0 vs phi_vs_eta >10GeV positive; #phi; #eta",
2647  20, -3.1, 3.1, 20, -2.5, 2.5);
2648  TH2F* trk_d0_wrtPV_map_vs_phi_vs_eta_10GeV_negative = new TH2F("trk_d0_wrtPV_map_vs_phi_vs_eta_10GeV_negative",
2649  "map d0 vs phi_vs_eta >10GeV negative; #phi; #eta",
2650  20, -3.1, 3.1, 20, -2.5, 2.5);
2651 
2652  MakeMap(trk_d0_wrtPV_map_vs_phi_vs_eta_10GeV_positive, trk_d0_wrtPV_vs_phi_vs_eta_10GeV_positive);
2653  MakeMap(trk_d0_wrtPV_map_vs_phi_vs_eta_10GeV_negative, trk_d0_wrtPV_vs_phi_vs_eta_10GeV_negative);
2654 
2655  trk_d0_wrtPV_map_vs_phi_vs_eta_10GeV_positive->Write("", TObject::kOverwrite);
2656  trk_d0_wrtPV_map_vs_phi_vs_eta_10GeV_negative->Write("", TObject::kOverwrite);
2657  }
2658 
2659  if (CheckHistogram(file, (path + "/trk_d0_wrtPV_vs_phi_vs_eta_2GeV").c_str())) {
2660  TH3F* trk_d0_wrtPV_vs_phi_vs_eta_2GeV =
2661  (TH3F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_vs_eta_2GeV").c_str())->Clone());
2662 
2663  TH2F* trk_d0_wrtPV_map_vs_phi_vs_eta_2GeV = new TH2F("trk_d0_wrtPV_map_vs_phi_vs_eta_2GeV",
2664  "map d0 vs phi_vs_eta >2GeV; #phi; #eta", 20, -3.1, 3.1, 20,
2665  -2.5, 2.5);
2666 
2667  MakeMap(trk_d0_wrtPV_map_vs_phi_vs_eta_2GeV, trk_d0_wrtPV_vs_phi_vs_eta_2GeV);
2668 
2669  trk_d0_wrtPV_map_vs_phi_vs_eta_2GeV->Write("", TObject::kOverwrite);
2670  }
2671 
2672 
2673  //Profiles vs phi
2674  if (CheckHistogram(file,
2675  (path + "/trk_d0_wrtPV_vs_phi_400MeV_600MeV_positive").c_str()) &&
2676  CheckHistogram(file, (path + "/trk_d0_wrtPV_vs_phi_400MeV_600MeV_negative").c_str())) {
2677  TH2F* trk_d0_wrtPV_vs_phi_400MeV_600MeV_positive =
2678  (TH2F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_400MeV_600MeV_positive").c_str())->Clone());
2679  TH2F* trk_d0_wrtPV_vs_phi_400MeV_600MeV_negative =
2680  (TH2F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_400MeV_600MeV_negative").c_str())->Clone());
2681 
2682  TH1F* trk_d0_wrtPV_profile_vs_phi_400MeV_600MeV_positive = new TH1F(
2683  "trk_d0_wrtPV_profile_vs_phi_400MeV_600MeV_positive", "profile d0 vs phi 400MeV-600MeV positive; #phi; d0 [mm]",
2684  50, -3.1, 3.1);
2685  TH1F* trk_d0_wrtPV_profile_vs_phi_400MeV_600MeV_negative = new TH1F(
2686  "trk_d0_wrtPV_profile_vs_phi_400MeV_600MeV_negative", "profile d0 vs phi 400MeV-600MeV negative; #phi; d0 [mm]",
2687  50, -3.1, 3.1);
2688 
2689  Make1DProfile(trk_d0_wrtPV_profile_vs_phi_400MeV_600MeV_positive, trk_d0_wrtPV_vs_phi_400MeV_600MeV_positive);
2690  Make1DProfile(trk_d0_wrtPV_profile_vs_phi_400MeV_600MeV_negative, trk_d0_wrtPV_vs_phi_400MeV_600MeV_negative);
2691 
2692  trk_d0_wrtPV_profile_vs_phi_400MeV_600MeV_positive->Write("", TObject::kOverwrite);
2693  trk_d0_wrtPV_profile_vs_phi_400MeV_600MeV_negative->Write("", TObject::kOverwrite);
2694  }
2695 
2696  if (CheckHistogram(file,
2697  (path + "/trk_d0_wrtPV_vs_phi_600MeV_1GeV_positive").c_str()) &&
2698  CheckHistogram(file, (path + "/trk_d0_wrtPV_vs_phi_600MeV_1GeV_negative").c_str())) {
2699  TH2F* trk_d0_wrtPV_vs_phi_600MeV_1GeV_positive =
2700  (TH2F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_600MeV_1GeV_positive").c_str())->Clone());
2701  TH2F* trk_d0_wrtPV_vs_phi_600MeV_1GeV_negative =
2702  (TH2F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_600MeV_1GeV_negative").c_str())->Clone());
2703 
2704  TH1F* trk_d0_wrtPV_profile_vs_phi_600MeV_1GeV_positive = new TH1F(
2705  "trk_d0_wrtPV_profile_vs_phi_600MeV_1GeV_positive", "profile d0 vs phi 600MeV-1GeV positive; #phi; d0 [mm]", 50,
2706  -3.1, 3.1);
2707  TH1F* trk_d0_wrtPV_profile_vs_phi_600MeV_1GeV_negative = new TH1F(
2708  "trk_d0_wrtPV_profile_vs_phi_600MeV_1GeV_negative", "profile d0 vs phi 600MeV-1GeV negative; #phi; d0 [mm]", 50,
2709  -3.1, 3.1);
2710 
2711  Make1DProfile(trk_d0_wrtPV_profile_vs_phi_600MeV_1GeV_positive, trk_d0_wrtPV_vs_phi_600MeV_1GeV_positive);
2712  Make1DProfile(trk_d0_wrtPV_profile_vs_phi_600MeV_1GeV_negative, trk_d0_wrtPV_vs_phi_600MeV_1GeV_negative);
2713 
2714  trk_d0_wrtPV_profile_vs_phi_600MeV_1GeV_positive->Write("", TObject::kOverwrite);
2715  trk_d0_wrtPV_profile_vs_phi_600MeV_1GeV_negative->Write("", TObject::kOverwrite);
2716  }
2717 
2718  if (CheckHistogram(file,
2719  (path + "/trk_d0_wrtPV_vs_phi_1GeV_2GeV_positive").c_str()) &&
2720  CheckHistogram(file, (path + "/trk_d0_wrtPV_vs_phi_1GeV_2GeV_negative").c_str())) {
2721  TH2F* trk_d0_wrtPV_vs_phi_1GeV_2GeV_positive =
2722  (TH2F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_1GeV_2GeV_positive").c_str())->Clone());
2723  TH2F* trk_d0_wrtPV_vs_phi_1GeV_2GeV_negative =
2724  (TH2F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_1GeV_2GeV_negative").c_str())->Clone());
2725 
2726  TH1F* trk_d0_wrtPV_profile_vs_phi_1GeV_2GeV_positive = new TH1F("trk_d0_wrtPV_profile_vs_phi_1GeV_2GeV_positive",
2727  "profile d0 vs phi 1GeV-2GeV positive; #phi; d0 [mm]", 50, -3.1,
2728  3.1);
2729  TH1F* trk_d0_wrtPV_profile_vs_phi_1GeV_2GeV_negative = new TH1F("trk_d0_wrtPV_profile_vs_phi_1GeV_2GeV_negative",
2730  "profile d0 vs phi 1GeV-2GeV negative; #phi; d0 [mm]", 50, -3.1,
2731  3.1);
2732 
2733  Make1DProfile(trk_d0_wrtPV_profile_vs_phi_1GeV_2GeV_positive, trk_d0_wrtPV_vs_phi_1GeV_2GeV_positive);
2734  Make1DProfile(trk_d0_wrtPV_profile_vs_phi_1GeV_2GeV_negative, trk_d0_wrtPV_vs_phi_1GeV_2GeV_negative);
2735 
2736  trk_d0_wrtPV_profile_vs_phi_1GeV_2GeV_positive->Write("", TObject::kOverwrite);
2737  trk_d0_wrtPV_profile_vs_phi_1GeV_2GeV_negative->Write("", TObject::kOverwrite);
2738  }
2739 
2740  if (CheckHistogram(file,
2741  (path + "/trk_d0_wrtPV_vs_phi_2GeV_5GeV_positive").c_str()) &&
2742  CheckHistogram(file, (path + "/trk_d0_wrtPV_vs_phi_2GeV_5GeV_negative").c_str())) {
2743  TH2F* trk_d0_wrtPV_vs_phi_2GeV_5GeV_positive =
2744  (TH2F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_2GeV_5GeV_positive").c_str())->Clone());
2745  TH2F* trk_d0_wrtPV_vs_phi_2GeV_5GeV_negative =
2746  (TH2F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_2GeV_5GeV_negative").c_str())->Clone());
2747 
2748  TH1F* trk_d0_wrtPV_profile_vs_phi_2GeV_5GeV_positive = new TH1F("trk_d0_wrtPV_profile_vs_phi_2GeV_5GeV_positive",
2749  "profile d0 vs phi 2GeV-5GeV positive; #phi; d0 [mm]", 50, -3.1,
2750  3.1);
2751  TH1F* trk_d0_wrtPV_profile_vs_phi_2GeV_5GeV_negative = new TH1F("trk_d0_wrtPV_profile_vs_phi_2GeV_5GeV_negative",
2752  "profile d0 vs phi 2GeV-5GeV negative; #phi; d0 [mm]", 50, -3.1,
2753  3.1);
2754 
2755  Make1DProfile(trk_d0_wrtPV_profile_vs_phi_2GeV_5GeV_positive, trk_d0_wrtPV_vs_phi_2GeV_5GeV_positive);
2756  Make1DProfile(trk_d0_wrtPV_profile_vs_phi_2GeV_5GeV_negative, trk_d0_wrtPV_vs_phi_2GeV_5GeV_negative);
2757 
2758  trk_d0_wrtPV_profile_vs_phi_2GeV_5GeV_positive->Write("", TObject::kOverwrite);
2759  trk_d0_wrtPV_profile_vs_phi_2GeV_5GeV_negative->Write("", TObject::kOverwrite);
2760  }
2761 
2762  if (CheckHistogram(file,
2763  (path + "/trk_d0_wrtPV_vs_phi_5GeV_10GeV_positive").c_str()) &&
2764  CheckHistogram(file, (path + "/trk_d0_wrtPV_vs_phi_5GeV_10GeV_negative").c_str())) {
2765  TH2F* trk_d0_wrtPV_vs_phi_5GeV_10GeV_positive =
2766  (TH2F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_5GeV_10GeV_positive").c_str())->Clone());
2767  TH2F* trk_d0_wrtPV_vs_phi_5GeV_10GeV_negative =
2768  (TH2F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_5GeV_10GeV_negative").c_str())->Clone());
2769 
2770  TH1F* trk_d0_wrtPV_profile_vs_phi_5GeV_10GeV_positive = new TH1F(
2771  "trk_d0_wrtPV_profile_vs_phi_5GeV_10GeV_positive", "profile d0 vs phi 5GeV-10GeV positive; #phi; d0 [mm]", 50,
2772  -3.1, 3.1);
2773  TH1F* trk_d0_wrtPV_profile_vs_phi_5GeV_10GeV_negative = new TH1F(
2774  "trk_d0_wrtPV_profile_vs_phi_5GeV_10GeV_negative", "profile d0 vs phi 5GeV-10GeV negative; #phi; d0 [mm]", 50,
2775  -3.1, 3.1);
2776 
2777  Make1DProfile(trk_d0_wrtPV_profile_vs_phi_5GeV_10GeV_positive, trk_d0_wrtPV_vs_phi_5GeV_10GeV_positive);
2778  Make1DProfile(trk_d0_wrtPV_profile_vs_phi_5GeV_10GeV_negative, trk_d0_wrtPV_vs_phi_5GeV_10GeV_negative);
2779 
2780  trk_d0_wrtPV_profile_vs_phi_5GeV_10GeV_positive->Write("", TObject::kOverwrite);
2781  trk_d0_wrtPV_profile_vs_phi_5GeV_10GeV_negative->Write("", TObject::kOverwrite);
2782  }
2783 
2784  if (CheckHistogram(file,
2785  (path + "/trk_d0_wrtPV_vs_phi_10GeV_positive").c_str()) &&
2786  CheckHistogram(file, (path + "/trk_d0_wrtPV_vs_phi_10GeV_negative").c_str())) {
2787  TH2F* trk_d0_wrtPV_vs_phi_10GeV_positive =
2788  (TH2F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_10GeV_positive").c_str())->Clone());
2789  TH2F* trk_d0_wrtPV_vs_phi_10GeV_negative =
2790  (TH2F*) (file->Get((path + "/trk_d0_wrtPV_vs_phi_10GeV_negative").c_str())->Clone());
2791 
2792  TH1F* trk_d0_wrtPV_profile_vs_phi_10GeV_positive = new TH1F("trk_d0_wrtPV_profile_vs_phi_10GeV_positive",
2793  "profile d0 vs phi >10GeV positive; #phi; d0 [mm]",
2794  50, -3.1, 3.1);
2795  TH1F* trk_d0_wrtPV_profile_vs_phi_10GeV_negative = new TH1F("trk_d0_wrtPV_profile_vs_phi_10GeV_negative",
2796  "profile d0 vs phi >10GeV negative; #phi; d0 [mm]",
2797  50, -3.1, 3.1);
2798 
2799  Make1DProfile(trk_d0_wrtPV_profile_vs_phi_10GeV_positive, trk_d0_wrtPV_vs_phi_10GeV_positive);
2800  Make1DProfile(trk_d0_wrtPV_profile_vs_phi_10GeV_negative, trk_d0_wrtPV_vs_phi_10GeV_negative);
2801 
2802  trk_d0_wrtPV_profile_vs_phi_10GeV_positive->Write("", TObject::kOverwrite);
2803  trk_d0_wrtPV_profile_vs_phi_10GeV_negative->Write("", TObject::kOverwrite);
2804  }
2805 
2806  //Profiles vs eta
2807  if (CheckHistogram(file,
2808  (path + "/trk_d0_wrtPV_vs_eta_400MeV_600MeV_positive").c_str()) &&
2809  CheckHistogram(file, (path + "/trk_d0_wrtPV_vs_eta_400MeV_600MeV_negative").c_str())) {
2810  TH2F* trk_d0_wrtPV_vs_eta_400MeV_600MeV_positive =
2811  (TH2F*) (file->Get((path + "/trk_d0_wrtPV_vs_eta_400MeV_600MeV_positive").c_str())->Clone());
2812  TH2F* trk_d0_wrtPV_vs_eta_400MeV_600MeV_negative =
2813  (TH2F*) (file->Get((path + "/trk_d0_wrtPV_vs_eta_400MeV_600MeV_negative").c_str())->Clone());
2814 
2815  TH1F* trk_d0_wrtPV_profile_vs_eta_400MeV_600MeV_positive = new TH1F(
2816  "trk_d0_wrtPV_profile_vs_eta_400MeV_600MeV_positive", "profile d0 vs eta 400MeV-600MeV positive; #eta; d0 [mm]",
2817  50, -2.5, 2.5);
2818  TH1F* trk_d0_wrtPV_profile_vs_eta_400MeV_600MeV_negative = new TH1F(
2819  "trk_d0_wrtPV_profile_vs_eta_400MeV_600MeV_negative", "profile d0 vs eta 400MeV-600MeV negative; #eta; d0 [mm]",
2820  50, -2.5, 2.5);
2821 
2822  Make1DProfile(trk_d0_wrtPV_profile_vs_eta_400MeV_600MeV_positive, trk_d0_wrtPV_vs_eta_400MeV_600MeV_positive);
2823  Make1DProfile(trk_d0_wrtPV_profile_vs_eta_400MeV_600MeV_negative, trk_d0_wrtPV_vs_eta_400MeV_600MeV_negative);
2824 
2825  trk_d0_wrtPV_profile_vs_eta_400MeV_600MeV_positive->Write("", TObject::kOverwrite);
2826  trk_d0_wrtPV_profile_vs_eta_400MeV_600MeV_negative->Write("", TObject::kOverwrite);
2827  }
2828 
2829  if (CheckHistogram(file,
2830  (path + "/trk_d0_wrtPV_vs_eta_600MeV_1GeV_positive").c_str()) &&
2831  CheckHistogram(file, (path + "/trk_d0_wrtPV_vs_eta_600MeV_1GeV_negative").c_str())) {
2832  TH2F* trk_d0_wrtPV_vs_eta_600MeV_1GeV_positive =
2833  (TH2F*) (file->Get((path + "/trk_d0_wrtPV_vs_eta_600MeV_1GeV_positive").c_str())->Clone());
2834  TH2F* trk_d0_wrtPV_vs_eta_600MeV_1GeV_negative =
2835  (TH2F*) (file->Get((path + "/trk_d0_wrtPV_vs_eta_600MeV_1GeV_negative").c_str())->Clone());
2836 
2837  TH1F* trk_d0_wrtPV_profile_vs_eta_600MeV_1GeV_positive = new TH1F(
2838  "trk_d0_wrtPV_profile_vs_eta_600MeV_1GeV_positive", "profile d0 vs eta 600MeV-1GeV positive; #eta; d0 [mm]", 50,
2839  -2.5, 2.5);
2840  TH1F* trk_d0_wrtPV_profile_vs_eta_600MeV_1GeV_negative = new TH1F(
2841  "trk_d0_wrtPV_profile_vs_eta_600MeV_1GeV_negative", "profile d0 vs eta 600MeV-1GeV negative; #eta; d0 [mm]", 50,
2842  -2.5, 2.5);
2843 
2844  Make1DProfile(trk_d0_wrtPV_profile_vs_eta_600MeV_1GeV_positive, trk_d0_wrtPV_vs_eta_600MeV_1GeV_positive);
2845  Make1DProfile(trk_d0_wrtPV_profile_vs_eta_600MeV_1GeV_negative, trk_d0_wrtPV_vs_eta_600MeV_1GeV_negative);
2846 
2847  trk_d0_wrtPV_profile_vs_eta_600MeV_1GeV_positive->Write("", TObject::kOverwrite);
2848  trk_d0_wrtPV_profile_vs_eta_600MeV_1GeV_negative->Write("", TObject::kOverwrite);
2849  }
2850 
2851  if (CheckHistogram(file,
2852  (path + "/trk_d0_wrtPV_vs_eta_1GeV_2GeV_positive").c_str()) &&
2853  CheckHistogram(file, (path + "/trk_d0_wrtPV_vs_eta_1GeV_2GeV_negative").c_str())) {
2854  TH2F* trk_d0_wrtPV_vs_eta_1GeV_2GeV_positive =
2855  (TH2F*) (file->Get((path + "/trk_d0_wrtPV_vs_eta_1GeV_2GeV_positive").c_str())->Clone());
2856  TH2F* trk_d0_wrtPV_vs_eta_1GeV_2GeV_negative =
2857  (TH2F*) (file->Get((path + "/trk_d0_wrtPV_vs_eta_1GeV_2GeV_negative").c_str())->Clone());
2858 
2859  TH1F* trk_d0_wrtPV_profile_vs_eta_1GeV_2GeV_positive = new TH1F("trk_d0_wrtPV_profile_vs_eta_1GeV_2GeV_positive",
2860  "profile d0 vs eta 1GeV-2GeV positive; #eta; d0 [mm]", 50, -2.5,
2861  2.5);
2862  TH1F* trk_d0_wrtPV_profile_vs_eta_1GeV_2GeV_negative = new TH1F("trk_d0_wrtPV_profile_vs_eta_1GeV_2GeV_negative",
2863  "profile d0 vs eta 1GeV-2GeV negative; #eta; d0 [mm]", 50, -2.5,
2864  2.5);
2865 
2866  Make1DProfile(trk_d0_wrtPV_profile_vs_eta_1GeV_2GeV_positive, trk_d0_wrtPV_vs_eta_1GeV_2GeV_positive);
2867  Make1DProfile(trk_d0_wrtPV_profile_vs_eta_1GeV_2GeV_negative, trk_d0_wrtPV_vs_eta_1GeV_2GeV_negative);
2868 
2869  trk_d0_wrtPV_profile_vs_eta_1GeV_2GeV_positive->Write("", TObject::kOverwrite);
2870  trk_d0_wrtPV_profile_vs_eta_1GeV_2GeV_negative->Write("", TObject::kOverwrite);
2871  }
2872 
2873  if (CheckHistogram(file,
2874  (path + "/trk_d0_wrtPV_vs_eta_2GeV_5GeV_positive").c_str()) &&
2875  CheckHistogram(file, (path + "/trk_d0_wrtPV_vs_eta_2GeV_5GeV_negative").c_str())) {
2876  TH2F* trk_d0_wrtPV_vs_eta_2GeV_5GeV_positive =
2877  (TH2F*) (file->Get((path + "/trk_d0_wrtPV_vs_eta_2GeV_5GeV_positive").c_str())->Clone());
2878  TH2F* trk_d0_wrtPV_vs_eta_2GeV_5GeV_negative =
2879  (TH2F*) (file->Get((path + "/trk_d0_wrtPV_vs_eta_2GeV_5GeV_negative").c_str())->Clone());
2880 
2881  TH1F* trk_d0_wrtPV_profile_vs_eta_2GeV_5GeV_positive = new TH1F("trk_d0_wrtPV_profile_vs_eta_2GeV_5GeV_positive",
2882  "profile d0 vs eta 2GeV-5GeV positive; #eta; d0 [mm]", 50, -2.5,
2883  2.5);
2884  TH1F* trk_d0_wrtPV_profile_vs_eta_2GeV_5GeV_negative = new TH1F("trk_d0_wrtPV_profile_vs_eta_2GeV_5GeV_negative",
2885  "profile d0 vs eta 2GeV-5GeV negative; #eta; d0 [mm]", 50, -2.5,
2886  2.5);
2887 
2888  Make1DProfile(trk_d0_wrtPV_profile_vs_eta_2GeV_5GeV_positive, trk_d0_wrtPV_vs_eta_2GeV_5GeV_positive);
2889  Make1DProfile(trk_d0_wrtPV_profile_vs_eta_2GeV_5GeV_negative, trk_d0_wrtPV_vs_eta_2GeV_5GeV_negative);
2890 
2891  trk_d0_wrtPV_profile_vs_eta_2GeV_5GeV_positive->Write("", TObject::kOverwrite);
2892  trk_d0_wrtPV_profile_vs_eta_2GeV_5GeV_negative->Write("", TObject::kOverwrite);
2893  }
2894 
2895  if (CheckHistogram(file,
2896  (path + "/trk_d0_wrtPV_vs_eta_5GeV_10GeV_positive").c_str()) &&
2897  CheckHistogram(file, (path + "/trk_d0_wrtPV_vs_eta_5GeV_10GeV_negative").c_str())) {
2898  TH2F* trk_d0_wrtPV_vs_eta_5GeV_10GeV_positive =
2899  (TH2F*) (file->Get((path + "/trk_d0_wrtPV_vs_eta_5GeV_10GeV_positive").c_str())->Clone());
2900  TH2F* trk_d0_wrtPV_vs_eta_5GeV_10GeV_negative =
2901  (TH2F*) (file->Get((path + "/trk_d0_wrtPV_vs_eta_5GeV_10GeV_negative").c_str())->Clone());
2902 
2903  TH1F* trk_d0_wrtPV_profile_vs_eta_5GeV_10GeV_positive = new TH1F(
2904  "trk_d0_wrtPV_profile_vs_eta_5GeV_10GeV_positive", "profile d0 vs eta 5GeV-10GeV positive; #eta; d0 [mm]", 50,
2905  -2.5, 2.5);
2906  TH1F* trk_d0_wrtPV_profile_vs_eta_5GeV_10GeV_negative = new TH1F(
2907  "trk_d0_wrtPV_profile_vs_eta_5GeV_10GeV_negative", "profile d0 vs eta 5GeV-10GeV negative; #eta; d0 [mm]", 50,
2908  -2.5, 2.5);
2909 
2910  Make1DProfile(trk_d0_wrtPV_profile_vs_eta_5GeV_10GeV_positive, trk_d0_wrtPV_vs_eta_5GeV_10GeV_positive);
2911  Make1DProfile(trk_d0_wrtPV_profile_vs_eta_5GeV_10GeV_negative, trk_d0_wrtPV_vs_eta_5GeV_10GeV_negative);
2912 
2913  trk_d0_wrtPV_profile_vs_eta_5GeV_10GeV_positive->Write("", TObject::kOverwrite);
2914  trk_d0_wrtPV_profile_vs_eta_5GeV_10GeV_negative->Write("", TObject::kOverwrite);
2915  }
2916 
2917  if (CheckHistogram(file,
2918  (path + "/trk_d0_wrtPV_vs_eta_10GeV_positive").c_str()) &&
2919  CheckHistogram(file, (path + "/trk_d0_wrtPV_vs_eta_10GeV_negative").c_str())) {
2920  TH2F* trk_d0_wrtPV_vs_eta_10GeV_positive =
2921  (TH2F*) (file->Get((path + "/trk_d0_wrtPV_vs_eta_10GeV_positive").c_str())->Clone());
2922  TH2F* trk_d0_wrtPV_vs_eta_10GeV_negative =
2923  (TH2F*) (file->Get((path + "/trk_d0_wrtPV_vs_eta_10GeV_negative").c_str())->Clone());
2924 
2925  TH1F* trk_d0_wrtPV_profile_vs_eta_10GeV_positive = new TH1F("trk_d0_wrtPV_profile_vs_eta_10GeV_positive",
2926  "profile d0 vs eta >10GeV positive; #eta; d0 [mm]",
2927  50, -2.5, 2.5);
2928  TH1F* trk_d0_wrtPV_profile_vs_eta_10GeV_negative = new TH1F("trk_d0_wrtPV_profile_vs_eta_10GeV_negative",
2929  "profile d0 vs eta >10GeV negative; #eta; d0 [mm]",
2930  50, -2.5, 2.5);
2931 
2932  Make1DProfile(trk_d0_wrtPV_profile_vs_eta_10GeV_positive, trk_d0_wrtPV_vs_eta_10GeV_positive);
2933  Make1DProfile(trk_d0_wrtPV_profile_vs_eta_10GeV_negative, trk_d0_wrtPV_vs_eta_10GeV_negative);
2934 
2935  trk_d0_wrtPV_profile_vs_eta_10GeV_positive->Write("", TObject::kOverwrite);
2936  trk_d0_wrtPV_profile_vs_eta_10GeV_negative->Write("", TObject::kOverwrite);
2937  }
2938 
2939  file->Write();
2940  }
2941 
2942  void
2945  int nXbins = histo->GetXaxis()->GetNbins(); //NEED TO CHANGE THIS
2946 
2947  for (int i = 0; i < nXbins; i++) {
2948  double current_mu;
2949  double current_err_mu;
2950  double current_sigma;
2951  double current_err_sigma;
2952 
2953  TH1D* projection = histo->ProjectionY("projection", i + 1, i + 1);
2954  IterativeGaussFit(projection, current_mu, current_err_mu, current_sigma, current_err_sigma);
2955 
2956  output->SetBinContent(i, current_mu);
2957  output->SetBinError(i, current_err_mu);
2958  }
2959  }
2960 
2961  void
2963  MakeMap(TH2* outputhist, TH3* hist) {
2964  int num_bins = 1; //WHAT IS THIS AGAIN
2965 
2966  int num_bins_x = hist->GetXaxis()->GetNbins();
2967  int num_bins_y = hist->GetYaxis()->GetNbins();
2968 
2969  TH1D* current_proj;
2970 
2971  for (int i = 1; i < num_bins_x + (num_bins == 1); i += num_bins) {
2972  for (int j = 1; j < num_bins_y + (num_bins == 1); j += num_bins) {
2973  int index = i / num_bins;
2974  int index_y = j / num_bins;
2975 
2976  current_proj = hist->ProjectionZ(Form("%s_GaussProjection_%i_%i",
2977  hist->GetName(), index, index_y), i, i + num_bins - 1, j,
2978  j + num_bins - 1);
2979  current_proj->SetTitle(Form("%s - Bin %i x %i", hist->GetName(), index, index_y));
2980 
2981  //Fit the gauss
2982  double current_mu, current_err_mu, current_sigma, current_err_sigma;
2983  IterativeGaussFit(current_proj, current_mu, current_err_mu, current_sigma, current_err_sigma);
2984 
2985  //Fill the maps
2986  float x_coord = (hist->GetXaxis()->GetBinLowEdge(i) + hist->GetXaxis()->GetBinUpEdge(i + num_bins - 1)) / 2;
2987  float y_coord = (hist->GetYaxis()->GetBinLowEdge(j) + hist->GetYaxis()->GetBinUpEdge(j + num_bins - 1)) / 2;
2988 
2989  outputhist->Fill(x_coord, y_coord, current_mu);
2990 
2991  delete current_proj;
2992  } //end loop on j (y)
2993  } //end loop on i (x)
2994  }
2995 
2996  int
2998  IterativeGaussFit(TH1* hist, double& mu, double& mu_err, double& sigma, double& sigma_err) {
2999  //constants for fitting algorithm
3000  const int iteration_limit = 20;
3001  const float percent_limit = 0.01;
3002  const float fit_range_multiplier = 1.5;
3003  const int fDebug = 0;
3004 
3005  double last_mu;
3006  double last_sigma;
3007  double current_mu;
3008  double current_sigma;
3009  double mu_percent_diff;
3010  double sigma_percent_diff;
3011 
3012  if (!hist) {
3013  if (fDebug) std::cout << "Error in Anp::IterativeGaussFit(): Histogram to be fit is missing" << std::endl;
3014  return 1;
3015  }
3016 
3017  TF1* fit_func = new TF1("fit_func", "gaus");
3018 
3019  int bad_fit = hist->Fit(fit_func, "QN");
3020 
3021  if (fDebug && bad_fit) std::cout << "BAD INITIAL FIT: " << hist->GetTitle() << std::endl;
3022 
3023  last_mu = fit_func->GetParameter(1);
3024  last_sigma = fit_func->GetParameter(2);
3025 
3026  if (bad_fit) last_mu = hist->GetMean();
3027 
3028  // check as well that the last_mu is reasonable
3029  if (fabs(last_mu - hist->GetMean()) > 5 * hist->GetBinWidth(1)) last_mu = hist->GetMean();
3030 
3031  fit_func->SetRange(last_mu - fit_range_multiplier * last_sigma, last_mu + fit_range_multiplier * last_sigma);
3032 
3033  int iteration = 0;
3034 
3035  while (iteration < iteration_limit) {
3036  iteration++;
3037 
3038  double FitRangeLower = last_mu - fit_range_multiplier * last_sigma;
3039  double FitRangeUpper = last_mu + fit_range_multiplier * last_sigma;
3040 
3041  // if range is to narrow --> broaden it
3042  if ((FitRangeUpper - FitRangeLower) / hist->GetBinWidth(1) < 4) {
3043  FitRangeLower -= hist->GetBinWidth(1);
3044  FitRangeUpper += hist->GetBinWidth(1);
3045  }
3046 
3047  fit_func->SetRange(FitRangeLower, FitRangeUpper);
3048 
3049  bad_fit = hist->Fit(fit_func, "RQN");
3050 
3051  if (fDebug &&
3052  bad_fit) std::cout << " ** BAD FIT ** : bin " << hist->GetTitle() << " iteration " << iteration << std::endl;
3053 
3054 
3055  current_mu = fit_func->GetParameter(1);
3056  current_sigma = fit_func->GetParameter(2);
3057 
3058  float average_mu = (last_mu + current_mu) / 2;
3059  float average_sigma = (last_sigma + current_sigma) / 2;
3060 
3061  if (average_mu == 0) {
3062  if (fDebug) std::cout << " Average mu = 0 in bin " << hist->GetTitle() << std::endl;
3063  average_mu = current_mu;
3064  }
3065 
3066  if (average_sigma == 0) {
3067  if (fDebug) std::cout << "Average sigma = 0; Fit Problem in " << hist->GetTitle() << ". " << last_sigma <<
3068  " " << current_sigma << std::endl;
3069  average_sigma = current_sigma;
3070  }
3071 
3072  mu_percent_diff = fabs((last_mu - current_mu) / average_mu);
3073  sigma_percent_diff = fabs((last_sigma - current_sigma) / average_sigma);
3074 
3075  if (mu_percent_diff < percent_limit && sigma_percent_diff < percent_limit) break;
3076 
3077  if (iteration != iteration_limit) { //necessary?
3078  last_mu = current_mu;
3079  last_sigma = current_sigma;
3080  }
3081  // check as well that the last_mu is reasonable
3082  if (fabs(last_mu - hist->GetMean()) > 5 * hist->GetBinWidth(1)) {
3083  last_mu = hist->GetMean();
3084  }
3085  }
3086 
3087  if (iteration == iteration_limit) {
3088  if (fDebug) std::cout << "WARNING: Fit did not converge to < " << percent_limit * 100 << "% in " <<
3089  hist->GetTitle() << " in " << iteration_limit << " iterations. Percent Diffs: " << mu_percent_diff * 100 <<
3090  "% (Mu)," << " " << sigma_percent_diff * 100 << "% (Sigma)" << std::endl;
3091  //possibly return a value other than 0 to indicate not converged?
3092  }
3093 
3094  mu = current_mu;
3095  mu_err = fit_func->GetParError(1);
3096  sigma = current_sigma;
3097  sigma_err = fit_func->GetParError(2);
3098  fit_func->SetLineColor(kRed);
3099 
3100  hist->GetListOfFunctions()->Add(fit_func);
3101 
3102  return 0;
3103  }
3104 
3105  void
3107  ProcessAsymHistograms(TH1F* h_neg, TH1F* h_pos, TH1F* h_asym) {
3108  if (h_neg->GetNbinsX() != h_pos->GetNbinsX() || h_neg->GetNbinsX() != h_asym->GetNbinsX()) return;
3109 
3110  for (int i = 1; i <= h_neg->GetNbinsX(); i++) {
3111  float asym = 0;
3112  float err = 0;
3113  float a = h_neg->GetBinContent(i);
3114  float b = h_pos->GetBinContent(i);
3115  float e1 = h_neg->GetBinError(i);
3116  float e2 = h_pos->GetBinError(i);
3117  if ((a + b) > 0) {
3118  asym = (a - b) / (a + b);
3119  //error propagation
3120  err = sqrt((4 * b * b * e1 * e1 + 4 * a * a * e2 * e2) / pow(a + b, 4));
3121  }
3122  h_asym->SetBinContent(i, asym);
3123  h_asym->SetBinError(i, err);
3124  }
3125  }
3126 
3127  void
3129  meanRMSProjections2D(TH2F* h2d, TH1F* h, int iopt) {
3130  //fills a 1-D histogram with mean or width of the distribution for each bin in a 2D histogram
3131  //the way in which the mean or width is determined is specified by the iopt option
3132  //can be from a gaussian fit for example
3133  // iopt = 0; fills with statistical mean
3134  // iopt = 1; fills with statistical RMS
3135  // iopt = 2; fills with mean of a two-stage Gaussian fit
3136  // iopt = 3; fills with width of a two-stage Gaussian fit
3137  // iopt = 4; fills with Chi2/DOF of a two-stage Gaussian fit
3138  // iopt = 5; fills with nentries in the bin
3139 
3140 
3141  //std::cout << "In fillGaussianMeanOrWidth for " << h->GetName() << std::endl;
3142 
3143  //calling this means that the histogram bin content is flagged
3144  //as being an average and so adding histos from different jobs
3145  //will produce weighted mean
3146  h->SetBit(TH1::kIsAverage);
3147 
3148  int nbins_2d = h2d->GetNbinsX();
3149  int nbins_y = h2d->GetNbinsY();
3150  // Removed by Alex
3151  //int nbins_h = h->GetNbinsX();
3152  //if(nbins_2d!=nbins_h) std::cout << "Mean/Width Histograms not set up correctly - nbins mismatch for " <<
3153  // h->GetName() << std::endl;
3154 
3155  // Check if nbins_y is less than 1 and skip if true
3156  if (nbins_y <= 1) {
3157  return;
3158  }
3159 
3160  for (int i = 1; i != nbins_2d + 1; i++) {
3161  //std::cout << "Gaussian: processing bin " << i << std::endl;
3162 
3163  TH1F* hproj = (TH1F*) h2d->ProjectionY("proj", i, i, "e");
3164 
3165  //std::cout << "Gaussian: made projection for bin " << i << std::endl;
3166 
3167  //do not fill if there are few entries in the bin
3168  if (iopt < 5 && (hproj->GetEntries() <= 30 || hproj->Integral() <= 30)) {
3169  delete hproj;
3170  //h->SetBinContent(i,j,0);
3171  //h->SetBinError(i,j,0);
3172  continue;
3173  }
3174 
3175  if (iopt == 0) {
3176  h->SetBinContent(i, hproj->GetMean());
3177  h->SetBinError(i, hproj->GetMeanError());
3178  } else if (iopt == 1) {
3179  h->SetBinContent(i, hproj->GetRMS());
3180  h->SetBinError(i, hproj->GetRMSError());
3181  } else if (iopt >= 2 && iopt < 5) {
3182  //we make a 2-stage Gaussian fit
3183  //first fit is in the range [MEAN + 2*RMS, MEAN - 2*RMS]
3184  //(restricting the range of the first fit has little effect)
3185  //second fit is in the range [mean + 2*width, mean - 2*width]
3186  //using the mean and width of the first fit
3187 
3188  //first fit
3189  float mean = hproj->GetMean();
3190  float rms = hproj->GetRMS();
3191  float min = mean - 2 * rms;
3192  float max = mean + 2 * rms;
3193  TF1* fW = new TF1("fW", "gaus", min, max);
3194  hproj->Fit("fW", "RQN");
3195 
3196  //second fit
3197  mean = fW->GetParameter(1);
3198  rms = fW->GetParameter(2);
3199  min = mean - 2 * rms;
3200  max = mean + 2 * rms;
3201  //if bins are large relative to distribution then
3202  //the above determined range could only be two bins
3203  //or even just fractions of bins
3204  //in this case a gauus fit is meaningless, and can have strange
3205  //chi2 behaviour and large errors on the mean
3206  //therefore make sure we are including full bins in fit and
3207  //have a minimum of 3 bins
3208  int minBin = hproj->FindBin(min);
3209  int maxBin = hproj->FindBin(max);
3210  if (maxBin - minBin < 2) {
3211  //require at least 3 bins for a meaningful gauss fit
3212  //std::cout << "WARNING core had too few bins for fit - expanding core for " << h->GetName() << std::endl;
3213  maxBin = maxBin + 1;
3214  minBin = minBin - 1;
3215  }
3216  min = hproj->GetBinLowEdge(minBin);
3217  max = (hproj->GetBinLowEdge(maxBin)) + (hproj->GetBinWidth(maxBin));
3218 
3219  TF1* fW2 = new TF1("fW2", "gaus", min, max);
3220  hproj->Fit("fW2", "RQN");
3221  if (iopt == 2) {
3222  h->SetBinContent(i, fW2->GetParameter(1));
3223  h->SetBinError(i, fW2->GetParError(1));
3224  } else if (iopt == 3) {
3225  h->SetBinContent(i, fW2->GetParameter(2));
3226  h->SetBinError(i, fW2->GetParError(2));
3227  } else if (iopt == 4) {
3228  float chi2 = fW2->GetChisquare();
3229  int ndf = fW2->GetNDF();
3230  if (ndf) h->SetBinContent(i, chi2 / ndf);
3231  else h->SetBinContent(i, 0);
3232  }
3233  delete fW;
3234  delete fW2;
3235  } else if (iopt == 5) {
3236  h->SetBinContent(i, hproj->GetEntries());
3237  }
3238  //else std::cerr << "Incorrect iopt switch in meanRMSProjections2D()" << std::endl;
3239 
3240  delete hproj;
3241  }
3242 
3243 
3244  return;
3245  }
3246 
3248  meanRMSProjections3D(TH3F* h3d, TH2F* h, int iopt) {
3249  //fills a 2-D histogram with mean or width of the distribution for each bin in a 3D histogram
3250  //the way in which the mean or width is determined is specified by the iopt option
3251  //can be from a gaussian fit for example
3252  // iopt = 0; fills with statistical mean
3253  // iopt = 1; fills with statistical RMS
3254  // iopt = 2; fills with mean of a two-stage Gaussian fit
3255  // iopt = 3; fills with width of a two-stage Gaussian fit
3256  // iopt = 4; fills with Chi2/DOF of a two-stage Gaussian fit
3257  // iopt = 5; fills with nentries in the bin
3258 
3259  int nbins_3dX = h3d->GetNbinsX();
3260  int nbins_3dY = h3d->GetNbinsY();
3261  int nbins_hX = h->GetNbinsX();
3262  int nbins_hY = h->GetNbinsY();
3263 
3264  // Check if nbins_3dZ is less than 1 and skip if true
3265  if (h3d->GetZaxis()->GetNbins() <= 1) {
3266  return;
3267  }
3268 
3269  if (nbins_3dX != nbins_hX) {
3270  std::cout << "meanRMSProjections3D: Mean/RMS Histograms not set up correctly - nbins mismatch for " <<
3271  h->GetName() << std::endl;
3272  return;
3273  }
3274  if (nbins_3dY != nbins_hY) {
3275  std::cout << "meanRMSProjections3D: Mean/RMS Histograms not set up correctly - nbins mismatch for " <<
3276  h->GetName() << std::endl;
3277  return;
3278  }
3279 
3280  for (int i = 1; i != nbins_3dX + 1; i++) {
3281  for (int j = 1; j != nbins_3dY + 1; j++) {
3282  TH1F* hproj = (TH1F*) h3d->ProjectionZ("proj", i, i, j, j, "e");
3283 
3284  //You can use this piece of code as snippet in order to produce fancy single modules residuals.
3285  //TCanvas Canvas;
3286  //std::string eta_mod="",phi_mod="";
3287  //std::string histoName = h3d->GetName();
3288  //if (histoName.find("pix_b0") == std::string::npos)
3289  //continue;
3290  //std::ostringstream convert_eta,convert_phi; // stream used for the conversion
3291  //convert_eta << i;
3292  //convert_phi << j;
3293  //eta_mod = convert_eta.str();
3294  //phi_mod = convert_phi.str();
3295  //Canvas.cd();
3296  //hproj->DrawClone();
3297 
3298  //Canvas.SaveAs((histoName+"_"+eta_mod+"_"+phi_mod+".pdf").c_str());
3299 
3300  //do not fill if there are 30 or less entries in the bin
3301  if (iopt < 5 && (hproj->GetEntries() <= 30 || hproj->Integral() <= 30)) {
3302  delete hproj;
3303  //h->SetBinContent(i,j,0);
3304  //h->SetBinError(i,j,0);
3305  continue;
3306  }
3307  if (iopt == 0) {
3308  h->SetBinContent(i, j, hproj->GetMean());
3309  h->SetBinError(i, j, hproj->GetMeanError());
3310  } else if (iopt == 1) {
3311  h->SetBinContent(i, j, hproj->GetRMS());
3312  h->SetBinError(i, j, hproj->GetRMSError());
3313  } else if (iopt >= 2 && iopt < 5) {
3314  //we make a 2-stage Gaussian fit
3315  //first fit is in the range [MEAN + 2*RMS, MEAN - 2*RMS]
3316  //(restricting the range of the first fit has little effect)
3317  //second fit is in the range [mean + 2*width, mean - 2*width]
3318  //using the mean and width of the first fit
3319 
3320  //first fit
3321  float mean = hproj->GetMean();
3322  float rms = hproj->GetRMS();
3323  float min = mean - 2 * rms;
3324  float max = mean + 2 * rms;
3325  TF1* fW = new TF1("fW", "gaus", min, max);
3326  hproj->Fit("fW", "RQN");
3327 
3328  //second fit
3329  mean = fW->GetParameter(1);
3330  rms = fW->GetParameter(2);
3331  min = mean - 2 * rms;
3332  max = mean + 2 * rms;
3333  //if bins are large relative to distribution then
3334  //the above determined range could only be two bins
3335  //or even just fractions of bins
3336  //in this case a gauus fit is meaningless, and can have strange
3337  //chi2 behaviour and large errors on the mean
3338  //therefore make sure we are including full bins in fit and
3339  //have a minimum of 3 bins
3340  int minBin = hproj->FindBin(min);
3341  int maxBin = hproj->FindBin(max);
3342  if (maxBin - minBin < 2) {
3343  //require at least 3 bins for a meaningful gauss fit
3344  //std::cout << "WARNING core had too few bins for fit - expanding core for " << h->GetName() << std::endl;
3345  maxBin = maxBin + 1;
3346  minBin = minBin - 1;
3347  }
3348  min = hproj->GetBinLowEdge(minBin);
3349  max = (hproj->GetBinLowEdge(maxBin)) + (hproj->GetBinWidth(maxBin));
3350 
3351  TF1* fW2 = new TF1("fW2", "gaus", min, max);
3352  hproj->Fit("fW2", "RQN");
3353  if (iopt == 2) {
3354  h->SetBinContent(i, j, fW2->GetParameter(1));
3355  h->SetBinError(i, j, fW2->GetParError(1));
3356  } else if (iopt == 3) {
3357  h->SetBinContent(i, j, fW2->GetParameter(2));
3358  h->SetBinError(i, j, fW2->GetParError(2));
3359  } else if (iopt == 4) {
3360  float chi2 = fW2->GetChisquare();
3361  int ndf = fW2->GetNDF();
3362  if (ndf) h->SetBinContent(i, j, chi2 / ndf);
3363  else h->SetBinContent(i, j, 0);
3364  }
3365 
3366  delete fW;
3367  delete fW2;
3368  } else if (iopt == 5) {
3369  h->SetBinContent(i, j, hproj->GetEntries());
3370  }
3371  //else std::cerr << "Incorrect iopt switch in meanRMSProjections3D()" << std::endl;
3372  delete hproj;
3373  }
3374  }
3375 
3376  return;
3377  }
3378 
3380  meanRMSProjections3D_DMRPlot(TH3F* h3d, TH1F* h, int iopt) {
3381  //fills a 1-D histogram with the mean or width of the distribution for each bin in a 3D histogram
3382  //the way in which the mean or width is determined is specified by the iopt option
3383  //can be from a gaussian fit for example
3384  // iopt = 0; fills with statistical mean
3385  // iopt = 1; fills with statistical RMS
3386  // iopt = 2; fills with mean of a two-stage Gaussian fit
3387  // iopt = 3; fills with width of a two-stage Gaussian fit
3388  // iopt = 4; fills with Chi2/DOF of a two-stage Gaussian fit
3389  // iopt = 5; fills with the error on the fitted mean
3390  // iopt = 6; fills with statistical median
3391  // iopt = 7; fills with nentries in the bin
3392 
3393  int nbins_3dX = h3d->GetNbinsX();
3394  int nbins_3dY = h3d->GetNbinsY();
3395 
3396  // Check if nbins_3dZ is less than 1 and skip if true
3397  if (h3d->GetZaxis()->GetNbins() <= 1) {
3398  return;
3399  }
3400 
3401  for (int i = 1; i != nbins_3dX + 1; i++) {
3402  for (int j = 1; j != nbins_3dY + 1; j++) {
3403  TH1F* hproj = (TH1F*) h3d->ProjectionZ("proj", i, i, j, j, "e");
3404 
3405  //do not fill if there are 30 or less entries in the bin
3406  if (iopt < 7 && (hproj->GetEntries() <= 30 || hproj->Integral() <= 30)) {
3407  delete hproj;
3408  continue;
3409  }
3410  if (iopt == 0) {
3411  h->Fill(hproj->GetMean());
3412  } else if (iopt == 1) {
3413  h->Fill(hproj->GetRMS());
3414  } else if (iopt >= 2 && iopt < 6) {
3415  //we make a 2-stage Gaussian fit
3416  //first fit is in the range [MEAN + 2*RMS, MEAN - 2*RMS]
3417  //(restricting the range of the first fit has little effect)
3418  //second fit is in the range [mean + 2*width, mean - 2*width]
3419  //using the mean and width of the first fit
3420 
3421  //first fit
3422  float mean = hproj->GetMean();
3423  float rms = hproj->GetRMS();
3424  float min = mean - 2 * rms;
3425  float max = mean + 2 * rms;
3426  TF1* fW = new TF1("fW", "gaus", min, max);
3427  hproj->Fit("fW", "RQN");
3428 
3429  //second fit
3430  mean = fW->GetParameter(1);
3431  rms = fW->GetParameter(2);
3432  min = mean - 2 * rms;
3433  max = mean + 2 * rms;
3434  //if bins are large relative to distribution then
3435  //the above determined range could only be two bins
3436  //or even just fractions of bins
3437  //in this case a gauus fit is meaningless, and can have strange
3438  //chi2 behaviour and large errors on the mean
3439  //therefore make sure we are including full bins in fit and
3440  //have a minimum of 3 bins
3441  int minBin = hproj->FindBin(min);
3442  int maxBin = hproj->FindBin(max);
3443  if (maxBin - minBin < 2) {
3444  //require at least 3 bins for a meaningful gauss fit
3445  //std::cout << "WARNING core had too few bins for fit - expanding core for " << h->GetName() << std::endl;
3446  maxBin = maxBin + 1;
3447  minBin = minBin - 1;
3448  }
3449  min = hproj->GetBinLowEdge(minBin);
3450  max = (hproj->GetBinLowEdge(maxBin)) + (hproj->GetBinWidth(maxBin));
3451 
3452  TF1* fW2 = new TF1("fW2", "gaus", min, max);
3453  hproj->Fit("fW2", "RQN");
3454  if (iopt == 2) {
3455  h->Fill(fW2->GetParameter(1));
3456  } else if (iopt == 3) {
3457  h->Fill(fW2->GetParameter(2));
3458  } else if (iopt == 4) {
3459  float chi2 = fW2->GetChisquare();
3460  int ndf = fW2->GetNDF();
3461  if (ndf) h->Fill(chi2 / ndf);
3462  else h->Fill(0.0);
3463  } else if (iopt == 5) {
3464  h->Fill(fW2->GetParError(1));
3465  }
3466 
3467  delete fW;
3468  delete fW2;
3469  } else if (iopt == 6) {
3470  h->Fill(getMedian(hproj));
3471  } else if (iopt == 7) {
3472  h->Fill(hproj->GetEntries());
3473  }
3474  //else std::cerr << "Incorrect iopt switch in meanRMSProjections3D_DMRPlot()" << std::endl;
3475  delete hproj;
3476  }
3477  }
3478 
3479  return;
3480  }
3481 
3483  meanRMSProjections3D_XY(TH3F* h3d, TH1F* h, int iXY, int iopt) {
3484  //fills a 1-D histogram with mean or width of the projected rows/columns of a 3-D histogram
3485  // iXY = 0; project columns (i.e. for each x of the 3D histogram form the distribution of all y-bins)
3486  // iXY = 1; project rows (i.e. for each y of the 3D histogram form the distribution of all x-bins)
3487  //the way in which the mean or width is determined is specified by the iopt option
3488  //can be from a gaussian fit for example
3489  // iopt = 0; fills with statistical mean
3490  // iopt = 1; fills with statistical RMS
3491  // iopt = 2; fills with mean of a two-stage Gaussian fit
3492  // iopt = 3; fills with width of a two-stage Gaussian fit
3493  // iopt = 4; fills with Chi2/DOF of a two-stage Gaussian fit
3494  // iopt = 5; fills with nentries in the bin
3495 
3496  int nbins_3dX = h3d->GetNbinsX();
3497  int nbins_3dY = h3d->GetNbinsY();
3498  int nbins_h = h->GetNbinsX();
3499  int nbins_3d = 0;//will be overridden
3500 
3501  // Check if nbins_3dZ is less than 1 and skip if true
3502  if (h3d->GetZaxis()->GetNbins()<= 1) {
3503  return;
3504  }
3505 
3506  if (iXY == 0) {
3507  if (nbins_3dX != nbins_h) {
3508  std::cerr << "meanRMSProjections3D_XY: Mean/RMS Histograms not set up correctly - nbins mismatch for " <<
3509  h->GetName() << std::endl;
3510  return;
3511  }
3512  nbins_3d = nbins_3dX;
3513  } else if (iXY == 1) {
3514  if (nbins_3dY != nbins_h) {
3515  std::cerr << "meanRMSProjections3D_XY: Mean/RMS Histograms not set up correctly - nbins mismatch for" <<
3516  h->GetName() << std::endl;
3517  std::cout << "nbins_3dY = " << nbins_3dY << ", nbins_h = " << nbins_h << std::endl;
3518  return;
3519  }
3520  nbins_3d = nbins_3dY;
3521  } else {
3522  //std::cerr << "meanRMSProjections3D_XY: iXY != 1 or 0 exiting" << std::endl;
3523  return;
3524  }
3525 
3526  for (int i = 1; i != nbins_3d + 1; i++) {
3527  TH1F* hproj;
3528  if (iXY == 0) {
3529  h3d->GetXaxis()->SetRange(i, i);
3530  h3d->GetYaxis()->SetRange(1, nbins_3dY);
3531  hproj = (TH1F*) h3d->Project3D("ze");
3532  } else { // (iXY == 1), as checked above
3533  h3d->GetYaxis()->SetRange(i, i);
3534  h3d->GetXaxis()->SetRange(1, nbins_3dX);
3535  hproj = (TH1F*) h3d->Project3D("ze");
3536  }
3537 
3538  //do not fill if there are 30 or less entries in the bin
3539  if (iopt < 5 && (hproj->GetEntries() <= 30 || hproj->Integral() <= 30)) {
3540  delete hproj;
3541  //h->SetBinContent(i,0);
3542  //h->SetBinError(i,0);
3543  continue;
3544  }
3545  if (iopt == 0) {
3546  h->SetBinContent(i, hproj->GetMean());
3547  h->SetBinError(i, hproj->GetMeanError());
3548  } else if (iopt == 1) {
3549  h->SetBinContent(i, hproj->GetRMS());
3550  h->SetBinError(i, hproj->GetRMSError());
3551  } else if (iopt >= 2 && iopt < 5) {
3552  //we make a 2-stage Gaussian fit
3553  //first fit is in the range [MEAN + 2*RMS, MEAN - 2*RMS]
3554  //(restricting the range of the first fit has little effect)
3555  //second fit is in the range [mean + 2*width, mean - 2*width]
3556  //using the mean and width of the first fit
3557 
3558  //first fit
3559  float mean = hproj->GetMean();
3560  float rms = hproj->GetRMS();
3561  float min = mean - 2 * rms;
3562  float max = mean + 2 * rms;
3563  TF1* fW = new TF1("fW", "gaus", min, max);
3564  hproj->Fit("fW", "RQN");
3565 
3566  //second fit
3567  mean = fW->GetParameter(1);
3568  rms = fW->GetParameter(2);
3569  min = mean - 2 * rms;
3570  max = mean + 2 * rms;
3571  //if bins are large relative to distribution then
3572  //the above determined range could only be two bins
3573  //or even just fractions of bins
3574  //in this case a gauus fit is meaningless, and can have strange
3575  //chi2 behaviour and large errors on the mean
3576  //therefore make sure we are including full bins in fit and
3577  //have a minimum of 3 bins
3578  int minBin = hproj->FindBin(min);
3579  int maxBin = hproj->FindBin(max);
3580  if (maxBin - minBin < 2) {
3581  //require at least 3 bins for a meaningful gauss fit
3582  //std::cout << "WARNING core had too few bins for fit - expanding core for " << h->GetName() << std::endl;
3583  maxBin = maxBin + 1;
3584  minBin = minBin - 1;
3585  }
3586  min = hproj->GetBinLowEdge(minBin);
3587  max = (hproj->GetBinLowEdge(maxBin)) + (hproj->GetBinWidth(maxBin));
3588 
3589  TF1* fW2 = new TF1("fW2", "gaus", min, max);
3590  hproj->Fit("fW2", "RQN");
3591  if (iopt == 2) {
3592  h->SetBinContent(i, fW2->GetParameter(1));
3593  h->SetBinError(i, fW2->GetParError(1));
3594  } else if (iopt == 3) {
3595  h->SetBinContent(i, fW2->GetParameter(2));
3596  h->SetBinError(i, fW2->GetParError(2));
3597  } else if (iopt == 4) {
3598  float chi2 = fW2->GetChisquare();
3599  int ndf = fW2->GetNDF();
3600  if (ndf) h->SetBinContent(i, chi2 / ndf);
3601  else h->SetBinContent(i, 0);
3602  }
3603  delete fW;
3604  delete fW2;
3605  } else if (iopt == 5) {
3606  h->SetBinContent(i, hproj->GetEntries());
3607  }
3608  //else std::cerr << "Incorrect iopt switch in meanRMSProjections3D_XY()" << std::endl;
3609  delete hproj;
3610  }
3611 
3612 
3613  return;
3614  }
3615 
3617  combineHistos(const char* name, const char* title, TObjArray* plots, int gap) {
3618  //makes one histogram out of all the histograms in the TObjArray
3619  //this histogram is built such that the histograms are placed side-by-side
3620  //on the same x-axis
3621 
3622  int n_plots = (plots->GetLast()) + 1;//add one since begins at zero
3623 
3624  //std::cout << "nplots = " << n_plots << std::endl;
3625 
3626  //count total bins
3627  int totalBins = 0;
3628 
3629  for (int i = 0; i != n_plots; ++i) {
3630  int nbins = ((TH1F*) (plots->At(i)))->GetNbinsX();
3631  totalBins = totalBins + nbins;
3632  }
3633  //take account of the gap we want to leave between plots
3634  totalBins = totalBins + ((n_plots - 1) * gap);
3635 
3636  TH1F* hnew = new TH1F(name, title, totalBins, 0, totalBins);
3637 
3638  int bCount = 1;
3639  //loop over the plots and fill the new one
3640  for (int i = 0; i != n_plots; ++i) {
3641  TH1F* h = (TH1F*) (plots->At(i));
3642 
3643  int nbins_h = h->GetNbinsX();
3644  //fill the bins with the content of h
3645  for (int j = 1; j != nbins_h + 1; ++j) {
3646  hnew->SetBinContent(bCount, h->GetBinContent(j));
3647  hnew->SetBinError(bCount, h->GetBinError(j));
3648  bCount++;
3649  }
3650 
3651  //skip the next bins to produce a gap
3652  //only if this isn't the last plot
3653  //(don't want a gap at the end)
3654  if (i < (n_plots - 1)) bCount = bCount + gap;
3655  }
3656 
3657  return hnew;
3658  }
3659 
3660  void
3662  setMinWindow(TH1* h1, float windowMin, float windowMax) {
3663  //establishes a minimum window size for TH1 histogram
3664 
3665  float min = h1->GetMinimum();
3666  float max = h1->GetMaximum();
3667  float margin = 0.05 * (max - min);
3668 
3669  if (min > windowMin) min = windowMin - margin;
3670  if (max < windowMax) max = windowMax + margin;
3671  h1->SetMinimum(min);
3672  h1->SetMaximum(max);
3673 
3674  return;
3675  }
3676 
3677  float
3679  getMedian(TH1* h1) {
3680  //calculates median for a TH1
3681 
3682  int nBins = h1->GetXaxis()->GetNbins();
3683 
3684  //double x[nBins]; double y[nBins];
3685  std::vector<double> x;
3686  std::vector<double> y;
3687  // double x[10000]; double y[10000];
3688  for (int i = 1; i != nBins + 1; i++) {
3689  //x[i] = h1->GetBinCenter(i);
3690  //y[i] = h1->GetBinContent(i);
3691  x.push_back(h1->GetBinCenter(i));
3692  y.push_back(h1->GetBinContent(i));
3693  }
3694 
3695  //float median = TMath::Median(nBins,x,y);
3696  float median = TMath::Median(nBins, &x[0], &y[0]);
3697 
3698  return median;
3699  }
3700 
3701  void
3703  fillMeanOrWidth(TH2F* h2d, TH1F* h, int iopt) {
3704  //fills a 1-D histogram with either the mean or RMS of the 2d histogram in each bin.
3705  //binning of 1d and 2d histograms must match
3706  // iopt=0; Mean
3707  // iopt=1; Width
3708 
3709  //std::cout << "In fillMeanOrWidth" << std::endl;
3710 
3711  int nbins_2d = h2d->GetNbinsX();
3712  int nbins_h = h->GetNbinsX();
3713 
3714  if (nbins_2d != nbins_h) //std::cout << "Mean/RMS Histograms not set up correctly - nbins mismatch for " <<
3715  // h->GetName() << std::endl;
3716 
3717  for (int i = 1; i != nbins_2d + 1; i++) {
3718  //std::cout << "Processing bin " << i << std::endl;
3719 
3720  TH1F* hproj = (TH1F*) h2d->ProjectionY("proj", i, i, "e");
3721 
3722  //std::cout << "Made projection for bin " << i << std::endl;
3723 
3724  //do not fill if there are no entries in the bin
3725  if (hproj->GetEntries() <= 0) {
3726  delete hproj;
3727  continue;
3728  }
3729 
3730  if (iopt == 0) {
3731  h->SetBinContent(i, hproj->GetMean());
3732  h->SetBinError(i, hproj->GetMeanError());
3733  //std::cout << "Filled mean results for bin " << i << std::endl;
3734  } else if (iopt == 1) {
3735  h->SetBinContent(i, hproj->GetRMS());
3736  h->SetBinError(i, hproj->GetRMSError());
3737  }
3738  //else std::cout << "Incorrect switch in MeanRMSProjectionsBarrel()" << std::endl;
3739 
3740  delete hproj;
3741  }
3742 
3743  //std::cout << "Finished fillMeanOrWidth" << std::endl;
3744 
3745  return;
3746  }
3747 
3748  void
3750  fillGaussianMeanOrWidth(TH2F* h2d, TH1F* h, float fitMin, float fitMax, int iopt) {
3751  //Makes a Gaussian fit to each bin of a TH2F and fills a TH1F with
3752  //the either the mean or width of this Gaussian
3753  // iopt=0; Mean
3754  // iopt=1; Width
3755 
3756  //std::cout << "In fillGaussianMeanOrWidth for " << h->GetName() << std::endl;
3757 
3758  //calling this means that the histogram bin content is flagged
3759  //as being an average and so adding histos from different jobs
3760  //will produce weighted mean
3761  h->SetBit(TH1::kIsAverage);
3762 
3763  int nbins_2d = h2d->GetNbinsX();
3764 
3765  // Removed by Alex
3766  //int nbins_h = h->GetNbinsX();
3767  //if(nbins_2d!=nbins_h) std::cout << "Mean/Width Histograms not set up correctly - nbins mismatch for " <<
3768  // h->GetName() << std::endl;
3769 
3770  for (int i = 1; i != nbins_2d + 1; i++) {
3771  //std::cout << "Gaussian: processing bin " << i << std::endl;
3772 
3773  TH1F* hproj = (TH1F*) h2d->ProjectionY("proj", i, i, "e");
3774 
3775  //std::cout << "Gaussian: made projection for bin " << i << std::endl;
3776 
3777  //do not fill if there are few entries in the bin
3778  if (hproj->GetEntries() <= 30 || hproj->Integral() <= 30) {
3779  delete hproj;
3780  continue;
3781  }
3782 
3783  TF1* fit = new TF1("fit", "gaus", fitMin, fitMax);
3784 
3785  hproj->Fit("fit", "RQN");
3786  float mean = fit->GetParameter(1);
3787  float meanErr = fit->GetParError(1);
3788  float width = fit->GetParameter(2);
3789  float widthErr = fit->GetParError(2);
3790 
3791  //std::cout << "Gaussian: fitted bin " << i << std::endl;
3792 
3793  if (iopt == 0) {
3794  h->SetBinContent(i, mean);
3795  h->SetBinError(i, meanErr);
3796  } else if (iopt == 1) {
3797  h->SetBinContent(i, width);
3798  h->SetBinError(i, widthErr);
3799  }
3800  //else std::cout << "Incorrect switch in fillGaussianMeanOrWidth" << std::endl;
3801 
3802  delete hproj;
3803  delete fit;
3804  }
3805 
3806  //std::cout << "leaving fillGaussianMeanOrWidth for " << h->GetName() << std::endl;
3807 
3808  return;
3809  }
3810 
3811 /*
3812  void MonitoringFile::MakeStaveShapeFit(float& mag, float& mag_er, float& base, float& base_er, TH1D* projection)
3813  {
3814  TGraphErrors* g = ConvertHistoInGraph(projection);
3815  TF1 *fit;
3816  fit = new TF1("fit", "[0]-[1]*(x+[2]) * (4.0*[2]*(x+[2])**2 - (x+[2])**3 - (2.0*[2])**3)", -m_z_fix, m_z_fix );
3817  fit->FixParameter(2, m_z_fix);
3818  fit->SetParameter(1, 5.e-12);
3819  TFitResultPtr r = g->Fit(fit,"EX0SQ");
3820  mag = 5.0 * fit->GetParameter(1) * (m_z_fix*m_z_fix*m_z_fix*m_z_fix);
3821  mag_er = 5.0 * fit->GetParError(1) * (m_z_fix*m_z_fix*m_z_fix*m_z_fix);
3822  base =fit->GetParameter(0);
3823  base_er =fit->GetParError(0);
3824 
3825  delete g;
3826  return;
3827  }
3828 
3829  TGraphErrors* MonitoringFile::ConvertHistoInGraph(TH1D* histo)
3830  {
3831  TGraphErrors* graph = new TGraphErrors();
3832  std::vector<int> filled_bins;
3833  for (int etabin=1;etabin < 21;++etabin)
3834  {
3835  if (histo->GetBinContent(etabin) != 0.)
3836  {
3837  filled_bins.push_back(etabin);
3838  }
3839  }
3840 
3841  for (int ibin=0;ibin < (int) filled_bins.size();++ibin)
3842  {
3843  graph->Set(ibin+1);
3844  graph->SetPoint(ibin,z_axis[filled_bins.at(ibin)-1],histo->GetBinContent(filled_bins.at(ibin)));
3845  graph->SetPointError(ibin,0,histo->GetBinError(filled_bins.at(ibin)));
3846  }
3847 
3848  graph->GetXaxis()->SetRangeUser(-m_z_fix,m_z_fix);
3849  return graph;
3850 
3851  }
3852  */
3853 /*
3854  void MonitoringFile::MakeBowingFit(TProfile2D* p2d, TH1F* hm, TH1F* hb)
3855  {
3856  for (int lumibin=1;lumibin <= p2d->GetXaxis()->GetNbins();++lumibin)
3857  {
3858  TH1D* projection_lumiblock =
3859  p2d->ProjectionY(("iblBowingProjection_lumiblock_"+intToString(lumibin-1)).c_str(),lumibin,lumibin);
3860  MakeStaveShapeFit(mag,mag_er,base,base_er,projection_lumiblock);
3861  pix_b0_mag_vs_lb->SetBinContent(lumibin,mag);
3862  pix_b0_mag_vs_lb->SetBinError(lumibin,mag_er);
3863  pix_b0_base_vs_lb->SetBinContent(lumibin,base);
3864  pix_b0_base_vs_lb->SetBinError(lumibin,base_er);
3865  delete projection_lumiblock;
3866  }
3867 
3868  return;
3869  }
3870  */
3871 
3872  void
3874  fillDetPaperMeanRMS(TH2F* h2d, TH1F* h, int iopt) {
3875  //this finds the statistical mean/rms using the detector paper definition
3876  //i.e. the mean and RMS defined using bins which contain 99.7% of entries (symmetrically) around the mean bin
3877  // iopt=0; Mean
3878  // iopt=1; RMS (resolution)
3879  //Note that this method is not reliable if there is large underflow/overflow in the histogram.
3880 
3881  //calling this means that the histogram bin content is flagged
3882  //as being an average and so adding histos from different jobs
3883  //will produce weighted mean
3884  h->SetBit(TH1::kIsAverage);
3885 
3886  int nbins_2d = h2d->GetNbinsX();
3887 
3888  // Removed by Alex
3889  //int nbins_h = h->GetNbinsX();
3890  //if(nbins_2d!=nbins_h) std::cout << "Mean/Width Histograms not set up correctly - nbins mismatch for " <<
3891  // h->GetName() << std::endl;
3892 
3893  for (int i = 1; i != nbins_2d + 1; i++) {
3894  //std::cout << "fillDetPaperMeanRMS: processing bin " << i << std::endl;
3895 
3896  TH1F* hproj = (TH1F*) h2d->ProjectionY("proj", i, i, "e");
3897 
3898  //std::cout << "fillDetPaperMeanRMS: made projection for bin " << i << std::endl;
3899 
3900  //do not fill if there are few entries in the bin
3901  if (hproj->GetEntries() <= 30 || hproj->Integral() <= 30) {
3902  delete hproj;
3903  continue;
3904  }
3905 
3906  float hmean = hproj->GetMean();
3907  // float hRMS = hproj->GetRMS();
3908  float hFullIntegral = hproj->Integral(1, hproj->GetNbinsX());
3909 
3910  //std::cout << "fillDetPaperMeanRMS: Original Mean, RMS = " << hmean << ", " << hRMS << std::endl;
3911 
3912  float hTargetIntegral = 0.997 * hFullIntegral;
3913  int hMeanBin = hproj->FindBin(hmean);
3914 
3915  //std::cout << "fillDetPaperMeanRMS: NEntries = " << hproj->GetEntries() << ", fullIntegral = " << hFullIntegral
3916  // << std::endl;
3917 
3918  int lowBin = hMeanBin;
3919  int highBin = hMeanBin;
3920  float hIntegral = 0.0;
3921 
3922  while (hIntegral < hTargetIntegral) {
3923  // find the bin which contains the mean
3924  // then integrate symmetrically around this bin, increasing the range
3925  // until the integral is larger than the target
3926  // this defines your upper and lower bounds for mean/rms.
3927 
3928  lowBin = lowBin - 1;
3929  highBin = highBin + 1;
3930  hIntegral = hproj->Integral(lowBin, highBin);
3931  }
3932 
3933  //std::cout << "fillDetPaperMeanRMS: NBins = " << hproj->GetNbinsX() << " minBin = " << lowBin << " highBin = "
3934  // << highBin << std::endl;
3935 
3936  TH1F* hclone = (TH1F*) hproj->Clone("clone");
3937 
3938  hclone->GetXaxis()->SetRange(lowBin, highBin);
3939  float hNewMean = hclone->GetMean();
3940  float hNewMeanErr = hclone->GetMeanError();
3941  float hNewRMS = hclone->GetRMS();
3942  float hNewRMSErr = hclone->GetRMSError();
3943 
3944  //std::cout << "fillDetPaperMeanRMS: New Mean, RMS = " << hNewMean << ", " << hNewRMS << std::endl;
3945 
3946  if (iopt == 0) {
3947  h->SetBinContent(i, hNewMean);
3948  h->SetBinError(i, hNewMeanErr);
3949  } else if (iopt == 1) {
3950  h->SetBinContent(i, hNewRMS);
3951  h->SetBinError(i, hNewRMSErr);
3952  }
3953  //else std::cout << "Incorrect switch in fillDetPaperMeanRMS" << std::endl;
3954 
3955  delete hproj;
3956  delete hclone;
3957  }
3958 
3959  return;
3960  }
3961 }
covarianceTool.ndf
ndf
Definition: covarianceTool.py:678
TH2::Fill
int Fill(double, double)
Definition: rootspy.cxx:382
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
pdg_comparison.sigma
sigma
Definition: pdg_comparison.py:324
TH1F::GetBinContent
double GetBinContent(int) const
Definition: rootspy.cxx:326
mean
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
Definition: dependence.cxx:254
athena.path
path
python interpreter configuration --------------------------------------—
Definition: athena.py:126
max
#define max(a, b)
Definition: cfImp.cxx:41
AddEmptyComponent.histName
string histName
Definition: AddEmptyComponent.py:64
dqutils::MonitoringFile::meanRMSProjections3D_XY
static void meanRMSProjections3D_XY(TH3F *h3d, TH1F *h, int iXY, int iopt)
Definition: MonitoringFile_IDAlignPostProcess.cxx:3483
dqutils::MonitoringFile::CheckHistogram
static bool CheckHistogram(TFile *f, const char *HistoName)
TH2F
Definition: rootspy.cxx:420
egammaEnergyPositionAllSamples::e1
double e1(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 1st sampling
dqutils::MonitoringFile::fillMeanOrWidth
static void fillMeanOrWidth(TH2F *h2d, TH1F *h, int iopt)
Definition: MonitoringFile_IDAlignPostProcess.cxx:3703
index
Definition: index.py:1
plotmaker.hist
hist
Definition: plotmaker.py:148
conifer::pow
constexpr int pow(int x)
Definition: conifer.h:20
TH1D
Definition: rootspy.cxx:342
InDet::median
float median(std::vector< float > &Vec)
Definition: BTagVrtSec.cxx:35
read_hist_ntuple.h1
h1
Definition: read_hist_ntuple.py:21
python.TrigEgammaMonitorHelper.TH2F
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:45
x
#define x
CaloSwCorrections.gap
def gap(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:212
hmean
double hmean(TH1 *h)
Definition: computils.cxx:433
dqutils::MonitoringFile::Make1DProfile
static void Make1DProfile(TH1 *output, TH2 *histo)
Definition: MonitoringFile_IDAlignPostProcess.cxx:2944
dqutils::MonitoringFile::setMinWindow
static void setMinWindow(TH1 *h1, float min, float max)
Definition: MonitoringFile_IDAlignPostProcess.cxx:3662
dqutils::MonitoringFile::meanRMSProjections3D
static void meanRMSProjections3D(TH3F *h3d, TH2F *h, int iopt)
Definition: MonitoringFile_IDAlignPostProcess.cxx:3248
dqutils::MonitoringFile::MakeMap
static void MakeMap(TH2 *outputhist, TH3 *hist)
Definition: MonitoringFile_IDAlignPostProcess.cxx:2963
dqutils::MonitoringFile::meanRMSProjections2D
static void meanRMSProjections2D(TH2F *h2d, TH1F *h, int iopt)
Definition: MonitoringFile_IDAlignPostProcess.cxx:3129
SCT_CalibAlgs::nbins
@ nbins
Definition: SCT_CalibNumbers.h:10
dqutils::MonitoringFile::IterativeGaussFit
static int IterativeGaussFit(TH1 *hist, double &mu, double &mu_err, double &sigma, double &sigma_err)
Definition: MonitoringFile_IDAlignPostProcess.cxx:2998
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:193
lumiFormat.i
int i
Definition: lumiFormat.py:92
dqutils::MonitoringFile::fitMergedFile_IDAlignMonPVbiases
static void fitMergedFile_IDAlignMonPVbiases(TFile *file, const std::string &run_dir, const std::string &tracksName)
Definition: MonitoringFile_IDAlignPostProcess.cxx:2515
dqutils::MonitoringFile::fitMergedFile_IDAlignMonResiduals
static void fitMergedFile_IDAlignMonResiduals(TFile *f, const std::string &run_dir, const std::string &TriggerName)
Definition: MonitoringFile_IDAlignPostProcess.cxx:473
covarianceTool.title
title
Definition: covarianceTool.py:542
TH3
Definition: rootspy.cxx:440
SignEnum::LE
@ LE
Definition: SignEnums.h:21
dqutils::MonitoringFile::combineHistos
static TH1F * combineHistos(const char *name, const char *title, TObjArray *plots, int gap)
Definition: MonitoringFile_IDAlignPostProcess.cxx:3617
chi2
double chi2(TH1 *h0, TH1 *h1)
Definition: comparitor.cxx:522
file
TFile * file
Definition: tile_monitor.h:29
SwapComponents.newHists
list newHists
Definition: SwapComponents.py:36
dqutils::MonitoringFile::meanRMSProjections3D_DMRPlot
static void meanRMSProjections3D_DMRPlot(TH3F *h3d, TH1F *h, int iopt)
Definition: MonitoringFile_IDAlignPostProcess.cxx:3380
TH1F::SetBinContent
void SetBinContent(int, double)
Definition: rootspy.cxx:327
dqutils
Definition: CoolMdt.h:76
TH2
Definition: rootspy.cxx:373
TH2F::GetBinContent
double GetBinContent(int) const
Definition: rootspy.cxx:425
dqutils::MonitoringFile::fillGaussianMeanOrWidth
static void fillGaussianMeanOrWidth(TH2F *h2d, TH1F *h, float fitMin, float fitMax, int iopt)
Definition: MonitoringFile_IDAlignPostProcess.cxx:3750
MuonValidation_CreateResolutionProfiles.fit
def fit(h, emin, emax)
Definition: MuonValidation_CreateResolutionProfiles.py:69
min
#define min(a, b)
Definition: cfImp.cxx:40
dqutils::MonitoringFile::fitMergedFile_IDAlignMonManager
static void fitMergedFile_IDAlignMonManager(const std::string &inFileName, bool isIncremental=false)
Definition: MonitoringFile_IDAlignPostProcess.cxx:31
merge.output
output
Definition: merge.py:17
dumpTgcDigiJitter.nBins
list nBins
Definition: dumpTgcDigiJitter.py:29
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
dqutils::MonitoringFile::ProcessAsymHistograms
static void ProcessAsymHistograms(TH1F *m_neg, TH1F *m_pos, TH1F *m_asym)
Definition: MonitoringFile_IDAlignPostProcess.cxx:3107
TH3F
Definition: rootspy.cxx:495
MonitoringFile.h
DeMoScan.index
string index
Definition: DeMoScan.py:362
a
TList * a
Definition: liststreamerinfos.cxx:10
y
#define y
h
TH1F
Definition: rootspy.cxx:320
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
egammaEnergyPositionAllSamples::e2
double e2(const xAOD::CaloCluster &cluster)
return the uncorrected cluster energy in 2nd sampling
TH1
Definition: rootspy.cxx:268
beamspotnt.rms
rms
Definition: bin/beamspotnt.py:1266
covarianceTool.plots
plots
Definition: covarianceTool.py:698
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
dqutils::MonitoringFile::fitMergedFile_IDAlignMonGenericTracks
static void fitMergedFile_IDAlignMonGenericTracks(TFile *file, const std::string &run_dir, const std::string &tracksName)
Definition: MonitoringFile_IDAlignPostProcess.cxx:2308
plotBeamSpotCompare.histo
histo
Definition: plotBeamSpotCompare.py:415
python.PyAthena.obj
obj
Definition: PyAthena.py:135
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
dqutils::MonitoringFile::getMedian
static float getMedian(TH1 *h1)
Definition: MonitoringFile_IDAlignPostProcess.cxx:3679
fitman.k
k
Definition: fitman.py:528
dqutils::MonitoringFile::fitMergedFile_IDAlignMonTrackSegments
static void fitMergedFile_IDAlignMonTrackSegments(TFile *file, const std::string &run_dir, const std::string &tracksName)
Definition: MonitoringFile_IDAlignPostProcess.cxx:179
dqutils::MonitoringFile::fillDetPaperMeanRMS
static void fillDetPaperMeanRMS(TH2F *h2d, TH1F *h, int iopt)
Definition: MonitoringFile_IDAlignPostProcess.cxx:3874