AliPhysics  449db5a (449db5a)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DrawAnaCaloTrackQA.C
Go to the documentation of this file.
1 
30 //---------------------------------------------------------
31 // Set includes and declare methods for compilation
32 
33 #if !defined(__CINT__) || defined(__MAKECINT__)
34 
35 #include <TFile.h>
36 #include <TDirectoryFile.h>
37 #include <TList.h>
38 #include <TString.h>
39 #include <TROOT.h>
40 #include <TStyle.h>
41 #include <TH1F.h>
42 #include <TH2F.h>
43 #include <TCanvas.h>
44 #include <TPad.h>
45 #include <TLegend.h>
46 #include <TObject.h>
47 #include <TAxis.h>
48 #include <TGaxis.h>
49 #include <TLine.h>
50 #include <TF1.h>
51 #include <TMath.h>
52 
53 #endif
54 
55 void ProcessTrigger(TString trigName = "default",
56  Bool_t checkList = kTRUE);
57 void CaloQA (Int_t icalo);
58 void TrackQA ();
59 void Pi0QA (Int_t icalo);
60 void IsolQA (Int_t icalo);
61 void CorrelQA (Int_t icalo);
62 void MCQA (Int_t icalo);
63 void ScaleAxis (TAxis *a, Double_t scale);
64 void ScaleXaxis(TH1 *h, Double_t scale);
65 
66 TObject * GetHisto (TString histoName);
67 void SaveHisto (TObject* histo, Bool_t tag = kTRUE);
68 void SaveCanvas(TCanvas* canvas );
69 Bool_t GetList (TString trigName );
70 //
71 //---------------------------------------------------------
72 
73 //-----------------------
74 // Some global variables
75 TDirectoryFile *dir = 0;
76 TList *list = 0;
77 TFile *file = 0;
78 TFile *fout = 0;
80 TString format = "eps";
82 
84 Int_t color[]={kBlack,kRed,kOrange+1,kYellow+1,kGreen+2,kBlue,kCyan+1,kViolet,kMagenta+2,kGray,kCyan-2,kViolet-2};
85 //
86 //-----------------------
87 
103 //_______________________________________________________________________
105 (
106  TString listName = "Pi0IM_GammaTrackCorr_EMCAL",
107  TString fileName = "AnalysisResults.root",
108  Int_t exportTo = 1,
109  TString fileFormat = "eps",
110  TString outFileName = "CaloTrackCorrQA_output"
111 )
112 {
113  format = fileFormat;
114  exportToFile = exportTo;
115 
116  printf("Open <%s>; Get Trigger List : <%s>; Export option <%d>; format %s; outputFileName %s.root\n",
117  fileName.Data(),listName.Data(),exportToFile, format.Data(),outFileName.Data());
118 
119  // Get file and list container, global variables
120  //
121  file = new TFile(fileName,"read");
122  if ( !file )
123  {
124  printf("File not found, do nothing\n");
125  return;
126  }
127 
128  dir = (TDirectoryFile*) file->Get(listName);
129  if ( !dir )
130  {
131  printf("DirectoryFile not found, do nothing\n");
132  return;
133  }
134 
135  //---------------
136  // output file with plots
137  if(exportToFile == 1)
138  {
139  fout = TFile::Open(Form("%s.root",outFileName.Data()),"UPDATE");
140  if(!fout)
141  fout = new TFile(Form("%s.root",outFileName.Data()),"RECREATE");
142 
143  //fout->ls();
144 
145  TDirectoryFile *cdd = (TDirectoryFile*)fout->Get("GA");
146  if(!cdd)
147  {
148  printf("Warning: GA <dir> doesn't exist, creating a new one");
149  cdd = (TDirectoryFile*)fout->mkdir("GA");
150  }
151  cdd->cd();
152  cdd->ls();
153  }
154  //---------------
155 
156  // Process each of the triggers
157  //
158  ProcessTrigger("default" );
159  ProcessTrigger("EMCAL_L0");
160  ProcessTrigger("EMCAL_L1");
161  ProcessTrigger("EMCAL_L2");
162  ProcessTrigger("DCAL_L0" );
163  ProcessTrigger("DCAL_L1" );
164  ProcessTrigger("DCAL_L2" );
165 
166  if(exportToFile == 1)
167  {
168  fout->cd();
169  fout->Close();
170  }
171 
172  file->Close();
173 }
174 
192 //_______________________________________________________________________
193 void ProcessTrigger( TString trigName, Bool_t checkList)
194 {
195  // Access the list of histograms, global variables
196  //
197  if(checkList)
198  {
199  Bool_t ok = GetList(trigName);
200  printf("\t -- Process trigger %s, ok %d\n",trigName.Data(), ok);
201 
202  if ( !ok ) return;
203  }
204 
205  gStyle->SetOptTitle(1);
206  gStyle->SetOptStat(0);
207  gStyle->SetOptFit(000000);
208  gStyle->SetPadRightMargin(0.15);
209  //gStyle->SetPadTopMargin(0.02);
210  //gStyle->SetPadLeftMargin(0.15);
211  gStyle->SetTitleFontSize(0.05);
212 
213  Int_t nCalo = 2;
214  Int_t calo = 0;
215  if (trigName.Contains("EMCAL")) { calo = 0 ; nCalo = 1 ; }
216  else if(trigName.Contains("DCAL" )) { calo = 1 ; nCalo = 2 ; }
217 
218  TString caloString [] = {"EMCAL","DCAL"};
219 
220  histoTag = trigName;
221 
222  // Plot basic Track QA
223  TrackQA();
224 
225  for(Int_t icalo = calo; icalo < nCalo; icalo++)
226  {
227  if(trigName.Contains("default")) histoTag=Form("%s_%s",caloString[icalo].Data(),trigName.Data());
228 
229  // Plot basic QA
230  CaloQA(icalo);
231 
232  // Plot basic Pi0 QA
233  Pi0QA(icalo);
234 
235  gStyle->SetPadRightMargin(0.02);
236  // Plot basic isolation QA
237  IsolQA(icalo);
238 
239  // Plot basic correlation QA
240  CorrelQA(icalo);
241 
242  // MC basic QA plots, cluster origins (only if it run on MC)
243  MCQA(icalo);
244 
245  // Re-set default setting
246  gStyle->SetPadRightMargin(0.15);
247  }
248 }
249 
258 //______________________________________
259 void CaloQA(Int_t icalo)
260 {
261  //-----------------------------
262  // Cluster spectra and track match residuals
263  //
264  TCanvas * ccalo = new TCanvas(Form("%s_CaloHisto_SpectraTM" ,histoTag.Data()),
265  Form("Cluster spectra and track match residuals for %s",histoTag.Data()),
266  1000,1000);
267  ccalo->Divide(2,2);
268 
269  ccalo->cd(1);
270  gPad->SetLogy();
271  gPad->SetLogx();
272 
273  TH1F* hClusterEnergy = (TH1F*) GetHisto(Form("AnaPhoton_Calo%d_hPt_Cut_6_Fidutial",icalo));
274  if(!hClusterEnergy) return;
275  hClusterEnergy->SetYTitle("Entries");
276  hClusterEnergy->SetTitle("Cluster-cell energy spectra");
277  hClusterEnergy->SetTitleOffset(1.5,"Y");
278  hClusterEnergy->Sumw2();
279  hClusterEnergy->SetMarkerColor(1);
280  hClusterEnergy->SetMarkerStyle(20);
281  hClusterEnergy->SetAxisRange(0.,50.,"X");
282  hClusterEnergy->Draw();
283 
284  TLegend l(0.15,0.15,0.3,0.3);
285  l.SetTextSize(0.04);
286  l.AddEntry(hClusterEnergy,"Good Cluster","P");
287  l.SetBorderSize(0);
288  l.SetFillColor(0);
289 
290 
291  TH2F* h2CellAmplitude = (TH2F*) GetHisto("QA_Cell_hAmp_Mod");
292  TH1F* hCellAmplitude = 0;
293  if(h2CellAmplitude)
294  {
295  if(histoTag.Contains("default"))
296  {
297  if ( icalo == 0 ) hCellAmplitude = (TH1F*) h2CellAmplitude->ProjectionX(Form("%s_hCellAmp",histoTag.Data()), 1,12);
298  else hCellAmplitude = (TH1F*) h2CellAmplitude->ProjectionX(Form("%s_hCellAmp",histoTag.Data()),12,20);
299  }
300  else hCellAmplitude = (TH1F*) h2CellAmplitude->ProjectionX(Form("%s_hCellAmp",histoTag.Data()),0,100);
301 
302  hCellAmplitude->Sumw2();
303  hCellAmplitude->SetMarkerColor(4);
304  hCellAmplitude->SetMarkerStyle(25);
305  hCellAmplitude->Draw("same");
306  l.AddEntry(hCellAmplitude,"Cell","P");
307  }
308 
309  l.Draw();
310 
311  ccalo->cd(2);
312  //gPad->SetLogy();
313  gPad->SetLogx();
314 
315  //TH1F* hRaw = (TH1F*) GetHisto(Form("AnaPhoton_Calo%d_hPt_Cut_6_Fidutial",icalo));
316  //TH1F* hCorr = (TH1F*) GetHisto(Form("AnaPhoton_Calo%d_hPt_Cut_4_NCells" ,icalo));
317  TH1F* hTM = (TH1F*) GetHisto(Form("AnaPhoton_Calo%d_hPt_Cut_7_Matching",icalo));
318  TH1F* hShSh = (TH1F*) GetHisto(Form("AnaPhoton_Calo%d_hPt_Cut_9_PID" ,icalo));
319 
320  //hRaw->Sumw2();
321 
322 // hCorr->SetTitle("Ratio after cluster cuts application");
323 // hCorr->SetYTitle("Selected clusters / Raw clusters");
324 // hCorr->SetTitleOffset(1.5,"Y");
325 // hCorr->Sumw2();
326 // hCorr->SetMarkerColor(1);
327 // hCorr->SetMarkerStyle(20);
328 // hCorr->Divide(hRaw);
329 // hCorr->SetAxisRange(0.,30.,"X");
330 // hCorr->SetMaximum(1.1);
331 // hCorr->SetMinimum(0);
332 // hCorr->Draw();
333 
334  hTM ->SetTitle("Ratio after cluster cuts application");
335  hTM ->SetYTitle("Selected clusters / Good clusters");
336  hTM ->SetTitleOffset(1.5,"Y");
337  hTM ->Sumw2();
338  hTM ->SetAxisRange(0.,50.,"X");
339  hTM ->SetMarkerColor(2);
340  hTM ->SetMarkerStyle(21);
341  hTM ->SetMaximum(1.1);
342  hTM ->SetMinimum(0);
343  hTM ->Divide(hClusterEnergy);
344  hTM ->Draw("");
345 
346  hShSh->Sumw2();
347  hShSh->SetMarkerColor(4);
348  hShSh->SetMarkerStyle(22);
349  hShSh->Divide(hClusterEnergy);
350  hShSh->Draw("same");
351 
352  TLegend l2(0.15,0.15,0.3,0.3);
353  l2.SetTextSize(0.04);
354  //l2.AddEntry(hCorr,"No Exotics + non lin.","P");
355  l2.AddEntry(hTM, "+ Track matching","P");
356  l2.AddEntry(hShSh,"+ #lambda^{2}_{0} < 0.4","P");
357  l2.SetBorderSize(0);
358  l2.SetFillColor(0);
359  l2.Draw();
360 
361  // Plot track-matching residuals
362  TH1F* hTrackMatchResEtaNeg;
363  TH1F* hTrackMatchResEtaPos;
364  TH1F* hTrackMatchResPhiNeg;
365  TH1F* hTrackMatchResPhiPos;
366 
367  // first test did not have this histogram, add protection
368  TH2F* hTrackMatchResEtaPhi = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hTrackMatchedDEtaDPhiPosNoCut",icalo));
369  if(hTrackMatchResEtaPhi)
370  {
371  hTrackMatchResEtaPhi ->Add( (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hTrackMatchedDEtaDPhiNegNoCut",icalo) ));
372 
373  ccalo->cd(3);
374  gPad->SetLogz();
375 
376  hTrackMatchResEtaPhi->SetAxisRange(-0.025,0.025,"X");
377  hTrackMatchResEtaPhi->SetAxisRange(-0.025,0.025,"Y");
378  hTrackMatchResEtaPhi->SetTitleOffset(1.5,"Y");
379  hTrackMatchResEtaPhi->SetTitleOffset(1.5,"Z");
380  hTrackMatchResEtaPhi->SetTitle("Track-cluster residual #Delta#varphi vs #Delta#eta, #it{E}>0.5 GeV");
381  hTrackMatchResEtaPhi->SetXTitle("#Delta #eta");
382  hTrackMatchResEtaPhi->SetYTitle("#Delta #varphi");
383  hTrackMatchResEtaPhi->SetZTitle("Entries");
384  hTrackMatchResEtaPhi->Draw("colz");
385 
386  ccalo->cd(4);
387  //gPad->SetLogy();
388  TGaxis::SetMaxDigits(3);
389 
390  TH2F* h2TrackMatchResEtaNeg = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hTrackMatchedDEtaNegNoCut",icalo));
391  TH2F* h2TrackMatchResEtaPos = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hTrackMatchedDEtaPosNoCut",icalo));
392  TH2F* h2TrackMatchResPhiNeg = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hTrackMatchedDPhiNegNoCut",icalo));
393  TH2F* h2TrackMatchResPhiPos = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hTrackMatchedDPhiPosNoCut",icalo));
394 
395  Float_t binMin = hClusterEnergy->FindBin(0.5);
396  hTrackMatchResEtaNeg = (TH1F*) h2TrackMatchResEtaNeg->ProjectionY(Form("%s_hTrackMatchProjClusEnEtaNeg",histoTag.Data()),binMin, 1000);
397  hTrackMatchResEtaPos = (TH1F*) h2TrackMatchResEtaPos->ProjectionY(Form("%s_hTrackMatchProjClusEnEtaPos",histoTag.Data()),binMin, 1000);
398  hTrackMatchResPhiNeg = (TH1F*) h2TrackMatchResPhiNeg->ProjectionY(Form("%s_hTrackMatchProjClusEnPhiNeg",histoTag.Data()),binMin, 1000);
399  hTrackMatchResPhiPos = (TH1F*) h2TrackMatchResPhiPos->ProjectionY(Form("%s_hTrackMatchProjClusEnPhiPos",histoTag.Data()),binMin, 1000);
400 
401  hTrackMatchResEtaNeg->SetXTitle("#Delta #eta, #Delta #varphi");
402  hTrackMatchResEtaNeg->SetYTitle("Entries");
403  hTrackMatchResEtaNeg->SetTitle("Track-cluster residuals, #it{E} > 1 GeV");
404  hTrackMatchResEtaNeg->SetTitleOffset(1.5,"Y");
405  hTrackMatchResEtaNeg->SetAxisRange(-0.025,0.025,"X");
406  hTrackMatchResEtaNeg->Sumw2();
407  hTrackMatchResEtaNeg->SetMarkerStyle(25);
408  hTrackMatchResEtaNeg->SetMarkerColor(2);
409  hTrackMatchResEtaNeg->Draw("");
410 
411  hTrackMatchResEtaPos->Sumw2();
412  hTrackMatchResEtaPos->SetMarkerStyle(25);
413  hTrackMatchResEtaPos->SetMarkerColor(4);
414  hTrackMatchResEtaPos->Draw("same");
415 
416  hTrackMatchResPhiNeg->Sumw2();
417  hTrackMatchResPhiNeg->SetMarkerStyle(24);
418  hTrackMatchResPhiNeg->SetMarkerColor(2);
419  hTrackMatchResPhiNeg->Draw("same");
420 
421  hTrackMatchResPhiPos->Sumw2();
422  hTrackMatchResPhiPos->SetMarkerStyle(24);
423  hTrackMatchResPhiPos->SetMarkerColor(4);
424  hTrackMatchResPhiPos->Draw("same");
425 
426  TLine l0(0,hTrackMatchResEtaNeg->GetMinimum(),0,hTrackMatchResEtaNeg->GetMaximum()*1.);
427  l0.Draw("same");
428 
429  TLegend l3(0.55,0.7,0.83,0.85);
430  l3.SetTextSize(0.04);
431  l3.AddEntry(hTrackMatchResEtaNeg,"#Delta #eta, Negative","P");
432  l3.AddEntry(hTrackMatchResEtaPos,"#Delta #eta, Positive","P");
433  l3.AddEntry(hTrackMatchResPhiNeg,"#Delta #varphi, Negative","P");
434  l3.AddEntry(hTrackMatchResPhiPos,"#Delta #varphi, Positive","P");
435  l3.SetBorderSize(0);
436  l3.SetFillColor(0);
437  l3.Draw();
438  }
439 
440  ccalo->Print(Form("%s_CaloHisto_ClusterSpectraAndTrackResiduals.%s",histoTag.Data(),format.Data()));
441 
442  // cleanup or save
443  //
444  if(exportToFile!=1)
445  {
446  delete hCellAmplitude;
447  delete hTrackMatchResEtaNeg;
448  delete hTrackMatchResEtaPos;
449  delete hTrackMatchResPhiNeg;
450  delete hTrackMatchResPhiPos;
451 
452  delete ccalo;
453  }
454  else
455  {
456  SaveHisto(hCellAmplitude ,kFALSE);
457  SaveHisto(hTrackMatchResEtaNeg,kFALSE);
458  SaveHisto(hTrackMatchResEtaPos,kFALSE);
459  SaveHisto(hTrackMatchResPhiNeg,kFALSE);
460  SaveHisto(hTrackMatchResPhiPos,kFALSE);
461 
462  SaveCanvas(ccalo);
463  }
464 
465  //-----------------------------
466  // Cell and cluster hit maps
467  //
468  TCanvas * ccalo2 = new TCanvas(Form("%s_CaloHisto_CellClusterHit" ,histoTag.Data()),
469  Form("Cell and cluster hit maps for %s",histoTag.Data()),
470  1000,1000);
471  ccalo2->Divide(2,2);
472 
473  ccalo2->cd(1);
474  gPad->SetLogz();
475 
476  TH2F* hCellActivity = (TH2F*) GetHisto("QA_Cell_hGridCells");
477  if(hCellActivity)
478  {
479  if(icalo == 0) hCellActivity->SetAxisRange( 0,127,"Y");
480  else hCellActivity->SetAxisRange(128,220,"Y");
481  hCellActivity->SetTitle("Hits per cell (#it{E} > 0.2 GeV)");
482  hCellActivity->SetTitleOffset(1.5,"Y");
483  hCellActivity->SetZTitle("Entries");
484  hCellActivity->SetTitleOffset(1.5,"Z");
485  hCellActivity->Draw("colz");
486  }
487  ccalo2->cd(2);
488 
489  TH2F* hCellActivityE = (TH2F*) GetHisto("QA_Cell_hGridCellsE");
490  if(hCellActivityE)
491  {
492  if(icalo == 0) hCellActivityE->SetAxisRange( 0,127,"Y");
493  else hCellActivityE->SetAxisRange(128,220,"Y");
494 
495  hCellActivityE->SetTitle("Mean energy per cell (#it{E} > 0.2 GeV)");
496 
497  if(icalo != 1 && !histoTag.Contains("default")) // ratio already done for calo=0
498  hCellActivityE->Divide(hCellActivity);
499 
500  hCellActivityE->SetTitleOffset(1.5,"Y");
501  hCellActivityE->SetZTitle("#Sigma #it{E}_{cell} / Entries_{per cell}");
502  hCellActivityE->SetTitleOffset(1.5,"Z");
503 
504  hCellActivityE->Draw("colz");
505  }
506  ccalo2->cd(3);
507  gPad->SetLogz();
508 
509  TH2F* hClusterActivity = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hEBin0_Cluster_ColRow_PID",icalo));
510 
511  if(histoTag.Contains("default")) hClusterActivity->SetTitle("Clusters per col-row 0.5<#it{E}<3 GeV");
512  else if(histoTag.Contains("L0")) hClusterActivity->SetTitle("Clusters per col-row 2<#it{E}<5 GeV");
513  else hClusterActivity->SetTitle("Clusters per col-row 5<#it{E}<12 GeV");
514 
515  hClusterActivity->SetTitleOffset(1.5,"Y");
516  hClusterActivity->SetZTitle("Entries");
517  hClusterActivity->SetTitleOffset(1.5,"Z");
518 
519  hClusterActivity->Draw("colz");
520 
521  ccalo2->cd(4);
522  gPad->SetLogz();
523 
524  TH2F* hClusterActivity2 = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hEBin1_Cluster_ColRow_PID",icalo));
525 
526  if(histoTag.Contains("default")) hClusterActivity2->SetTitle("Clusters per col-row #it{E} > 3 GeV");
527  else if(histoTag.Contains("L0")) hClusterActivity2->SetTitle("Clusters per col-row #it{E} > 5 GeV");
528  else hClusterActivity2->SetTitle("Clusters per col-row #it{E} > 12 GeV");
529 
530  hClusterActivity2->SetTitleOffset(1.5,"Y");
531  hClusterActivity2->SetZTitle("Entries");
532  hClusterActivity2->SetTitleOffset(1.5,"Z");
533 
534  hClusterActivity2->Draw("colz");
535 
536  ccalo2->Print(Form("%s_CaloHisto_CellClusterHit.%s",histoTag.Data(),format.Data()));
537 
538  // cleanup or save
539  //
540  if(exportToFile!=1) delete ccalo2;
541  else SaveCanvas(ccalo2);
542 
543  //-----------------------------
544  // Cluster time, shape, ncells
545  //
546  TCanvas * ccalo3 = new TCanvas(Form("%s_CaloHisto_ClusterTimeShape" ,histoTag.Data()),
547  Form("Cluster time, shape, ncells for %s",histoTag.Data()),
548  1000,1000);
549  ccalo3->Divide(2,2);
550 
551  ccalo3->cd(1);
552 
553  gPad->SetLogz();
554 
555  TH2F* hClusterTime = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hTimePt",icalo));
556  hClusterTime->SetTitle("Cluster #it{E} vs #it{time}");
557  hClusterTime->SetYTitle("#it{time} (ns)");
558  //hClusterTime->SetAxisRange(300.,900.,"Y");
559  hClusterTime->SetAxisRange(0.,30.,"X");
560  hClusterTime->SetTitleOffset(1.5,"Y");
561  hClusterTime->SetZTitle("Entries");
562  hClusterTime->SetTitleOffset(1.5,"Z");
563  hClusterTime->Draw("colz");
564 
565  ccalo3->cd(2);
566 
567  gPad->SetLogz();
568 
569  TH2F* hClusterL0 = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hLam0E",icalo));
570  hClusterL0->SetTitle("Cluster #sigma_{long}");
571  hClusterL0->SetAxisRange(0.,30.,"X");
572  hClusterL0->SetTitleOffset(1.5,"Y");
573  hClusterL0->SetZTitle("Entries");
574  hClusterL0->SetTitleOffset(1.5,"Z");
575 
576  hClusterL0->Draw("colz");
577 
578  ccalo3->cd(3);
579 
580  gPad->SetLogz();
581 
582  TH2F* hClusterNCell = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hNCellsE",icalo));
583  hClusterNCell->SetTitle("Number of cells in cluster");
584  hClusterNCell->SetAxisRange(0.,30.,"X");
585  hClusterNCell->SetTitleOffset(1.5,"Y");
586  hClusterNCell->SetZTitle("Entries");
587  hClusterNCell->SetTitleOffset(1.5,"Z");
588 
589  hClusterNCell->Draw("colz");
590 
591  ccalo3->cd(4);
592 
593  gPad->SetLogz();
594 
595  TH2F* hClusterECell = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hCellsE",icalo));
596  hClusterECell->SetTitle("cells in cluster #it{E} vs cluster #it{E}");
597  hClusterECell->SetAxisRange(0.,30.,"X");
598  hClusterECell->SetAxisRange(0.,20.,"Y");
599  hClusterECell->SetTitleOffset(1.5,"Y");
600  hClusterECell->SetZTitle("Entries");
601  hClusterECell->SetTitleOffset(1.5,"Z");
602 
603  hClusterECell->Draw("colz");
604 
605  ccalo3->Print(Form("%s_CaloHisto_TimeShapeNCells.%s",histoTag.Data(),format.Data()));
606 
607  // cleanup or save
608  //
609  if(exportToFile!=1) delete ccalo3;
610  else SaveCanvas(ccalo3);
611 
612 }
613 
620 //______________________________________
621 void TrackQA()
622 {
623  TCanvas * ctrack = new TCanvas(Form("%s_TrackHisto" ,histoTag.Data()),
624  Form("Hybrid tracks for %s",histoTag.Data()),
625  1000,1000);
626  ctrack->Divide(2,2);
627 
628  ctrack->cd(1);
629  //gPad->SetLogz();
630  TH2F * hTrackEtaPhi = (TH2F*) GetHisto("AnaHadrons_hEtaPhiNegative");
631  if(!hTrackEtaPhi) return;
632  hTrackEtaPhi ->Add( (TH2F*) GetHisto("AnaHadrons_hEtaPhiPositive"));
633  hTrackEtaPhi ->SetAxisRange(-0.9,0.9,"X");
634  hTrackEtaPhi ->SetTitleOffset(1.5,"Y");
635  hTrackEtaPhi ->SetTitle("Hybrid tracks #eta vs #varphi #it{p}_{T} > 0.2 GeV/#it{c}");
636  hTrackEtaPhi->SetZTitle("Entries");
637  hTrackEtaPhi->SetTitleOffset(1.5,"Z");
638 
639  hTrackEtaPhi ->Draw("colz");
640 
641  ctrack->cd(2);
642  //gPad->SetLogy();
643  TH2F * hTrackEtaPhiSPD = (TH2F*) GetHisto("AnaHadrons_hEtaPhiSPDRefitPt02");
644  TH2F * hTrackEtaPhiNoSPD = (TH2F*) GetHisto("AnaHadrons_hEtaPhiNoSPDRefitPt02");
645 
646  TH1F* hPhiSPD = (TH1F*)hTrackEtaPhiSPD ->ProjectionY(Form("%s_hTrackPhiSPD" ,histoTag.Data()),0,1000);
647  TH1F* hPhiNoSPD = (TH1F*)hTrackEtaPhiNoSPD->ProjectionY(Form("%s_hTrackPhiNoSPD",histoTag.Data()),0,1000);
648  TH1F* hPhi = (TH1F*)hPhiSPD->Clone( Form("%s_hTrackPhi" ,histoTag.Data()));
649  hPhi->Add(hPhiNoSPD);
650 
651  hPhi ->SetTitle("Hybrid track type #varphi, 0.2<#it{p}_{T}<2 GeV/#it{c}");
652  hPhi ->SetLineColor(1);
653  hPhiSPD ->SetLineColor(2);
654  hPhiNoSPD->SetLineColor(4);
655 
656  hPhi ->SetMinimum(1);
657  hPhi ->SetMaximum(hPhi->GetMaximum()*1.3);
658  hPhi ->SetTitleOffset(1.5,"Y");
659  hPhi ->SetYTitle("Entries");
660 
661  TGaxis::SetMaxDigits(3);
662 
663  hPhi ->Draw("H");
664  hPhiSPD ->Draw("Hsame");
665  hPhiNoSPD->Draw("Hsame");
666 
667  TLegend l(0.2,0.75,0.4,0.89);
668  l.SetTextSize(0.04);
669  l.AddEntry(hPhi,"Sum","L");
670  l.AddEntry(hPhiSPD ,"SPD+Refit","L");
671  l.AddEntry(hPhiNoSPD,"No SPD+Refit","L");
672  l.SetBorderSize(0);
673  l.SetFillColor(0);
674  l.Draw();
675 
676  ctrack->cd(3);
677  gPad->SetLogy();
678 
679  TH1F* hTOF = (TH1F*) GetHisto("AnaHadrons_hTOFSignalPtCut");
680  hTOF->SetYTitle("Entries");
681  hTOF->SetTitleOffset(1.5,"Y");
682 
683  hTOF->Draw("");
684 
685  ctrack->cd(4);
686  gPad->SetLogy();
687  gPad->SetLogx();
688 
689  TH1F* hPt = (TH1F*) GetHisto("AnaHadrons_hPt");
690  TH1F* hPtSPD = (TH1F*) GetHisto("AnaHadrons_hPtSPDRefit");
691  TH1F* hPtNoSPD = (TH1F*) GetHisto("AnaHadrons_hPtNoSPDRefit");
692  hPt ->SetLineColor(1);
693  hPtSPD ->SetLineColor(2);
694  hPtNoSPD->SetLineColor(4);
695 
696  hPt ->SetTitle("Hybrid track type #it{p}_{T}");
697  hPt ->SetYTitle("Entries");
698  hPt ->SetTitleOffset(1.5,"Y");
699 
700  hPt ->Draw("");
701  hPtSPD ->Draw("same");
702  hPtNoSPD->Draw("same");
703 
704 // ctrack->cd(3);
705 // gPad->SetLogz();
706 //
707 // TH2F* hPtDCAxy = (TH2F*) GetHisto("AnaHadrons_hPtDCAxy");
708 // hPtDCAxy->SetAxisRange(-1,1,"Y");
709 // hPtDCAxy->SetAxisRange(0,30,"X");
710 // hPtDCAxy->Draw("colz");
711 //
712 // ctrack->cd(4);
713 // gPad->SetLogz();
714 //
715 // TH2F* hPtDCAz = (TH2F*) GetHisto("AnaHadrons_hPtDCAz");
716 // hPtDCAz->SetAxisRange(-1,1,"Y");
717 // hPtDCAz->SetAxisRange(0,30,"X");
718 // hPtDCAz->Draw("colz");
719 
720  ctrack->Print(Form("%s_TrackHisto.%s",histoTag.Data(),format.Data()));
721 
722  // cleanup or save
723  //
724  if(exportToFile!=1)
725  {
726  delete hPhi;
727  delete hPhiSPD;
728  delete hPhiNoSPD;
729 
730  delete ctrack;
731  }
732  else
733  {
734  SaveHisto(hPhi ,kFALSE);
735  SaveHisto(hPhiSPD ,kFALSE);
736  SaveHisto(hPhiNoSPD,kFALSE);
737 
738  SaveCanvas(ctrack);
739  }
740 }
741 
750 //_____________________________
751 void Pi0QA(Int_t icalo)
752 {
753  TCanvas * cpi0 = new TCanvas(Form("%s_InvariantMassHisto" ,histoTag.Data()),
754  Form("Neutral mesons inv. mass for %s",histoTag.Data()),
755  1000,1000);
756  cpi0->Divide(2,2);
757 
758  TH2F* hMassE[10];
759  TH2F* hMixMassE[10];
760  for(Int_t icen = 0; icen < 10; icen++)
761  {
762  hMassE [icen] = (TH2F*) GetHisto(Form("AnaPi0_Calo%d_hRe_cen%d_pidbit0_asy0_dist1",icalo,icen));
763  hMixMassE[icen] = (TH2F*) GetHisto(Form("AnaPi0_Calo%d_hMi_cen%d_pidbit0_asy0_dist1",icalo,icen));
764  }
765  if(!hMassE[0]) return;
766 
767  // 2D Invariant mass vs E, in PbPb from 60 to 100 %, all in pp
768  cpi0->cd(1);
769  gPad->SetLogz();
770  TH2F* h2DMass;
771 
772  if(hMassE[1]) // Plot centrality from 60 to 100%
773  {
774  h2DMass = (TH2F*) hMassE[6]->Clone(Form("%s_h2DMass",histoTag.Data()));
775  for(Int_t icen = 7; icen < 10; icen++) h2DMass->Add(hMassE[icen]);
776  h2DMass->SetTitle("Inv. mass vs #it{p}_{T,pair}, Cen: 60-100%");
777  }
778  else
779  {
780  h2DMass = (TH2F*) hMassE[0]->Clone(Form("%s_h2DMass",histoTag.Data()));
781  h2DMass->SetTitle("Inv. mass vs #it{p}_{T,pair}");
782  }
783 
784  h2DMass->SetTitleOffset(1.5,"Y");
785  h2DMass->SetAxisRange(0.0,0.7,"Y");
786  h2DMass->SetAxisRange(0,30,"X");
787  h2DMass->Draw("colz");
788 
789  // Pi0 Invariant mass projection, in PbPb 6 centrality bins from 0 to 50%, all in pp
790  cpi0->cd(2);
791  TH1F* hMass [10];
792  TH1F* hMix [10];
793  TH1F* hMassEta[10];
794  TH1F* hMassPi0[10];
795 
796  //Init to 0
797  for(Int_t icen=0; icen<10; icen++ )
798  {
799  hMass [icen] = 0;
800  hMix [icen] = 0;
801  hMassEta[icen] = 0;
802  hMassPi0[icen] = 0;
803  }
804 
805  TH1F * hX = (TH1F*) hMassE[0]->ProjectionX(Form("%s_hEPairCen0",histoTag.Data()),0,10000);
806  Int_t binmin = hX->FindBin(2); // Project histo from 2 GeV pairs
807  Int_t binmax = hX->FindBin(10); // Project histo up to 10 GeV pairs
808  if(histoTag.Contains("L0"))
809  {
810  binmin = hX->FindBin(5); // Project histo from 5 GeV pairs
811  binmax = hX->FindBin(10); // Project histo up to 10 GeV pairs
812  }
813  else if(histoTag.Contains("L2"))
814  {
815  binmin = hX->FindBin(8); // Project histo from 8 GeV pairs
816  binmax = hX->FindBin(12); // Project histo up to 12 GeV pairs
817  }
818  else if(histoTag.Contains("L1"))
819  {
820  binmin = hX->FindBin(10); // Project histo from 10 GeV pairs
821  binmax = hX->FindBin(15); // Project histo up to 15 GeV pairs
822  }
823 
824  Float_t maxPi0 = 0;
825  Float_t maxEta = 0;
826  Float_t minPi0 = 1e6;
827  Float_t minEta = 1e6;
828  for(Int_t icen = 0; icen < 6; icen++)
829  {
830  if(!hMassE[icen]) continue;
831 
832  hMass[icen] = (TH1F*) hMassE [icen]->ProjectionY(Form("%s_hMassCen%d",histoTag.Data(),icen),binmin,binmax);
833  hMix [icen] = (TH1F*) hMixMassE[icen]->ProjectionY(Form("%s_hMixCen%d" ,histoTag.Data(),icen),binmin,binmax);
834  hMass[icen]->Sumw2();
835  hMix [icen]->Sumw2();
836 
837  hMassPi0[icen] = (TH1F*) hMass[icen]->Clone(Form("%s_hMassPi0Cen%d",histoTag.Data(),icen));
838  hMassEta[icen] = (TH1F*) hMass[icen]->Clone(Form("%s_hMassEtaCen%d",histoTag.Data(),icen));
839 
840  hMassPi0[icen]->Divide(hMix[icen]);
841  hMassPi0[icen]->Fit("pol0","Q","",0.25,0.35);
842  Float_t scale = 1;
843  if(hMassPi0[icen]->GetFunction("pol0")) scale = hMassPi0[icen]->GetFunction("pol0")->GetParameter(0);
844  //printf("Scale factor %f for cen %d\n",scale,icen);
845  hMassPi0[icen]->Scale(1./scale);
846  hMassPi0[icen]->SetMarkerStyle(24);
847  hMassPi0[icen]->SetMarkerColor(color[icen]);
848  hMassPi0[icen]->SetLineColor(color[icen]);
849  hMassPi0[icen]->SetAxisRange(0.04,0.24);
850  //hMassPi0[icen]->SetMarkerSize(0.5);
851 
852  hMassEta[icen]->Rebin(4);
853  hMix [icen]->Rebin(4);
854  hMassEta[icen]->Divide(hMix[icen]);
855  hMassEta[icen]->SetMarkerStyle(25);
856  hMassEta[icen]->SetMarkerColor(color[icen]);
857  hMassEta[icen]->SetLineColor(color[icen]);
858  hMassEta[icen]->SetAxisRange(0.4,0.9);
859  //hMassEta[icen]->SetMarkerSize(0.5);
860  hMassEta[icen]->Scale(1./scale);
861 
862  if(maxEta < hMassEta[icen]->GetMaximum()) maxEta = hMassEta[icen]->GetMaximum();
863  if(maxPi0 < hMassPi0[icen]->GetMaximum()) maxPi0 = hMassPi0[icen]->GetMaximum();
864 
865  if(minEta > hMassEta[icen]->GetMinimum()) minEta = hMassEta[icen]->GetMinimum();
866  if(minPi0 > hMassPi0[icen]->GetMinimum()) minPi0 = hMassPi0[icen]->GetMinimum();
867  }
868 
869  //gPad->SetLogy();
870  //gPad->SetGridy();
871  hMassPi0[0]->SetMinimum(minPi0);
872  hMassPi0[0]->SetTitleOffset(1.5,"Y");
873  hMassPi0[0]->SetYTitle("Real / Mixed");
874  hMassPi0[0]->SetTitle("#pi^{0} peak, 2 < #it{E}_{pair}< 10 GeV");
875  if (histoTag.Contains("L0")) hMassPi0[0]->SetTitle("#pi^{0} peak, 5 < #it{E}_{pair}< 10 GeV");
876  else if(histoTag.Contains("L2")) hMassPi0[0]->SetTitle("#pi^{0} peak, 8 < #it{E}_{pair}< 12 GeV");
877  else if(histoTag.Contains("L1")) hMassPi0[0]->SetTitle("#pi^{0} peak, 10 < #it{E}_{pair}< 15 GeV");
878 
879  hMassPi0[0]->Draw();
880 
881  if(hMass[1]) // PbPb
882  {
883  hMassPi0[0]->SetMaximum(maxPi0*1.2);
884  hMassPi0[5]->Draw("Hsame");
885  hMassPi0[4]->Draw("Hsame");
886  hMassPi0[3]->Draw("Hsame");
887  hMassPi0[2]->Draw("Hsame");
888  hMassPi0[1]->Draw("Hsame");
889  hMassPi0[0]->Draw("Hsame");
890  //hMass[6]->Draw("Hsame");
891  //hMass[7]->Draw("same");
892  //hMass[8]->Draw("same");
893  //hMass[9]->Draw("same");
894 
895  TLegend l(0.12,0.6,0.4,0.85);
896  l.SetTextSize(0.04);
897  l.AddEntry(hMassPi0[0],"0-10%","P");
898  l.AddEntry(hMassPi0[1],"10-20%","P");
899  l.AddEntry(hMassPi0[2],"20-30%","P");
900  l.AddEntry(hMassPi0[3],"30-40%","P");
901  l.AddEntry(hMassPi0[4],"40-70%","P");
902  l.AddEntry(hMassPi0[5],"50-60%","P");
903  l.SetBorderSize(0);
904  l.SetFillColor(0);
905  l.Draw();
906  }
907 
908  TLine l1(0.04,1,0.24,1);
909  l1.Draw("same");
910 
911  // Pi0 invariant mass per EMCal super module
912  cpi0->cd(3);
913 
914  TH1F* hSM [20];
915  TH1F* hMixSM[20];
916 
917  //Init to 0
918  for(Int_t ism = 0; ism < 20; ism++)
919  {
920  hSM [ism] = 0;
921  hMixSM[ism] = 0;
922  }
923 
924  binmin = hX->FindBin(4); // Project histo from 3 GeV pairs
925  binmax = hX->FindBin(20); // Project histo up to 20 GeV pairs
926  Float_t maxSM = 0;
927 
928  Int_t first = 0;
929  if(icalo==1) first = 12;
930 
931  for(Int_t ism = first; ism < 20; ism++)
932  {
933  TH2F* hTmpSM = (TH2F*) GetHisto(Form("AnaPi0_Calo%d_hReMod_%d",icalo,ism));
934  if(!hTmpSM) continue;
935 
936  hSM[ism] = (TH1F*) hTmpSM->ProjectionY(Form("%s_hMassSM%d",histoTag.Data(),ism),binmin,binmax);
937  hSM[ism]->Sumw2();
938  hSM[ism]->SetMarkerStyle(26);
939  hSM[ism]->Rebin(2);
940  //hSM[ism]->Scale(1./hSM[ism]->Integral(0,10000));
941  hSM[ism]->SetMarkerColor(color[ism-first]);
942  hSM[ism]->SetLineColor(color[ism-first]);
943  //hSM[ism]->SetMarkerSize(0.5);
944 
945  TH2F* hTmpMixSM = (TH2F*) GetHisto(Form("AnaPi0_hMiMod_%d",ism));
946  if(hTmpMixSM)
947  {
948  hMixSM[ism] = (TH1F*) hTmpMixSM->ProjectionY(Form("%s_hMassMixSM%d",histoTag.Data(),ism),binmin,binmax);
949  hMixSM[ism]->Sumw2();
950  hMixSM[ism]->Rebin(2);
951  hSM[ism]->Divide(hMixSM[ism]);
952  hSM[ism]->Fit("pol0","Q","",0.25,0.35);
953  Float_t scale = 1;
954  if(hSM[ism]->GetFunction("pol0")) scale = hSM[ism]->GetFunction("pol0")->GetParameter(0);
955  //printf("Scale factor %f for cen %d\n",scale,icen);
956  hSM[ism]->Scale(1./scale);
957  }
958 
959  if(maxSM < hSM[ism]->GetMaximum()) maxSM = hSM[ism]->GetMaximum();
960  }
961 
962  hSM[first]->SetTitle("#pi^{0} peak in SM, 4 < #it{E}_{pair}< 10 GeV");
963  hSM[first]->SetTitleOffset(1.5,"Y");
964  hSM[first]->SetAxisRange(0.04,0.24);
965  hSM[first]->SetMaximum(maxSM*1.2);
966  hSM[first]->SetMinimum(0.8);
967  hSM[first]->SetYTitle("Real / Mixed");
968 
969  hSM[first]->Draw("H");
970  TLegend lsm(0.12,0.5,0.35,0.85);
971  lsm.SetTextSize(0.04);
972  lsm.AddEntry(hSM[first],Form("Mod %d",first),"P");
973 
974  for(Int_t ism = first+1; ism < 20; ism++)
975  {
976  if(!hSM[ism]) continue;
977 
978  hSM[ism]->Draw("Hsame");
979  lsm.AddEntry(hSM[ism],Form("Mod %d",ism),"P");
980  }
981 
982  lsm.SetBorderSize(0);
983  lsm.SetFillColor(0);
984  lsm.Draw();
985 
986  l1.Draw("same");
987 
988  // Pi0 Invariant mass projection, in PbPb 6 centrality bins from 0 to 50%, all in pp
989  cpi0->cd(4);
990 
991  //gPad->SetLogy();
992  //gPad->SetGridy();
993  hMassEta[0]->SetMinimum(minEta);
994  hMassEta[0]->SetTitleOffset(1.5,"Y");
995  hMassEta[0]->SetYTitle("Real / Mixed");
996  hMassEta[0]->SetTitle("#eta peak, 2 <#it{E}_{pair}< 10 GeV");
997  if (histoTag.Contains("L0")) hMassEta[0]->SetTitle("#eta peak, 5 < #it{E}_{pair}< 10 GeV");
998  else if(histoTag.Contains("L2")) hMassEta[0]->SetTitle("#eta peak, 8 < #it{E}_{pair}< 12 GeV");
999  else if(histoTag.Contains("L1")) hMassEta[0]->SetTitle("#eta peak, 10 < #it{E}_{pair}< 15 GeV");
1000 
1001  hMassEta[0]->Draw("H");
1002 
1003  if(hMass[1]) // PbPb
1004  {
1005  hMassEta[0]->SetMaximum(maxEta*1.2);
1006  hMassEta[5]->Draw("Hsame");
1007  hMassEta[4]->Draw("Hsame");
1008  hMassEta[3]->Draw("Hsame");
1009  hMassEta[2]->Draw("Hsame");
1010  hMassEta[1]->Draw("Hsame");
1011  hMassEta[0]->Draw("Hsame");
1012 
1013  TLegend l2(0.12,0.6,0.4,0.85);
1014  l2.SetTextSize(0.04);
1015  l2.AddEntry(hMassEta[0],"0-10%","P");
1016  l2.AddEntry(hMassEta[1],"10-20%","P");
1017  l2.AddEntry(hMassEta[2],"20-30%","P");
1018  l2.AddEntry(hMassEta[3],"30-40%","P");
1019  l2.AddEntry(hMassEta[4],"40-70%","P");
1020  l2.AddEntry(hMassEta[5],"50-60%","P");
1021  l2.SetBorderSize(0);
1022  l2.SetFillColor(0);
1023  l2.Draw();
1024  }
1025 
1026  cpi0->Print(Form("%s_Pi0Histo.%s",histoTag.Data(),format.Data()));
1027 
1028  // cleanup or save
1029  //
1030  if(exportToFile!=1)
1031  {
1032  delete h2DMass;
1033  delete hX;
1034 
1035  for(Int_t icen=0; icen<10; icen++ )
1036  {
1037  if ( hMass [icen] ) delete hMass [icen];
1038  if ( hMix [icen] ) delete hMix [icen];
1039  if ( hMassPi0[icen] ) delete hMassPi0[icen];
1040  if ( hMassEta[icen] ) delete hMassEta[icen];
1041  }
1042 
1043  for(Int_t ism = first; ism < 20; ism++)
1044  {
1045  if ( hSM [ism] ) delete hSM [ism];
1046  if ( hMixSM[ism] ) delete hMixSM[ism];
1047  }
1048 
1049  delete cpi0;
1050  }
1051  else
1052  {
1053  SaveHisto(h2DMass,kFALSE);
1054 
1055  for(Int_t icen=0; icen<10; icen++ )
1056  {
1057  SaveHisto(hMass [icen],kFALSE);
1058  SaveHisto(hMix [icen],kFALSE);
1059  SaveHisto(hMassPi0[icen],kFALSE);
1060  SaveHisto(hMassEta[icen],kFALSE);
1061  }
1062 
1063  for(Int_t ism = first; ism < 20; ism++)
1064  {
1065  SaveHisto(hSM [ism],kFALSE);
1066  SaveHisto(hMixSM[ism],kFALSE);
1067  }
1068 
1069  SaveCanvas(cpi0);
1070  }
1071 }
1072 
1080 //__________________________________________________
1081 void IsolQA(Int_t icalo)
1082 {
1083  TCanvas * cIsolation = new TCanvas(Form("%s_IsolationHisto" ,histoTag.Data()),
1084  Form("Isolation cone for %s",histoTag.Data()),
1085  1000,1000);
1086  cIsolation->Divide(2,2);
1087 
1088  Float_t minClusterE = 5;
1089  if ( histoTag.Contains("L0") ) minClusterE = 5;
1090  else if ( histoTag.Contains("L2") ) minClusterE = 10;
1091  else if ( histoTag.Contains("L1") ) minClusterE = 12;
1092 
1093  TH1F * hIsolated = (TH1F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hPt" ,icalo));
1094  TH1F * hNotIsolated = (TH1F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hPtNoIso",icalo));
1095 
1096  if(!hIsolated) return;
1097 
1098  Int_t minClusterEBin = hIsolated->FindBin(minClusterE);
1099  Float_t nTrig = hIsolated->Integral(minClusterEBin,100000)+hNotIsolated->Integral(minClusterE,100000);
1100 
1101  if ( nTrig <=0 ) return ;
1102 
1103  //
1104  // Pt in cone
1105  //
1106  cIsolation->cd(1);
1107  gPad->SetLogy();
1108 
1109  hIsolated ->Sumw2();
1110  hNotIsolated->Sumw2();
1111  hIsolated ->SetMarkerColor(4);
1112  hNotIsolated->SetMarkerColor(2);
1113  hIsolated ->SetLineColor (4);
1114  hNotIsolated->SetLineColor (2);
1115  hIsolated ->SetMarkerStyle(24);
1116  hNotIsolated->SetMarkerStyle(20);
1117 
1118  hNotIsolated->SetTitle("(non) isolated cluster spectra, #it{R}=0.4, #Sigma #it{p}_{T}<2 GeV/#it{c}");
1119  hNotIsolated->SetYTitle("Entries");
1120 
1121  hNotIsolated->Draw();
1122  hIsolated ->Draw("same");
1123 
1124  TLegend lI(0.4,0.7,0.88,0.88);
1125  lI.SetTextSize(0.04);
1126  lI.SetBorderSize(0);
1127  lI.SetFillColor(0);
1128  lI.AddEntry(hIsolated ,"Isolated candidates","P");
1129  lI.AddEntry(hNotIsolated,"NOT Isolated candidates","P");
1130  lI.Draw("same");
1131 
1132  //
1133  // Pt in cone
1134  //
1135  cIsolation->cd(2);
1136  gPad->SetLogy();
1137 
1138  TLegend l(0.55,0.55,0.88,0.88);
1139  l.SetTextSize(0.04);
1140  l.SetBorderSize(0);
1141  l.SetFillColor(0);
1142 
1143  TH2F* h2PtInCone = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hPtInCone" ,icalo));
1144  TH2F* h2PtInConeCluster = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hPtClusterInCone" ,icalo));
1145  TH2F* h2PtInConeTrack = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hPtTrackInCone" ,icalo));
1146  TH2F* h2PtInConeTrackPerp = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hPtInPerpCone" ,icalo));
1147  TH2F* h2PtInEtaBandTrack = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hEtaBandTrackPt" ,icalo));
1148  TH2F* h2PtInEtaBandCluster = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hEtaBandClusterPt",icalo));
1149 
1150  TH1F* hPtInCone = (TH1F*) h2PtInCone ->ProjectionY(Form("%s_hPtInCone_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1151  TH1F* hPtInConeCluster = (TH1F*) h2PtInConeCluster ->ProjectionY(Form("%s_hPtInConeCluster_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1152  TH1F* hPtInConeTrack = (TH1F*) h2PtInConeTrack ->ProjectionY(Form("%s_hPtInConeTrack_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1153  TH1F* hPtInConeTrackPerp = (TH1F*) h2PtInConeTrackPerp ->ProjectionY(Form("%s_hPtInConePerp_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1154  TH1F* hPtInEtaBandTrack = (TH1F*) h2PtInEtaBandTrack ->ProjectionY(Form("%s_hPtInConeEtaBandTrack_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1155  TH1F* hPtInEtaBandCluster = (TH1F*) h2PtInEtaBandCluster->ProjectionY(Form("%s_hPtInConeEtaBandCluster_TrigEnMin%2.0fGeV",histoTag.Data(),minClusterE),minClusterEBin,10000);
1156 
1157  hPtInCone ->Sumw2();
1158  hPtInConeCluster ->Sumw2();
1159  hPtInConeTrack ->Sumw2();
1160  hPtInConeTrackPerp ->Sumw2();
1161  hPtInEtaBandCluster->Sumw2();
1162  hPtInEtaBandTrack ->Sumw2();
1163 
1164  Int_t rb = 1;
1165  hPtInCone ->Rebin(rb);
1166  hPtInConeCluster ->Rebin(rb);
1167  hPtInConeTrack ->Rebin(rb);
1168  hPtInConeTrackPerp ->Rebin(rb);
1169  hPtInEtaBandCluster->Rebin(rb);
1170  hPtInEtaBandTrack ->Rebin(rb);
1171 
1172  hPtInCone ->Scale(1./nTrig);
1173  hPtInConeCluster ->Scale(1./nTrig);
1174  hPtInConeTrack ->Scale(1./nTrig);
1175  hPtInConeTrackPerp ->Scale(1./nTrig);
1176  hPtInEtaBandCluster->Scale(1./nTrig);
1177  hPtInEtaBandTrack ->Scale(1./nTrig);
1178 
1179  hPtInCone ->SetAxisRange(0,20);
1180  hPtInConeCluster ->SetAxisRange(0,20);
1181  hPtInConeTrack ->SetAxisRange(0,20);
1182  hPtInConeTrackPerp ->SetAxisRange(0,20);
1183  hPtInEtaBandCluster->SetAxisRange(0,20);
1184  hPtInEtaBandTrack ->SetAxisRange(0,20);
1185 
1186  hPtInCone ->SetMarkerStyle(24);
1187  hPtInConeCluster ->SetMarkerStyle(20);
1188  hPtInConeTrack ->SetMarkerStyle(20);
1189  hPtInConeTrackPerp ->SetMarkerStyle(27);
1190  hPtInEtaBandCluster->SetMarkerStyle(21);
1191  hPtInEtaBandTrack ->SetMarkerStyle(21);
1192 
1193  hPtInCone ->SetMarkerColor(1);
1194  hPtInConeCluster ->SetMarkerColor(2);
1195  hPtInConeTrack ->SetMarkerColor(4);
1196  hPtInConeTrackPerp ->SetMarkerColor(4);
1197  hPtInEtaBandCluster->SetMarkerColor(2);
1198  hPtInEtaBandTrack ->SetMarkerColor(4);
1199 
1200  hPtInCone ->SetLineColor(1);
1201  hPtInConeCluster ->SetLineColor(2);
1202  hPtInConeTrack ->SetLineColor(4);
1203  hPtInConeTrackPerp ->SetLineColor(4);
1204  hPtInEtaBandCluster->SetLineColor(2);
1205  hPtInEtaBandTrack ->SetLineColor(4);
1206 
1207  hPtInCone->SetTitleOffset(1.5,"Y");
1208  hPtInCone->SetYTitle("Entries / #it{N}_{candidates}");
1209  hPtInCone->SetTitle(Form("Track/cluster spectra in cone p_{T,cand}>%2.0f GeV/#it{c}, #it{R}=0.4",minClusterE));
1210 
1211  Float_t max = hPtInCone->GetMaximum();
1212  if(max < hPtInConeTrack ->GetMaximum()) max = hPtInConeTrack ->GetMaximum();
1213  if(max < hPtInConeCluster ->GetMaximum()) max = hPtInConeCluster ->GetMaximum();
1214  if(max < hPtInConeTrackPerp ->GetMaximum()) max = hPtInConeTrackPerp ->GetMaximum();
1215  if(max < hPtInEtaBandCluster->GetMaximum()) max = hPtInEtaBandCluster->GetMaximum();
1216  if(max < hPtInEtaBandTrack ->GetMaximum()) max = hPtInEtaBandTrack ->GetMaximum();
1217  hPtInCone->SetMaximum(max*2);
1218 
1219  hPtInCone ->Draw("");
1220  hPtInConeCluster ->Draw("same");
1221  hPtInConeTrack ->Draw("same");
1222  hPtInConeTrackPerp ->Draw("same");
1223  hPtInEtaBandCluster->Draw("same");
1224  hPtInEtaBandTrack ->Draw("same");
1225 
1226  l.AddEntry(hPtInCone ,"Tracks+Clusters","P");
1227  l.AddEntry(hPtInConeCluster ,"Clusters inside cone","P");
1228  l.AddEntry(hPtInConeTrack ,"Tracks inside cone","P");
1229  l.AddEntry(hPtInConeTrackPerp ,"Tracks inside #perp cones","P");
1230  l.AddEntry(hPtInEtaBandTrack ,"Tracks #eta band","P");
1231  l.AddEntry(hPtInEtaBandCluster,"Clusters #eta band","P");
1232 
1233  l.Draw("same");
1234 
1235  //
1236  // Sum Pt in cone
1237  //
1238  cIsolation->cd(3);
1239  gPad->SetLogy();
1240 
1241  TLegend l2(0.55,0.55,0.88,0.88);
1242  l2.SetTextSize(0.04);
1243  l2.SetBorderSize(0);
1244  l2.SetFillColor(0);
1245 
1246  TH2F* h2SumPtCone = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hConePtSum" ,icalo));
1247  TH2F* h2SumPtConeCluster = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hConePtSumCluster" ,icalo));
1248  TH2F* h2SumPtConeTrack = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hConePtSumTrack" ,icalo));
1249  TH2F* h2SumPtConeTrackPerp = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hPerpConePtSum" ,icalo));
1250  TH2F* h2SumPtEtaBandTrack = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hConeSumPtEtaUENormTrack" ,icalo));
1251  TH2F* h2SumPtEtaBandCluster = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hConeSumPtEtaUENormCluster",icalo));
1252  TH2F* h2SumPtConeSubTrack = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hConeSumPtEtaUESubTrack" ,icalo));
1253  TH2F* h2SumPtConeSubCluster = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hConeSumPtEtaUESubCluster" ,icalo));
1254  TH2F* h2SumPtConeSub = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hConeSumPtEtaUESub" ,icalo));
1255 
1256  TH1F* hSumPtCone = (TH1F*) h2SumPtCone ->ProjectionY(Form("%s_hSumPtCone_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1257  TH1F* hSumPtConeCluster = (TH1F*) h2SumPtConeCluster ->ProjectionY(Form("%s_hSumPtConeCluster_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1258  TH1F* hSumPtConeTrack = (TH1F*) h2SumPtConeTrack ->ProjectionY(Form("%s_hSumPtConeTrack_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1259  TH1F* hSumPtConeTrackPerp = (TH1F*) h2SumPtConeTrackPerp ->ProjectionY(Form("%s_hSumPtConePerp_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1260  TH1F* hSumPtEtaBandTrack = (TH1F*) h2SumPtEtaBandTrack ->ProjectionY(Form("%s_hSumPtConeEtaBandTrack_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1261  TH1F* hSumPtEtaBandCluster = (TH1F*) h2SumPtEtaBandCluster->ProjectionY(Form("%s_hSumPtConeEtaBandCluster_TrigEnMin%2.0fGeV",histoTag.Data(),minClusterE),minClusterEBin,10000);
1262  TH1F* hSumPtConeSub = (TH1F*) h2SumPtConeSub ->ProjectionY(Form("%s_hSumPtConeSub_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1263  TH1F* hSumPtConeSubCluster = (TH1F*) h2SumPtConeSubCluster->ProjectionY(Form("%s_hSumPtConeSubCluster_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1264  TH1F* hSumPtConeSubTrack = (TH1F*) h2SumPtConeSubTrack ->ProjectionY(Form("%s_hSumPtConeSubTrack_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1265 
1266  hSumPtCone ->Sumw2();
1267  hSumPtConeCluster ->Sumw2();
1268  hSumPtConeTrack ->Sumw2();
1269  hSumPtConeSub ->Sumw2();
1270  hSumPtConeSubCluster->Sumw2();
1271  hSumPtConeSubTrack ->Sumw2();
1272  hSumPtConeTrackPerp ->Sumw2();
1273  hSumPtEtaBandCluster->Sumw2();
1274  hSumPtEtaBandTrack ->Sumw2();
1275 
1276  rb = 1;
1277  hSumPtCone ->Rebin(rb);
1278  hSumPtConeCluster ->Rebin(rb);
1279  hSumPtConeTrack ->Rebin(rb);
1280  hSumPtConeSub ->Rebin(rb);
1281  hSumPtConeSubCluster->Rebin(rb);
1282  hSumPtConeSubTrack ->Rebin(rb);
1283  hSumPtConeTrackPerp ->Rebin(rb);
1284  hSumPtEtaBandCluster->Rebin(rb);
1285  hSumPtEtaBandTrack ->Rebin(rb);
1286 
1287  hSumPtCone ->Scale(1./nTrig);
1288  hSumPtConeCluster ->Scale(1./nTrig);
1289  hSumPtConeTrack ->Scale(1./nTrig);
1290  hSumPtConeSub ->Scale(1./nTrig);
1291  hSumPtConeSubCluster->Scale(1./nTrig);
1292  hSumPtConeSubTrack ->Scale(1./nTrig);
1293  hSumPtConeTrackPerp ->Scale(1./nTrig);
1294  hSumPtEtaBandCluster->Scale(1./nTrig);
1295  hSumPtEtaBandTrack ->Scale(1./nTrig);
1296 
1297  hSumPtCone ->SetAxisRange(0,500);
1298  hSumPtConeCluster ->SetAxisRange(0,500);
1299  hSumPtConeTrack ->SetAxisRange(0,500);
1300  hSumPtConeSub ->SetAxisRange(-5,500);
1301  hSumPtConeSubCluster->SetAxisRange(-5,500);
1302  hSumPtConeSubTrack ->SetAxisRange(-5,500);
1303  hSumPtConeTrackPerp ->SetAxisRange(0,500);
1304  hSumPtEtaBandCluster->SetAxisRange(0,500);
1305  hSumPtEtaBandTrack ->SetAxisRange(0,500);
1306 
1307  hSumPtCone ->SetMarkerStyle(24);
1308  hSumPtConeCluster ->SetMarkerStyle(20);
1309  hSumPtConeTrack ->SetMarkerStyle(20);
1310  hSumPtConeSub ->SetMarkerStyle(25);
1311  hSumPtConeSubCluster->SetMarkerStyle(25);
1312  hSumPtConeSubTrack ->SetMarkerStyle(25);
1313  hSumPtConeTrackPerp ->SetMarkerStyle(27);
1314  hSumPtEtaBandCluster->SetMarkerStyle(21);
1315  hSumPtEtaBandTrack ->SetMarkerStyle(21);
1316 
1317  hSumPtCone ->SetMarkerColor(1);
1318  hSumPtConeCluster ->SetMarkerColor(2);
1319  hSumPtConeTrack ->SetMarkerColor(4);
1320  hSumPtConeSub ->SetMarkerColor(1);
1321  hSumPtConeSubCluster->SetMarkerColor(2);
1322  hSumPtConeSubTrack ->SetMarkerColor(4);
1323  hSumPtConeTrackPerp ->SetMarkerColor(4);
1324  hSumPtEtaBandCluster->SetMarkerColor(2);
1325  hSumPtEtaBandTrack ->SetMarkerColor(4);
1326 
1327  hSumPtCone ->SetLineColor(1);
1328  hSumPtConeCluster ->SetLineColor(2);
1329  hSumPtConeTrack ->SetLineColor(4);
1330  hSumPtConeSub ->SetLineColor(1);
1331  hSumPtConeSubCluster->SetLineColor(2);
1332  hSumPtConeSubTrack ->SetLineColor(4);
1333  hSumPtConeTrackPerp ->SetLineColor(4);
1334  hSumPtEtaBandCluster->SetLineColor(2);
1335  hSumPtEtaBandTrack ->SetLineColor(4);
1336 
1337  hSumPtCone->SetTitleOffset(1.5,"Y");
1338  hSumPtCone->SetYTitle("Entries / #it{N}_{candidates}");
1339  hSumPtCone->SetTitle(Form("Track/cluster #Sigma #it{p}_{T}, p_{T,cand}>%2.0f GeV/#it{c}, #it{R}=0.4, ",minClusterE));
1340 
1341  max = hSumPtCone->GetMaximum();
1342  if(max < hSumPtConeTrack ->GetMaximum()) max = hSumPtConeTrack ->GetMaximum();
1343  if(max < hSumPtConeCluster ->GetMaximum()) max = hSumPtConeCluster ->GetMaximum();
1344  if(max < hSumPtConeSub ->GetMaximum()) max = hSumPtConeSub ->GetMaximum();
1345  if(max < hSumPtConeSubTrack ->GetMaximum()) max = hSumPtConeSubTrack ->GetMaximum();
1346  if(max < hSumPtConeSubCluster->GetMaximum()) max = hSumPtConeSubCluster->GetMaximum();
1347  if(max < hSumPtConeTrackPerp ->GetMaximum()) max = hSumPtConeTrackPerp ->GetMaximum();
1348  if(max < hSumPtEtaBandCluster->GetMaximum()) max = hSumPtEtaBandCluster->GetMaximum();
1349  if(max < hSumPtEtaBandTrack ->GetMaximum()) max = hSumPtEtaBandTrack ->GetMaximum();
1350  hSumPtCone->SetMaximum(max*2);
1351 
1352  hSumPtCone ->Draw("");
1353  hSumPtConeCluster ->Draw("same");
1354  hSumPtConeTrack ->Draw("same");
1355 // hSumPtConeSub ->Draw("same");
1356 // hSumPtConeSubCluster->Draw("same");
1357 // hSumPtConeSubTrack ->Draw("same");
1358  hSumPtConeTrackPerp ->Draw("same");
1359  hSumPtEtaBandCluster->Draw("same");
1360  hSumPtEtaBandTrack ->Draw("same");
1361 
1362  l2.AddEntry(hSumPtCone ,"Tracks+Clusters","P");
1363  l2.AddEntry(hSumPtConeCluster ,"Clusters inside cone","P");
1364  l2.AddEntry(hSumPtConeTrack ,"Tracks inside cone","P");
1365  l2.AddEntry(hSumPtConeTrackPerp ,"Tracks inside #perp cones","P");
1366  l2.AddEntry(hSumPtEtaBandTrack ,"Tracks #eta band","P");
1367  l2.AddEntry(hSumPtEtaBandCluster,"Clusters #eta band","P");
1368 // l2.AddEntry(hSumPtConeSub ,"Tracks+Clusters-#eta band","P");
1369 // l2.AddEntry(hSumPtConeSubCluster,"Clusters inside cone-#eta band","P");
1370 // l2.AddEntry(hSumPtConeSubTrack ,"Tracks inside cone-#eta band","P");
1371 
1372  l2.Draw("same");
1373 
1374  //
1375  // Sum Pt in cone, UE subtracted
1376  //
1377  cIsolation->cd(4);
1378  gPad->SetLogy();
1379 
1380  TLegend l3(0.4,0.75,0.8,0.88);
1381  l3.SetTextSize(0.04);
1382  l3.SetBorderSize(0);
1383  l3.SetFillColor(0);
1384 
1385  hSumPtConeSub->SetTitle(Form("Track/Cluster #Sigma #it{p}_{T}-#Sigma #eta band, p_{T,cand}>%2.0f GeV/#it{c}, #it{R}=0.4",minClusterE));
1386  hSumPtConeSub->SetYTitle("Entries / #it{N}_{candidates}");
1387  hSumPtConeSub->SetMaximum(max*2);
1388 
1389  hSumPtConeSub ->Draw("");
1390  hSumPtConeSubCluster->Draw("same");
1391  hSumPtConeSubTrack ->Draw("same");
1392 
1393  l3.AddEntry(hSumPtConeSub ,"Tracks+Clusters-#eta band","P");
1394  l3.AddEntry(hSumPtConeSubCluster,"Clusters inside cone-#eta band","P");
1395  l3.AddEntry(hSumPtConeSubTrack ,"Tracks inside cone-#eta band","P");
1396 
1397  l3.Draw("same");
1398 
1399  cIsolation->Print(Form("%s_IsolationHisto.%s",histoTag.Data(),format.Data()));
1400 
1401  // cleanup or save
1402  //
1403  if(exportToFile!=1)
1404  {
1405  delete hPtInCone ;
1406  delete hPtInConeCluster ;
1407  delete hPtInConeTrack ;
1408  delete hPtInConeTrackPerp ;
1409  delete hPtInEtaBandTrack ;
1410  delete hPtInEtaBandCluster ;
1411 
1412  delete hSumPtCone ;
1413  delete hSumPtConeCluster ;
1414  delete hSumPtConeTrack ;
1415  delete hSumPtConeTrackPerp ;
1416  delete hSumPtEtaBandTrack ;
1417  delete hSumPtEtaBandCluster ;
1418 
1419  delete hSumPtConeSub ;
1420  delete hSumPtConeSubCluster ;
1421  delete hSumPtConeSubTrack ;
1422 
1423  delete cIsolation ;
1424  }
1425  else
1426  {
1427  SaveHisto(hPtInCone ,kFALSE);
1428  SaveHisto(hPtInConeCluster ,kFALSE);
1429  SaveHisto(hPtInConeTrack ,kFALSE);
1430  SaveHisto(hPtInConeTrackPerp ,kFALSE);
1431  SaveHisto(hPtInEtaBandTrack ,kFALSE);
1432  SaveHisto(hPtInEtaBandCluster ,kFALSE);
1433 
1434  SaveHisto(hSumPtCone ,kFALSE);
1435  SaveHisto(hSumPtConeCluster ,kFALSE);
1436  SaveHisto(hSumPtConeTrack ,kFALSE);
1437  SaveHisto(hSumPtConeTrackPerp ,kFALSE);
1438  SaveHisto(hSumPtEtaBandTrack ,kFALSE);
1439  SaveHisto(hSumPtEtaBandCluster,kFALSE);
1440 
1441  SaveHisto(hSumPtConeSub ,kFALSE);
1442  SaveHisto(hSumPtConeSubCluster,kFALSE);
1443  SaveHisto(hSumPtConeSubTrack ,kFALSE);
1444 
1445  SaveCanvas(cIsolation);
1446  }
1447 }
1448 
1455 //__________________________________________________
1456 void CorrelQA(Int_t icalo)
1457 {
1458  TCanvas * cCorrelation = new TCanvas(Form("%s_CorrelationHisto" ,histoTag.Data()),
1459  Form("Trigger cluster - associated track correlation for %s",histoTag.Data()),
1460  1000,500);
1461  cCorrelation->Divide(2,1);
1462 
1463  Float_t minClusterE = 5;
1464  if ( histoTag.Contains("L0") ) minClusterE = 8;
1465  else if ( histoTag.Contains("L2") ) minClusterE = 10;
1466  else if ( histoTag.Contains("L1") ) minClusterE = 12;
1467 
1468  Float_t assocBins[] = {0.5,2.,5.,10.,20.};
1469  Int_t nAssocBins = 4;
1470 
1471  TH1F * hTrigger = (TH1F*) GetHisto(Form("AnaPhotonHadronCorr_Calo%d_hPtTrigger",icalo));
1472 
1473  if(!hTrigger) return;
1474 
1475  Int_t minClusterEBin = hTrigger->FindBin(minClusterE);
1476  Float_t nTrig = hTrigger->Integral(minClusterEBin,100000);
1477 
1478  if ( nTrig <=0 ) return ;
1479 
1480  //Azimuthal correlation
1481  cCorrelation->cd(1);
1482  gPad->SetLogy();
1483  TH1F* hDeltaPhi[4];
1484  for(Int_t i = 0; i < 4; i++) hDeltaPhi[i] = 0;
1485 
1486  TLegend l(0.35,0.6,0.83,0.85);
1487  l.SetHeader(Form("p_{T,T} > %2.1f GeV/c",minClusterE));
1488  l.SetTextSize(0.04);
1489  l.SetBorderSize(0);
1490  l.SetFillColor(0);
1491 
1492  for(Int_t ibin = 0; ibin < nAssocBins; ibin++ )
1493  {
1494  TH2F* hDeltaPhiE =
1495  (TH2F*) GetHisto(Form("AnaPhotonHadronCorr_Calo%d_hDeltaPhiPtAssocPt%2.1f_%2.1f",icalo,assocBins[ibin],assocBins[ibin+1]));
1496  hDeltaPhi[ibin] =
1497  (TH1F*) hDeltaPhiE->ProjectionY(Form("%s_hDeltaPhi_TrackMinPt%2.1fGeV_TrigEnMin%2.0f",histoTag.Data(),assocBins[ibin],minClusterE),minClusterEBin,10000);
1498  hDeltaPhi[ibin]->Sumw2();
1499  hDeltaPhi[ibin]->Rebin(2);
1500  hDeltaPhi[ibin]->Scale(1./nTrig);
1501 
1502  hDeltaPhi[ibin]->Fit("pol0","Q","",1,2);
1503 
1504  Float_t scale = 1;
1505  if(hDeltaPhi[ibin]->GetFunction("pol0"))
1506  {
1507  scale = hDeltaPhi[ibin]->GetFunction("pol0")->GetParameter(0);
1508  hDeltaPhi[ibin]->GetFunction("pol0")->SetRange(6,7); // move from plot
1509  }
1510  hDeltaPhi[ibin]->Scale(1./scale);
1511  //printf("ibin %d, scale %f\n",ibin,scale);
1512 
1513  hDeltaPhi[ibin]->SetAxisRange(-1.6,4.7);
1514 
1515  hDeltaPhi[ibin]->SetMarkerStyle(24);
1516  hDeltaPhi[ibin]->SetMarkerColor(color[ibin]);
1517  hDeltaPhi[ibin]->SetLineColor(color[ibin]);
1518  hDeltaPhi[ibin]->SetTitleOffset(1.5,"Y");
1519  hDeltaPhi[ibin]->SetYTitle("#it{N}_{pairs} / #it{N}_{trig} / ZYAM");
1520  hDeltaPhi[ibin]->SetTitle("#gamma (#lambda_{0}^{2} < 0.4, neutral cluster) trigger");
1521 
1522  l.AddEntry(hDeltaPhi[ibin],Form("%2.1f<#it{p}_{T,A}< %2.0f GeV/c",assocBins[ibin],assocBins[ibin+1]),"P");
1523  }
1524 
1525  hDeltaPhi[2]->SetMaximum(hDeltaPhi[2]->GetMaximum()*10);
1526  hDeltaPhi[2]->SetMinimum(0.8);
1527 
1528  hDeltaPhi[2]->Draw("H");
1529  hDeltaPhi[1]->Draw("Hsame");
1530  hDeltaPhi[3]->Draw("Hsame");
1531  hDeltaPhi[0]->Draw("Hsame");
1532 
1533  l.Draw("same");
1534 
1535  // xE correlation
1536  cCorrelation->cd(2);
1537  gPad->SetLogy();
1538 
1539  TLegend l2(0.35,0.6,0.83,0.85);
1540  l2.SetHeader(Form("p_{T,T} > %2.0f GeV/c",minClusterE));
1541  l2.SetTextSize(0.04);
1542  l2.SetBorderSize(0);
1543  l2.SetFillColor(0);
1544 
1545  TH2F* hEXE = (TH2F*) GetHisto(Form("AnaPhotonHadronCorr_Calo%d_hXECharged" ,icalo));
1546  TH2F* hEXEUE = (TH2F*) GetHisto(Form("AnaPhotonHadronCorr_Calo%d_hXEUeCharged",icalo));
1547 
1548  TH1F* hXE = (TH1F*) hEXE->ProjectionY(Form("%s_hXE_TrigEnMin%2.0fGeV",histoTag.Data(),minClusterE),minClusterEBin,10000);
1549  hXE->Sumw2();
1550  hXE->Rebin(2);
1551  hXE->Scale(1./nTrig);
1552  hXE->SetAxisRange(0,1);
1553  hXE->SetMarkerStyle(24);
1554  hXE->SetMarkerColor(1);
1555  hXE->SetLineColor(1);
1556  hXE->SetTitleOffset(1.5,"Y");
1557  hXE->SetYTitle("#it{N}_{pairs} / #it{N}_{trig}");
1558  hXE->SetTitle("#gamma (#lambda_{0}^{2} < 0.4, neutral cluster) trigger");
1559  l2.AddEntry(hXE,"raw x_{E}","P");
1560  hXE->Draw();
1561 
1562  TH1F* hXEUE = (TH1F*) hEXEUE->ProjectionY(Form("%s_hXEUE_TrigEnMin%2.0fGeV",histoTag.Data(),minClusterE),minClusterEBin,10000);
1563  hXEUE->Sumw2();
1564  hXEUE->Rebin(2);
1565  hXEUE->Scale(1./nTrig);
1566  hXEUE->SetAxisRange(0,1);
1567  hXEUE->SetMarkerStyle(25);
1568  hXEUE->SetMarkerColor(2);
1569  hXEUE->SetLineColor(2);
1570  l2.AddEntry(hXEUE,"raw Und. Event x_{E}","P");
1571  hXEUE->Draw("same");
1572 
1573  l2.Draw("same");
1574 
1575  cCorrelation->Print(Form("%s_CorrelationHisto.%s",histoTag.Data(),format.Data()));
1576 
1577  // cleanup or save
1578  //
1579  if(exportToFile!=1)
1580  {
1581  for(Int_t i = 0; i < 4; i++) delete hDeltaPhi[i];
1582 
1583  delete hXE ;
1584  delete hXEUE;
1585 
1586  delete cCorrelation;
1587  }
1588  else
1589  {
1590  for(Int_t i = 0; i < 4; i++) SaveHisto(hDeltaPhi[i],kFALSE);
1591 
1592  SaveHisto(hXE ,kFALSE) ;
1593  SaveHisto(hXEUE,kFALSE);
1594 
1595  SaveCanvas(cCorrelation);
1596  }
1597 
1598 }
1599 
1608 //________________________________________________________
1609 void MCQA(Int_t icalo)
1610 {
1611  TH1F* hClusterPho = (TH1F*) GetHisto(Form("AnaPhoton_Calo%d_hPt_MCPhoton",icalo));
1612  TH1F* hClusterPi0 = (TH1F*) GetHisto(Form("AnaPhoton_Calo%d_hPt_MCPi0" ,icalo));
1613  TH1F* hClusterEta = (TH1F*) GetHisto(Form("AnaPhoton_Calo%d_hPt_MCEta" ,icalo));
1614  TH1F* hClusterPhoPi0 = (TH1F*) GetHisto(Form("AnaPhoton_Calo%d_hPt_MCPhotonPi0Decay",icalo));
1615  TH1F* hClusterPhoEta = (TH1F*) GetHisto(Form("AnaPhoton_Calo%d_hPt_MCPhotonEtaDecay",icalo));
1616 
1617  if(!hClusterPho) return;
1618 
1619  TH1F* hPrimPho = (TH1F*) GetHisto(Form("AnaPhoton_Calo%d_hPtPrim_MCPhoton" ,icalo));
1620  TH1F* hPrimPhoPi0 = (TH1F*) GetHisto(Form("AnaPhoton_Calo%d_hPtPrim_MCPhotonPi0Decay",icalo));
1621  TH1F* hPrimPhoEta = (TH1F*) GetHisto(Form("AnaPhoton_Calo%d_hPtPrim_MCPhotonEtaDecay",icalo));
1622  TH1F* hPrimPi0 = (TH1F*) GetHisto(Form("AnaPi0_Calo%d_hPrimPi0Pt",icalo));
1623  TH1F* hPrimEta = (TH1F*) GetHisto(Form("AnaPi0_Calo%d_hPrimEtaPt",icalo));
1624 
1625  TCanvas * cmc = new TCanvas(Form("%s_MCHisto" ,histoTag.Data()),
1626  Form("Cluster MC origin for %s",histoTag.Data()),
1627  1000,1000);
1628  cmc->Divide(2,2);
1629 
1630  cmc->cd(1);
1631  gPad->SetLogy();
1632 
1633  hClusterPho->SetTitle("Cluster origin spectra, primary spectra in Calo acceptance");
1634  hClusterPho->Sumw2();
1635  hClusterPho->SetMarkerColor(1);
1636  hClusterPho->SetMarkerStyle(20);
1637  hClusterPho->SetAxisRange(0.,50.,"X");
1638  //hClusterPho->SetXTitle("E_{rec,gen} (GeV)");
1639  hClusterPho->SetXTitle("#it{E}_{rec}, #it{p}_{T,gen} (GeV)");
1640  hClusterPho->SetYTitle("Entries");
1641  hClusterPho->Draw("");
1642 
1643  hClusterPhoPi0->Sumw2();
1644  hClusterPhoPi0->SetMarkerColor(4);
1645  hClusterPhoPi0->SetMarkerStyle(20);
1646  hClusterPhoPi0->Draw("same");
1647 
1648  hClusterPhoEta->Sumw2();
1649  hClusterPhoEta->SetMarkerColor(2);
1650  hClusterPhoEta->SetMarkerStyle(20);
1651  hClusterPhoEta->Draw("same");
1652 
1653  hClusterPi0->Sumw2();
1654  hClusterPi0->SetMarkerColor(4);
1655  hClusterPi0->SetMarkerStyle(21);
1656  hClusterPi0->Draw("same");
1657 
1658  hClusterEta->Sumw2();
1659  hClusterEta->SetMarkerColor(2);
1660  hClusterEta->SetMarkerStyle(22);
1661  hClusterEta->Draw("same");
1662 
1663  hPrimPho->Sumw2();
1664  hPrimPho->SetMarkerColor(1);
1665  hPrimPho->SetMarkerStyle(24);
1666  hPrimPho->Draw("same");
1667 
1668  hPrimPhoPi0->Sumw2();
1669  hPrimPhoPi0->SetMarkerColor(4);
1670  hPrimPhoPi0->SetMarkerStyle(24);
1671  hPrimPhoPi0->Draw("same");
1672 
1673  hPrimPhoEta->Sumw2();
1674  hPrimPhoEta->SetMarkerColor(2);
1675  hPrimPhoEta->SetMarkerStyle(24);
1676  hPrimPhoEta->Draw("same");
1677 
1678  hPrimPi0->Sumw2();
1679  hPrimPi0->SetMarkerColor(4);
1680  hPrimPi0->SetMarkerStyle(25);
1681  hPrimPi0->Draw("same");
1682 
1683  hPrimEta->Sumw2();
1684  hPrimEta->SetMarkerColor(2);
1685  hPrimEta->SetMarkerStyle(26);
1686  hPrimEta->Draw("same");
1687 
1688  TLegend lR(0.5,0.5,0.7,0.89);
1689  lR.SetHeader("reco");
1690  lR.SetTextSize(0.04);
1691  lR.AddEntry(hClusterPho,"#gamma","P");
1692  lR.AddEntry(hClusterPhoPi0,"#gamma_{#pi^{0}}","P");
1693  lR.AddEntry(hClusterPhoEta,"#gamma_{#eta}","P");
1694  lR.AddEntry(hClusterPi0,"#pi^{0}","P");
1695  lR.AddEntry(hClusterEta,"#eta","P");
1696  lR.SetBorderSize(0);
1697  lR.SetFillColor(0);
1698  lR.Draw();
1699 
1700  TLegend lG(0.7,0.5,0.83,0.89);
1701  lG.SetHeader("gener");
1702  lG.SetTextSize(0.04);
1703  lG.AddEntry(hPrimPho,"#gamma","P");
1704  lG.AddEntry(hPrimPhoPi0,"#gamma_{#pi^{0}}","P");
1705  lG.AddEntry(hPrimPhoEta,"#gamma_{#eta}","P");
1706  lG.AddEntry(hPrimPi0,"#pi^{0}","P");
1707  lG.AddEntry(hPrimEta,"#eta","P");
1708  lG.SetBorderSize(0);
1709  lG.SetFillColor(0);
1710  lG.Draw();
1711 
1712  cmc->cd(2);
1713  gPad->SetLogy();
1714  TH1F* hRatPho = (TH1F*) hClusterPho ->Clone(Form("%s_hGenRecoRatPho" ,histoTag.Data()));
1715  TH1F* hRatPi0 = (TH1F*) hClusterPi0 ->Clone(Form("%s_hGenRecoRatPi0" ,histoTag.Data()));
1716  TH1F* hRatEta = (TH1F*) hClusterEta ->Clone(Form("%s_hGenRecoRatEta" ,histoTag.Data()));
1717  TH1F* hRatPhoPi0 = (TH1F*) hClusterPhoPi0->Clone(Form("%s_hGenRecoRatPhoPi0",histoTag.Data()));
1718  TH1F* hRatPhoEta = (TH1F*) hClusterPhoEta->Clone(Form("%s_hGenRecoRatPhoEta",histoTag.Data()));
1719 
1720  hRatPho ->Divide(hPrimPho);
1721  hRatPhoPi0->Divide(hPrimPhoPi0);
1722  hRatPhoEta->Divide(hPrimPhoEta);
1723  hRatPi0 ->Divide(hPrimPi0);
1724  hRatEta ->Divide(hPrimEta);
1725 
1726  hRatPho->SetTitle("Reconstructed cluster / Generated particle in Calo acc.");
1727  hRatPho->SetYTitle("#it{Ratio reco / gener}");
1728  hRatPho->SetXTitle("#it{E} (GeV)");
1729  hRatPho->SetMinimum(1e-3);
1730  hRatPho->SetMaximum(20);
1731  hRatPho->Draw("");
1732  hRatPhoPi0->Draw("same");
1733  hRatPhoEta->Draw("same");
1734  hRatPi0->Draw("same");
1735  hRatEta->Draw("same");
1736 
1737  TLegend l2(0.15,0.62,0.3,0.89);
1738  l2.SetTextSize(0.04);
1739  l2.AddEntry(hRatPho,"#gamma","P");
1740  l2.AddEntry(hRatPhoPi0,"#gamma_{#pi^{0}}","P");
1741  l2.AddEntry(hRatPhoEta,"#gamma_{#eta}","P");
1742  l2.AddEntry(hRatPi0,"#pi^{0}","P");
1743  l2.AddEntry(hRatEta,"#eta","P");
1744  l2.SetBorderSize(0);
1745  l2.SetFillColor(0);
1746  l2.Draw();
1747 
1748  cmc->cd(3);
1749  //gPad->SetLogy();
1750 
1751  TH2F* h2PrimPhoPhi = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hPhiPrim_MCPhoton",icalo));
1752  TH2F* h2PrimPi0Phi = (TH2F*) GetHisto(Form("AnaPi0_Calo%d_hPrimPi0Phi" ,icalo));
1753  TH2F* h2PrimEtaPhi = (TH2F*) GetHisto(Form("AnaPi0_Calo%d_hPrimEtaPhi" ,icalo));
1754 
1755  Int_t binMin = hPrimPho->FindBin(3);
1756 
1757  TH1F* hPrimPhoPhi = (TH1F*) h2PrimPhoPhi->ProjectionY(Form("%s_hPrimPhoPhi",histoTag.Data()),binMin,1000);
1758  TH1F* hPrimPi0Phi = (TH1F*) h2PrimPi0Phi->ProjectionY(Form("%s_hPrimPi0Phi",histoTag.Data()),binMin,1000);
1759  TH1F* hPrimEtaPhi = (TH1F*) h2PrimEtaPhi->ProjectionY(Form("%s_hPrimEtaPhi",histoTag.Data()),binMin,1000);
1760 
1761  hPrimPhoPhi->Sumw2();
1762  hPrimPi0Phi->Sumw2();
1763  hPrimEtaPhi->Sumw2();
1764 
1765  hPrimPhoPhi->Scale(1./hPrimPhoPhi->Integral(0,1000));
1766  hPrimPi0Phi->Scale(1./hPrimPi0Phi->Integral(0,1000));
1767  hPrimEtaPhi->Scale(1./hPrimEtaPhi->Integral(0,1000));
1768 
1769  Float_t maxPhi = hPrimPhoPhi->GetMaximum();
1770  if(maxPhi < hPrimPi0Phi->GetMaximum()) maxPhi = hPrimPi0Phi->GetMaximum();
1771  if(maxPhi < hPrimEtaPhi->GetMaximum()) maxPhi = hPrimEtaPhi->GetMaximum();
1772 
1773  Float_t minPhi = hPrimPhoPhi->GetMinimum();
1774  if(minPhi > hPrimPi0Phi->GetMinimum()) minPhi = hPrimPi0Phi->GetMinimum();
1775  if(minPhi > hPrimEtaPhi->GetMinimum()) minPhi = hPrimEtaPhi->GetMinimum();
1776 
1777  hPrimPi0Phi->SetMaximum(maxPhi*1.1);
1778  hPrimPi0Phi->SetMinimum(minPhi);
1779  TGaxis::SetMaxDigits(3);
1780 
1781  hPrimPi0Phi->SetYTitle("1/total entries d#it{N}/d#varphi");
1782  hPrimPi0Phi->SetTitle("Generated particles #varphi for #it{E} > 3 GeV");
1783  hPrimPi0Phi->SetTitleOffset(1.5,"Y");
1784  hPrimPi0Phi->SetMarkerColor(4);
1785  hPrimPi0Phi->SetMarkerStyle(21);
1786  hPrimPi0Phi->Draw("");
1787 
1788  hPrimPhoPhi->SetMarkerColor(1);
1789  hPrimPhoPhi->SetMarkerStyle(20);
1790  Float_t scale = TMath::RadToDeg();
1791  ScaleXaxis(hPrimPhoPhi, TMath::RadToDeg());
1792  hPrimPhoPhi->Draw("same");
1793 
1794  hPrimEtaPhi->SetMarkerColor(2);
1795  hPrimEtaPhi->SetMarkerStyle(22);
1796  hPrimEtaPhi->Draw("same");
1797 
1798  cmc->cd(4);
1799  //gPad->SetLogy();
1800 
1801  TH2F* h2PrimPhoEtaP = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hYPrim_MCPhoton",icalo));
1802  TH2F* h2PrimPi0EtaP = (TH2F*) GetHisto(Form("AnaPi0_Calo%d_hPrimPi0Rapidity" ,icalo));
1803  TH2F* h2PrimEtaEtaP = (TH2F*) GetHisto(Form("AnaPi0_Calo%d_hPrimEtaRapidity" ,icalo));
1804 
1805  h2PrimPhoEtaP->Sumw2();
1806  h2PrimEtaEtaP->Sumw2();
1807  h2PrimPi0EtaP->Sumw2();
1808 
1809  binMin = hPrimPho->FindBin(3);
1810 
1811  TH1F* hPrimPhoEtaP = (TH1F*) h2PrimPhoEtaP->ProjectionY(Form("%s_hPrimPhoEtaP",histoTag.Data()),binMin,1000);
1812  TH1F* hPrimPi0EtaP = (TH1F*) h2PrimPi0EtaP->ProjectionY(Form("%s_hPrimPi0EtaP",histoTag.Data()),binMin,1000);
1813  TH1F* hPrimEtaEtaP = (TH1F*) h2PrimEtaEtaP->ProjectionY(Form("%s_hPrimEtaEtaP",histoTag.Data()),binMin,1000);
1814 
1815  hPrimPhoEtaP->Scale(1./hPrimPhoEtaP->Integral(0,1000));
1816  hPrimPi0EtaP->Scale(1./hPrimPi0EtaP->Integral(0,1000));
1817  hPrimEtaEtaP->Scale(1./hPrimEtaEtaP->Integral(0,1000));
1818 
1819  Float_t maxEta = hPrimPhoEtaP->GetMaximum();
1820  if(maxEta < hPrimPi0EtaP->GetMaximum()) maxEta = hPrimPi0EtaP->GetMaximum();
1821  if(maxEta < hPrimEtaEtaP->GetMaximum()) maxEta = hPrimEtaEtaP->GetMaximum();
1822 
1823  Float_t minEta = hPrimPhoEtaP->GetMinimum();
1824  if(minEta > hPrimPi0EtaP->GetMinimum()) minEta = hPrimPi0EtaP->GetMinimum();
1825  if(minEta > hPrimEtaEtaP->GetMinimum()) minEta = hPrimEtaEtaP->GetMinimum();
1826 
1827  hPrimPi0EtaP->SetMaximum(maxEta*1.1);
1828  hPrimPi0EtaP->SetMinimum(minEta);
1829  TGaxis::SetMaxDigits(3);
1830 
1831  hPrimPi0EtaP->SetYTitle("1/total entries d#it{N}/d#eta");
1832  hPrimPi0EtaP->SetTitle("Generated particles #eta for #it{E} > 3 GeV");
1833  hPrimPi0EtaP->SetTitleOffset(1.5,"Y");
1834  hPrimPi0EtaP->SetMarkerColor(4);
1835  hPrimPi0EtaP->SetMarkerStyle(21);
1836  hPrimPi0EtaP->Draw("");
1837 
1838  hPrimPhoEtaP->SetMarkerColor(1);
1839  hPrimPhoEtaP->SetMarkerStyle(20);
1840  scale = TMath::RadToDeg();
1841  hPrimPhoEtaP->Draw("same");
1842 
1843  hPrimEtaEtaP->SetMarkerColor(2);
1844  hPrimEtaEtaP->SetMarkerStyle(22);
1845  hPrimEtaEtaP->Draw("same");
1846 
1847  cmc->Print(Form("%s_MCHisto.%s",histoTag.Data(),format.Data()));
1848 
1849  // cleanup or save
1850  //
1851  if(exportToFile!=1)
1852  {
1853  delete hPrimPhoPhi ;
1854  delete hPrimPi0Phi ;
1855  delete hPrimEtaPhi ;
1856  delete hPrimPhoEtaP ;
1857  delete hPrimPi0EtaP ;
1858  delete hPrimEtaEtaP ;
1859 
1860  delete cmc ;
1861  }
1862  else
1863  {
1864  SaveHisto(hPrimPhoPhi ,kFALSE);
1865  SaveHisto(hPrimPi0Phi ,kFALSE);
1866  SaveHisto(hPrimEtaPhi ,kFALSE);
1867  SaveHisto(hPrimPhoEtaP,kFALSE);
1868  SaveHisto(hPrimPi0EtaP,kFALSE);
1869  SaveHisto(hPrimEtaEtaP,kFALSE);
1870 
1871  SaveCanvas(cmc) ;
1872  }
1873 }
1874 
1880 //____________________________________________________________________
1882 {
1883  if(list) delete list;
1884 
1885  list = (TList*) dir->Get(trigName);
1886 
1887  if ( !list )
1888  {
1889  printf("List not found, do nothing\n");
1890  return kFALSE;
1891  }
1892 
1893  if ( list->GetEntries() <= 0 )
1894  {
1895  printf("No histograms found <%d>, do nothing\n",list->GetEntries());
1896  return kFALSE;
1897  }
1898 
1899  if ( exportToFile == 2 )
1900  {
1901  fout = new TFile(Form("AnalysisResults%s.root",histoTag.Data()),"RECREATE");
1902  list->Write();
1903  fout->Close();
1904  }
1905 
1906  return kTRUE ;
1907 }
1908 
1916 //___________________________________
1918 {
1919  TObject *histo = 0x0;
1920 
1921  if ( list ) histo = list->FindObject(histoName);
1922  else histo = file->Get (histoName);
1923 
1924  SaveHisto(histo);
1925 
1926  return histo;
1927 }
1928 
1935 //_________________________________________
1936 void SaveHisto(TObject* histo, Bool_t tag)
1937 {
1938  if(histo)
1939  {
1940  if(tag) histo->Write(Form("fig_ga_%s_%s",histoTag.Data(), histo->GetName()));
1941  else histo->Write(Form("fig_ga_%s" ,histo->GetName()));
1942  }
1943 // else
1944 // printf("Object not Available");
1945 }
1946 
1950 //_______________________________
1951 void SaveCanvas(TCanvas* canvas)
1952 {
1953  if(canvas) canvas->Write(Form("canvas_ga_%s",canvas->GetName()));
1954 }
1955 
1959 //___________________________________________________
1960 void ScaleAxis(TAxis *a, Double_t scale)
1961 {
1962  if (!a) return; // just a precaution
1963  if (a->GetXbins()->GetSize())
1964  {
1965  // an axis with variable bins
1966  // note: bins must remain in increasing order, hence the "Scale"
1967  // function must be strictly (monotonically) increasing
1968  TArrayD X(*(a->GetXbins()));
1969  for(Int_t i = 0; i < X.GetSize(); i++) X[i] = scale*X[i];
1970  a->Set((X.GetSize() - 1), X.GetArray()); // new Xbins
1971  }
1972  else
1973  {
1974  // an axis with fix bins
1975  // note: we modify Xmin and Xmax only, hence the "Scale" function
1976  // must be linear (and Xmax must remain greater than Xmin)
1977  a->Set(a->GetNbins(),
1978  - scale*a->GetXmin(), // new Xmin
1979  - scale*a->GetXmax()); // new Xmax
1980  }
1981  return;
1982 }
1983 
1987 //___________________________________________________
1988 void ScaleXaxis(TH1 *h, Double_t scale)
1989 {
1990  if (!h) return; // just a precaution
1991  ScaleAxis(h->GetXaxis(), scale);
1992  return;
1993 }
1994 
1995 
1996 
Int_t color[]
option to what and if export to output file
double Double_t
Definition: External.C:58
Definition: External.C:236
TCanvas * canvas
Definition: DrawAnaELoss.C:28
void CaloQA(Int_t icalo)
TString fileName
TString format
file names tag, basically the trigger and calorimeter combination
void CorrelQA(Int_t icalo)
TObject * GetHisto(TString histoName)
TString histoTag
output file with plots or extracted histograms
void SaveCanvas(TCanvas *canvas)
TList * list
TDirectory file where lists per trigger are stored in train ouput.
void ProcessTrigger(TString trigName="default", Bool_t checkList=kTRUE)
void ScaleAxis(TAxis *a, Double_t scale)
void DrawAnaCaloTrackQA(TString listName="Pi0IM_GammaTrackCorr_EMCAL", TString fileName="AnalysisResults.root", Int_t exportTo=1, TString fileFormat="eps", TString outFileName="CaloTrackCorrQA_output")
int Int_t
Definition: External.C:63
void MCQA(Int_t icalo)
float Float_t
Definition: External.C:68
void IsolQA(Int_t icalo)
void SaveHisto(TObject *histo, Bool_t tag=kTRUE)
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
Int_t exportToFile
plots format: eps, pdf, etc.
TFile * file
TList with histograms for a given trigger.
Bool_t GetList(TString trigName)
void Pi0QA(Int_t icalo)
bool Bool_t
Definition: External.C:53
TFile * fout
input train file
void ScaleXaxis(TH1 *h, Double_t scale)
void TrackQA()
Definition: External.C:196
TDirectoryFile * dir