43 #if !defined(__CINT__) || defined(__MAKECINT__) 46 #include <TDirectoryFile.h> 87 TDirectoryFile *
dir = 0;
99 Int_t color[]={kBlack,kRed,kOrange+1,kYellow+1,kGreen+2,kBlue,kCyan+1,kViolet,kMagenta+2,kGray,kCyan-2,kViolet-2};
122 TString listName =
"Pi0IM_GammaTrackCorr_EMCAL",
126 TString outFileName =
"CaloTrackCorrQA_output",
134 printf(
"Open <%s>; Get Trigger List : <%s>; Export option <%d>; format %s; outputFileName %s.root, ok flag %d\n",
142 printf(
"File not found, do nothing\n");
146 dir = (TDirectoryFile*) file->Get(listName);
149 printf(
"DirectoryFile not found, do nothing\n");
157 fout = TFile::Open(Form(
"%s.root",outFileName.Data()),
"UPDATE");
159 fout =
new TFile(Form(
"%s.root",outFileName.Data()),
"RECREATE");
163 TDirectoryFile *cdd = (TDirectoryFile*)
fout->Get(
"GA");
166 printf(
"Warning: GA <dir> doesn't exist, creating a new one");
167 cdd = (TDirectoryFile*)
fout->mkdir(
"GA");
229 printf(
"\t -- Process trigger %s, ok %d\n",trigName.Data(), ok);
237 printf(
"\t \t n Events %2.3e\n",
nEvents);
241 printf(
"Skip list %s, no events\n",trigName.Data());
247 gStyle->SetOptTitle(1);
248 gStyle->SetOptStat(0);
249 gStyle->SetOptFit(000000);
250 gStyle->SetPadRightMargin(0.15);
253 gStyle->SetTitleFontSize(0.05);
259 if (trigName.Contains(
"EMCAL")) { calo = 0 ; nCalo = 1 ; }
260 else if(trigName.Contains(
"DCAL" )) { calo = 1 ; nCalo = 2 ; }
262 TString caloString [] = {
"EMCAL",
"DCAL"};
273 for(
Int_t icalo = calo; icalo < nCalo; icalo++)
275 if(trigName.Contains(
"default")) histoTag=Form(
"%s_%s",caloString[icalo].
Data(),trigName.Data());
283 gStyle->SetPadRightMargin(0.02);
294 gStyle->SetPadRightMargin(0.15);
314 TCanvas * ccalo =
new TCanvas(Form(
"%s_CaloHisto_SpectraTM" ,histoTag.Data()),
315 Form(
"Cluster spectra and track match residuals for %s",histoTag.Data()),
323 TH1F* hClusterEnergy = (TH1F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hPt_Cut_6_Fidutial",icalo));
324 if(!hClusterEnergy)
return;
325 hClusterEnergy->SetYTitle(
"Entries");
326 hClusterEnergy->SetTitle(
"Cluster-cell energy spectra");
327 hClusterEnergy->SetTitleOffset(1.5,
"Y");
328 hClusterEnergy->Sumw2();
329 hClusterEnergy->SetMarkerColor(1);
330 hClusterEnergy->SetMarkerStyle(20);
331 hClusterEnergy->SetAxisRange(0.,50.,
"X");
332 hClusterEnergy->Draw();
334 TLegend l(0.15,0.15,0.3,0.3);
336 l.AddEntry(hClusterEnergy,
"Good Cluster",
"P");
341 TH1F* hCellAmplitude = 0;
344 if(histoTag.Contains(
"default"))
346 if ( icalo == 0 ) hCellAmplitude = (TH1F*) h2CellAmplitude->ProjectionX(Form(
"%s_hCellAmp",histoTag.Data()), 1,12);
347 else hCellAmplitude = (TH1F*) h2CellAmplitude->ProjectionX(Form(
"%s_hCellAmp",histoTag.Data()),12,20);
349 else hCellAmplitude = (TH1F*) h2CellAmplitude->ProjectionX(Form(
"%s_hCellAmp",histoTag.Data()),0,100);
351 hCellAmplitude->Sumw2();
352 hCellAmplitude->SetMarkerColor(4);
353 hCellAmplitude->SetMarkerStyle(25);
354 hCellAmplitude->Draw(
"same");
355 l.AddEntry(hCellAmplitude,
"Cell",
"P");
365 if ( histoTag.Contains(
"L0") ) minClusterE = 4;
366 else if ( histoTag.Contains(
"L2") ) minClusterE = 10;
367 else if ( histoTag.Contains(
"L1") ) minClusterE = 14;
371 if ( hClusterEnergy->GetEntries() < 1000 ) ok = 4;
374 for(
Int_t ibin = 1; ibin < hClusterEnergy->GetNbinsX(); ibin++)
376 if ( hClusterEnergy->GetBinCenter(ibin) < minClusterE )
continue;
378 if ( hClusterEnergy->GetBinContent(ibin) < 100 )
continue;
380 if ( hClusterEnergy->GetBinContent(ibin)*1.4 < hClusterEnergy->GetBinContent(ibin+1) )
397 TH1F* hTM = (TH1F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hPt_Cut_7_Matching",icalo));
398 TH1F* hShSh = (TH1F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hPt_Cut_9_PID" ,icalo));
414 hTM ->SetTitle(
"Ratio after cluster cuts application");
415 hTM ->SetYTitle(
"Selected clusters / Good clusters");
416 hTM ->SetTitleOffset(1.5,
"Y");
418 hTM ->SetAxisRange(0.,50.,
"X");
419 hTM ->SetMarkerColor(2);
420 hTM ->SetMarkerStyle(21);
421 hTM ->SetMaximum(1.1);
423 hTM ->Divide(hClusterEnergy);
427 hShSh->SetMarkerColor(4);
428 hShSh->SetMarkerStyle(22);
429 hShSh->Divide(hClusterEnergy);
432 TLegend l2(0.15,0.15,0.3,0.3);
433 l2.SetTextSize(0.04);
435 l2.AddEntry(hTM,
"+ Track matching",
"P");
436 l2.AddEntry(hShSh,
"+ #lambda^{2}_{0} < 0.4",
"P");
447 for(
Int_t ibin = 1; ibin < hTM->GetNbinsX(); ibin++)
449 if(hTM->GetBinCenter(ibin) < 0.5)
continue;
450 if(hTM->GetBinCenter(ibin) > 20 )
break;
452 Float_t conTM = hTM ->GetBinContent(ibin);
453 Float_t conSh = hShSh->GetBinContent(ibin);
454 Float_t errTM = hTM ->GetBinError(ibin);
455 Float_t errSh = hShSh->GetBinError(ibin);
457 if(errTM > conTM || errSh > conSh)
continue;
461 if(conTM > 0.999 || conSh > 0.999 || conTM < 0.5 || conSh < 0.2)
473 TH1F* hTrackMatchResEtaNeg = NULL;
474 TH1F* hTrackMatchResEtaPos = NULL;
475 TH1F* hTrackMatchResPhiNeg = NULL;
476 TH1F* hTrackMatchResPhiPos = NULL;
479 TH2F* hTrackMatchResEtaPhi = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hTrackMatchedDEtaDPhiPosNoCut",icalo));
480 if(hTrackMatchResEtaPhi)
482 hTrackMatchResEtaPhi ->Add( (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hTrackMatchedDEtaDPhiNegNoCut",icalo) ));
487 hTrackMatchResEtaPhi->SetAxisRange(-0.025,0.025,
"X");
488 hTrackMatchResEtaPhi->SetAxisRange(-0.025,0.025,
"Y");
489 hTrackMatchResEtaPhi->SetTitleOffset(1.5,
"Y");
490 hTrackMatchResEtaPhi->SetTitleOffset(1.5,
"Z");
491 hTrackMatchResEtaPhi->SetTitle(
"Track-cluster residual #Delta#varphi vs #Delta#eta, #it{E}>0.5 GeV");
492 hTrackMatchResEtaPhi->SetXTitle(
"#Delta #eta");
493 hTrackMatchResEtaPhi->SetYTitle(
"#Delta #varphi");
494 hTrackMatchResEtaPhi->SetZTitle(
"Entries");
495 hTrackMatchResEtaPhi->Draw(
"colz");
501 TGaxis::SetMaxDigits(3);
503 TH2F* h2TrackMatchResEtaNeg = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hTrackMatchedDEtaNegNoCut",icalo));
504 TH2F* h2TrackMatchResEtaPos = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hTrackMatchedDEtaPosNoCut",icalo));
505 TH2F* h2TrackMatchResPhiNeg = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hTrackMatchedDPhiNegNoCut",icalo));
506 TH2F* h2TrackMatchResPhiPos = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hTrackMatchedDPhiPosNoCut",icalo));
508 Float_t binMin = hClusterEnergy->FindBin(0.5);
509 hTrackMatchResEtaNeg = (TH1F*) h2TrackMatchResEtaNeg->ProjectionY(Form(
"%s_hTrackMatchProjClusEnEtaNeg",histoTag.Data()),binMin, 1000);
510 hTrackMatchResEtaPos = (TH1F*) h2TrackMatchResEtaPos->ProjectionY(Form(
"%s_hTrackMatchProjClusEnEtaPos",histoTag.Data()),binMin, 1000);
511 hTrackMatchResPhiNeg = (TH1F*) h2TrackMatchResPhiNeg->ProjectionY(Form(
"%s_hTrackMatchProjClusEnPhiNeg",histoTag.Data()),binMin, 1000);
512 hTrackMatchResPhiPos = (TH1F*) h2TrackMatchResPhiPos->ProjectionY(Form(
"%s_hTrackMatchProjClusEnPhiPos",histoTag.Data()),binMin, 1000);
514 hTrackMatchResEtaNeg->SetXTitle(
"#Delta #eta, #Delta #varphi");
515 hTrackMatchResEtaNeg->SetYTitle(
"Entries");
516 hTrackMatchResEtaNeg->SetTitle(
"Track-cluster residuals, #it{E} > 1 GeV");
517 hTrackMatchResEtaNeg->SetTitleOffset(1.5,
"Y");
518 hTrackMatchResEtaNeg->SetAxisRange(-0.025,0.025,
"X");
519 hTrackMatchResEtaNeg->Sumw2();
520 hTrackMatchResEtaNeg->SetMarkerStyle(25);
521 hTrackMatchResEtaNeg->SetMarkerColor(2);
522 hTrackMatchResEtaNeg->Draw(
"");
524 hTrackMatchResEtaPos->Sumw2();
525 hTrackMatchResEtaPos->SetMarkerStyle(25);
526 hTrackMatchResEtaPos->SetMarkerColor(4);
527 hTrackMatchResEtaPos->Draw(
"same");
529 hTrackMatchResPhiNeg->Sumw2();
530 hTrackMatchResPhiNeg->SetMarkerStyle(24);
531 hTrackMatchResPhiNeg->SetMarkerColor(2);
532 hTrackMatchResPhiNeg->Draw(
"same");
534 hTrackMatchResPhiPos->Sumw2();
535 hTrackMatchResPhiPos->SetMarkerStyle(24);
536 hTrackMatchResPhiPos->SetMarkerColor(4);
537 hTrackMatchResPhiPos->Draw(
"same");
539 TLine l0(0,hTrackMatchResEtaNeg->GetMinimum(),0,hTrackMatchResEtaNeg->GetMaximum()*1.);
542 TLegend l3(0.55,0.7,0.83,0.85);
543 l3.SetTextSize(0.04);
544 l3.AddEntry(hTrackMatchResEtaNeg,
"#Delta #eta, Negative",
"P");
545 l3.AddEntry(hTrackMatchResEtaPos,
"#Delta #eta, Positive",
"P");
546 l3.AddEntry(hTrackMatchResPhiNeg,
"#Delta #varphi, Negative",
"P");
547 l3.AddEntry(hTrackMatchResPhiPos,
"#Delta #varphi, Positive",
"P");
559 if ( hTrackMatchResPhiPos->GetEntries() < 10 || hTrackMatchResPhiNeg->GetEntries() < 10 ||
560 hTrackMatchResEtaPos->GetEntries() < 10 || hTrackMatchResEtaNeg->GetEntries() < 10 ) ok = 1;
570 if( hTrackMatchResPhiPos->GetMean()*1000 < -2 || hTrackMatchResEtaPos->GetMean()*1000 < -2 ||
571 hTrackMatchResPhiNeg->GetMean()*1000 > 2 || hTrackMatchResEtaNeg->GetMean()*1000 > 2) ok = 2;
577 ccalo->Print(Form(
"%s_CaloHisto_ClusterSpectraAndTrackResiduals.%s",histoTag.Data(),format.Data()));
583 delete hCellAmplitude;
584 delete hTrackMatchResEtaNeg;
585 delete hTrackMatchResEtaPos;
586 delete hTrackMatchResPhiNeg;
587 delete hTrackMatchResPhiPos;
605 TCanvas * ccalo2 =
new TCanvas(Form(
"%s_CaloHisto_CellClusterHit" ,histoTag.Data()),
606 Form(
"Cell and cluster hit maps for %s",histoTag.Data()),
616 if(icalo == 0) hCellActivity->SetAxisRange( 0,127,
"Y");
617 else hCellActivity->SetAxisRange(128,220,
"Y");
618 hCellActivity->SetTitle(
"Hits per cell (#it{E} > 0.2 GeV)");
619 hCellActivity->SetTitleOffset(1.5,
"Y");
620 hCellActivity->SetZTitle(
"Entries");
621 hCellActivity->SetTitleOffset(1.5,
"Z");
622 hCellActivity->Draw(
"colz");
633 for(
Int_t ibin = 2; ibin < hCellActivity->GetNbinsX(); ibin++)
635 for(
Int_t jbin = 2; jbin < hCellActivity->GetNbinsY(); jbin++)
637 if(histoTag.Contains(
"default"))
639 if ( icalo == 0 && jbin > 129 ) continue ;
640 if ( icalo == 1 && jbin < 130 ) continue ;
644 if ( hCellActivity->GetBinContent(ibin,jbin) > 2 ) nHitCell++;
650 Float_t totalCells = 10*24*48+2*8*48;
651 if(icalo==1) totalCells = 6*24*32+2*8*48;
653 Float_t active = nHitCell / totalCells ;
655 if ( active > 0.90) ok = 0;
656 else if ( active > 0.7 ) ok = 2;
682 if(icalo == 0) hCellActivityE->SetAxisRange( 0,127,
"Y");
683 else hCellActivityE->SetAxisRange(128,220,
"Y");
685 hCellActivityE->SetTitle(
"Mean energy per cell (#it{E} > 0.2 GeV)");
687 if(icalo != 1 && !histoTag.Contains(
"default"))
688 hCellActivityE->Divide(hCellActivity);
690 hCellActivityE->SetTitleOffset(1.5,
"Y");
691 hCellActivityE->SetZTitle(
"#Sigma #it{E}_{cell} / Entries_{per cell}");
692 hCellActivityE->SetTitleOffset(1.5,
"Z");
694 hCellActivityE->Draw(
"colz");
705 for(
Int_t ibin = 2; ibin < hCellActivityE->GetNbinsX(); ibin++)
708 for(
Int_t jbin = 2; jbin < hCellActivityE->GetNbinsY(); jbin++)
710 if(histoTag.Contains(
"default"))
712 if ( icalo == 0 && jbin > 129 ) continue ;
713 if ( icalo == 1 && jbin < 130 ) continue ;
717 if ( hCellActivityE->GetBinContent(ibin,jbin) > 0 )
729 Float_t totalCells = 10*24*48+2*8*48;
730 if(icalo==1) totalCells = 6*24*32+2*8*48;
732 Float_t active = nHitCell / totalCells ;
734 if ( active > 0.90) ok = 0;
735 else if ( active > 0.7 ) ok = 2;
760 TH2F* hClusterActivity = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hEBin0_Cluster_ColRow_PID",icalo));
762 if(histoTag.Contains(
"default")) hClusterActivity->SetTitle(
"Clusters per col-row 0.5<#it{E}<3 GeV");
763 else if(histoTag.Contains(
"L0")) hClusterActivity->SetTitle(
"Clusters per col-row 2<#it{E}<5 GeV");
764 else hClusterActivity->SetTitle(
"Clusters per col-row 5<#it{E}<12 GeV");
766 hClusterActivity->SetTitleOffset(1.5,
"Y");
767 hClusterActivity->SetZTitle(
"Entries");
768 hClusterActivity->SetTitleOffset(1.5,
"Z");
770 hClusterActivity->Draw(
"colz");
781 for(
Int_t ibin = 1; ibin < hClusterActivity->GetNbinsX(); ibin++)
783 for(
Int_t jbin = 1; jbin < hClusterActivity->GetNbinsY(); jbin++)
786 if ( hClusterActivity->GetBinContent(ibin,jbin) > 2 ) nHitCell++;
792 Float_t totalCells = 10*24*48+2*8*48 -48*12-10*24-4*8;
793 if(icalo==1) totalCells = 6*24*32+2*8*48 -32*8-48*4-6*24-8*2;
795 Float_t active = nHitCell / totalCells ;
797 if ( active > 0.90) ok = 0;
798 else if ( active > 0.7 ) ok = 2;
801 if(ok==1 &&
nEvents < 1000000) ok = 2;
823 TH2F* hClusterActivity2 = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hEBin1_Cluster_ColRow_PID",icalo));
825 if(histoTag.Contains(
"default")) hClusterActivity2->SetTitle(
"Clusters per col-row #it{E} > 3 GeV");
826 else if(histoTag.Contains(
"L0")) hClusterActivity2->SetTitle(
"Clusters per col-row #it{E} > 5 GeV");
827 else hClusterActivity2->SetTitle(
"Clusters per col-row #it{E} > 12 GeV");
829 hClusterActivity2->SetTitleOffset(1.5,
"Y");
830 hClusterActivity2->SetZTitle(
"Entries");
831 hClusterActivity2->SetTitleOffset(1.5,
"Z");
833 hClusterActivity2->Draw(
"colz");
844 for(
Int_t ibin = 1; ibin < hClusterActivity2->GetNbinsX(); ibin++)
846 for(
Int_t jbin = 1; jbin < hClusterActivity2->GetNbinsY(); jbin++)
849 if ( hClusterActivity2->GetBinContent(ibin,jbin) > 0 ) nHitCell++;
855 Float_t totalCells = 10*24*48+2*8*48 -48*12-10*24-4*8;
856 if(icalo==1) totalCells = 6*24*32+2*8*48 -32*8-48*4-6*24-8*2;
858 Float_t active = nHitCell / totalCells ;
860 if ( active > 0.80) ok = 0;
861 else if ( active > 0.50) ok = 2;
864 if(ok==1 &&
nEvents < 1000000) ok = 2;
881 ccalo2->Print(Form(
"%s_CaloHisto_CellClusterHit.%s",histoTag.Data(),format.Data()));
891 TCanvas * ccalo3 =
new TCanvas(Form(
"%s_CaloHisto_ClusterTimeShape" ,histoTag.Data()),
892 Form(
"Cluster time, shape, ncells for %s",histoTag.Data()),
900 TH2F* hClusterTime = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hTimePt",icalo));
901 hClusterTime->SetTitle(
"Cluster #it{E} vs #it{time}");
902 hClusterTime->SetYTitle(
"#it{time} (ns)");
904 hClusterTime->SetAxisRange(0.,30.,
"X");
905 hClusterTime->SetTitleOffset(1.5,
"Y");
906 hClusterTime->SetZTitle(
"Entries");
907 hClusterTime->SetTitleOffset(1.5,
"Z");
908 hClusterTime->Draw(
"colz");
917 hClusterL0->SetTitle(
"Cluster #sigma_{long}");
918 hClusterL0->SetAxisRange(0.,30.,
"X");
919 hClusterL0->SetTitleOffset(1.5,
"Y");
920 hClusterL0->SetZTitle(
"Entries");
921 hClusterL0->SetTitleOffset(1.5,
"Z");
923 hClusterL0->Draw(
"colz");
930 TH2F* hClusterNCell = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hNCellsE",icalo));
931 hClusterNCell->SetTitle(
"Number of cells in cluster");
932 hClusterNCell->SetAxisRange(0.,30.,
"X");
933 hClusterNCell->SetTitleOffset(1.5,
"Y");
934 hClusterNCell->SetZTitle(
"Entries");
935 hClusterNCell->SetTitleOffset(1.5,
"Z");
937 hClusterNCell->Draw(
"colz");
944 TH2F* hClusterECell = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hCellsE",icalo));
945 hClusterECell->SetTitle(
"cells in cluster #it{E} vs cluster #it{E}");
946 hClusterECell->SetAxisRange(0.,30.,
"X");
947 hClusterECell->SetAxisRange(0.,20.,
"Y");
948 hClusterECell->SetTitleOffset(1.5,
"Y");
949 hClusterECell->SetZTitle(
"Entries");
950 hClusterECell->SetTitleOffset(1.5,
"Z");
952 hClusterECell->Draw(
"colz");
955 ccalo3->Print(Form(
"%s_CaloHisto_TimeShapeNCells.%s",histoTag.Data(),format.Data()));
975 TCanvas * ctrack =
new TCanvas(Form(
"%s_TrackHisto" ,histoTag.Data()),
976 Form(
"Hybrid tracks for %s",histoTag.Data()),
983 if(!hTrackEtaPhi)
return;
984 hTrackEtaPhi ->Add( (
TH2F*)
GetHisto(
"AnaHadrons_hEtaPhiPositive"));
985 hTrackEtaPhi ->SetAxisRange(-0.9,0.9,
"X");
986 hTrackEtaPhi ->SetTitleOffset(1.5,
"Y");
987 hTrackEtaPhi ->SetTitle(
"Hybrid tracks #eta vs #varphi #it{p}_{T} > 0.2 GeV/#it{c}");
988 hTrackEtaPhi->SetZTitle(
"Entries");
989 hTrackEtaPhi->SetTitleOffset(1.5,
"Z");
991 hTrackEtaPhi ->Draw(
"colz");
998 TH2F * hTrackEtaPhiSPD = (
TH2F*)
GetHisto(
"AnaHadrons_hEtaPhiSPDRefitPt02");
999 TH2F * hTrackEtaPhiNoSPD = (
TH2F*)
GetHisto(
"AnaHadrons_hEtaPhiNoSPDRefitPt02");
1001 TH1F* hPhiSPD = (TH1F*)hTrackEtaPhiSPD ->ProjectionY(Form(
"%s_hTrackPhiSPD" ,histoTag.Data()),0,1000);
1002 TH1F* hPhiNoSPD = (TH1F*)hTrackEtaPhiNoSPD->ProjectionY(Form(
"%s_hTrackPhiNoSPD",histoTag.Data()),0,1000);
1003 TH1F* hPhi = (TH1F*)hPhiSPD->Clone( Form(
"%s_hTrackPhi" ,histoTag.Data()));
1004 hPhi->Add(hPhiNoSPD);
1006 hPhi ->SetTitle(
"Hybrid track type #varphi, 0.2<#it{p}_{T}<2 GeV/#it{c}");
1007 hPhi ->SetLineColor(1);
1008 hPhiSPD ->SetLineColor(2);
1009 hPhiNoSPD->SetLineColor(4);
1011 hPhi ->SetMinimum(1);
1012 hPhi ->SetMaximum(hPhi->GetMaximum()*1.3);
1013 hPhi ->SetTitleOffset(1.5,
"Y");
1014 hPhi ->SetYTitle(
"Entries");
1016 TGaxis::SetMaxDigits(3);
1019 hPhiSPD ->Draw(
"Hsame");
1020 hPhiNoSPD->Draw(
"Hsame");
1022 TLegend l(0.2,0.75,0.4,0.89);
1023 l.SetTextSize(0.04);
1024 l.AddEntry(hPhi,
"Sum",
"L");
1025 l.AddEntry(hPhiSPD ,
"SPD+Refit",
"L");
1026 l.AddEntry(hPhiNoSPD,
"No SPD+Refit",
"L");
1038 if ( hPhi->GetEntries() < 1000 ) ok = 4;
1039 else if ( !histoTag.Contains(
"default")) ok = 3;
1042 hPhi->Fit(
"pol0",
"QRL",
"",0, 7);
1043 Float_t fitParam = hPhi->GetFunction(
"pol0")->GetParameter(0);
1045 for(
Int_t ibin = 1; ibin < hPhi->GetNbinsX(); ibin++)
1053 if ( hPhi->GetBinContent(ibin) < 100 )
continue;
1055 Float_t ratToFit = hPhi->GetBinContent(ibin)/fitParam;
1057 if ( ratToFit < 0.85 || ratToFit > 1.15 )
1063 else if ( (ratToFit < 0.98 && ratToFit >= 0.85) || (ratToFit <= 1.15 && ratToFit > 1.02) )
1075 TH1F* hTOF = (TH1F*)
GetHisto(
"AnaHadrons_hTOFSignalPtCut");
1076 hTOF->SetYTitle(
"Entries");
1077 hTOF->SetTitleOffset(1.5,
"Y");
1087 if ( hTOF->GetEntries() < 1000 ) ok = 4;
1090 Float_t intBC0 = hTOF->Integral(hTOF->FindBin(0),hTOF->FindBin(25));
1091 Float_t intAll = hTOF->Integral();
1094 if ( intAll > 0 ) rat = intBC0 / intAll;
1098 if (rat < 0.7) ok = 1;
1099 else if(rat < 0.9) ok = 2;
1109 TH1F* hPt = (TH1F*)
GetHisto(
"AnaHadrons_hPt");
1110 TH1F* hPtSPD = (TH1F*)
GetHisto(
"AnaHadrons_hPtSPDRefit");
1111 TH1F* hPtNoSPD = (TH1F*)
GetHisto(
"AnaHadrons_hPtNoSPDRefit");
1112 hPt ->SetLineColor(1);
1113 hPtSPD ->SetLineColor(2);
1114 hPtNoSPD->SetLineColor(4);
1116 hPt ->SetTitle(
"Hybrid track type #it{p}_{T}");
1117 hPt ->SetYTitle(
"Entries");
1118 hPt ->SetTitleOffset(1.5,
"Y");
1121 hPtSPD ->Draw(
"same");
1122 hPtNoSPD->Draw(
"same");
1130 if ( hPt->GetEntries() < 1000 ) ok = 4;
1133 for(
Int_t ibin = 1; ibin < hPt->GetNbinsX(); ibin++)
1135 if ( hPt->GetBinContent(ibin) < 100 )
continue;
1137 if ( hPt->GetBinContent(ibin)*1.4 < hPt->GetBinContent(ibin+1) )
1166 ctrack->Print(Form(
"%s_TrackHisto.%s",histoTag.Data(),format.Data()));
1201 TCanvas * cpi0 =
new TCanvas(Form(
"%s_InvariantMassHisto" ,histoTag.Data()),
1202 Form(
"Neutral mesons inv. mass for %s",histoTag.Data()),
1207 TH2F* hMixMassE[10];
1208 for(
Int_t icen = 0; icen < 10; icen++)
1210 hMassE [icen] = (
TH2F*)
GetHisto(Form(
"AnaPi0_Calo%d_hRe_cen%d_pidbit0_asy0_dist1",icalo,icen));
1211 hMixMassE[icen] = (
TH2F*)
GetHisto(Form(
"AnaPi0_Calo%d_hMi_cen%d_pidbit0_asy0_dist1",icalo,icen));
1213 if(!hMassE[0])
return;
1222 h2DMass = (
TH2F*) hMassE[6]->Clone(Form(
"%s_h2DMass",histoTag.Data()));
1223 for(
Int_t icen = 7; icen < 10; icen++) h2DMass->Add(hMassE[icen]);
1224 h2DMass->SetTitle(
"Inv. mass vs #it{p}_{T,pair}, Cen: 60-100%");
1228 h2DMass = (
TH2F*) hMassE[0]->Clone(Form(
"%s_h2DMass",histoTag.Data()));
1229 h2DMass->SetTitle(
"Inv. mass vs #it{p}_{T,pair}");
1232 h2DMass->SetTitleOffset(1.5,
"Y");
1233 h2DMass->SetAxisRange(0.0,0.7,
"Y");
1234 h2DMass->SetAxisRange(0,30,
"X");
1235 h2DMass->Draw(
"colz");
1248 for(
Int_t icen=0; icen<10; icen++ )
1256 TH1F * hX = (TH1F*) hMassE[0]->ProjectionX(Form(
"%s_hEPairCen0",histoTag.Data()),0,10000);
1257 Int_t binmin = hX->FindBin(2);
1258 Int_t binmax = hX->FindBin(10);
1259 if(histoTag.Contains(
"L0"))
1261 binmin = hX->FindBin(5);
1262 binmax = hX->FindBin(10);
1264 else if(histoTag.Contains(
"L2"))
1266 binmin = hX->FindBin(8);
1267 binmax = hX->FindBin(12);
1269 else if(histoTag.Contains(
"L1"))
1271 binmin = hX->FindBin(10);
1272 binmax = hX->FindBin(15);
1279 for(
Int_t icen = 0; icen < 6; icen++)
1281 if(!hMassE[icen])
continue;
1283 hMass[icen] = (TH1F*) hMassE [icen]->ProjectionY(Form(
"%s_hMassCen%d",histoTag.Data(),icen),binmin,binmax);
1284 hMix [icen] = (TH1F*) hMixMassE[icen]->ProjectionY(Form(
"%s_hMixCen%d" ,histoTag.Data(),icen),binmin,binmax);
1285 hMass[icen]->Sumw2();
1286 hMix [icen]->Sumw2();
1288 hMassPi0[icen] = (TH1F*) hMass[icen]->Clone(Form(
"%s_hMassPi0Cen%d",histoTag.Data(),icen));
1289 hMassEta[icen] = (TH1F*) hMass[icen]->Clone(Form(
"%s_hMassEtaCen%d",histoTag.Data(),icen));
1291 hMassPi0[icen]->Divide(hMix[icen]);
1292 hMassPi0[icen]->Fit(
"pol0",
"Q",
"",0.25,0.35);
1294 if(hMassPi0[icen]->GetFunction(
"pol0")) scale = hMassPi0[icen]->GetFunction(
"pol0")->GetParameter(0);
1296 hMassPi0[icen]->Scale(1./scale);
1297 hMassPi0[icen]->SetMarkerStyle(24);
1298 hMassPi0[icen]->SetMarkerColor(
color[icen]);
1299 hMassPi0[icen]->SetLineColor(
color[icen]);
1300 hMassPi0[icen]->SetAxisRange(0.04,0.24);
1303 hMassEta[icen]->Rebin(4);
1304 hMix [icen]->Rebin(4);
1305 hMassEta[icen]->Divide(hMix[icen]);
1306 hMassEta[icen]->SetMarkerStyle(25);
1307 hMassEta[icen]->SetMarkerColor(
color[icen]);
1308 hMassEta[icen]->SetLineColor(
color[icen]);
1309 hMassEta[icen]->SetAxisRange(0.4,0.9);
1311 hMassEta[icen]->Scale(1./scale);
1313 if(maxEta < hMassEta[icen]->GetMaximum()) maxEta = hMassEta[icen]->GetMaximum();
1314 if(maxPi0 < hMassPi0[icen]->GetMaximum()) maxPi0 = hMassPi0[icen]->GetMaximum();
1316 if(minEta > hMassEta[icen]->GetMinimum()) minEta = hMassEta[icen]->GetMinimum();
1317 if(minPi0 > hMassPi0[icen]->GetMinimum()) minPi0 = hMassPi0[icen]->GetMinimum();
1322 hMassPi0[0]->SetMinimum(minPi0);
1323 hMassPi0[0]->SetTitleOffset(1.5,
"Y");
1324 hMassPi0[0]->SetYTitle(
"Real / Mixed");
1325 hMassPi0[0]->SetTitle(
"#pi^{0} peak, 2 < #it{E}_{pair}< 10 GeV");
1326 if (histoTag.Contains(
"L0")) hMassPi0[0]->SetTitle(
"#pi^{0} peak, 5 < #it{E}_{pair}< 10 GeV");
1327 else if(histoTag.Contains(
"L2")) hMassPi0[0]->SetTitle(
"#pi^{0} peak, 8 < #it{E}_{pair}< 12 GeV");
1328 else if(histoTag.Contains(
"L1")) hMassPi0[0]->SetTitle(
"#pi^{0} peak, 10 < #it{E}_{pair}< 15 GeV");
1330 hMassPi0[0]->Draw();
1339 if ( hMassPi0[0]->GetEntries() < 1000 ) ok = 4;
1342 Float_t intLowMass = hMassPi0[0]->Integral(hMassPi0[0]->FindBin(0.04),hMassPi0[0]->FindBin(0.08));
1343 Float_t intPi0Mass = hMassPi0[0]->Integral(hMassPi0[0]->FindBin(0.10),hMassPi0[0]->FindBin(0.14));
1344 Float_t intHigMass = hMassPi0[0]->Integral(hMassPi0[0]->FindBin(0.18),hMassPi0[0]->FindBin(0.22));
1347 if ( intPi0Mass > 0 ) ratL = intLowMass / intPi0Mass;
1349 if ( intPi0Mass > 0 ) ratH = intHigMass / intPi0Mass;
1353 if (ratL > 0.80 || ratH > 0.80 ) ok = 1;
1354 else if(ratL > 0.25 || ratH > 0.25 ) ok = 2;
1368 hMassPi0[0]->SetMaximum(maxPi0*1.2);
1369 hMassPi0[5]->Draw(
"Hsame");
1370 hMassPi0[4]->Draw(
"Hsame");
1371 hMassPi0[3]->Draw(
"Hsame");
1372 hMassPi0[2]->Draw(
"Hsame");
1373 hMassPi0[1]->Draw(
"Hsame");
1374 hMassPi0[0]->Draw(
"Hsame");
1380 TLegend l(0.12,0.6,0.4,0.85);
1381 l.SetTextSize(0.04);
1382 l.AddEntry(hMassPi0[0],
"0-10%",
"P");
1383 l.AddEntry(hMassPi0[1],
"10-20%",
"P");
1384 l.AddEntry(hMassPi0[2],
"20-30%",
"P");
1385 l.AddEntry(hMassPi0[3],
"30-40%",
"P");
1386 l.AddEntry(hMassPi0[4],
"40-70%",
"P");
1387 l.AddEntry(hMassPi0[5],
"50-60%",
"P");
1393 TLine l1(0.04,1,0.24,1);
1403 for(
Int_t ism = 0; ism < 20; ism++)
1409 binmin = hX->FindBin(4);
1410 binmax = hX->FindBin(20);
1414 if(icalo==1) first = 12;
1416 for(
Int_t ism = first; ism < 20; ism++)
1418 TH2F* hTmpSM = (
TH2F*)
GetHisto(Form(
"AnaPi0_Calo%d_hReMod_%d",icalo,ism));
1419 if(!hTmpSM)
continue;
1421 hSM[ism] = (TH1F*) hTmpSM->ProjectionY(Form(
"%s_hMassSM%d",histoTag.Data(),ism),binmin,binmax);
1423 hSM[ism]->SetMarkerStyle(26);
1426 hSM[ism]->SetMarkerColor(
color[ism-first]);
1427 hSM[ism]->SetLineColor(
color[ism-first]);
1433 hMixSM[ism] = (TH1F*) hTmpMixSM->ProjectionY(Form(
"%s_hMassMixSM%d",histoTag.Data(),ism),binmin,binmax);
1434 hMixSM[ism]->Sumw2();
1435 hMixSM[ism]->Rebin(2);
1436 hSM[ism]->Divide(hMixSM[ism]);
1437 hSM[ism]->Fit(
"pol0",
"Q",
"",0.25,0.35);
1439 if(hSM[ism]->GetFunction(
"pol0")) scale = hSM[ism]->GetFunction(
"pol0")->GetParameter(0);
1441 hSM[ism]->Scale(1./scale);
1444 if(maxSM < hSM[ism]->GetMaximum()) maxSM = hSM[ism]->GetMaximum();
1447 hSM[first]->SetTitle(
"#pi^{0} peak in SM, 4 < #it{E}_{pair}< 10 GeV");
1448 hSM[first]->SetTitleOffset(1.5,
"Y");
1449 hSM[first]->SetAxisRange(0.04,0.24);
1450 hSM[first]->SetMaximum(maxSM*1.2);
1451 hSM[first]->SetMinimum(0.8);
1452 hSM[first]->SetYTitle(
"Real / Mixed");
1454 hSM[first]->Draw(
"H");
1459 Bool_t okSM[20] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
1464 if ( hMassPi0[0]->GetEntries() < 1000 )
text[4]->Draw();
1467 for(
Int_t ism = first+1; ism < 20; ism++)
1469 if(!hSM[ism])
continue;
1471 Float_t intLowMass = hSM[ism]->Integral(hSM[ism]->FindBin(0.04),hSM[ism]->FindBin(0.08));
1472 Float_t intPi0Mass = hSM[ism]->Integral(hSM[ism]->FindBin(0.10),hSM[ism]->FindBin(0.14));
1473 Float_t intHigMass = hSM[ism]->Integral(hSM[ism]->FindBin(0.18),hSM[ism]->FindBin(0.22));
1476 if ( intPi0Mass > 0 ) ratL = intLowMass / intPi0Mass;
1478 if ( intPi0Mass > 0 ) ratH = intHigMass / intPi0Mass;
1482 if (ratL > 0.80 || ratH > 0.80 ) { okSM[ism] = 1; okcheck=1;}
1483 else if(ratL > 0.2 || ratH > 0.2 ) { okSM[ism] = 2; okcheck=1;}
1487 if ( !okcheck ) {
text[ok]->Draw();}
1490 TLegend lsm(0.12,0.5,0.35,0.85);
1491 lsm.SetTextSize(0.04);
1492 if(
addOkFlag && okcheck && okSM[first]) lsm.AddEntry(hSM[first],Form(
"#color[6]{Mod %d; not ok?}",first),
"P");
1493 else lsm.AddEntry(hSM[first],Form(
"Mod %d",first),
"P");
1495 for(
Int_t ism = first+1; ism < 20; ism++)
1497 if(!hSM[ism])
continue;
1499 hSM[ism]->Draw(
"Hsame");
1501 if(
addOkFlag && okcheck && okSM[ism]) lsm.AddEntry(hSM[ism],Form(
"#color[6]{Mod %d; not ok?}",ism),
"P");
1502 else lsm.AddEntry(hSM[ism],Form(
"Mod %d",ism),
"P");
1505 lsm.SetBorderSize(0);
1506 lsm.SetFillColor(0);
1516 hMassEta[0]->SetMinimum(minEta);
1517 hMassEta[0]->SetTitleOffset(1.5,
"Y");
1518 hMassEta[0]->SetYTitle(
"Real / Mixed");
1519 hMassEta[0]->SetTitle(
"#eta peak, 2 <#it{E}_{pair}< 10 GeV");
1520 if (histoTag.Contains(
"L0")) hMassEta[0]->SetTitle(
"#eta peak, 5 < #it{E}_{pair}< 10 GeV");
1521 else if(histoTag.Contains(
"L2")) hMassEta[0]->SetTitle(
"#eta peak, 8 < #it{E}_{pair}< 12 GeV");
1522 else if(histoTag.Contains(
"L1")) hMassEta[0]->SetTitle(
"#eta peak, 10 < #it{E}_{pair}< 15 GeV");
1524 hMassEta[0]->Draw(
"H");
1533 if ( hMassEta[0]->GetEntries() < 1000 ) ok = 4;
1536 Float_t intLowMass = hMassEta[0]->Integral(hMassEta[0]->FindBin(0.40),hMassEta[0]->FindBin(0.47));
1537 Float_t intEtaMass = hMassEta[0]->Integral(hMassEta[0]->FindBin(0.48),hMassEta[0]->FindBin(0.55));
1538 Float_t intHigMass = hMassEta[0]->Integral(hMassEta[0]->FindBin(0.60),hMassEta[0]->FindBin(0.67));
1541 if ( intEtaMass > 0 ) ratL = intLowMass / intEtaMass;
1543 if ( intEtaMass > 0 ) ratH = intHigMass / intEtaMass;
1547 if (ratL > 1.50 || ratH > 1.50 ) ok = 1;
1548 else if(ratL > 1.10 || ratH > 1.10 ) ok = 2;
1562 hMassEta[0]->SetMaximum(maxEta*1.2);
1563 hMassEta[5]->Draw(
"Hsame");
1564 hMassEta[4]->Draw(
"Hsame");
1565 hMassEta[3]->Draw(
"Hsame");
1566 hMassEta[2]->Draw(
"Hsame");
1567 hMassEta[1]->Draw(
"Hsame");
1568 hMassEta[0]->Draw(
"Hsame");
1570 TLegend l2(0.12,0.6,0.4,0.85);
1571 l2.SetTextSize(0.04);
1572 l2.AddEntry(hMassEta[0],
"0-10%",
"P");
1573 l2.AddEntry(hMassEta[1],
"10-20%",
"P");
1574 l2.AddEntry(hMassEta[2],
"20-30%",
"P");
1575 l2.AddEntry(hMassEta[3],
"30-40%",
"P");
1576 l2.AddEntry(hMassEta[4],
"40-70%",
"P");
1577 l2.AddEntry(hMassEta[5],
"50-60%",
"P");
1578 l2.SetBorderSize(0);
1583 cpi0->Print(Form(
"%s_Pi0Histo.%s",histoTag.Data(),format.Data()));
1592 for(
Int_t icen=0; icen<10; icen++ )
1594 if ( hMass [icen] )
delete hMass [icen];
1595 if ( hMix [icen] )
delete hMix [icen];
1596 if ( hMassPi0[icen] )
delete hMassPi0[icen];
1597 if ( hMassEta[icen] )
delete hMassEta[icen];
1600 for(
Int_t ism = first; ism < 20; ism++)
1602 if ( hSM [ism] )
delete hSM [ism];
1603 if ( hMixSM[ism] )
delete hMixSM[ism];
1612 for(
Int_t icen=0; icen<10; icen++ )
1620 for(
Int_t ism = first; ism < 20; ism++)
1642 TCanvas * cIsolation =
new TCanvas(Form(
"%s_IsolationHisto" ,histoTag.Data()),
1643 Form(
"Isolation cone for %s",histoTag.Data()),
1645 cIsolation->Divide(2,2);
1648 if ( histoTag.Contains(
"L0") ) minClusterE = 5;
1649 else if ( histoTag.Contains(
"L2") ) minClusterE = 10;
1650 else if ( histoTag.Contains(
"L1") ) minClusterE = 12;
1652 TH1F * hIsolated = (TH1F*)
GetHisto(Form(
"AnaIsolPhoton_Calo%d_hPt" ,icalo));
1653 TH1F * hNotIsolated = (TH1F*)
GetHisto(Form(
"AnaIsolPhoton_Calo%d_hPtNoIso",icalo));
1655 if(!hIsolated)
return;
1657 Int_t minClusterEBin = hIsolated->FindBin(minClusterE);
1658 Float_t nTrig = hIsolated->Integral(minClusterEBin,100000)+hNotIsolated->Integral(minClusterE,100000);
1660 if ( nTrig <=0 ) return ;
1669 hIsolated ->Sumw2();
1670 hNotIsolated->Sumw2();
1671 hIsolated ->SetMarkerColor(4);
1672 hNotIsolated->SetMarkerColor(2);
1673 hIsolated ->SetLineColor (4);
1674 hNotIsolated->SetLineColor (2);
1675 hIsolated ->SetMarkerStyle(24);
1676 hNotIsolated->SetMarkerStyle(20);
1678 hNotIsolated->SetTitle(
"(non) isolated cluster spectra, #it{R}=0.4, #Sigma #it{p}_{T}<2 GeV/#it{c}");
1679 hNotIsolated->SetYTitle(
"Entries");
1681 hNotIsolated->SetAxisRange(5,100,
"X");
1683 hNotIsolated->Draw();
1684 hIsolated ->Draw(
"same");
1686 TLegend lI(0.5,0.7,0.88,0.88);
1687 lI.SetTextSize(0.04);
1688 lI.SetBorderSize(0);
1690 lI.AddEntry(hIsolated ,
"Isolated candidates",
"P");
1691 lI.AddEntry(hNotIsolated,
"NOT Isolated candidates",
"P");
1700 if ( histoTag.Contains(
"L2") ) minClusterE = 10;
1701 else if ( histoTag.Contains(
"L1") ) minClusterE = 14;
1705 if ( hNotIsolated->GetEntries() < 1000 ) ok = 4;
1708 for(
Int_t ibin = 1; ibin < hNotIsolated->GetNbinsX(); ibin++)
1710 if ( hNotIsolated->GetBinCenter(ibin) < minClusterE )
continue;
1712 if ( hNotIsolated->GetBinContent(ibin) < 100 )
continue;
1714 if ( hNotIsolated->GetBinContent(ibin)*1.4 < hNotIsolated->GetBinContent(ibin+1) ||
1715 hIsolated ->GetBinContent(ibin)*1.4 < hIsolated ->GetBinContent(ibin+1) ||
1716 hNotIsolated->GetBinContent(ibin) < hIsolated ->GetBinContent(ibin)
1737 TLegend l(0.55,0.55,0.88,0.88);
1738 l.SetTextSize(0.04);
1742 TH2F* h2PtInCone = (
TH2F*)
GetHisto(Form(
"AnaIsolPhoton_Calo%d_hPtInCone" ,icalo));
1743 TH2F* h2PtInConeCluster = (
TH2F*)
GetHisto(Form(
"AnaIsolPhoton_Calo%d_hPtClusterInCone" ,icalo));
1744 TH2F* h2PtInConeTrack = (
TH2F*)
GetHisto(Form(
"AnaIsolPhoton_Calo%d_hPtTrackInCone" ,icalo));
1745 TH2F* h2PtInConeTrackPerp = (
TH2F*)
GetHisto(Form(
"AnaIsolPhoton_Calo%d_hPtInPerpCone" ,icalo));
1746 TH2F* h2PtInEtaBandTrack = (
TH2F*)
GetHisto(Form(
"AnaIsolPhoton_Calo%d_hEtaBandTrackPt" ,icalo));
1747 TH2F* h2PtInEtaBandCluster = (
TH2F*)
GetHisto(Form(
"AnaIsolPhoton_Calo%d_hEtaBandClusterPt",icalo));
1749 TH1F* hPtInCone = (TH1F*) h2PtInCone ->ProjectionY(Form(
"%s_hPtInCone_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1750 TH1F* hPtInConeCluster = (TH1F*) h2PtInConeCluster ->ProjectionY(Form(
"%s_hPtInConeCluster_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1751 TH1F* hPtInConeTrack = (TH1F*) h2PtInConeTrack ->ProjectionY(Form(
"%s_hPtInConeTrack_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1752 TH1F* hPtInConeTrackPerp = (TH1F*) h2PtInConeTrackPerp ->ProjectionY(Form(
"%s_hPtInConePerp_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1753 TH1F* hPtInEtaBandTrack = (TH1F*) h2PtInEtaBandTrack ->ProjectionY(Form(
"%s_hPtInConeEtaBandTrack_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1754 TH1F* hPtInEtaBandCluster = (TH1F*) h2PtInEtaBandCluster->ProjectionY(Form(
"%s_hPtInConeEtaBandCluster_TrigEnMin%2.0fGeV",histoTag.Data(),minClusterE),minClusterEBin,10000);
1756 hPtInCone ->Sumw2();
1757 hPtInConeCluster ->Sumw2();
1758 hPtInConeTrack ->Sumw2();
1759 hPtInConeTrackPerp ->Sumw2();
1760 hPtInEtaBandCluster->Sumw2();
1761 hPtInEtaBandTrack ->Sumw2();
1764 hPtInCone ->Rebin(rb);
1765 hPtInConeCluster ->Rebin(rb);
1766 hPtInConeTrack ->Rebin(rb);
1767 hPtInConeTrackPerp ->Rebin(rb);
1768 hPtInEtaBandCluster->Rebin(rb);
1769 hPtInEtaBandTrack ->Rebin(rb);
1771 hPtInCone ->Scale(1./nTrig);
1772 hPtInConeCluster ->Scale(1./nTrig);
1773 hPtInConeTrack ->Scale(1./nTrig);
1774 hPtInConeTrackPerp ->Scale(1./nTrig);
1775 hPtInEtaBandCluster->Scale(1./nTrig);
1776 hPtInEtaBandTrack ->Scale(1./nTrig);
1778 hPtInCone ->SetAxisRange(0,20);
1779 hPtInConeCluster ->SetAxisRange(0,20);
1780 hPtInConeTrack ->SetAxisRange(0,20);
1781 hPtInConeTrackPerp ->SetAxisRange(0,20);
1782 hPtInEtaBandCluster->SetAxisRange(0,20);
1783 hPtInEtaBandTrack ->SetAxisRange(0,20);
1785 hPtInCone ->SetMarkerStyle(24);
1786 hPtInConeCluster ->SetMarkerStyle(20);
1787 hPtInConeTrack ->SetMarkerStyle(20);
1788 hPtInConeTrackPerp ->SetMarkerStyle(27);
1789 hPtInEtaBandCluster->SetMarkerStyle(21);
1790 hPtInEtaBandTrack ->SetMarkerStyle(21);
1792 hPtInCone ->SetMarkerColor(1);
1793 hPtInConeCluster ->SetMarkerColor(2);
1794 hPtInConeTrack ->SetMarkerColor(4);
1795 hPtInConeTrackPerp ->SetMarkerColor(4);
1796 hPtInEtaBandCluster->SetMarkerColor(2);
1797 hPtInEtaBandTrack ->SetMarkerColor(4);
1799 hPtInCone ->SetLineColor(1);
1800 hPtInConeCluster ->SetLineColor(2);
1801 hPtInConeTrack ->SetLineColor(4);
1802 hPtInConeTrackPerp ->SetLineColor(4);
1803 hPtInEtaBandCluster->SetLineColor(2);
1804 hPtInEtaBandTrack ->SetLineColor(4);
1806 hPtInCone->SetTitleOffset(1.5,
"Y");
1807 hPtInCone->SetYTitle(
"Entries / #it{N}_{candidates}");
1808 hPtInCone->SetTitle(Form(
"Track/cluster spectra in cone p_{T,cand}>%2.0f GeV/#it{c}, #it{R}=0.4",minClusterE));
1810 Float_t max = hPtInCone->GetMaximum();
1811 if(max < hPtInConeTrack ->GetMaximum()) max = hPtInConeTrack ->GetMaximum();
1812 if(max < hPtInConeCluster ->GetMaximum()) max = hPtInConeCluster ->GetMaximum();
1813 if(max < hPtInConeTrackPerp ->GetMaximum()) max = hPtInConeTrackPerp ->GetMaximum();
1814 if(max < hPtInEtaBandCluster->GetMaximum()) max = hPtInEtaBandCluster->GetMaximum();
1815 if(max < hPtInEtaBandTrack ->GetMaximum()) max = hPtInEtaBandTrack ->GetMaximum();
1816 hPtInCone->SetMaximum(max*2);
1817 hPtInCone->SetMinimum(1e-4);
1819 hPtInCone ->Draw(
"");
1820 hPtInConeCluster ->Draw(
"same");
1821 hPtInConeTrack ->Draw(
"same");
1822 hPtInConeTrackPerp ->Draw(
"same");
1823 hPtInEtaBandCluster->Draw(
"same");
1824 hPtInEtaBandTrack ->Draw(
"same");
1826 l.AddEntry(hPtInCone ,
"Tracks+Clusters",
"P");
1827 l.AddEntry(hPtInConeCluster ,
"Clusters inside cone",
"P");
1828 l.AddEntry(hPtInConeTrack ,
"Tracks inside cone",
"P");
1829 l.AddEntry(hPtInConeTrackPerp ,
"Tracks inside #perp cones",
"P");
1830 l.AddEntry(hPtInEtaBandTrack ,
"Tracks #eta band",
"P");
1831 l.AddEntry(hPtInEtaBandCluster,
"Clusters #eta band",
"P");
1840 if ( nTrig < 10000 ) ok = 4;
1879 TLegend l2(0.55,0.55,0.88,0.88);
1880 l2.SetTextSize(0.04);
1881 l2.SetBorderSize(0);
1884 TH2F* h2SumPtCone = (
TH2F*)
GetHisto(Form(
"AnaIsolPhoton_Calo%d_hConePtSum" ,icalo));
1885 TH2F* h2SumPtConeCluster = (
TH2F*)
GetHisto(Form(
"AnaIsolPhoton_Calo%d_hConePtSumCluster" ,icalo));
1886 TH2F* h2SumPtConeTrack = (
TH2F*)
GetHisto(Form(
"AnaIsolPhoton_Calo%d_hConePtSumTrack" ,icalo));
1887 TH2F* h2SumPtConeTrackPerp = (
TH2F*)
GetHisto(Form(
"AnaIsolPhoton_Calo%d_hPerpConePtSum" ,icalo));
1888 TH2F* h2SumPtEtaBandTrack = (
TH2F*)
GetHisto(Form(
"AnaIsolPhoton_Calo%d_hConeSumPtEtaUENormTrack" ,icalo));
1889 TH2F* h2SumPtEtaBandCluster = (
TH2F*)
GetHisto(Form(
"AnaIsolPhoton_Calo%d_hConeSumPtEtaUENormCluster",icalo));
1890 TH2F* h2SumPtConeSubTrack = (
TH2F*)
GetHisto(Form(
"AnaIsolPhoton_Calo%d_hConeSumPtEtaUESubTrack" ,icalo));
1891 TH2F* h2SumPtConeSubCluster = (
TH2F*)
GetHisto(Form(
"AnaIsolPhoton_Calo%d_hConeSumPtEtaUESubCluster" ,icalo));
1892 TH2F* h2SumPtConeSub = (
TH2F*)
GetHisto(Form(
"AnaIsolPhoton_Calo%d_hConeSumPtEtaUESub" ,icalo));
1894 TH1F* hSumPtCone = (TH1F*) h2SumPtCone ->ProjectionY(Form(
"%s_hSumPtCone_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1895 TH1F* hSumPtConeCluster = (TH1F*) h2SumPtConeCluster ->ProjectionY(Form(
"%s_hSumPtConeCluster_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1896 TH1F* hSumPtConeTrack = (TH1F*) h2SumPtConeTrack ->ProjectionY(Form(
"%s_hSumPtConeTrack_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1897 TH1F* hSumPtConeTrackPerp = (TH1F*) h2SumPtConeTrackPerp ->ProjectionY(Form(
"%s_hSumPtConePerp_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1898 TH1F* hSumPtEtaBandTrack = (TH1F*) h2SumPtEtaBandTrack ->ProjectionY(Form(
"%s_hSumPtConeEtaBandTrack_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1899 TH1F* hSumPtEtaBandCluster = (TH1F*) h2SumPtEtaBandCluster->ProjectionY(Form(
"%s_hSumPtConeEtaBandCluster_TrigEnMin%2.0fGeV",histoTag.Data(),minClusterE),minClusterEBin,10000);
1900 TH1F* hSumPtConeSub = (TH1F*) h2SumPtConeSub ->ProjectionY(Form(
"%s_hSumPtConeSub_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1901 TH1F* hSumPtConeSubCluster = (TH1F*) h2SumPtConeSubCluster->ProjectionY(Form(
"%s_hSumPtConeSubCluster_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1902 TH1F* hSumPtConeSubTrack = (TH1F*) h2SumPtConeSubTrack ->ProjectionY(Form(
"%s_hSumPtConeSubTrack_TrigEnMin%2.0fGeV" ,histoTag.Data(),minClusterE),minClusterEBin,10000);
1904 hSumPtCone ->Sumw2();
1905 hSumPtConeCluster ->Sumw2();
1906 hSumPtConeTrack ->Sumw2();
1907 hSumPtConeSub ->Sumw2();
1908 hSumPtConeSubCluster->Sumw2();
1909 hSumPtConeSubTrack ->Sumw2();
1910 hSumPtConeTrackPerp ->Sumw2();
1911 hSumPtEtaBandCluster->Sumw2();
1912 hSumPtEtaBandTrack ->Sumw2();
1915 hSumPtCone ->Rebin(rb);
1916 hSumPtConeCluster ->Rebin(rb);
1917 hSumPtConeTrack ->Rebin(rb);
1918 hSumPtConeSub ->Rebin(rb);
1919 hSumPtConeSubCluster->Rebin(rb);
1920 hSumPtConeSubTrack ->Rebin(rb);
1921 hSumPtConeTrackPerp ->Rebin(rb);
1922 hSumPtEtaBandCluster->Rebin(rb);
1923 hSumPtEtaBandTrack ->Rebin(rb);
1925 hSumPtCone ->Scale(1./nTrig);
1926 hSumPtConeCluster ->Scale(1./nTrig);
1927 hSumPtConeTrack ->Scale(1./nTrig);
1928 hSumPtConeSub ->Scale(1./nTrig);
1929 hSumPtConeSubCluster->Scale(1./nTrig);
1930 hSumPtConeSubTrack ->Scale(1./nTrig);
1931 hSumPtConeTrackPerp ->Scale(1./nTrig);
1932 hSumPtEtaBandCluster->Scale(1./nTrig);
1933 hSumPtEtaBandTrack ->Scale(1./nTrig);
1935 hSumPtCone ->SetAxisRange(0,500);
1936 hSumPtConeCluster ->SetAxisRange(0,500);
1937 hSumPtConeTrack ->SetAxisRange(0,500);
1938 hSumPtConeSub ->SetAxisRange(-5,500);
1939 hSumPtConeSubCluster->SetAxisRange(-5,500);
1940 hSumPtConeSubTrack ->SetAxisRange(-5,500);
1941 hSumPtConeTrackPerp ->SetAxisRange(0,500);
1942 hSumPtEtaBandCluster->SetAxisRange(0,500);
1943 hSumPtEtaBandTrack ->SetAxisRange(0,500);
1945 hSumPtCone ->SetMarkerStyle(24);
1946 hSumPtConeCluster ->SetMarkerStyle(20);
1947 hSumPtConeTrack ->SetMarkerStyle(20);
1948 hSumPtConeSub ->SetMarkerStyle(25);
1949 hSumPtConeSubCluster->SetMarkerStyle(25);
1950 hSumPtConeSubTrack ->SetMarkerStyle(25);
1951 hSumPtConeTrackPerp ->SetMarkerStyle(27);
1952 hSumPtEtaBandCluster->SetMarkerStyle(21);
1953 hSumPtEtaBandTrack ->SetMarkerStyle(21);
1955 hSumPtCone ->SetMarkerColor(1);
1956 hSumPtConeCluster ->SetMarkerColor(2);
1957 hSumPtConeTrack ->SetMarkerColor(4);
1958 hSumPtConeSub ->SetMarkerColor(1);
1959 hSumPtConeSubCluster->SetMarkerColor(2);
1960 hSumPtConeSubTrack ->SetMarkerColor(4);
1961 hSumPtConeTrackPerp ->SetMarkerColor(4);
1962 hSumPtEtaBandCluster->SetMarkerColor(2);
1963 hSumPtEtaBandTrack ->SetMarkerColor(4);
1965 hSumPtCone ->SetLineColor(1);
1966 hSumPtConeCluster ->SetLineColor(2);
1967 hSumPtConeTrack ->SetLineColor(4);
1968 hSumPtConeSub ->SetLineColor(1);
1969 hSumPtConeSubCluster->SetLineColor(2);
1970 hSumPtConeSubTrack ->SetLineColor(4);
1971 hSumPtConeTrackPerp ->SetLineColor(4);
1972 hSumPtEtaBandCluster->SetLineColor(2);
1973 hSumPtEtaBandTrack ->SetLineColor(4);
1975 hSumPtCone->SetTitleOffset(1.5,
"Y");
1976 hSumPtCone->SetYTitle(
"Entries / #it{N}_{candidates}");
1977 hSumPtCone->SetTitle(Form(
"Track/cluster #Sigma #it{p}_{T}, p_{T,cand}>%2.0f GeV/#it{c}, #it{R}=0.4, ",minClusterE));
1979 max = hSumPtCone->GetMaximum();
1980 if(max < hSumPtConeTrack ->GetMaximum()) max = hSumPtConeTrack ->GetMaximum();
1981 if(max < hSumPtConeCluster ->GetMaximum()) max = hSumPtConeCluster ->GetMaximum();
1982 if(max < hSumPtConeSub ->GetMaximum()) max = hSumPtConeSub ->GetMaximum();
1983 if(max < hSumPtConeSubTrack ->GetMaximum()) max = hSumPtConeSubTrack ->GetMaximum();
1984 if(max < hSumPtConeSubCluster->GetMaximum()) max = hSumPtConeSubCluster->GetMaximum();
1985 if(max < hSumPtConeTrackPerp ->GetMaximum()) max = hSumPtConeTrackPerp ->GetMaximum();
1986 if(max < hSumPtEtaBandCluster->GetMaximum()) max = hSumPtEtaBandCluster->GetMaximum();
1987 if(max < hSumPtEtaBandTrack ->GetMaximum()) max = hSumPtEtaBandTrack ->GetMaximum();
1988 hSumPtCone->SetMaximum(max*2);
1990 hSumPtCone ->Draw(
"");
1991 hSumPtConeCluster ->Draw(
"same");
1992 hSumPtConeTrack ->Draw(
"same");
1996 hSumPtConeTrackPerp ->Draw(
"same");
1997 hSumPtEtaBandCluster->Draw(
"same");
1998 hSumPtEtaBandTrack ->Draw(
"same");
2000 l2.AddEntry(hSumPtCone ,
"Tracks+Clusters",
"P");
2001 l2.AddEntry(hSumPtConeCluster ,
"Clusters inside cone",
"P");
2002 l2.AddEntry(hSumPtConeTrack ,
"Tracks inside cone",
"P");
2003 l2.AddEntry(hSumPtConeTrackPerp ,
"Tracks inside #perp cones",
"P");
2004 l2.AddEntry(hSumPtEtaBandTrack ,
"Tracks #eta band",
"P");
2005 l2.AddEntry(hSumPtEtaBandCluster,
"Clusters #eta band",
"P");
2017 if ( nTrig < 10000 ) ok = 4;
2056 TLegend l3(0.4,0.75,0.8,0.88);
2057 l3.SetTextSize(0.04);
2058 l3.SetBorderSize(0);
2061 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));
2062 hSumPtConeSub->SetYTitle(
"Entries / #it{N}_{candidates}");
2063 hSumPtConeSub->SetMaximum(max*2);
2065 hSumPtConeSub ->Draw(
"");
2066 hSumPtConeSubCluster->Draw(
"same");
2067 hSumPtConeSubTrack ->Draw(
"same");
2069 l3.AddEntry(hSumPtConeSub ,
"Tracks+Clusters-#eta band",
"P");
2070 l3.AddEntry(hSumPtConeSubCluster,
"Clusters inside cone-#eta band",
"P");
2071 l3.AddEntry(hSumPtConeSubTrack ,
"Tracks inside cone-#eta band",
"P");
2081 if ( nTrig < 10000 ) ok = 4;
2109 cIsolation->Print(Form(
"%s_IsolationHisto.%s",histoTag.Data(),format.Data()));
2116 delete hPtInConeCluster ;
2117 delete hPtInConeTrack ;
2118 delete hPtInConeTrackPerp ;
2119 delete hPtInEtaBandTrack ;
2120 delete hPtInEtaBandCluster ;
2123 delete hSumPtConeCluster ;
2124 delete hSumPtConeTrack ;
2125 delete hSumPtConeTrackPerp ;
2126 delete hSumPtEtaBandTrack ;
2127 delete hSumPtEtaBandCluster ;
2129 delete hSumPtConeSub ;
2130 delete hSumPtConeSubCluster ;
2131 delete hSumPtConeSubTrack ;
2170 TCanvas * cCorrelation =
new TCanvas(Form(
"%s_CorrelationHisto" ,histoTag.Data()),
2171 Form(
"Trigger cluster - associated track correlation for %s",histoTag.Data()),
2173 cCorrelation->Divide(2,1);
2176 if ( histoTag.Contains(
"L0") ) minClusterE = 8;
2177 else if ( histoTag.Contains(
"L2") ) minClusterE = 10;
2178 else if ( histoTag.Contains(
"L1") ) minClusterE = 12;
2180 Float_t assocBins[] = {0.5,2.,5.,10.,20.};
2181 Int_t nAssocBins = 4;
2183 TH1F * hTrigger = (TH1F*)
GetHisto(Form(
"AnaPhotonHadronCorr_Calo%d_hPtTrigger",icalo));
2185 if(!hTrigger)
return;
2187 Int_t minClusterEBin = hTrigger->FindBin(minClusterE);
2188 Float_t nTrig = hTrigger->Integral(minClusterEBin,100000);
2190 if ( nTrig <=0 ) return ;
2193 cCorrelation->cd(1);
2196 for(
Int_t i = 0; i < 4; i++) hDeltaPhi[i] = 0;
2198 TLegend l(0.35,0.6,0.83,0.85);
2199 l.SetHeader(Form(
"p_{T,T} > %2.1f GeV/c",minClusterE));
2200 l.SetTextSize(0.04);
2204 for(
Int_t ibin = 0; ibin < nAssocBins; ibin++ )
2207 (
TH2F*)
GetHisto(Form(
"AnaPhotonHadronCorr_Calo%d_hDeltaPhiPtAssocPt%2.1f_%2.1f",icalo,assocBins[ibin],assocBins[ibin+1]));
2209 (TH1F*) hDeltaPhiE->ProjectionY(Form(
"%s_hDeltaPhi_TrackMinPt%2.1fGeV_TrigEnMin%2.0f",histoTag.Data(),assocBins[ibin],minClusterE),minClusterEBin,10000);
2210 hDeltaPhi[ibin]->Sumw2();
2211 hDeltaPhi[ibin]->Rebin(2);
2212 hDeltaPhi[ibin]->Scale(1./nTrig);
2214 hDeltaPhi[ibin]->Fit(
"pol0",
"Q",
"",1,2);
2217 if(hDeltaPhi[ibin]->GetFunction(
"pol0"))
2219 scale = hDeltaPhi[ibin]->GetFunction(
"pol0")->GetParameter(0);
2220 hDeltaPhi[ibin]->GetFunction(
"pol0")->SetRange(6,7);
2222 hDeltaPhi[ibin]->Scale(1./scale);
2225 hDeltaPhi[ibin]->SetAxisRange(-1.6,4.7);
2227 hDeltaPhi[ibin]->SetMarkerStyle(24);
2228 hDeltaPhi[ibin]->SetMarkerColor(
color[ibin]);
2229 hDeltaPhi[ibin]->SetLineColor(
color[ibin]);
2230 hDeltaPhi[ibin]->SetTitleOffset(1.5,
"Y");
2231 hDeltaPhi[ibin]->SetYTitle(
"#it{N}_{pairs} / #it{N}_{trig} / ZYAM");
2232 hDeltaPhi[ibin]->SetTitle(
"#gamma (#lambda_{0}^{2} < 0.4, neutral cluster) trigger");
2234 if(!
addOkFlag) l.AddEntry(hDeltaPhi[ibin],Form(
"%2.1f<#it{p}_{T,A}< %2.0f GeV/c",assocBins[ibin],assocBins[ibin+1]),
"P");
2237 hDeltaPhi[2]->SetMaximum(hDeltaPhi[2]->GetMaximum()*10);
2238 hDeltaPhi[2]->SetMinimum(0.8);
2240 hDeltaPhi[2]->Draw(
"H");
2241 hDeltaPhi[1]->Draw(
"Hsame");
2242 hDeltaPhi[3]->Draw(
"Hsame");
2243 hDeltaPhi[0]->Draw(
"Hsame");
2251 if ( nTrig < 1000 )
text[4]->Draw();
2254 for(
Int_t ibin = 0; ibin < nAssocBins; ibin++ )
2256 if(!hDeltaPhi[ibin])
continue;
2258 Float_t intNear = hDeltaPhi[ibin]->Integral(hDeltaPhi[ibin]->FindBin(-0.4),hDeltaPhi[ibin]->FindBin(0.4));
2259 Float_t intZyam = hDeltaPhi[ibin]->Integral(hDeltaPhi[ibin]->FindBin( 1.1),hDeltaPhi[ibin]->FindBin(1.9));
2260 Float_t intAway = hDeltaPhi[ibin]->Integral(hDeltaPhi[ibin]->FindBin( 2.8),hDeltaPhi[ibin]->FindBin(3.6));
2262 if(intNear > intZyam && intAway > intZyam && intNear > intAway )
2264 l.AddEntry(hDeltaPhi[ibin],Form(
"%2.1f<#it{p}_{T,A}< %2.0f GeV/c",assocBins[ibin],assocBins[ibin+1]),
"P");
2269 l.AddEntry(hDeltaPhi[ibin],Form(
"#color[6]{%2.1f<#it{p}_{T,A}< %2.0f GeV/c, not ok?}",assocBins[ibin],assocBins[ibin+1]),
"P");
2275 if ( !okcheck ) {
text[ok]->Draw();}
2283 cCorrelation->cd(2);
2286 TLegend l2(0.35,0.6,0.83,0.85);
2287 l2.SetHeader(Form(
"p_{T,T} > %2.0f GeV/c",minClusterE));
2288 l2.SetTextSize(0.04);
2289 l2.SetBorderSize(0);
2292 TH2F* hEXE = (
TH2F*)
GetHisto(Form(
"AnaPhotonHadronCorr_Calo%d_hXECharged" ,icalo));
2293 TH2F* hEXEUE = (
TH2F*)
GetHisto(Form(
"AnaPhotonHadronCorr_Calo%d_hXEUeCharged",icalo));
2296 TH1F* hXE = (TH1F*) hEXE->ProjectionY(Form(
"%s_hXE_TrigEnMin%2.0fGeV",histoTag.Data(),minClusterE),minClusterEBin,10000);
2298 hXE->Rebin(rebinXE);
2299 hXE->Scale(1./nTrig);
2300 hXE->SetAxisRange(0,1);
2301 hXE->SetMarkerStyle(24);
2302 hXE->SetMarkerColor(1);
2303 hXE->SetLineColor(1);
2304 hXE->SetTitleOffset(1.5,
"Y");
2305 hXE->SetXTitle(
"#it{x}_{E}, #it{z}_{T}");
2306 hXE->SetYTitle(
"#it{N}_{pairs} / #it{N}_{trig}");
2307 hXE->SetTitle(
"#gamma (#lambda_{0}^{2} < 0.4, neutral cluster) trigger");
2308 l2.AddEntry(hXE,
"raw #it{x}_{E}",
"P");
2310 hXE->SetMaximum(2e2);
2311 hXE->SetMinimum(1e-5);
2315 TH1F* hXEUE = (TH1F*) hEXEUE->ProjectionY(Form(
"%s_hXEUE_TrigEnMin%2.0fGeV",histoTag.Data(),minClusterE),minClusterEBin,10000);
2317 hXEUE->Rebin(rebinXE);
2318 hXEUE->Scale(1./nTrig);
2319 hXEUE->SetAxisRange(0,1);
2320 hXEUE->SetMarkerStyle(25);
2321 hXEUE->SetMarkerColor(2);
2322 hXEUE->SetLineColor(2);
2324 l2.AddEntry(hXEUE,
"raw Und. Event #it{x}_{E}",
"P");
2325 hXEUE->Draw(
"same");
2327 TH2F* hEZT = (
TH2F*)
GetHisto(Form(
"AnaPhotonHadronCorr_Calo%d_hZTCharged" ,icalo));
2328 TH2F* hEZTUE = (
TH2F*)
GetHisto(Form(
"AnaPhotonHadronCorr_Calo%d_hZTUeCharged",icalo));
2330 TH1F* hZT = (TH1F*) hEZT->ProjectionY(Form(
"%s_hZT_TrigEnMin%2.0fGeV",histoTag.Data(),minClusterE),minClusterEBin,10000);
2332 hZT->Rebin(rebinXE);
2333 hZT->Scale(1./nTrig);
2334 hZT->SetAxisRange(0,1);
2335 hZT->SetMarkerStyle(20);
2336 hZT->SetMarkerColor(1);
2337 hZT->SetLineColor(1);
2338 hZT->SetTitleOffset(1.5,
"Y");
2341 l2.AddEntry(hZT,
"raw #it{z}_{T}",
"P");
2344 TH1F* hZTUE = (TH1F*) hEZTUE->ProjectionY(Form(
"%s_hZTUE_TrigEnMin%2.0fGeV",histoTag.Data(),minClusterE),minClusterEBin,10000);
2346 hZTUE->Rebin(rebinXE);
2347 hZTUE->Scale(1./nTrig);
2348 hZTUE->SetAxisRange(0,1);
2349 hZTUE->SetMarkerStyle(21);
2350 hZTUE->SetMarkerColor(2);
2351 hZTUE->SetLineColor(2);
2352 l2.AddEntry(hZTUE,
"raw Und. Event #it{z}_{T}",
"P");
2353 hZTUE->Draw(
"same");
2363 if ( nTrig < 1000 ) ok = 4;
2371 for(
Int_t ibin = 1; ibin < hXE->GetNbinsX(); ibin++)
2373 if ( hXE->GetBinCenter(ibin) < minXE )
continue;
2374 if ( hXE->GetBinCenter(ibin) > maxXE )
continue;
2376 if ( hXE->GetBinContent(ibin) < 1e-3 )
continue;
2379 hXE ->GetBinContent(ibin)*2 < hXE ->GetBinContent(ibin+1) ||
2381 hXE ->GetBinContent(ibin) < hXEUE->GetBinContent(ibin)
2386 printf(
"ibin %d, XE bin %2.2f, XE: %2.1e (+1 bin) %2.1e; XEUE %2.1e (+1 bin) %2.1e;\n",
2387 ibin, hXE->GetBinCenter(ibin),
2388 hXE->GetBinContent(ibin)*2, hXE->GetBinContent(ibin+1),
2389 hXEUE->GetBinContent(ibin)*2, hXEUE->GetBinContent(ibin+1));
2411 cCorrelation->Print(Form(
"%s_CorrelationHisto.%s",histoTag.Data(),format.Data()));
2417 for(
Int_t i = 0; i < 4; i++)
delete hDeltaPhi[i];
2422 delete cCorrelation;
2447 TH1F* hClusterPho = (TH1F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hPt_MCPhoton",icalo));
2448 TH1F* hClusterPi0 = (TH1F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hPt_MCPi0" ,icalo));
2449 TH1F* hClusterEta = (TH1F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hPt_MCEta" ,icalo));
2450 TH1F* hClusterPhoPi0 = (TH1F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hPt_MCPhotonPi0Decay",icalo));
2451 TH1F* hClusterPhoEta = (TH1F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hPt_MCPhotonEtaDecay",icalo));
2453 if(!hClusterPho)
return;
2455 TH1F* hPrimPho = (TH1F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hPtPrim_MCPhoton" ,icalo));
2456 TH1F* hPrimPhoPi0 = (TH1F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hPtPrim_MCPhotonPi0Decay",icalo));
2457 TH1F* hPrimPhoEta = (TH1F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hPtPrim_MCPhotonEtaDecay",icalo));
2458 TH1F* hPrimPi0 = (TH1F*)
GetHisto(Form(
"AnaPi0_Calo%d_hPrimPi0Pt",icalo));
2459 TH1F* hPrimEta = (TH1F*)
GetHisto(Form(
"AnaPi0_Calo%d_hPrimEtaPt",icalo));
2461 TCanvas * cmc =
new TCanvas(Form(
"%s_MCHisto" ,histoTag.Data()),
2462 Form(
"Cluster MC origin for %s",histoTag.Data()),
2469 hClusterPho->SetTitle(
"Cluster origin spectra, primary spectra in Calo acceptance");
2470 hClusterPho->Sumw2();
2471 hClusterPho->SetMarkerColor(1);
2472 hClusterPho->SetMarkerStyle(20);
2473 hClusterPho->SetAxisRange(0.,50.,
"X");
2475 hClusterPho->SetXTitle(
"#it{E}_{rec}, #it{p}_{T,gen} (GeV)");
2476 hClusterPho->SetYTitle(
"Entries");
2477 hClusterPho->Draw(
"");
2479 hClusterPhoPi0->Sumw2();
2480 hClusterPhoPi0->SetMarkerColor(4);
2481 hClusterPhoPi0->SetMarkerStyle(20);
2482 hClusterPhoPi0->Draw(
"same");
2484 hClusterPhoEta->Sumw2();
2485 hClusterPhoEta->SetMarkerColor(2);
2486 hClusterPhoEta->SetMarkerStyle(20);
2487 hClusterPhoEta->Draw(
"same");
2489 hClusterPi0->Sumw2();
2490 hClusterPi0->SetMarkerColor(4);
2491 hClusterPi0->SetMarkerStyle(21);
2492 hClusterPi0->Draw(
"same");
2494 hClusterEta->Sumw2();
2495 hClusterEta->SetMarkerColor(2);
2496 hClusterEta->SetMarkerStyle(22);
2497 hClusterEta->Draw(
"same");
2500 hPrimPho->SetMarkerColor(1);
2501 hPrimPho->SetMarkerStyle(24);
2502 hPrimPho->Draw(
"same");
2504 hPrimPhoPi0->Sumw2();
2505 hPrimPhoPi0->SetMarkerColor(4);
2506 hPrimPhoPi0->SetMarkerStyle(24);
2507 hPrimPhoPi0->Draw(
"same");
2509 hPrimPhoEta->Sumw2();
2510 hPrimPhoEta->SetMarkerColor(2);
2511 hPrimPhoEta->SetMarkerStyle(24);
2512 hPrimPhoEta->Draw(
"same");
2515 hPrimPi0->SetMarkerColor(4);
2516 hPrimPi0->SetMarkerStyle(25);
2517 hPrimPi0->Draw(
"same");
2520 hPrimEta->SetMarkerColor(2);
2521 hPrimEta->SetMarkerStyle(26);
2522 hPrimEta->Draw(
"same");
2524 TLegend lR(0.5,0.5,0.7,0.89);
2525 lR.SetHeader(
"reco");
2526 lR.SetTextSize(0.04);
2527 lR.AddEntry(hClusterPho,
"#gamma",
"P");
2528 lR.AddEntry(hClusterPhoPi0,
"#gamma_{#pi^{0}}",
"P");
2529 lR.AddEntry(hClusterPhoEta,
"#gamma_{#eta}",
"P");
2530 lR.AddEntry(hClusterPi0,
"#pi^{0}",
"P");
2531 lR.AddEntry(hClusterEta,
"#eta",
"P");
2532 lR.SetBorderSize(0);
2536 TLegend lG(0.7,0.5,0.83,0.89);
2537 lG.SetHeader(
"gener");
2538 lG.SetTextSize(0.04);
2539 lG.AddEntry(hPrimPho,
"#gamma",
"P");
2540 lG.AddEntry(hPrimPhoPi0,
"#gamma_{#pi^{0}}",
"P");
2541 lG.AddEntry(hPrimPhoEta,
"#gamma_{#eta}",
"P");
2542 lG.AddEntry(hPrimPi0,
"#pi^{0}",
"P");
2543 lG.AddEntry(hPrimEta,
"#eta",
"P");
2544 lG.SetBorderSize(0);
2552 TH1F* hRatPho = (TH1F*) hClusterPho ->Clone(Form(
"%s_hGenRecoRatPho" ,histoTag.Data()));
2553 TH1F* hRatPi0 = (TH1F*) hClusterPi0 ->Clone(Form(
"%s_hGenRecoRatPi0" ,histoTag.Data()));
2554 TH1F* hRatEta = (TH1F*) hClusterEta ->Clone(Form(
"%s_hGenRecoRatEta" ,histoTag.Data()));
2555 TH1F* hRatPhoPi0 = (TH1F*) hClusterPhoPi0->Clone(Form(
"%s_hGenRecoRatPhoPi0",histoTag.Data()));
2556 TH1F* hRatPhoEta = (TH1F*) hClusterPhoEta->Clone(Form(
"%s_hGenRecoRatPhoEta",histoTag.Data()));
2558 hRatPho ->Divide(hPrimPho);
2559 hRatPhoPi0->Divide(hPrimPhoPi0);
2560 hRatPhoEta->Divide(hPrimPhoEta);
2561 hRatPi0 ->Divide(hPrimPi0);
2562 hRatEta ->Divide(hPrimEta);
2564 hRatPho->SetTitle(
"Reconstructed cluster / Generated particle in Calo acc.");
2565 hRatPho->SetYTitle(
"#it{Ratio reco / gener}");
2566 hRatPho->SetXTitle(
"#it{E} (GeV)");
2567 hRatPho->SetMinimum(1e-3);
2568 hRatPho->SetMaximum(20);
2570 hRatPhoPi0->Draw(
"same");
2571 hRatPhoEta->Draw(
"same");
2572 hRatPi0->Draw(
"same");
2573 hRatEta->Draw(
"same");
2575 TLegend l2(0.15,0.62,0.3,0.89);
2576 l2.SetTextSize(0.04);
2577 l2.AddEntry(hRatPho,
"#gamma",
"P");
2578 l2.AddEntry(hRatPhoPi0,
"#gamma_{#pi^{0}}",
"P");
2579 l2.AddEntry(hRatPhoEta,
"#gamma_{#eta}",
"P");
2580 l2.AddEntry(hRatPi0,
"#pi^{0}",
"P");
2581 l2.AddEntry(hRatEta,
"#eta",
"P");
2582 l2.SetBorderSize(0);
2591 TH2F* h2PrimPhoPhi = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hPhiPrim_MCPhoton",icalo));
2592 TH2F* h2PrimPi0Phi = (
TH2F*)
GetHisto(Form(
"AnaPi0_Calo%d_hPrimPi0Phi" ,icalo));
2593 TH2F* h2PrimEtaPhi = (
TH2F*)
GetHisto(Form(
"AnaPi0_Calo%d_hPrimEtaPhi" ,icalo));
2595 Int_t binMin = hPrimPho->FindBin(3);
2597 TH1F* hPrimPhoPhi = (TH1F*) h2PrimPhoPhi->ProjectionY(Form(
"%s_hPrimPhoPhi",histoTag.Data()),binMin,1000);
2598 TH1F* hPrimPi0Phi = (TH1F*) h2PrimPi0Phi->ProjectionY(Form(
"%s_hPrimPi0Phi",histoTag.Data()),binMin,1000);
2599 TH1F* hPrimEtaPhi = (TH1F*) h2PrimEtaPhi->ProjectionY(Form(
"%s_hPrimEtaPhi",histoTag.Data()),binMin,1000);
2601 hPrimPhoPhi->Sumw2();
2602 hPrimPi0Phi->Sumw2();
2603 hPrimEtaPhi->Sumw2();
2605 hPrimPhoPhi->Scale(1./hPrimPhoPhi->Integral(0,1000));
2606 hPrimPi0Phi->Scale(1./hPrimPi0Phi->Integral(0,1000));
2607 hPrimEtaPhi->Scale(1./hPrimEtaPhi->Integral(0,1000));
2609 Float_t maxPhi = hPrimPhoPhi->GetMaximum();
2610 if(maxPhi < hPrimPi0Phi->GetMaximum()) maxPhi = hPrimPi0Phi->GetMaximum();
2611 if(maxPhi < hPrimEtaPhi->GetMaximum()) maxPhi = hPrimEtaPhi->GetMaximum();
2613 Float_t minPhi = hPrimPhoPhi->GetMinimum();
2614 if(minPhi > hPrimPi0Phi->GetMinimum()) minPhi = hPrimPi0Phi->GetMinimum();
2615 if(minPhi > hPrimEtaPhi->GetMinimum()) minPhi = hPrimEtaPhi->GetMinimum();
2617 hPrimPi0Phi->SetMaximum(maxPhi*1.1);
2618 hPrimPi0Phi->SetMinimum(minPhi);
2619 TGaxis::SetMaxDigits(3);
2621 hPrimPi0Phi->SetYTitle(
"1/total entries d#it{N}/d#varphi");
2622 hPrimPi0Phi->SetTitle(
"Generated particles #varphi for #it{E} > 3 GeV");
2623 hPrimPi0Phi->SetTitleOffset(1.5,
"Y");
2624 hPrimPi0Phi->SetMarkerColor(4);
2625 hPrimPi0Phi->SetMarkerStyle(21);
2626 hPrimPi0Phi->Draw(
"");
2628 hPrimPhoPhi->SetMarkerColor(1);
2629 hPrimPhoPhi->SetMarkerStyle(20);
2630 Float_t scale = TMath::RadToDeg();
2632 hPrimPhoPhi->Draw(
"same");
2634 hPrimEtaPhi->SetMarkerColor(2);
2635 hPrimEtaPhi->SetMarkerStyle(22);
2636 hPrimEtaPhi->Draw(
"same");
2643 TH2F* h2PrimPhoEtaP = (
TH2F*)
GetHisto(Form(
"AnaPhoton_Calo%d_hYPrim_MCPhoton",icalo));
2644 TH2F* h2PrimPi0EtaP = (
TH2F*)
GetHisto(Form(
"AnaPi0_Calo%d_hPrimPi0Rapidity" ,icalo));
2645 TH2F* h2PrimEtaEtaP = (
TH2F*)
GetHisto(Form(
"AnaPi0_Calo%d_hPrimEtaRapidity" ,icalo));
2647 h2PrimPhoEtaP->Sumw2();
2648 h2PrimEtaEtaP->Sumw2();
2649 h2PrimPi0EtaP->Sumw2();
2651 binMin = hPrimPho->FindBin(3);
2653 TH1F* hPrimPhoEtaP = (TH1F*) h2PrimPhoEtaP->ProjectionY(Form(
"%s_hPrimPhoEtaP",histoTag.Data()),binMin,1000);
2654 TH1F* hPrimPi0EtaP = (TH1F*) h2PrimPi0EtaP->ProjectionY(Form(
"%s_hPrimPi0EtaP",histoTag.Data()),binMin,1000);
2655 TH1F* hPrimEtaEtaP = (TH1F*) h2PrimEtaEtaP->ProjectionY(Form(
"%s_hPrimEtaEtaP",histoTag.Data()),binMin,1000);
2657 hPrimPhoEtaP->Scale(1./hPrimPhoEtaP->Integral(0,1000));
2658 hPrimPi0EtaP->Scale(1./hPrimPi0EtaP->Integral(0,1000));
2659 hPrimEtaEtaP->Scale(1./hPrimEtaEtaP->Integral(0,1000));
2661 Float_t maxEta = hPrimPhoEtaP->GetMaximum();
2662 if(maxEta < hPrimPi0EtaP->GetMaximum()) maxEta = hPrimPi0EtaP->GetMaximum();
2663 if(maxEta < hPrimEtaEtaP->GetMaximum()) maxEta = hPrimEtaEtaP->GetMaximum();
2665 Float_t minEta = hPrimPhoEtaP->GetMinimum();
2666 if(minEta > hPrimPi0EtaP->GetMinimum()) minEta = hPrimPi0EtaP->GetMinimum();
2667 if(minEta > hPrimEtaEtaP->GetMinimum()) minEta = hPrimEtaEtaP->GetMinimum();
2669 hPrimPi0EtaP->SetMaximum(maxEta*1.1);
2670 hPrimPi0EtaP->SetMinimum(minEta);
2671 TGaxis::SetMaxDigits(3);
2673 hPrimPi0EtaP->SetYTitle(
"1/total entries d#it{N}/d#eta");
2674 hPrimPi0EtaP->SetTitle(
"Generated particles #eta for #it{E} > 3 GeV");
2675 hPrimPi0EtaP->SetTitleOffset(1.5,
"Y");
2676 hPrimPi0EtaP->SetMarkerColor(4);
2677 hPrimPi0EtaP->SetMarkerStyle(21);
2678 hPrimPi0EtaP->Draw(
"");
2680 hPrimPhoEtaP->SetMarkerColor(1);
2681 hPrimPhoEtaP->SetMarkerStyle(20);
2682 scale = TMath::RadToDeg();
2683 hPrimPhoEtaP->Draw(
"same");
2685 hPrimEtaEtaP->SetMarkerColor(2);
2686 hPrimEtaEtaP->SetMarkerStyle(22);
2687 hPrimEtaEtaP->Draw(
"same");
2691 cmc->Print(Form(
"%s_MCHisto.%s",histoTag.Data(),format.Data()));
2697 delete hPrimPhoPhi ;
2698 delete hPrimPi0Phi ;
2699 delete hPrimEtaPhi ;
2700 delete hPrimPhoEtaP ;
2701 delete hPrimPi0EtaP ;
2702 delete hPrimEtaEtaP ;
2729 histArr = (
TList*)
dir->Get(trigName);
2733 printf(
"List not found, do nothing\n");
2737 if ( histArr->GetEntries() <= 0 )
2739 printf(
"No histograms found <%d>, do nothing\n",histArr->GetEntries());
2745 fout =
new TFile(Form(
"AnalysisResults%s.root",histoTag.Data()),
"RECREATE");
2766 histo = histArr->FindObject(histoName);
2768 histo =
file->Get (histoName);
2786 if(tag) histo->Write(Form(
"fig_ga_%s_%s",histoTag.Data(), histo->GetName()));
2787 else histo->Write(Form(
"fig_ga_%s" ,histo->GetName()));
2799 if(canvas) canvas->Write(Form(
"canvas_ga_%s",canvas->GetName()));
2809 if (a->GetXbins()->GetSize())
2815 for(
Int_t i = 0; i < X.GetSize(); i++) X[i] = scale*X[i];
2816 a->Set((X.GetSize() - 1), X.GetArray());
2823 a->Set(a->GetNbins(),
2824 - scale*a->GetXmin(),
2825 - scale*a->GetXmax());
2847 currentLatex->SetNDC();
2848 currentLatex->SetTextFont(textfont);
2849 currentLatex->SetTextSize(textsize);
2850 currentLatex->SetTextColor(textcolor);
Int_t color[]
print message on plot with ok/not ok
void DrawAnaCaloTrackQA(TString listName="Pi0IM_GammaTrackCorr_EMCAL", TString fileName="AnalysisResults.root", Int_t exportTo=1, TString fileFormat="eps", TString outFileName="CaloTrackCorrQA_output", Bool_t okFlag=kTRUE)
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)
void ProcessTrigger(TString trigName="default", Bool_t checkList=kTRUE)
TList * histArr
TDirectory file where lists per trigger are stored in train ouput.
void ScaleAxis(TAxis *a, Double_t scale)
TLatex * text[5]
option to what and if export to output file
void SaveHisto(TObject *histo, Bool_t tag=kTRUE)
Double_t nEvents
plot quality messages
void MyLatexMakeUp(TLatex *currentLatex, Int_t textfont, Double_t textsize, Int_t textcolor)
Latex settings.
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)
TFile * fout
input train file
Bool_t addOkFlag
number of events analyzed
void ScaleXaxis(TH1 *h, Double_t scale)