AliPhysics  135f0b0 (135f0b0)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DrawAnaCaloTrackQA.C
Go to the documentation of this file.
1 
29 //---------------------------------------------------------
30 // Set includes and declare methods for compilation
31 
32 #if !defined(__CINT__) || defined(__MAKECINT__)
33 
34 #include <TFile.h>
35 #include <TDirectoryFile.h>
36 #include <TList.h>
37 #include <TString.h>
38 #include <TROOT.h>
39 #include <TStyle.h>
40 #include <TH1F.h>
41 #include <TH2F.h>
42 #include <TCanvas.h>
43 #include <TPad.h>
44 #include <TLegend.h>
45 #include <TObject.h>
46 #include <TAxis.h>
47 #include <TGaxis.h>
48 #include <TLine.h>
49 #include <TF1.h>
50 #include <TMath.h>
51 
52 #endif
53 
54 void ProcessTrigger(TString trigName = "default",
55  Bool_t checkList = kTRUE);
56 void CaloQA (Int_t icalo);
57 void TrackQA ();
58 void Pi0QA (Int_t icalo);
59 void IsolQA (Int_t icalo);
60 void CorrelQA (Int_t icalo);
61 void MCQA (Int_t icalo);
62 void ScaleAxis (TAxis *a, Double_t scale);
63 void ScaleXaxis(TH1 *h, Double_t scale);
64 
65 TObject * GetHisto (TString histoName);
66 void SaveHisto (TObject* histo, Bool_t tag = kTRUE);
67 void SaveCanvas(TCanvas* canvas );
68 Bool_t GetList (TString trigName );
69 //
70 //---------------------------------------------------------
71 
72 //-----------------------
73 // Some global variables
74 TDirectoryFile *dir = 0;
75 TList *list = 0;
76 TFile *file = 0;
77 TFile *fout = 0;
79 TString format = "eps";
81 
83 Int_t color[]={kBlack,kRed,kOrange+1,kYellow+1,kGreen+2,kBlue,kCyan+1,kViolet,kMagenta+2,kGray,kCyan-2,kViolet-2};
84 //
85 //-----------------------
86 
102 //_______________________________________________________________________
104 (
105  TString listName = "Pi0IM_GammaTrackCorr_EMCAL",
106  TString fileName = "AnalysisResults.root",
107  Int_t exportTo = 1,
108  TString fileFormat = "eps",
109  TString outFileName = "CaloTrackCorrQA_output"
110 )
111 {
112  format = fileFormat;
113  exportToFile = exportTo;
114 
115  printf("Open <%s>; Get Trigger List : <%s>; Export option <%d>; format %s; outputFileName %s.root\n",
116  fileName.Data(),listName.Data(),exportToFile, format.Data(),outFileName.Data());
117 
118  // Get file and list container, global variables
119  //
120  file = new TFile(fileName,"read");
121  if ( !file )
122  {
123  printf("File not found, do nothing\n");
124  return;
125  }
126 
127  dir = (TDirectoryFile*) file->Get(listName);
128  if ( !dir )
129  {
130  printf("DirectoryFile not found, do nothing\n");
131  return;
132  }
133 
134  //---------------
135  // output file with plots
136  if(exportToFile == 1)
137  {
138  fout = TFile::Open(Form("%s.root",outFileName.Data()),"UPDATE");
139  if(!fout)
140  fout = new TFile(Form("%s.root",outFileName.Data()),"RECREATE");
141 
142  //fout->ls();
143 
144  TDirectoryFile *cdd = (TDirectoryFile*)fout->Get("GA");
145  if(!cdd)
146  {
147  printf("Warning: GA <dir> doesn't exist, creating a new one");
148  cdd = (TDirectoryFile*)fout->mkdir("GA");
149  }
150  cdd->cd();
151  cdd->ls();
152  }
153  //---------------
154 
155  // Process each of the triggers
156  //
157  ProcessTrigger("default" );
158  ProcessTrigger("EMCAL_L0");
159  ProcessTrigger("EMCAL_L1");
160  ProcessTrigger("EMCAL_L2");
161  ProcessTrigger("DCAL_L0" );
162  ProcessTrigger("DCAL_L1" );
163  ProcessTrigger("DCAL_L2" );
164 
165  if(exportToFile == 1)
166  {
167  fout->cd();
168  fout->Close();
169  }
170 
171  file->Close();
172 }
173 
191 //_______________________________________________________________________
192 void ProcessTrigger( TString trigName, Bool_t checkList)
193 {
194  // Access the list of histograms, global variables
195  //
196  if(checkList)
197  {
198  Bool_t ok = GetList(trigName);
199  printf("\t -- Process trigger %s, ok %d\n",trigName.Data(), ok);
200 
201  if ( !ok ) return;
202  }
203 
204  gStyle->SetOptTitle(1);
205  gStyle->SetOptStat(0);
206  gStyle->SetOptFit(000000);
207  gStyle->SetPadRightMargin(0.15);
208  //gStyle->SetPadTopMargin(0.02);
209  //gStyle->SetPadLeftMargin(0.15);
210  gStyle->SetTitleFontSize(0.05);
211 
212  Int_t nCalo = 2;
213  Int_t calo = 0;
214  if (trigName.Contains("EMCAL")) { calo = 0 ; nCalo = 1 ; }
215  else if(trigName.Contains("DCAL" )) { calo = 1 ; nCalo = 2 ; }
216 
217  TString caloString [] = {"EMCAL","DCAL"};
218 
219  histoTag = trigName;
220 
221  // Plot basic Track QA
222  TrackQA();
223 
224  for(Int_t icalo = calo; icalo < nCalo; icalo++)
225  {
226  if(trigName.Contains("default")) histoTag=Form("%s_%s",caloString[icalo].Data(),trigName.Data());
227 
228  // Plot basic QA
229  CaloQA(icalo);
230 
231  // Plot basic Pi0 QA
232  Pi0QA(icalo);
233 
234  gStyle->SetPadRightMargin(0.02);
235  // Plot basic isolation QA
236  IsolQA(icalo);
237 
238  // Plot basic correlation QA
239  CorrelQA(icalo);
240 
241  // MC basic QA plots, cluster origins (only if it run on MC)
242  MCQA(icalo);
243 
244  // Re-set default setting
245  gStyle->SetPadRightMargin(0.15);
246  }
247 }
248 
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_hTrackMatchedDEtaNeg",icalo));
391  TH2F* h2TrackMatchResEtaPos = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hTrackMatchedDEtaPos",icalo));
392  TH2F* h2TrackMatchResPhiNeg = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hTrackMatchedDPhiNeg",icalo));
393  TH2F* h2TrackMatchResPhiPos = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hTrackMatchedDPhiPos",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 
621 //______________________________________
622 void TrackQA()
623 {
624  TCanvas * ctrack = new TCanvas(Form("%s_TrackHisto" ,histoTag.Data()),
625  Form("Hybrid tracks for %s",histoTag.Data()),
626  1000,1000);
627  ctrack->Divide(2,2);
628 
629  ctrack->cd(1);
630  //gPad->SetLogz();
631  TH2F * hTrackEtaPhi = (TH2F*) GetHisto("AnaHadrons_hEtaPhiNegative");
632  if(!hTrackEtaPhi) return;
633  hTrackEtaPhi ->Add( (TH2F*) GetHisto("AnaHadrons_hEtaPhiPositive"));
634  hTrackEtaPhi ->SetAxisRange(-0.9,0.9,"X");
635  hTrackEtaPhi ->SetTitleOffset(1.5,"Y");
636  hTrackEtaPhi ->SetTitle("Hybrid tracks #eta vs #varphi #it{p}_{T} > 0.2 GeV/#it{c}");
637  hTrackEtaPhi->SetZTitle("Entries");
638  hTrackEtaPhi->SetTitleOffset(1.5,"Z");
639 
640  hTrackEtaPhi ->Draw("colz");
641 
642  ctrack->cd(2);
643  //gPad->SetLogy();
644  TH2F * hTrackEtaPhiSPD = (TH2F*) GetHisto("AnaHadrons_hEtaPhiSPDRefitPt02");
645  TH2F * hTrackEtaPhiNoSPD = (TH2F*) GetHisto("AnaHadrons_hEtaPhiNoSPDRefitPt02");
646 
647  TH1F* hPhiSPD = (TH1F*)hTrackEtaPhiSPD ->ProjectionY(Form("%s_hTrackPhiSPD" ,histoTag.Data()),0,1000);
648  TH1F* hPhiNoSPD = (TH1F*)hTrackEtaPhiNoSPD->ProjectionY(Form("%s_hTrackPhiNoSPD",histoTag.Data()),0,1000);
649  TH1F* hPhi = (TH1F*)hPhiSPD->Clone( Form("%s_hTrackPhi" ,histoTag.Data()));
650  hPhi->Add(hPhiNoSPD);
651 
652  hPhi ->SetTitle("Hybrid track type #varphi, 0.2<#it{p}_{T}<2 GeV/#it{c}");
653  hPhi ->SetLineColor(1);
654  hPhiSPD ->SetLineColor(2);
655  hPhiNoSPD->SetLineColor(4);
656 
657  hPhi ->SetMinimum(1);
658  hPhi ->SetMaximum(hPhi->GetMaximum()*1.3);
659  hPhi ->SetTitleOffset(1.5,"Y");
660  hPhi ->SetYTitle("Entries");
661 
662  TGaxis::SetMaxDigits(3);
663 
664  hPhi ->Draw("H");
665  hPhiSPD ->Draw("Hsame");
666  hPhiNoSPD->Draw("Hsame");
667 
668  TLegend l(0.2,0.75,0.4,0.89);
669  l.SetTextSize(0.04);
670  l.AddEntry(hPhi,"Sum","L");
671  l.AddEntry(hPhiSPD ,"SPD+Refit","L");
672  l.AddEntry(hPhiNoSPD,"No SPD+Refit","L");
673  l.SetBorderSize(0);
674  l.SetFillColor(0);
675  l.Draw();
676 
677  ctrack->cd(3);
678  gPad->SetLogy();
679 
680  TH1F* hTOF = (TH1F*) GetHisto("AnaHadrons_hTOFSignalPtCut");
681  hTOF->SetYTitle("Entries");
682  hTOF->SetTitleOffset(1.5,"Y");
683 
684  hTOF->Draw("");
685 
686  ctrack->cd(4);
687  gPad->SetLogy();
688  gPad->SetLogx();
689 
690  TH1F* hPt = (TH1F*) GetHisto("AnaHadrons_hPt");
691  TH1F* hPtSPD = (TH1F*) GetHisto("AnaHadrons_hPtSPDRefit");
692  TH1F* hPtNoSPD = (TH1F*) GetHisto("AnaHadrons_hPtNoSPDRefit");
693  hPt ->SetLineColor(1);
694  hPtSPD ->SetLineColor(2);
695  hPtNoSPD->SetLineColor(4);
696 
697  hPt ->SetTitle("Hybrid track type #it{p}_{T}");
698  hPt ->SetYTitle("Entries");
699  hPt ->SetTitleOffset(1.5,"Y");
700 
701  hPt ->Draw("");
702  hPtSPD ->Draw("same");
703  hPtNoSPD->Draw("same");
704 
705 // ctrack->cd(3);
706 // gPad->SetLogz();
707 //
708 // TH2F* hPtDCAxy = (TH2F*) GetHisto("AnaHadrons_hPtDCAxy");
709 // hPtDCAxy->SetAxisRange(-1,1,"Y");
710 // hPtDCAxy->SetAxisRange(0,30,"X");
711 // hPtDCAxy->Draw("colz");
712 //
713 // ctrack->cd(4);
714 // gPad->SetLogz();
715 //
716 // TH2F* hPtDCAz = (TH2F*) GetHisto("AnaHadrons_hPtDCAz");
717 // hPtDCAz->SetAxisRange(-1,1,"Y");
718 // hPtDCAz->SetAxisRange(0,30,"X");
719 // hPtDCAz->Draw("colz");
720 
721  ctrack->Print(Form("%s_TrackHisto.%s",histoTag.Data(),format.Data()));
722 
723  // cleanup or save
724  //
725  if(exportToFile!=1)
726  {
727  delete hPhi;
728  delete hPhiSPD;
729  delete hPhiNoSPD;
730 
731  delete ctrack;
732  }
733  else
734  {
735  SaveHisto(hPhi ,kFALSE);
736  SaveHisto(hPhiSPD ,kFALSE);
737  SaveHisto(hPhiNoSPD,kFALSE);
738 
739  SaveCanvas(ctrack);
740  }
741 }
742 
752 //_____________________________
753 void Pi0QA(Int_t icalo)
754 {
755  TCanvas * cpi0 = new TCanvas(Form("%s_InvariantMassHisto" ,histoTag.Data()),
756  Form("Neutral mesons inv. mass for %s",histoTag.Data()),
757  1000,1000);
758  cpi0->Divide(2,2);
759 
760  TH2F* hMassE[10];
761  TH2F* hMixMassE[10];
762  for(Int_t icen = 0; icen < 10; icen++)
763  {
764  hMassE [icen] = (TH2F*) GetHisto(Form("AnaPi0_Calo%d_hRe_cen%d_pidbit0_asy0_dist1",icalo,icen));
765  hMixMassE[icen] = (TH2F*) GetHisto(Form("AnaPi0_Calo%d_hMi_cen%d_pidbit0_asy0_dist1",icalo,icen));
766  }
767  if(!hMassE[0]) return;
768 
769  // 2D Invariant mass vs E, in PbPb from 60 to 100 %, all in pp
770  cpi0->cd(1);
771  gPad->SetLogz();
772  TH2F* h2DMass;
773 
774  if(hMassE[1]) // Plot centrality from 60 to 100%
775  {
776  h2DMass = (TH2F*) hMassE[6]->Clone(Form("%s_h2DMass",histoTag.Data()));
777  for(Int_t icen = 7; icen < 10; icen++) h2DMass->Add(hMassE[icen]);
778  h2DMass->SetTitle("Inv. mass vs #it{p}_{T,pair}, Cen: 60-100%");
779  }
780  else
781  {
782  h2DMass = (TH2F*) hMassE[0]->Clone(Form("%s_h2DMass",histoTag.Data()));
783  h2DMass->SetTitle("Inv. mass vs #it{p}_{T,pair}");
784  }
785 
786  h2DMass->SetTitleOffset(1.5,"Y");
787  h2DMass->SetAxisRange(0.0,0.7,"Y");
788  h2DMass->SetAxisRange(0,30,"X");
789  h2DMass->Draw("colz");
790 
791  // Pi0 Invariant mass projection, in PbPb 6 centrality bins from 0 to 50%, all in pp
792  cpi0->cd(2);
793  TH1F* hMass [10];
794  TH1F* hMix [10];
795  TH1F* hMassEta[10];
796  TH1F* hMassPi0[10];
797 
798  //Init to 0
799  for(Int_t icen=0; icen<10; icen++ )
800  {
801  hMass [icen] = 0;
802  hMix [icen] = 0;
803  hMassEta[icen] = 0;
804  hMassPi0[icen] = 0;
805  }
806 
807  TH1F * hX = (TH1F*) hMassE[0]->ProjectionX(Form("%s_hEPairCen0",histoTag.Data()),0,10000);
808  Int_t binmin = hX->FindBin(2); // Project histo from 2 GeV pairs
809  Int_t binmax = hX->FindBin(10); // Project histo up to 10 GeV pairs
810  if(histoTag.Contains("L0"))
811  {
812  binmin = hX->FindBin(5); // Project histo from 5 GeV pairs
813  binmax = hX->FindBin(10); // Project histo up to 10 GeV pairs
814  }
815  else if(histoTag.Contains("L2"))
816  {
817  binmin = hX->FindBin(8); // Project histo from 8 GeV pairs
818  binmax = hX->FindBin(12); // Project histo up to 12 GeV pairs
819  }
820  else if(histoTag.Contains("L1"))
821  {
822  binmin = hX->FindBin(10); // Project histo from 10 GeV pairs
823  binmax = hX->FindBin(15); // Project histo up to 15 GeV pairs
824  }
825 
826  Float_t maxPi0 = 0;
827  Float_t maxEta = 0;
828  Float_t minPi0 = 1e6;
829  Float_t minEta = 1e6;
830  for(Int_t icen = 0; icen < 6; icen++)
831  {
832  if(!hMassE[icen]) continue;
833 
834  hMass[icen] = (TH1F*) hMassE [icen]->ProjectionY(Form("%s_hMassCen%d",histoTag.Data(),icen),binmin,binmax);
835  hMix [icen] = (TH1F*) hMixMassE[icen]->ProjectionY(Form("%s_hMixCen%d" ,histoTag.Data(),icen),binmin,binmax);
836  hMass[icen]->Sumw2();
837  hMix [icen]->Sumw2();
838 
839  hMassPi0[icen] = (TH1F*) hMass[icen]->Clone(Form("%s_hMassPi0Cen%d",histoTag.Data(),icen));
840  hMassEta[icen] = (TH1F*) hMass[icen]->Clone(Form("%s_hMassEtaCen%d",histoTag.Data(),icen));
841 
842  hMassPi0[icen]->Divide(hMix[icen]);
843  hMassPi0[icen]->Fit("pol0","Q","",0.25,0.35);
844  Float_t scale = 1;
845  if(hMassPi0[icen]->GetFunction("pol0")) scale = hMassPi0[icen]->GetFunction("pol0")->GetParameter(0);
846  //printf("Scale factor %f for cen %d\n",scale,icen);
847  hMassPi0[icen]->Scale(1./scale);
848  hMassPi0[icen]->SetMarkerStyle(24);
849  hMassPi0[icen]->SetMarkerColor(color[icen]);
850  hMassPi0[icen]->SetLineColor(color[icen]);
851  hMassPi0[icen]->SetAxisRange(0.04,0.24);
852  //hMassPi0[icen]->SetMarkerSize(0.5);
853 
854  hMassEta[icen]->Rebin(4);
855  hMix [icen]->Rebin(4);
856  hMassEta[icen]->Divide(hMix[icen]);
857  hMassEta[icen]->SetMarkerStyle(25);
858  hMassEta[icen]->SetMarkerColor(color[icen]);
859  hMassEta[icen]->SetLineColor(color[icen]);
860  hMassEta[icen]->SetAxisRange(0.4,0.9);
861  //hMassEta[icen]->SetMarkerSize(0.5);
862  hMassEta[icen]->Scale(1./scale);
863 
864  if(maxEta < hMassEta[icen]->GetMaximum()) maxEta = hMassEta[icen]->GetMaximum();
865  if(maxPi0 < hMassPi0[icen]->GetMaximum()) maxPi0 = hMassPi0[icen]->GetMaximum();
866 
867  if(minEta > hMassEta[icen]->GetMinimum()) minEta = hMassEta[icen]->GetMinimum();
868  if(minPi0 > hMassPi0[icen]->GetMinimum()) minPi0 = hMassPi0[icen]->GetMinimum();
869  }
870 
871  //gPad->SetLogy();
872  //gPad->SetGridy();
873  hMassPi0[0]->SetMinimum(minPi0);
874  hMassPi0[0]->SetTitleOffset(1.5,"Y");
875  hMassPi0[0]->SetYTitle("Real / Mixed");
876  hMassPi0[0]->SetTitle("#pi^{0} peak, 2 < #it{E}_{pair}< 10 GeV");
877  if (histoTag.Contains("L0")) hMassPi0[0]->SetTitle("#pi^{0} peak, 5 < #it{E}_{pair}< 10 GeV");
878  else if(histoTag.Contains("L2")) hMassPi0[0]->SetTitle("#pi^{0} peak, 8 < #it{E}_{pair}< 12 GeV");
879  else if(histoTag.Contains("L1")) hMassPi0[0]->SetTitle("#pi^{0} peak, 10 < #it{E}_{pair}< 15 GeV");
880 
881  hMassPi0[0]->Draw();
882 
883  if(hMass[1]) // PbPb
884  {
885  hMassPi0[0]->SetMaximum(maxPi0*1.2);
886  hMassPi0[5]->Draw("Hsame");
887  hMassPi0[4]->Draw("Hsame");
888  hMassPi0[3]->Draw("Hsame");
889  hMassPi0[2]->Draw("Hsame");
890  hMassPi0[1]->Draw("Hsame");
891  hMassPi0[0]->Draw("Hsame");
892  //hMass[6]->Draw("Hsame");
893  //hMass[7]->Draw("same");
894  //hMass[8]->Draw("same");
895  //hMass[9]->Draw("same");
896 
897  TLegend l(0.12,0.6,0.4,0.85);
898  l.SetTextSize(0.04);
899  l.AddEntry(hMassPi0[0],"0-10%","P");
900  l.AddEntry(hMassPi0[1],"10-20%","P");
901  l.AddEntry(hMassPi0[2],"20-30%","P");
902  l.AddEntry(hMassPi0[3],"30-40%","P");
903  l.AddEntry(hMassPi0[4],"40-70%","P");
904  l.AddEntry(hMassPi0[5],"50-60%","P");
905  l.SetBorderSize(0);
906  l.SetFillColor(0);
907  l.Draw();
908  }
909 
910  TLine l1(0.04,1,0.24,1);
911  l1.Draw("same");
912 
913  // Pi0 invariant mass per EMCal super module
914  cpi0->cd(3);
915 
916  TH1F* hSM [20];
917  TH1F* hMixSM[20];
918 
919  //Init to 0
920  for(Int_t ism = 0; ism < 20; ism++)
921  {
922  hSM [ism] = 0;
923  hMixSM[ism] = 0;
924  }
925 
926  binmin = hX->FindBin(4); // Project histo from 3 GeV pairs
927  binmax = hX->FindBin(20); // Project histo up to 20 GeV pairs
928  Float_t maxSM = 0;
929 
930  Int_t first = 0;
931  if(icalo==1) first = 12;
932 
933  for(Int_t ism = first; ism < 20; ism++)
934  {
935  TH2F* hTmpSM = (TH2F*) GetHisto(Form("AnaPi0_Calo%d_hReMod_%d",icalo,ism));
936  if(!hTmpSM) continue;
937 
938  hSM[ism] = (TH1F*) hTmpSM->ProjectionY(Form("%s_hMassSM%d",histoTag.Data(),ism),binmin,binmax);
939  hSM[ism]->Sumw2();
940  hSM[ism]->SetMarkerStyle(26);
941  hSM[ism]->Rebin(2);
942  //hSM[ism]->Scale(1./hSM[ism]->Integral(0,10000));
943  hSM[ism]->SetMarkerColor(color[ism-first]);
944  hSM[ism]->SetLineColor(color[ism-first]);
945  //hSM[ism]->SetMarkerSize(0.5);
946 
947  TH2F* hTmpMixSM = (TH2F*) GetHisto(Form("AnaPi0_hMiMod_%d",ism));
948  if(hTmpMixSM)
949  {
950  hMixSM[ism] = (TH1F*) hTmpMixSM->ProjectionY(Form("%s_hMassMixSM%d",histoTag.Data(),ism),binmin,binmax);
951  hMixSM[ism]->Sumw2();
952  hMixSM[ism]->Rebin(2);
953  hSM[ism]->Divide(hMixSM[ism]);
954  hSM[ism]->Fit("pol0","Q","",0.25,0.35);
955  Float_t scale = 1;
956  if(hSM[ism]->GetFunction("pol0")) scale = hSM[ism]->GetFunction("pol0")->GetParameter(0);
957  //printf("Scale factor %f for cen %d\n",scale,icen);
958  hSM[ism]->Scale(1./scale);
959  }
960 
961  if(maxSM < hSM[ism]->GetMaximum()) maxSM = hSM[ism]->GetMaximum();
962  }
963 
964  hSM[first]->SetTitle("#pi^{0} peak in SM, 4 < #it{E}_{pair}< 10 GeV");
965  hSM[first]->SetTitleOffset(1.5,"Y");
966  hSM[first]->SetAxisRange(0.04,0.24);
967  hSM[first]->SetMaximum(maxSM*1.2);
968  hSM[first]->SetMinimum(0.8);
969  hSM[first]->SetYTitle("Real / Mixed");
970 
971  hSM[first]->Draw("H");
972  TLegend lsm(0.12,0.5,0.35,0.85);
973  lsm.SetTextSize(0.04);
974  lsm.AddEntry(hSM[first],Form("Mod %d",first),"P");
975 
976  for(Int_t ism = first+1; ism < 20; ism++)
977  {
978  if(!hSM[ism]) continue;
979 
980  hSM[ism]->Draw("Hsame");
981  lsm.AddEntry(hSM[ism],Form("Mod %d",ism),"P");
982  }
983 
984  lsm.SetBorderSize(0);
985  lsm.SetFillColor(0);
986  lsm.Draw();
987 
988  l1.Draw("same");
989 
990  // Pi0 Invariant mass projection, in PbPb 6 centrality bins from 0 to 50%, all in pp
991  cpi0->cd(4);
992 
993  //gPad->SetLogy();
994  //gPad->SetGridy();
995  hMassEta[0]->SetMinimum(minEta);
996  hMassEta[0]->SetTitleOffset(1.5,"Y");
997  hMassEta[0]->SetYTitle("Real / Mixed");
998  hMassEta[0]->SetTitle("#eta peak, 2 <#it{E}_{pair}< 10 GeV");
999  if (histoTag.Contains("L0")) hMassEta[0]->SetTitle("#eta peak, 5 < #it{E}_{pair}< 10 GeV");
1000  else if(histoTag.Contains("L2")) hMassEta[0]->SetTitle("#eta peak, 8 < #it{E}_{pair}< 12 GeV");
1001  else if(histoTag.Contains("L1")) hMassEta[0]->SetTitle("#eta peak, 10 < #it{E}_{pair}< 15 GeV");
1002 
1003  hMassEta[0]->Draw("H");
1004 
1005  if(hMass[1]) // PbPb
1006  {
1007  hMassEta[0]->SetMaximum(maxEta*1.2);
1008  hMassEta[5]->Draw("Hsame");
1009  hMassEta[4]->Draw("Hsame");
1010  hMassEta[3]->Draw("Hsame");
1011  hMassEta[2]->Draw("Hsame");
1012  hMassEta[1]->Draw("Hsame");
1013  hMassEta[0]->Draw("Hsame");
1014 
1015  TLegend l2(0.12,0.6,0.4,0.85);
1016  l2.SetTextSize(0.04);
1017  l2.AddEntry(hMassEta[0],"0-10%","P");
1018  l2.AddEntry(hMassEta[1],"10-20%","P");
1019  l2.AddEntry(hMassEta[2],"20-30%","P");
1020  l2.AddEntry(hMassEta[3],"30-40%","P");
1021  l2.AddEntry(hMassEta[4],"40-70%","P");
1022  l2.AddEntry(hMassEta[5],"50-60%","P");
1023  l2.SetBorderSize(0);
1024  l2.SetFillColor(0);
1025  l2.Draw();
1026  }
1027 
1028  cpi0->Print(Form("%s_Pi0Histo.%s",histoTag.Data(),format.Data()));
1029 
1030  // cleanup or save
1031  //
1032  if(exportToFile!=1)
1033  {
1034  delete h2DMass;
1035  delete hX;
1036 
1037  for(Int_t icen=0; icen<10; icen++ )
1038  {
1039  if ( hMass [icen] ) delete hMass [icen];
1040  if ( hMix [icen] ) delete hMix [icen];
1041  if ( hMassPi0[icen] ) delete hMassPi0[icen];
1042  if ( hMassEta[icen] ) delete hMassEta[icen];
1043  }
1044 
1045  for(Int_t ism = first; ism < 20; ism++)
1046  {
1047  if ( hSM [ism] ) delete hSM [ism];
1048  if ( hMixSM[ism] ) delete hMixSM[ism];
1049  }
1050 
1051  delete cpi0;
1052  }
1053  else
1054  {
1055  SaveHisto(h2DMass,kFALSE);
1056 
1057  for(Int_t icen=0; icen<10; icen++ )
1058  {
1059  SaveHisto(hMass [icen],kFALSE);
1060  SaveHisto(hMix [icen],kFALSE);
1061  SaveHisto(hMassPi0[icen],kFALSE);
1062  SaveHisto(hMassEta[icen],kFALSE);
1063  }
1064 
1065  for(Int_t ism = first; ism < 20; ism++)
1066  {
1067  SaveHisto(hSM [ism],kFALSE);
1068  SaveHisto(hMixSM[ism],kFALSE);
1069  }
1070 
1071  SaveCanvas(cpi0);
1072  }
1073 }
1074 
1082 //__________________________________________________
1083 void IsolQA(Int_t icalo)
1084 {
1085  TCanvas * cIsolation = new TCanvas(Form("%s_IsolationHisto" ,histoTag.Data()),
1086  Form("Isolation cone for %s",histoTag.Data()),
1087  1000,1000);
1088  cIsolation->Divide(2,2);
1089 
1090  Float_t minClusterE = 5;
1091  if ( histoTag.Contains("L0") ) minClusterE = 5;
1092  else if ( histoTag.Contains("L2") ) minClusterE = 10;
1093  else if ( histoTag.Contains("L1") ) minClusterE = 12;
1094 
1095  TH1F * hIsolated = (TH1F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hPt" ,icalo));
1096  TH1F * hNotIsolated = (TH1F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hPtNoIso",icalo));
1097 
1098  if(!hIsolated) return;
1099 
1100  Int_t minClusterEBin = hIsolated->FindBin(minClusterE);
1101  Float_t nTrig = hIsolated->Integral(minClusterEBin,100000)+hNotIsolated->Integral(minClusterE,100000);
1102 
1103  if ( nTrig <=0 ) return ;
1104 
1105  //
1106  // Pt in cone
1107  //
1108  cIsolation->cd(1);
1109  gPad->SetLogy();
1110 
1111  hIsolated ->Sumw2();
1112  hNotIsolated->Sumw2();
1113  hIsolated ->SetMarkerColor(4);
1114  hNotIsolated->SetMarkerColor(2);
1115  hIsolated ->SetLineColor (4);
1116  hNotIsolated->SetLineColor (2);
1117  hIsolated ->SetMarkerStyle(24);
1118  hNotIsolated->SetMarkerStyle(20);
1119 
1120  hNotIsolated->SetTitle("(non) isolated cluster spectra, #it{R}=0.4, #Sigma #it{p}_{T}<2 GeV/#it{c}");
1121  hNotIsolated->SetYTitle("Entries");
1122 
1123  hNotIsolated->Draw();
1124  hIsolated ->Draw("same");
1125 
1126  TLegend lI(0.4,0.7,0.88,0.88);
1127  lI.SetTextSize(0.04);
1128  lI.SetBorderSize(0);
1129  lI.SetFillColor(0);
1130  lI.AddEntry(hIsolated ,"Isolated candidates","P");
1131  lI.AddEntry(hNotIsolated,"NOT Isolated candidates","P");
1132  lI.Draw("same");
1133 
1134  //
1135  // Pt in cone
1136  //
1137  cIsolation->cd(2);
1138  gPad->SetLogy();
1139 
1140  TLegend l(0.55,0.55,0.88,0.88);
1141  l.SetTextSize(0.04);
1142  l.SetBorderSize(0);
1143  l.SetFillColor(0);
1144 
1145  TH2F* h2PtInCone = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hPtInCone" ,icalo));
1146  TH2F* h2PtInConeCluster = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hPtClusterInCone" ,icalo));
1147  TH2F* h2PtInConeTrack = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hPtTrackInCone" ,icalo));
1148  TH2F* h2PtInConeTrackPerp = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hPtInPerpCone" ,icalo));
1149  TH2F* h2PtInEtaBandTrack = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hEtaBandTrackPt" ,icalo));
1150  TH2F* h2PtInEtaBandCluster = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hEtaBandClusterPt",icalo));
1151 
1152  TH1F* hPtInCone = (TH1F*) h2PtInCone ->ProjectionY(Form("%s_hPtInCone_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1153  TH1F* hPtInConeCluster = (TH1F*) h2PtInConeCluster ->ProjectionY(Form("%s_hPtInConeCluster_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1154  TH1F* hPtInConeTrack = (TH1F*) h2PtInConeTrack ->ProjectionY(Form("%s_hPtInConeTrack_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1155  TH1F* hPtInConeTrackPerp = (TH1F*) h2PtInConeTrackPerp ->ProjectionY(Form("%s_hPtInConePerp_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1156  TH1F* hPtInEtaBandTrack = (TH1F*) h2PtInEtaBandTrack ->ProjectionY(Form("%s_hPtInConeEtaBandTrack_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1157  TH1F* hPtInEtaBandCluster = (TH1F*) h2PtInEtaBandCluster->ProjectionY(Form("%s_hPtInConeEtaBandCluster_TrigEnMin%2.0fGeV",histoTag.Data(),minClusterE),minClusterEBin,10000);
1158 
1159  hPtInCone ->Sumw2();
1160  hPtInConeCluster ->Sumw2();
1161  hPtInConeTrack ->Sumw2();
1162  hPtInConeTrackPerp ->Sumw2();
1163  hPtInEtaBandCluster->Sumw2();
1164  hPtInEtaBandTrack ->Sumw2();
1165 
1166  Int_t rb = 1;
1167  hPtInCone ->Rebin(rb);
1168  hPtInConeCluster ->Rebin(rb);
1169  hPtInConeTrack ->Rebin(rb);
1170  hPtInConeTrackPerp ->Rebin(rb);
1171  hPtInEtaBandCluster->Rebin(rb);
1172  hPtInEtaBandTrack ->Rebin(rb);
1173 
1174  hPtInCone ->Scale(1./nTrig);
1175  hPtInConeCluster ->Scale(1./nTrig);
1176  hPtInConeTrack ->Scale(1./nTrig);
1177  hPtInConeTrackPerp ->Scale(1./nTrig);
1178  hPtInEtaBandCluster->Scale(1./nTrig);
1179  hPtInEtaBandTrack ->Scale(1./nTrig);
1180 
1181  hPtInCone ->SetAxisRange(0,20);
1182  hPtInConeCluster ->SetAxisRange(0,20);
1183  hPtInConeTrack ->SetAxisRange(0,20);
1184  hPtInConeTrackPerp ->SetAxisRange(0,20);
1185  hPtInEtaBandCluster->SetAxisRange(0,20);
1186  hPtInEtaBandTrack ->SetAxisRange(0,20);
1187 
1188  hPtInCone ->SetMarkerStyle(24);
1189  hPtInConeCluster ->SetMarkerStyle(20);
1190  hPtInConeTrack ->SetMarkerStyle(20);
1191  hPtInConeTrackPerp ->SetMarkerStyle(27);
1192  hPtInEtaBandCluster->SetMarkerStyle(21);
1193  hPtInEtaBandTrack ->SetMarkerStyle(21);
1194 
1195  hPtInCone ->SetMarkerColor(1);
1196  hPtInConeCluster ->SetMarkerColor(2);
1197  hPtInConeTrack ->SetMarkerColor(4);
1198  hPtInConeTrackPerp ->SetMarkerColor(4);
1199  hPtInEtaBandCluster->SetMarkerColor(2);
1200  hPtInEtaBandTrack ->SetMarkerColor(4);
1201 
1202  hPtInCone ->SetLineColor(1);
1203  hPtInConeCluster ->SetLineColor(2);
1204  hPtInConeTrack ->SetLineColor(4);
1205  hPtInConeTrackPerp ->SetLineColor(4);
1206  hPtInEtaBandCluster->SetLineColor(2);
1207  hPtInEtaBandTrack ->SetLineColor(4);
1208 
1209  hPtInCone->SetTitleOffset(1.5,"Y");
1210  hPtInCone->SetYTitle("Entries / #it{N}_{candidates}");
1211  hPtInCone->SetTitle(Form("Track/cluster spectra in cone p_{T,cand}>%2.0f GeV/#it{c}, #it{R}=0.4",minClusterE));
1212 
1213  Float_t max = hPtInCone->GetMaximum();
1214  if(max < hPtInConeTrack ->GetMaximum()) max = hPtInConeTrack ->GetMaximum();
1215  if(max < hPtInConeCluster ->GetMaximum()) max = hPtInConeCluster ->GetMaximum();
1216  if(max < hPtInConeTrackPerp ->GetMaximum()) max = hPtInConeTrackPerp ->GetMaximum();
1217  if(max < hPtInEtaBandCluster->GetMaximum()) max = hPtInEtaBandCluster->GetMaximum();
1218  if(max < hPtInEtaBandTrack ->GetMaximum()) max = hPtInEtaBandTrack ->GetMaximum();
1219  hPtInCone->SetMaximum(max*2);
1220 
1221  hPtInCone ->Draw("");
1222  hPtInConeCluster ->Draw("same");
1223  hPtInConeTrack ->Draw("same");
1224  hPtInConeTrackPerp ->Draw("same");
1225  hPtInEtaBandCluster->Draw("same");
1226  hPtInEtaBandTrack ->Draw("same");
1227 
1228  l.AddEntry(hPtInCone ,"Tracks+Clusters","P");
1229  l.AddEntry(hPtInConeCluster ,"Clusters inside cone","P");
1230  l.AddEntry(hPtInConeTrack ,"Tracks inside cone","P");
1231  l.AddEntry(hPtInConeTrackPerp ,"Tracks inside #perp cones","P");
1232  l.AddEntry(hPtInEtaBandTrack ,"Tracks #eta band","P");
1233  l.AddEntry(hPtInEtaBandCluster,"Clusters #eta band","P");
1234 
1235  l.Draw("same");
1236 
1237  //
1238  // Sum Pt in cone
1239  //
1240  cIsolation->cd(3);
1241  gPad->SetLogy();
1242 
1243  TLegend l2(0.55,0.55,0.88,0.88);
1244  l2.SetTextSize(0.04);
1245  l2.SetBorderSize(0);
1246  l2.SetFillColor(0);
1247 
1248  TH2F* h2SumPtCone = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hConePtSum" ,icalo));
1249  TH2F* h2SumPtConeCluster = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hConePtSumCluster" ,icalo));
1250  TH2F* h2SumPtConeTrack = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hConePtSumTrack" ,icalo));
1251  TH2F* h2SumPtConeTrackPerp = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hPerpConePtSum" ,icalo));
1252  TH2F* h2SumPtEtaBandTrack = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hConeSumPtEtaUENormTrack" ,icalo));
1253  TH2F* h2SumPtEtaBandCluster = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hConeSumPtEtaUENormCluster",icalo));
1254  TH2F* h2SumPtConeSubTrack = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hConeSumPtEtaUESubTrack" ,icalo));
1255  TH2F* h2SumPtConeSubCluster = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hConeSumPtEtaUESubCluster" ,icalo));
1256  TH2F* h2SumPtConeSub = (TH2F*) GetHisto(Form("AnaIsolPhoton_Calo%d_hConeSumPtEtaUESub" ,icalo));
1257 
1258  TH1F* hSumPtCone = (TH1F*) h2SumPtCone ->ProjectionY(Form("%s_hSumPtCone_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1259  TH1F* hSumPtConeCluster = (TH1F*) h2SumPtConeCluster ->ProjectionY(Form("%s_hSumPtConeCluster_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1260  TH1F* hSumPtConeTrack = (TH1F*) h2SumPtConeTrack ->ProjectionY(Form("%s_hSumPtConeTrack_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1261  TH1F* hSumPtConeTrackPerp = (TH1F*) h2SumPtConeTrackPerp ->ProjectionY(Form("%s_hSumPtConePerp_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1262  TH1F* hSumPtEtaBandTrack = (TH1F*) h2SumPtEtaBandTrack ->ProjectionY(Form("%s_hSumPtConeEtaBandTrack_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1263  TH1F* hSumPtEtaBandCluster = (TH1F*) h2SumPtEtaBandCluster->ProjectionY(Form("%s_hSumPtConeEtaBandCluster_TrigEnMin%2.0fGeV",histoTag.Data(),minClusterE),minClusterEBin,10000);
1264  TH1F* hSumPtConeSub = (TH1F*) h2SumPtConeSub ->ProjectionY(Form("%s_hSumPtConeSub_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1265  TH1F* hSumPtConeSubCluster = (TH1F*) h2SumPtConeSubCluster->ProjectionY(Form("%s_hSumPtConeSubCluster_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1266  TH1F* hSumPtConeSubTrack = (TH1F*) h2SumPtConeSubTrack ->ProjectionY(Form("%s_hSumPtConeSubTrack_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1267 
1268  hSumPtCone ->Sumw2();
1269  hSumPtConeCluster ->Sumw2();
1270  hSumPtConeTrack ->Sumw2();
1271  hSumPtConeSub ->Sumw2();
1272  hSumPtConeSubCluster->Sumw2();
1273  hSumPtConeSubTrack ->Sumw2();
1274  hSumPtConeTrackPerp ->Sumw2();
1275  hSumPtEtaBandCluster->Sumw2();
1276  hSumPtEtaBandTrack ->Sumw2();
1277 
1278  rb = 1;
1279  hSumPtCone ->Rebin(rb);
1280  hSumPtConeCluster ->Rebin(rb);
1281  hSumPtConeTrack ->Rebin(rb);
1282  hSumPtConeSub ->Rebin(rb);
1283  hSumPtConeSubCluster->Rebin(rb);
1284  hSumPtConeSubTrack ->Rebin(rb);
1285  hSumPtConeTrackPerp ->Rebin(rb);
1286  hSumPtEtaBandCluster->Rebin(rb);
1287  hSumPtEtaBandTrack ->Rebin(rb);
1288 
1289  hSumPtCone ->Scale(1./nTrig);
1290  hSumPtConeCluster ->Scale(1./nTrig);
1291  hSumPtConeTrack ->Scale(1./nTrig);
1292  hSumPtConeSub ->Scale(1./nTrig);
1293  hSumPtConeSubCluster->Scale(1./nTrig);
1294  hSumPtConeSubTrack ->Scale(1./nTrig);
1295  hSumPtConeTrackPerp ->Scale(1./nTrig);
1296  hSumPtEtaBandCluster->Scale(1./nTrig);
1297  hSumPtEtaBandTrack ->Scale(1./nTrig);
1298 
1299  hSumPtCone ->SetAxisRange(0,500);
1300  hSumPtConeCluster ->SetAxisRange(0,500);
1301  hSumPtConeTrack ->SetAxisRange(0,500);
1302  hSumPtConeSub ->SetAxisRange(-5,500);
1303  hSumPtConeSubCluster->SetAxisRange(-5,500);
1304  hSumPtConeSubTrack ->SetAxisRange(-5,500);
1305  hSumPtConeTrackPerp ->SetAxisRange(0,500);
1306  hSumPtEtaBandCluster->SetAxisRange(0,500);
1307  hSumPtEtaBandTrack ->SetAxisRange(0,500);
1308 
1309  hSumPtCone ->SetMarkerStyle(24);
1310  hSumPtConeCluster ->SetMarkerStyle(20);
1311  hSumPtConeTrack ->SetMarkerStyle(20);
1312  hSumPtConeSub ->SetMarkerStyle(25);
1313  hSumPtConeSubCluster->SetMarkerStyle(25);
1314  hSumPtConeSubTrack ->SetMarkerStyle(25);
1315  hSumPtConeTrackPerp ->SetMarkerStyle(27);
1316  hSumPtEtaBandCluster->SetMarkerStyle(21);
1317  hSumPtEtaBandTrack ->SetMarkerStyle(21);
1318 
1319  hSumPtCone ->SetMarkerColor(1);
1320  hSumPtConeCluster ->SetMarkerColor(2);
1321  hSumPtConeTrack ->SetMarkerColor(4);
1322  hSumPtConeSub ->SetMarkerColor(1);
1323  hSumPtConeSubCluster->SetMarkerColor(2);
1324  hSumPtConeSubTrack ->SetMarkerColor(4);
1325  hSumPtConeTrackPerp ->SetMarkerColor(4);
1326  hSumPtEtaBandCluster->SetMarkerColor(2);
1327  hSumPtEtaBandTrack ->SetMarkerColor(4);
1328 
1329  hSumPtCone ->SetLineColor(1);
1330  hSumPtConeCluster ->SetLineColor(2);
1331  hSumPtConeTrack ->SetLineColor(4);
1332  hSumPtConeSub ->SetLineColor(1);
1333  hSumPtConeSubCluster->SetLineColor(2);
1334  hSumPtConeSubTrack ->SetLineColor(4);
1335  hSumPtConeTrackPerp ->SetLineColor(4);
1336  hSumPtEtaBandCluster->SetLineColor(2);
1337  hSumPtEtaBandTrack ->SetLineColor(4);
1338 
1339  hSumPtCone->SetTitleOffset(1.5,"Y");
1340  hSumPtCone->SetYTitle("Entries / #it{N}_{candidates}");
1341  hSumPtCone->SetTitle(Form("Track/cluster #Sigma #it{p}_{T}, p_{T,cand}>%2.0f GeV/#it{c}, #it{R}=0.4, ",minClusterE));
1342 
1343  max = hSumPtCone->GetMaximum();
1344  if(max < hSumPtConeTrack ->GetMaximum()) max = hSumPtConeTrack ->GetMaximum();
1345  if(max < hSumPtConeCluster ->GetMaximum()) max = hSumPtConeCluster ->GetMaximum();
1346  if(max < hSumPtConeSub ->GetMaximum()) max = hSumPtConeSub ->GetMaximum();
1347  if(max < hSumPtConeSubTrack ->GetMaximum()) max = hSumPtConeSubTrack ->GetMaximum();
1348  if(max < hSumPtConeSubCluster->GetMaximum()) max = hSumPtConeSubCluster->GetMaximum();
1349  if(max < hSumPtConeTrackPerp ->GetMaximum()) max = hSumPtConeTrackPerp ->GetMaximum();
1350  if(max < hSumPtEtaBandCluster->GetMaximum()) max = hSumPtEtaBandCluster->GetMaximum();
1351  if(max < hSumPtEtaBandTrack ->GetMaximum()) max = hSumPtEtaBandTrack ->GetMaximum();
1352  hSumPtCone->SetMaximum(max*2);
1353 
1354  hSumPtCone ->Draw("");
1355  hSumPtConeCluster ->Draw("same");
1356  hSumPtConeTrack ->Draw("same");
1357 // hSumPtConeSub ->Draw("same");
1358 // hSumPtConeSubCluster->Draw("same");
1359 // hSumPtConeSubTrack ->Draw("same");
1360  hSumPtConeTrackPerp ->Draw("same");
1361  hSumPtEtaBandCluster->Draw("same");
1362  hSumPtEtaBandTrack ->Draw("same");
1363 
1364  l2.AddEntry(hSumPtCone ,"Tracks+Clusters","P");
1365  l2.AddEntry(hSumPtConeCluster ,"Clusters inside cone","P");
1366  l2.AddEntry(hSumPtConeTrack ,"Tracks inside cone","P");
1367  l2.AddEntry(hSumPtConeTrackPerp ,"Tracks inside #perp cones","P");
1368  l2.AddEntry(hSumPtEtaBandTrack ,"Tracks #eta band","P");
1369  l2.AddEntry(hSumPtEtaBandCluster,"Clusters #eta band","P");
1370 // l2.AddEntry(hSumPtConeSub ,"Tracks+Clusters-#eta band","P");
1371 // l2.AddEntry(hSumPtConeSubCluster,"Clusters inside cone-#eta band","P");
1372 // l2.AddEntry(hSumPtConeSubTrack ,"Tracks inside cone-#eta band","P");
1373 
1374  l2.Draw("same");
1375 
1376  //
1377  // Sum Pt in cone, UE subtracted
1378  //
1379  cIsolation->cd(4);
1380  gPad->SetLogy();
1381 
1382  TLegend l3(0.4,0.75,0.8,0.88);
1383  l3.SetTextSize(0.04);
1384  l3.SetBorderSize(0);
1385  l3.SetFillColor(0);
1386 
1387  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));
1388  hSumPtConeSub->SetYTitle("Entries / #it{N}_{candidates}");
1389  hSumPtConeSub->SetMaximum(max*2);
1390 
1391  hSumPtConeSub ->Draw("");
1392  hSumPtConeSubCluster->Draw("same");
1393  hSumPtConeSubTrack ->Draw("same");
1394 
1395  l3.AddEntry(hSumPtConeSub ,"Tracks+Clusters-#eta band","P");
1396  l3.AddEntry(hSumPtConeSubCluster,"Clusters inside cone-#eta band","P");
1397  l3.AddEntry(hSumPtConeSubTrack ,"Tracks inside cone-#eta band","P");
1398 
1399  l3.Draw("same");
1400 
1401  cIsolation->Print(Form("%s_IsolationHisto.%s",histoTag.Data(),format.Data()));
1402 
1403  // cleanup or save
1404  //
1405  if(exportToFile!=1)
1406  {
1407  delete hPtInCone ;
1408  delete hPtInConeCluster ;
1409  delete hPtInConeTrack ;
1410  delete hPtInConeTrackPerp ;
1411  delete hPtInEtaBandTrack ;
1412  delete hPtInEtaBandCluster ;
1413 
1414  delete hSumPtCone ;
1415  delete hSumPtConeCluster ;
1416  delete hSumPtConeTrack ;
1417  delete hSumPtConeTrackPerp ;
1418  delete hSumPtEtaBandTrack ;
1419  delete hSumPtEtaBandCluster ;
1420 
1421  delete hSumPtConeSub ;
1422  delete hSumPtConeSubCluster ;
1423  delete hSumPtConeSubTrack ;
1424 
1425  delete cIsolation ;
1426  }
1427  else
1428  {
1429  SaveHisto(hPtInCone ,kFALSE);
1430  SaveHisto(hPtInConeCluster ,kFALSE);
1431  SaveHisto(hPtInConeTrack ,kFALSE);
1432  SaveHisto(hPtInConeTrackPerp ,kFALSE);
1433  SaveHisto(hPtInEtaBandTrack ,kFALSE);
1434  SaveHisto(hPtInEtaBandCluster ,kFALSE);
1435 
1436  SaveHisto(hSumPtCone ,kFALSE);
1437  SaveHisto(hSumPtConeCluster ,kFALSE);
1438  SaveHisto(hSumPtConeTrack ,kFALSE);
1439  SaveHisto(hSumPtConeTrackPerp ,kFALSE);
1440  SaveHisto(hSumPtEtaBandTrack ,kFALSE);
1441  SaveHisto(hSumPtEtaBandCluster,kFALSE);
1442 
1443  SaveHisto(hSumPtConeSub ,kFALSE);
1444  SaveHisto(hSumPtConeSubCluster,kFALSE);
1445  SaveHisto(hSumPtConeSubTrack ,kFALSE);
1446 
1447  SaveCanvas(cIsolation);
1448  }
1449 }
1450 
1458 //__________________________________________________
1459 void CorrelQA(Int_t icalo)
1460 {
1461  TCanvas * cCorrelation = new TCanvas(Form("%s_CorrelationHisto" ,histoTag.Data()),
1462  Form("Trigger cluster - associated track correlation for %s",histoTag.Data()),
1463  1000,500);
1464  cCorrelation->Divide(2,1);
1465 
1466  Float_t minClusterE = 5;
1467  if ( histoTag.Contains("L0") ) minClusterE = 8;
1468  else if ( histoTag.Contains("L2") ) minClusterE = 10;
1469  else if ( histoTag.Contains("L1") ) minClusterE = 12;
1470 
1471  Float_t assocBins[] = {0.5,2.,5.,10.,20.};
1472  Int_t nAssocBins = 4;
1473 
1474  TH1F * hTrigger = (TH1F*) GetHisto(Form("AnaPhotonHadronCorr_Calo%d_hPtTrigger",icalo));
1475 
1476  if(!hTrigger) return;
1477 
1478  Int_t minClusterEBin = hTrigger->FindBin(minClusterE);
1479  Float_t nTrig = hTrigger->Integral(minClusterEBin,100000);
1480 
1481  if ( nTrig <=0 ) return ;
1482 
1483  //Azimuthal correlation
1484  cCorrelation->cd(1);
1485  gPad->SetLogy();
1486  TH1F* hDeltaPhi[4];
1487  for(Int_t i = 0; i < 4; i++) hDeltaPhi[i] = 0;
1488 
1489  TLegend l(0.35,0.6,0.83,0.85);
1490  l.SetHeader(Form("p_{T,T} > %2.1f GeV/c",minClusterE));
1491  l.SetTextSize(0.04);
1492  l.SetBorderSize(0);
1493  l.SetFillColor(0);
1494 
1495  for(Int_t ibin = 0; ibin < nAssocBins; ibin++ )
1496  {
1497  TH2F* hDeltaPhiE =
1498  (TH2F*) GetHisto(Form("AnaPhotonHadronCorr_Calo%d_hDeltaPhiPtAssocPt%2.1f_%2.1f",icalo,assocBins[ibin],assocBins[ibin+1]));
1499  hDeltaPhi[ibin] =
1500  (TH1F*) hDeltaPhiE->ProjectionY(Form("%s_hDeltaPhi_TrackMinPt%2.1fGeV_TrigEnMin%2.0f",histoTag.Data(),assocBins[ibin],minClusterE),minClusterEBin,10000);
1501  hDeltaPhi[ibin]->Sumw2();
1502  hDeltaPhi[ibin]->Rebin(2);
1503  hDeltaPhi[ibin]->Scale(1./nTrig);
1504 
1505  hDeltaPhi[ibin]->Fit("pol0","Q","",1,2);
1506 
1507  Float_t scale = 1;
1508  if(hDeltaPhi[ibin]->GetFunction("pol0"))
1509  {
1510  scale = hDeltaPhi[ibin]->GetFunction("pol0")->GetParameter(0);
1511  hDeltaPhi[ibin]->GetFunction("pol0")->SetRange(6,7); // move from plot
1512  }
1513  hDeltaPhi[ibin]->Scale(1./scale);
1514  //printf("ibin %d, scale %f\n",ibin,scale);
1515 
1516  hDeltaPhi[ibin]->SetAxisRange(-1.6,4.7);
1517 
1518  hDeltaPhi[ibin]->SetMarkerStyle(24);
1519  hDeltaPhi[ibin]->SetMarkerColor(color[ibin]);
1520  hDeltaPhi[ibin]->SetLineColor(color[ibin]);
1521  hDeltaPhi[ibin]->SetTitleOffset(1.5,"Y");
1522  hDeltaPhi[ibin]->SetYTitle("#it{N}_{pairs} / #it{N}_{trig} / ZYAM");
1523  hDeltaPhi[ibin]->SetTitle("#gamma (#lambda_{0}^{2} < 0.4, neutral cluster) trigger");
1524 
1525  l.AddEntry(hDeltaPhi[ibin],Form("%2.1f<#it{p}_{T,A}< %2.0f GeV/c",assocBins[ibin],assocBins[ibin+1]),"P");
1526  }
1527 
1528  hDeltaPhi[2]->SetMaximum(hDeltaPhi[2]->GetMaximum()*10);
1529  hDeltaPhi[2]->SetMinimum(0.8);
1530 
1531  hDeltaPhi[2]->Draw("H");
1532  hDeltaPhi[1]->Draw("Hsame");
1533  hDeltaPhi[3]->Draw("Hsame");
1534  hDeltaPhi[0]->Draw("Hsame");
1535 
1536  l.Draw("same");
1537 
1538  // xE correlation
1539  cCorrelation->cd(2);
1540  gPad->SetLogy();
1541 
1542  TLegend l2(0.35,0.6,0.83,0.85);
1543  l2.SetHeader(Form("p_{T,T} > %2.0f GeV/c",minClusterE));
1544  l2.SetTextSize(0.04);
1545  l2.SetBorderSize(0);
1546  l2.SetFillColor(0);
1547 
1548  TH2F* hEXE = (TH2F*) GetHisto(Form("AnaPhotonHadronCorr_Calo%d_hXECharged" ,icalo));
1549  TH2F* hEXEUE = (TH2F*) GetHisto(Form("AnaPhotonHadronCorr_Calo%d_hXEUeCharged",icalo));
1550 
1551  TH1F* hXE = (TH1F*) hEXE->ProjectionY(Form("%s_hXE_TrigEnMin%2.0fGeV",histoTag.Data(),minClusterE),minClusterEBin,10000);
1552  hXE->Sumw2();
1553  hXE->Rebin(2);
1554  hXE->Scale(1./nTrig);
1555  hXE->SetAxisRange(0,1);
1556  hXE->SetMarkerStyle(24);
1557  hXE->SetMarkerColor(1);
1558  hXE->SetLineColor(1);
1559  hXE->SetTitleOffset(1.5,"Y");
1560  hXE->SetYTitle("#it{N}_{pairs} / #it{N}_{trig}");
1561  hXE->SetTitle("#gamma (#lambda_{0}^{2} < 0.4, neutral cluster) trigger");
1562  l2.AddEntry(hXE,"raw x_{E}","P");
1563  hXE->Draw();
1564 
1565  TH1F* hXEUE = (TH1F*) hEXEUE->ProjectionY(Form("%s_hXEUE_TrigEnMin%2.0fGeV",histoTag.Data(),minClusterE),minClusterEBin,10000);
1566  hXEUE->Sumw2();
1567  hXEUE->Rebin(2);
1568  hXEUE->Scale(1./nTrig);
1569  hXEUE->SetAxisRange(0,1);
1570  hXEUE->SetMarkerStyle(25);
1571  hXEUE->SetMarkerColor(2);
1572  hXEUE->SetLineColor(2);
1573  l2.AddEntry(hXEUE,"raw Und. Event x_{E}","P");
1574  hXEUE->Draw("same");
1575 
1576  l2.Draw("same");
1577 
1578  cCorrelation->Print(Form("%s_CorrelationHisto.%s",histoTag.Data(),format.Data()));
1579 
1580  // cleanup or save
1581  //
1582  if(exportToFile!=1)
1583  {
1584  for(Int_t i = 0; i < 4; i++) delete hDeltaPhi[i];
1585 
1586  delete hXE ;
1587  delete hXEUE;
1588 
1589  delete cCorrelation;
1590  }
1591  else
1592  {
1593  for(Int_t i = 0; i < 4; i++) SaveHisto(hDeltaPhi[i],kFALSE);
1594 
1595  SaveHisto(hXE ,kFALSE) ;
1596  SaveHisto(hXEUE,kFALSE);
1597 
1598  SaveCanvas(cCorrelation);
1599  }
1600 
1601 }
1602 
1612 //________________________________________________________
1613 void MCQA(Int_t icalo)
1614 {
1615  TH1F* hClusterPho = (TH1F*) GetHisto(Form("AnaPhoton_Calo%d_hPt_MCPhoton",icalo));
1616  TH1F* hClusterPi0 = (TH1F*) GetHisto(Form("AnaPhoton_Calo%d_hPt_MCPi0" ,icalo));
1617  TH1F* hClusterEta = (TH1F*) GetHisto(Form("AnaPhoton_Calo%d_hPt_MCEta" ,icalo));
1618  TH1F* hClusterPhoPi0 = (TH1F*) GetHisto(Form("AnaPhoton_Calo%d_hPt_MCPhotonPi0Decay",icalo));
1619  TH1F* hClusterPhoEta = (TH1F*) GetHisto(Form("AnaPhoton_Calo%d_hPt_MCPhotonEtaDecay",icalo));
1620 
1621  if(!hClusterPho) return;
1622 
1623  TH1F* hPrimPho = (TH1F*) GetHisto(Form("AnaPhoton_Calo%d_hPtPrim_MCPhoton" ,icalo));
1624  TH1F* hPrimPhoPi0 = (TH1F*) GetHisto(Form("AnaPhoton_Calo%d_hPtPrim_MCPhotonPi0Decay",icalo));
1625  TH1F* hPrimPhoEta = (TH1F*) GetHisto(Form("AnaPhoton_Calo%d_hPtPrim_MCPhotonEtaDecay",icalo));
1626  TH1F* hPrimPi0 = (TH1F*) GetHisto(Form("AnaPi0_Calo%d_hPrimPi0Pt",icalo));
1627  TH1F* hPrimEta = (TH1F*) GetHisto(Form("AnaPi0_Calo%d_hPrimEtaPt",icalo));
1628 
1629  TCanvas * cmc = new TCanvas(Form("%s_MCHisto" ,histoTag.Data()),
1630  Form("Cluster MC origin for %s",histoTag.Data()),
1631  1000,1000);
1632  cmc->Divide(2,2);
1633 
1634  cmc->cd(1);
1635  gPad->SetLogy();
1636 
1637  hClusterPho->SetTitle("Cluster origin spectra, primary spectra in Calo acceptance");
1638  hClusterPho->Sumw2();
1639  hClusterPho->SetMarkerColor(1);
1640  hClusterPho->SetMarkerStyle(20);
1641  hClusterPho->SetAxisRange(0.,50.,"X");
1642  //hClusterPho->SetXTitle("E_{rec,gen} (GeV)");
1643  hClusterPho->SetXTitle("#it{E}_{rec}, #it{p}_{T,gen} (GeV)");
1644  hClusterPho->SetYTitle("Entries");
1645  hClusterPho->Draw("");
1646 
1647  hClusterPhoPi0->Sumw2();
1648  hClusterPhoPi0->SetMarkerColor(4);
1649  hClusterPhoPi0->SetMarkerStyle(20);
1650  hClusterPhoPi0->Draw("same");
1651 
1652  hClusterPhoEta->Sumw2();
1653  hClusterPhoEta->SetMarkerColor(2);
1654  hClusterPhoEta->SetMarkerStyle(20);
1655  hClusterPhoEta->Draw("same");
1656 
1657  hClusterPi0->Sumw2();
1658  hClusterPi0->SetMarkerColor(4);
1659  hClusterPi0->SetMarkerStyle(21);
1660  hClusterPi0->Draw("same");
1661 
1662  hClusterEta->Sumw2();
1663  hClusterEta->SetMarkerColor(2);
1664  hClusterEta->SetMarkerStyle(22);
1665  hClusterEta->Draw("same");
1666 
1667  hPrimPho->Sumw2();
1668  hPrimPho->SetMarkerColor(1);
1669  hPrimPho->SetMarkerStyle(24);
1670  hPrimPho->Draw("same");
1671 
1672  hPrimPhoPi0->Sumw2();
1673  hPrimPhoPi0->SetMarkerColor(4);
1674  hPrimPhoPi0->SetMarkerStyle(24);
1675  hPrimPhoPi0->Draw("same");
1676 
1677  hPrimPhoEta->Sumw2();
1678  hPrimPhoEta->SetMarkerColor(2);
1679  hPrimPhoEta->SetMarkerStyle(24);
1680  hPrimPhoEta->Draw("same");
1681 
1682  hPrimPi0->Sumw2();
1683  hPrimPi0->SetMarkerColor(4);
1684  hPrimPi0->SetMarkerStyle(25);
1685  hPrimPi0->Draw("same");
1686 
1687  hPrimEta->Sumw2();
1688  hPrimEta->SetMarkerColor(2);
1689  hPrimEta->SetMarkerStyle(26);
1690  hPrimEta->Draw("same");
1691 
1692  TLegend lR(0.5,0.5,0.7,0.89);
1693  lR.SetHeader("reco");
1694  lR.SetTextSize(0.04);
1695  lR.AddEntry(hClusterPho,"#gamma","P");
1696  lR.AddEntry(hClusterPhoPi0,"#gamma_{#pi^{0}}","P");
1697  lR.AddEntry(hClusterPhoEta,"#gamma_{#eta}","P");
1698  lR.AddEntry(hClusterPi0,"#pi^{0}","P");
1699  lR.AddEntry(hClusterEta,"#eta","P");
1700  lR.SetBorderSize(0);
1701  lR.SetFillColor(0);
1702  lR.Draw();
1703 
1704  TLegend lG(0.7,0.5,0.83,0.89);
1705  lG.SetHeader("gener");
1706  lG.SetTextSize(0.04);
1707  lG.AddEntry(hPrimPho,"#gamma","P");
1708  lG.AddEntry(hPrimPhoPi0,"#gamma_{#pi^{0}}","P");
1709  lG.AddEntry(hPrimPhoEta,"#gamma_{#eta}","P");
1710  lG.AddEntry(hPrimPi0,"#pi^{0}","P");
1711  lG.AddEntry(hPrimEta,"#eta","P");
1712  lG.SetBorderSize(0);
1713  lG.SetFillColor(0);
1714  lG.Draw();
1715 
1716  cmc->cd(2);
1717  gPad->SetLogy();
1718  TH1F* hRatPho = (TH1F*) hClusterPho ->Clone(Form("%s_hGenRecoRatPho" ,histoTag.Data()));
1719  TH1F* hRatPi0 = (TH1F*) hClusterPi0 ->Clone(Form("%s_hGenRecoRatPi0" ,histoTag.Data()));
1720  TH1F* hRatEta = (TH1F*) hClusterEta ->Clone(Form("%s_hGenRecoRatEta" ,histoTag.Data()));
1721  TH1F* hRatPhoPi0 = (TH1F*) hClusterPhoPi0->Clone(Form("%s_hGenRecoRatPhoPi0",histoTag.Data()));
1722  TH1F* hRatPhoEta = (TH1F*) hClusterPhoEta->Clone(Form("%s_hGenRecoRatPhoEta",histoTag.Data()));
1723 
1724  hRatPho ->Divide(hPrimPho);
1725  hRatPhoPi0->Divide(hPrimPhoPi0);
1726  hRatPhoEta->Divide(hPrimPhoEta);
1727  hRatPi0 ->Divide(hPrimPi0);
1728  hRatEta ->Divide(hPrimEta);
1729 
1730  hRatPho->SetTitle("Reconstructed cluster / Generated particle in Calo acc.");
1731  hRatPho->SetYTitle("#it{Ratio reco / gener}");
1732  hRatPho->SetXTitle("#it{E} (GeV)");
1733  hRatPho->SetMinimum(1e-3);
1734  hRatPho->SetMaximum(20);
1735  hRatPho->Draw("");
1736  hRatPhoPi0->Draw("same");
1737  hRatPhoEta->Draw("same");
1738  hRatPi0->Draw("same");
1739  hRatEta->Draw("same");
1740 
1741  TLegend l2(0.15,0.62,0.3,0.89);
1742  l2.SetTextSize(0.04);
1743  l2.AddEntry(hRatPho,"#gamma","P");
1744  l2.AddEntry(hRatPhoPi0,"#gamma_{#pi^{0}}","P");
1745  l2.AddEntry(hRatPhoEta,"#gamma_{#eta}","P");
1746  l2.AddEntry(hRatPi0,"#pi^{0}","P");
1747  l2.AddEntry(hRatEta,"#eta","P");
1748  l2.SetBorderSize(0);
1749  l2.SetFillColor(0);
1750  l2.Draw();
1751 
1752  cmc->cd(3);
1753  //gPad->SetLogy();
1754 
1755  TH2F* h2PrimPhoPhi = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hPhiPrim_MCPhoton",icalo));
1756  TH2F* h2PrimPi0Phi = (TH2F*) GetHisto(Form("AnaPi0_Calo%d_hPrimPi0Phi" ,icalo));
1757  TH2F* h2PrimEtaPhi = (TH2F*) GetHisto(Form("AnaPi0_Calo%d_hPrimEtaPhi" ,icalo));
1758 
1759  Int_t binMin = hPrimPho->FindBin(3);
1760 
1761  TH1F* hPrimPhoPhi = (TH1F*) h2PrimPhoPhi->ProjectionY(Form("%s_hPrimPhoPhi",histoTag.Data()),binMin,1000);
1762  TH1F* hPrimPi0Phi = (TH1F*) h2PrimPi0Phi->ProjectionY(Form("%s_hPrimPi0Phi",histoTag.Data()),binMin,1000);
1763  TH1F* hPrimEtaPhi = (TH1F*) h2PrimEtaPhi->ProjectionY(Form("%s_hPrimEtaPhi",histoTag.Data()),binMin,1000);
1764 
1765  hPrimPhoPhi->Sumw2();
1766  hPrimPi0Phi->Sumw2();
1767  hPrimEtaPhi->Sumw2();
1768 
1769  hPrimPhoPhi->Scale(1./hPrimPhoPhi->Integral(0,1000));
1770  hPrimPi0Phi->Scale(1./hPrimPi0Phi->Integral(0,1000));
1771  hPrimEtaPhi->Scale(1./hPrimEtaPhi->Integral(0,1000));
1772 
1773  Float_t maxPhi = hPrimPhoPhi->GetMaximum();
1774  if(maxPhi < hPrimPi0Phi->GetMaximum()) maxPhi = hPrimPi0Phi->GetMaximum();
1775  if(maxPhi < hPrimEtaPhi->GetMaximum()) maxPhi = hPrimEtaPhi->GetMaximum();
1776 
1777  Float_t minPhi = hPrimPhoPhi->GetMinimum();
1778  if(minPhi > hPrimPi0Phi->GetMinimum()) minPhi = hPrimPi0Phi->GetMinimum();
1779  if(minPhi > hPrimEtaPhi->GetMinimum()) minPhi = hPrimEtaPhi->GetMinimum();
1780 
1781  hPrimPi0Phi->SetMaximum(maxPhi*1.1);
1782  hPrimPi0Phi->SetMinimum(minPhi);
1783  TGaxis::SetMaxDigits(3);
1784 
1785  hPrimPi0Phi->SetYTitle("1/total entries d#it{N}/d#varphi");
1786  hPrimPi0Phi->SetTitle("Generated particles #varphi for #it{E} > 3 GeV");
1787  hPrimPi0Phi->SetTitleOffset(1.5,"Y");
1788  hPrimPi0Phi->SetMarkerColor(4);
1789  hPrimPi0Phi->SetMarkerStyle(21);
1790  hPrimPi0Phi->Draw("");
1791 
1792  hPrimPhoPhi->SetMarkerColor(1);
1793  hPrimPhoPhi->SetMarkerStyle(20);
1794  Float_t scale = TMath::RadToDeg();
1795  ScaleXaxis(hPrimPhoPhi, TMath::RadToDeg());
1796  hPrimPhoPhi->Draw("same");
1797 
1798  hPrimEtaPhi->SetMarkerColor(2);
1799  hPrimEtaPhi->SetMarkerStyle(22);
1800  hPrimEtaPhi->Draw("same");
1801 
1802  cmc->cd(4);
1803  //gPad->SetLogy();
1804 
1805  TH2F* h2PrimPhoEtaP = (TH2F*) GetHisto(Form("AnaPhoton_Calo%d_hYPrim_MCPhoton",icalo));
1806  TH2F* h2PrimPi0EtaP = (TH2F*) GetHisto(Form("AnaPi0_Calo%d_hPrimPi0Rapidity" ,icalo));
1807  TH2F* h2PrimEtaEtaP = (TH2F*) GetHisto(Form("AnaPi0_Calo%d_hPrimEtaRapidity" ,icalo));
1808 
1809  h2PrimPhoEtaP->Sumw2();
1810  h2PrimEtaEtaP->Sumw2();
1811  h2PrimPi0EtaP->Sumw2();
1812 
1813  binMin = hPrimPho->FindBin(3);
1814 
1815  TH1F* hPrimPhoEtaP = (TH1F*) h2PrimPhoEtaP->ProjectionY(Form("%s_hPrimPhoEtaP",histoTag.Data()),binMin,1000);
1816  TH1F* hPrimPi0EtaP = (TH1F*) h2PrimPi0EtaP->ProjectionY(Form("%s_hPrimPi0EtaP",histoTag.Data()),binMin,1000);
1817  TH1F* hPrimEtaEtaP = (TH1F*) h2PrimEtaEtaP->ProjectionY(Form("%s_hPrimEtaEtaP",histoTag.Data()),binMin,1000);
1818 
1819  hPrimPhoEtaP->Scale(1./hPrimPhoEtaP->Integral(0,1000));
1820  hPrimPi0EtaP->Scale(1./hPrimPi0EtaP->Integral(0,1000));
1821  hPrimEtaEtaP->Scale(1./hPrimEtaEtaP->Integral(0,1000));
1822 
1823  Float_t maxEta = hPrimPhoEtaP->GetMaximum();
1824  if(maxEta < hPrimPi0EtaP->GetMaximum()) maxEta = hPrimPi0EtaP->GetMaximum();
1825  if(maxEta < hPrimEtaEtaP->GetMaximum()) maxEta = hPrimEtaEtaP->GetMaximum();
1826 
1827  Float_t minEta = hPrimPhoEtaP->GetMinimum();
1828  if(minEta > hPrimPi0EtaP->GetMinimum()) minEta = hPrimPi0EtaP->GetMinimum();
1829  if(minEta > hPrimEtaEtaP->GetMinimum()) minEta = hPrimEtaEtaP->GetMinimum();
1830 
1831  hPrimPi0EtaP->SetMaximum(maxEta*1.1);
1832  hPrimPi0EtaP->SetMinimum(minEta);
1833  TGaxis::SetMaxDigits(3);
1834 
1835  hPrimPi0EtaP->SetYTitle("1/total entries d#it{N}/d#eta");
1836  hPrimPi0EtaP->SetTitle("Generated particles #eta for #it{E} > 3 GeV");
1837  hPrimPi0EtaP->SetTitleOffset(1.5,"Y");
1838  hPrimPi0EtaP->SetMarkerColor(4);
1839  hPrimPi0EtaP->SetMarkerStyle(21);
1840  hPrimPi0EtaP->Draw("");
1841 
1842  hPrimPhoEtaP->SetMarkerColor(1);
1843  hPrimPhoEtaP->SetMarkerStyle(20);
1844  scale = TMath::RadToDeg();
1845  hPrimPhoEtaP->Draw("same");
1846 
1847  hPrimEtaEtaP->SetMarkerColor(2);
1848  hPrimEtaEtaP->SetMarkerStyle(22);
1849  hPrimEtaEtaP->Draw("same");
1850 
1851  cmc->Print(Form("%s_MCHisto.%s",histoTag.Data(),format.Data()));
1852 
1853  // cleanup or save
1854  //
1855  if(exportToFile!=1)
1856  {
1857  delete hPrimPhoPhi ;
1858  delete hPrimPi0Phi ;
1859  delete hPrimEtaPhi ;
1860  delete hPrimPhoEtaP ;
1861  delete hPrimPi0EtaP ;
1862  delete hPrimEtaEtaP ;
1863 
1864  delete cmc ;
1865  }
1866  else
1867  {
1868  SaveHisto(hPrimPhoPhi ,kFALSE);
1869  SaveHisto(hPrimPi0Phi ,kFALSE);
1870  SaveHisto(hPrimEtaPhi ,kFALSE);
1871  SaveHisto(hPrimPhoEtaP,kFALSE);
1872  SaveHisto(hPrimPi0EtaP,kFALSE);
1873  SaveHisto(hPrimEtaEtaP,kFALSE);
1874 
1875  SaveCanvas(cmc) ;
1876  }
1877 }
1878 
1885 //____________________________________________________________________
1887 {
1888  if(list) delete list;
1889 
1890  list = (TList*) dir->Get(trigName);
1891 
1892  if ( !list )
1893  {
1894  printf("List not found, do nothing\n");
1895  return kFALSE;
1896  }
1897 
1898  if ( list->GetEntries() <= 0 )
1899  {
1900  printf("No histograms found <%d>, do nothing\n",list->GetEntries());
1901  return kFALSE;
1902  }
1903 
1904  if ( exportToFile == 2 )
1905  {
1906  fout = new TFile(Form("AnalysisResults%s.root",histoTag.Data()),"RECREATE");
1907  list->Write();
1908  fout->Close();
1909  }
1910 
1911  return kTRUE ;
1912 }
1913 
1922 //___________________________________
1924 {
1925  TObject *histo = 0x0;
1926 
1927  if ( list ) histo = list->FindObject(histoName);
1928  else histo = file->Get (histoName);
1929 
1930  SaveHisto(histo);
1931 
1932  return histo;
1933 }
1934 
1942 //_________________________________________
1943 void SaveHisto(TObject* histo, Bool_t tag)
1944 {
1945  if(histo)
1946  {
1947  if(tag) histo->Write(Form("fig_ga_%s_%s",histoTag.Data(), histo->GetName()));
1948  else histo->Write(Form("fig_ga_%s" ,histo->GetName()));
1949  }
1950 // else
1951 // printf("Object not Available");
1952 }
1953 
1958 //_______________________________
1959 void SaveCanvas(TCanvas* canvas)
1960 {
1961  if(canvas) canvas->Write(Form("canvas_ga_%s",canvas->GetName()));
1962 }
1963 
1968 //___________________________________________________
1969 void ScaleAxis(TAxis *a, Double_t scale)
1970 {
1971  if (!a) return; // just a precaution
1972  if (a->GetXbins()->GetSize())
1973  {
1974  // an axis with variable bins
1975  // note: bins must remain in increasing order, hence the "Scale"
1976  // function must be strictly (monotonically) increasing
1977  TArrayD X(*(a->GetXbins()));
1978  for(Int_t i = 0; i < X.GetSize(); i++) X[i] = scale*X[i];
1979  a->Set((X.GetSize() - 1), X.GetArray()); // new Xbins
1980  }
1981  else
1982  {
1983  // an axis with fix bins
1984  // note: we modify Xmin and Xmax only, hence the "Scale" function
1985  // must be linear (and Xmax must remain greater than Xmin)
1986  a->Set(a->GetNbins(),
1987  - scale*a->GetXmin(), // new Xmin
1988  - scale*a->GetXmax()); // new Xmax
1989  }
1990  return;
1991 }
1992 
1997 //___________________________________________________
1998 void ScaleXaxis(TH1 *h, Double_t scale)
1999 {
2000  if (!h) return; // just a precaution
2001  ScaleAxis(h->GetXaxis(), scale);
2002  return;
2003 }
2004 
2005 
2006 
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