1 #if !defined(__CINT__) || defined(__MAKECINT__) 3 #include "AliEMCALGeometry.h" 7 #include <TDirectory.h> 13 #include <TGraphErrors.h> 18 #include <TObjString.h> 56 const Int_t NRGBs = 5;
57 const Int_t NCont = 255;
59 Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
60 Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
61 Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
62 Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
63 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
64 gStyle->SetNumberContours(NCont);
74 gaus = par[0] * TMath::Exp( -(x[0]-par[1])*(x[0]-par[1]) / (2*par[2]*par[2]) );
78 Double_t back = par[3] + par[4]*x[0] + par[5]*x[0]*x[0];
87 Double_t gaus = par[0] * TMath::Exp( -(x[0]-par[1])*(x[0]-par[1]) / (2*par[2]*par[2]) );
88 Double_t back = par[3] + par[4]*x[0];
99 levy = par[0] * TMath::Exp( -par[1]/x[0]) * TMath::Power(x[0], -par[2]) ;
112 if(! QAPATH.BeginsWith(
"./"))
113 QAPATH = QAPATH + RunId +
"/";
115 AliLog::SetGlobalLogLevel(AliLog::kError);
116 TFile *f =
new TFile(filename);
117 AliLog::SetGlobalLogLevel(AliLog::kInfo);
120 Error(__FUNCTION__, Form(
"Error openning the input file %s", filename));
127 TPMERegexp name_re(
"CaloQA_\\w+");
128 TObjLink* link = f->GetListOfKeys()->FirstLink();
131 TString name = link->GetObject()->GetName();
132 if(name_re.Match(name)){
133 TriggersList->Add(link->GetObject());
134 if(
TString(filename).Contains(
"barrel") && ! name.Contains(
"default")) TriggersList->Remove(link->GetObject());
135 if(
TString(filename).Contains(
"outer") && ! name.Contains(
"EMC")) TriggersList->Remove(link->GetObject());
141 TriggersList->Add(
new TObjString(fTrigger.Data()));
144 if(!TriggersList->GetEntries()){
145 Error(__FUNCTION__,
"No trigger found!");
149 int nSM =
FindNumberOfSM(f, ((TObjString*)TriggersList->Last())->GetString(), period);
152 Error(__FUNCTION__,
"Could not find the number of super modules!");
155 Info(__FUNCTION__, Form(
"%i super modules were discovered", nSM));
158 if(nSM <= 4) { nSM = 4; GeomName =
"EMCAL_FIRSTYEARv1"; }
159 else if(nSM <= 10){ nSM = 10; GeomName =
"EMCAL_COMPLETEv1"; }
160 else if(nSM <= 12){ nSM = 12; GeomName =
"EMCAL_COMPLETE12SMv1"; }
161 else { nSM = 20; GeomName =
"EMCAL_COMPLETE12SMv1_DCAL_8SM";}
163 AliEMCALGeometry *geom =
new AliEMCALGeometry(GeomName.Data(),
"EMCAL");
164 Info(__FUNCTION__, Form(
"Using %i super modules and the Geometry %s", nSM, GeomName.Data()));
166 TFile *
fout =
new TFile(
TString( QAPATH + period+
"_"+pass + fTrigger+
"_"+ (Long_t)RunId.Atoi() +
"_QAplots.root").
Data(),
"RECREATE");
168 if((system.IsNull()) && (period.EndsWith(
"h")))
172 TIter next(TriggersList);
174 fTrigger=
TString(obj->GetName());
175 ret -=
DrawOccupancy(RunId.Atoi(), period, pass, fTrigger, system, f,
fout, geom, SavePlots);
176 ret -=
DrawRun(RunId.Atoi(), period, pass, fTrigger, f,
fout, SavePlots, nSM, filter);
178 ret-=
TrendingEMCALTree(RunId.Atoi(), fCalorimeter, system, period, pass, nSM, TriggersList, f,
fout, SavePlots);
192 gStyle->SetOptStat(0);
194 TH1::AddDirectory(kFALSE);
195 TH2D *hEnergyMapReal =
new TH2D(
"hEnergyMapReal",
"", 96, -48, 48, 120, -0, 120);
196 TH2D *hOccupancyMapReal =
new TH2D(
"hOccupancyMapReal",
"", 96, -48, 48, 120, -0, 120);
198 hEnergyMapReal->SetXTitle(
"#eta (bin)");
199 hEnergyMapReal->SetYTitle(
"#varphi (bin)");
200 hEnergyMapReal->SetZTitle(
"E (GeV)/event");
201 hEnergyMapReal->GetYaxis()->SetTitleOffset(1.2);
202 hEnergyMapReal->GetZaxis()->SetLabelSize(0.02);
203 hEnergyMapReal->GetZaxis()->SetTitleOffset(1.36);
205 hOccupancyMapReal->SetXTitle(
"#eta (bin)");
206 hOccupancyMapReal->SetYTitle(
"#varphi (bin)");
207 hOccupancyMapReal->GetYaxis()->SetTitleOffset(1.2);
208 hOccupancyMapReal->GetZaxis()->SetLabelSize(0.02);
210 Int_t nSupMod, nModule, nIphi, nIeta;
216 Int_t mask[1] = {2222222};
218 TH2F *hCellAmplitude;
224 if(!fTrigger.Contains(
"QA")){
229 Bool_t dirok = f->cd(direct);
231 Error(__FUNCTION__, Form(
"No input drectory %s", direct.Data()));
235 TList *outputList = (
TList*)gDirectory->Get(direct);
237 Error(__FUNCTION__,
"No input list! ");
240 outputList->SetOwner();
242 fout->mkdir(Form(
"%s/%s/%ld/%s/%s", period.Data(), pass.Data(), run,
"RunLevelQA", fTrigger.Data()));
244 fout->Cd(Form(
"%s/%s/%ld/%s/%s", period.Data(), pass.Data(), run,
"RunLevelQA", fTrigger.Data()));
246 hNEvents = (TH1F *)outputList->FindObject(
"hNEvents");
248 Error(__FUNCTION__, Form(
"hNEvent histogram not found for trigger %s ", fTrigger.Data()));
252 Events = (
Int_t)hNEvents->GetEntries();
254 Error(__FUNCTION__, Form(
"No event in trigger %s", fTrigger.Data()));
258 TH1F* hE = (TH1F *)outputList->FindObject(
"EMCAL_hE");
259 if(!hE || (!hE->GetEntries())){
260 Error(__FUNCTION__, Form(
"hE Histogram not found or it is empty for trigger %s, EMCal was not in this run?", fTrigger.Data()));
267 if(fTrigger.Contains(
"EMC"))
272 if(fTrigger.Contains(
"EMC"))
276 hCellAmplitude = (
TH2F *)outputList->FindObject(
"EMCAL_hAmpId");
278 for(
Int_t i = 0; i < geom->GetNCells() ; i++){
282 for(
Int_t j = 1; j <= hCellAmplitude->GetNbinsX(); j++){
283 Double_t E = hCellAmplitude->GetXaxis()->GetBinCenter(j);
284 Double_t N = hCellAmplitude->GetBinContent(j, i+1);
297 if(mask[n]<=mask[n-1])
298 Warning(__FUNCTION__,
"The list of bad cells is not sorted !!");
306 geom->GetCellIndex(absId, nSupMod, nModule, nIphi, nIeta);
307 geom->GetCellPhiEtaIndexInSModule(nSupMod, nModule, nIphi, nIeta, iphi, ieta);
309 realbinphi = 120-(nSupMod/2)*24 -iphi -1;
311 realbineta= 48-ieta -1;
313 realbineta= -ieta -1;
315 hEnergyMapReal->Fill(realbineta, realbinphi, Esum/(
Double_t)Events);
319 cout <<
" Run: " << run <<
" trigger: " << fTrigger <<
" N_events: "<<Events<<endl;
321 TPMERegexp r(
"_\\w+");
368 outputList->Delete();
369 delete hEnergyMapReal;
370 delete hOccupancyMapReal;
379 if(!fTrigger.Contains(
"QA")){
386 Error(__FUNCTION__, Form(
"No input directory %s", direct.Data()));
390 TList *outputList = (
TList*)gDirectory->Get(direct);
392 Error(__FUNCTION__, Form(
"No input list! %s", direct.Data()));
395 outputList->SetOwner();
398 fout->mkdir(Form(
"%s/%s/%ld/%s", period.Data(), pass.Data(), run, fTrigger.Data()));
400 fout->Cd(Form(
"%s/%s/%ld/%s", period.Data(), pass.Data(), run, fTrigger.Data()));
404 fout->Cd(Form(
"%s/%s/%ld/%s/%s", period.Data(), pass.Data(), run,
"RunLevelQA", fTrigger.Data()));
407 gStyle->SetPalette(1);
411 TH1::AddDirectory(kFALSE);
418 const char* legend=
"";
419 TPMERegexp r(
"_\\w+");
421 if(fTrigger.Contains(
"EMC"))
422 legend = Form(
" Run %d EMC ", (
int)run);
424 legend = Form(
" Run %d MB ", (
int)run);
426 TH1F* hNEvents =(TH1F *)outputList->FindObject(
"hNEvents");
428 Error(__FUNCTION__, Form(
"hNEvent histogram not found for trigger %s ", fTrigger.Data()));
434 Error(__FUNCTION__, Form(
"No event in trigger %s", fTrigger.Data()));
438 TH1F* hE =(TH1F *)outputList->FindObject(
"EMCAL_hE");
439 if(!hE || (!hE->GetEntries())){
440 Error(__FUNCTION__, Form(
"hE Histogram not found or it is empty for trigger %s, EMCal was not in this run?", fTrigger.Data()));
444 TCanvas* c00 =
new TCanvas(
"Occupancy map",
"Occupancy", 600, 600);
446 c00->SetFillColor(0);
447 c00->SetBorderSize(0);
448 c00->SetFrameBorderMode(0);
450 TH2F* hOccupancyMapReal =(
TH2F *)outputList->FindObject(
"EMCAL_hEtaPhi");
451 if(!hOccupancyMapReal){
452 Error(__FUNCTION__, Form(
"EMCAL_hEtaPhi: Histogram for trigger %s not found!", fTrigger.Data()));
455 FormatRunHisto(hOccupancyMapReal, Form(
"Occupancy%s", legend),
"#varphi (bin)");
456 hOccupancyMapReal->SetXTitle(
"#eta (bin)");
458 AutoZoom(hOccupancyMapReal,
"all")->DrawCopy(
"colz");
459 outfilename = QAPATH +
"OccupancyMap" + fTrigger(r) +
".pdf" ;
460 outfilename2 = QAPATH +
"OccupancyMap" + fTrigger(r) +
".png" ;
463 c00->SaveAs(outfilename);
465 c00->SaveAs(outfilename2);
469 TCanvas* c0 =
new TCanvas(
"Grid Cell",
"Occupancy from Grid Cells", 600, 600);
472 c0->SetBorderSize(0);
473 c0->SetFrameBorderMode(0);
475 TH2F* hGridCells =(
TH2F *)outputList->FindObject(
"EMCAL_hGridCells");
477 Error(__FUNCTION__, Form(
"EMCAL_hGridCells: Histogram for trigger %s not found!", fTrigger.Data()));
480 FormatRunHisto(hGridCells, Form(
"Occupancy from Grid Cells%s", legend),
"#varphi row columns");
481 hGridCells->SetXTitle(
"#eta row columns");
482 AutoZoom(hGridCells,
"all")->DrawCopy(
"colz");
484 outfilename = QAPATH +
"GridCells" + fTrigger(r) +
".pdf" ;
485 outfilename2 = QAPATH +
"GridCells" + fTrigger(r) +
".png" ;
488 c0->SaveAs(outfilename);
490 c0->SaveAs(outfilename2);
494 TCanvas* c1 =
new TCanvas(
"TimeVsE",
"Cluster Time vs. Energy", 600, 600);
497 c1->SetBorderSize(0);
498 c1->SetFrameBorderMode(0);
500 TH2F* hClusterTimeEnergy =(
TH2F *)outputList->FindObject(
"EMCAL_hClusterTimeEnergy");
501 if(!hClusterTimeEnergy){
502 Error(__FUNCTION__, Form(
"EMCAL_hClusterTimeEnergy: Histogram for trigger %s not found!", fTrigger.Data()));
505 FormatRunHisto(hClusterTimeEnergy, Form(
"Time vs. Energy%s", legend),
"EMCal ToF (ns)");
506 AutoZoom(hClusterTimeEnergy,
"maxx")->DrawCopy(
"colz");
508 outfilename = QAPATH +
"TimeRun" + fTrigger(r) +
".pdf" ;
509 outfilename2 = QAPATH +
"TimeRun" + fTrigger(r) +
".png" ;
512 c1->SaveAs(outfilename);
514 c1->SaveAs(outfilename2);
518 if((pass!=
"simu")||(pass!=
"passMC")){
519 TCanvas* c1a =
new TCanvas(
"TimeVsAbsId",
"Cell Id vs. time ", 600, 600);
521 c1a->SetFillColor(0);
522 c1a->SetBorderSize(0);
523 c1a->SetFrameBorderMode(0);
525 TH2F* hTimeAbsId =(
TH2F *)outputList->FindObject(
"EMCAL_hTimeId");
527 Error(__FUNCTION__, Form(
"EMCAL_hTimeId: Histogram for trigger %s not found!", fTrigger.Data()));
530 FormatRunHisto(hTimeAbsId, Form(
"Cell ID vs. Time%s", legend),
"Cell AbsID");
531 hTimeAbsId->RebinY(16);
532 hTimeAbsId->SetMinimum(32);
533 AutoZoom(hTimeAbsId,
"maxx")->DrawCopy(
"colz");
535 outfilename = QAPATH +
"TimeAbsIdRun" + fTrigger(r) +
".pdf" ;
536 outfilename2 = QAPATH +
"TimeAbsRun" + fTrigger(r) +
".png" ;
539 c1a->SaveAs(outfilename);
541 c1a->SaveAs(outfilename2);
568 TCanvas* c1b =
new TCanvas(
"EVsAbsId",
"Cell Id vs. Energy", 600, 600);
570 c1b->SetFillColor(0);
571 c1b->SetBorderSize(0);
572 c1b->SetFrameBorderMode(0);
574 TH2F* hEAbsId =(
TH2F *)outputList->FindObject(
"EMCAL_hAmpId");
576 Error(__FUNCTION__, Form(
"EMCAL_hAmpId: Histogram for trigger %s not found!", fTrigger.Data()));
579 FormatRunHisto(hEAbsId, Form(
"Cell ID vs. Energy%s", legend),
"Cell AbsID");
581 hEAbsId->SetMinimum(32);
582 AutoZoom(hEAbsId,
"maxx")->DrawCopy(
"colz");
584 outfilename = QAPATH +
"EAbsIdRun" + fTrigger(r) +
".pdf" ;
585 outfilename2 = QAPATH +
"EAbsIdRun" + fTrigger(r) +
".png" ;
588 c1b->SaveAs(outfilename);
590 c1b->SaveAs(outfilename2);
616 if (!(pass.Contains(
"muon_calo"))){
618 TCanvas * c2 =
new TCanvas(
"ClusterVsTrack ",
"Correlation calo Mult vs. Track Multiplicity", 600, 600);
621 c2->SetBorderSize(0);
622 c2->SetFrameBorderMode(0);
624 TH2F* hClusterVsTrack =(
TH2F *)outputList->FindObject(
"EMCAL_hCaloTrackMNClusters");
625 FormatRunHisto(hClusterVsTrack, Form(
"#it{N} clusters vs. #it{N} tracks%s", legend),
"#it{N} clusters");
626 AutoZoom(hClusterVsTrack,
"maxx, maxy", 1)->DrawCopy(
"colz");
628 outfilename = QAPATH +
"CaloTrackMult" + fTrigger(r) +
".pdf";
629 outfilename2 = QAPATH +
"CaloTrackMult" + fTrigger(r) +
".png";
633 c2->SaveAs(outfilename);
635 c2->SaveAs(outfilename2);
639 TCanvas* c3 =
new TCanvas(
"ClusterEVsTrack ",
"Correlation #it{E} calo vs. Track Multiplicity", 600, 600);
642 c3->SetBorderSize(0);
643 c3->SetFrameBorderMode(0);
645 TH2F* hClusterEVsTrack =(
TH2F*)outputList->FindObject(
"EMCAL_hCaloTrackMEClusters");
646 FormatRunHisto(hClusterEVsTrack, Form(
"Sum #it{E} clusters vs. #it{N} tracks%s", legend),
"#Sigma#it{E} clusters");
647 AutoZoom(hClusterEVsTrack,
"maxx, maxy", 1)->DrawCopy(
"colz");
649 outfilename = QAPATH +
"ETrackMult" + fTrigger(r) +
".pdf";
650 outfilename2 = QAPATH +
"ETrackMult" + fTrigger(r) +
".png";
654 c3->SaveAs(outfilename);
656 c3->SaveAs(outfilename2);
662 TCanvas* c4 =
new TCanvas(
"ClusterEVsV0 ",
"Correlation #it{E} calo vs. V0 signal", 600, 600);
665 c4->SetBorderSize(0);
666 c4->SetFrameBorderMode(0);
668 TH2F* hClusterEVsV0S =(
TH2F*)outputList->FindObject(
"EMCAL_hCaloV0SEClusters");
669 FormatRunHisto(hClusterEVsV0S, Form(
"Sum #it{E} clusters vs. V0 signal%s", legend),
"#Sigma#it{E} clusters");
670 AutoZoom(hClusterEVsV0S,
"maxx, maxy", 1)->DrawCopy(
"colz");
672 outfilename = QAPATH +
"EVsV0s" + fTrigger(r) +
".pdf";
673 outfilename2 = QAPATH +
"EVsV0s" + fTrigger(r) +
".png";
676 c4->SaveAs(outfilename);
678 c4->SaveAs(outfilename2);
682 TCanvas* c6 =
new TCanvas(
"SumCellEvsSM",
"sum cell energy vs. SM", 600, 600);
685 c6->SetBorderSize(0);
686 c6->SetFrameBorderMode(0);
688 TH2F* hSumCellEVsSM =(
TH2F*)outputList->FindObject(
"EMCAL_hSumCellsAmp_Mod");
689 FormatRunHisto(hSumCellEVsSM, Form(
"Sum #it{E} cells vs. SM%s", legend),
"SM number");
690 AutoZoom(hSumCellEVsSM,
"maxx, maxy", 1)->DrawCopy(
"colz");
692 outfilename = QAPATH +
"SumCellEVsSM" + fTrigger(r) +
".pdf";
693 outfilename2 = QAPATH +
"SumCellEVsSM" + fTrigger(r) +
".png";
696 c6->SaveAs(outfilename);
698 c6->SaveAs(outfilename2);
702 TCanvas* c5 =
new TCanvas(
"CellsperCluster",
"Nb of cells per cluster for each SM", 600, 600);
705 c5->SetBorderSize(0);
706 c5->SetFrameBorderMode(0);
711 c5->Divide(3, (nSM/3)+mod3);
713 for(
int ism = 0; ism < nSM; ism++){
717 if(
TString(Form(
"Nb cells per clus%s Mod %d", legend, ism)).Length() > 60){
718 Error(__FUNCTION__,
"Title too long!");
722 AutoZoom(
HistoPerMod((
TH2F*)outputList->FindObject(Form(
"EMCAL_hNCellsPerCluster_Mod%i", ism)), Form(
"Nb of cells per cluster%s Mod %d", legend, ism)),
"all", 1)->DrawCopy(
"colz");
725 outfilename = QAPATH +
"CellsperClusterSM" + fTrigger(r) +
".pdf";
726 outfilename2 = QAPATH +
"CellsperClusterSM" + fTrigger(r) +
".png";
729 c5->SaveAs(outfilename);
731 c5->SaveAs(outfilename2);
735 outputList->Delete();
746 aCalorimeter = fCalorimeter;
748 aCalorimeter =
TString(
"EMCAL_and_DCAL");
806 TFile* ftree =
new TFile(Form(
"%s/trending.root", QAPATH.Data()),
"RECREATE");
808 TTree *tree =
new TTree(
"trending",
"Trending QA Tree");
809 tree->Branch(
"fDate", &now);
810 tree->Branch(
"fCalorimeter", &aCalorimeter);
811 tree->Branch(
"system", &system);
812 tree->Branch(
"period", &period);
813 tree->Branch(
"pass", &pass);
814 tree->Branch(
"fTrigger", &fTrigger);
815 tree->Branch(
"run", &RunId,
"run/I");
816 tree->Branch(
"xe", &xe,
"xe/D");
818 tree->Branch(
"Nevent", &Nevent,
"Nevent/D");
819 tree->Branch(
"NeventEGA1", &NeventEGA1,
"NeventEGA1/D");
820 tree->Branch(
"NeventEGA2", &NeventEGA2,
"NeventEGA2/D");
821 tree->Branch(
"NeventDGA1", &NeventDGA1,
"NeventDGA1/D");
822 tree->Branch(
"NeventDGA2", &NeventDGA2,
"NeventDGA2/D");
823 tree->Branch(
"NeventEJE1", &NeventEJE1,
"NeventEJE1/D");
824 tree->Branch(
"NeventEJE2", &NeventEJE2,
"NeventEJE2/D");
825 tree->Branch(
"NeventDJE1", &NeventDJE1,
"NeventDJE1/D");
826 tree->Branch(
"NeventDJE2", &NeventDJE2,
"NeventDJE2/D");
827 tree->Branch(
"NMatchClustersP", &NMatchClustersP,
"NMatchClustersP/D");
828 tree->Branch(
"NMatchClustersPRMS", &NMatchClustersPRMS,
"NMatchClustersPRMS/D");
829 tree->Branch(
"CellMean", &CellMean,
"CellMean/D");
830 tree->Branch(
"CellRMS", &CellRMS,
"CellRMS/D");
831 tree->Branch(
"ClusterMean", &ClusterMean,
"ClusterMean/D");
832 tree->Branch(
"ClusterRMS", &ClusterRMS,
"ClusterRMS/D");
833 tree->Branch(
"EtotalMean", &EtotalMean,
"EtotalMean/D");
834 tree->Branch(
"EtotalRMS", &EtotalRMS,
"EtotalRMS/D");
836 tree->Branch(
"CellPerClusterMean", &CellPerClusterMean,
"CellPerClusterMean/D");
837 tree->Branch(
"CellPerClusterRMS", &CellPerClusterRMS,
"CellPerClusterRMS/D");
839 tree->Branch(
"Npi0EMCAL", &Npi0EMCAL,
"Npi0EMCAL/D");
840 tree->Branch(
"Npi0EMCALErr", &Npi0EMCALErr,
"Npi0EMCALErr/D");
841 tree->Branch(
"Npi0DCAL", &Npi0DCAL,
"Npi0DCAL/D");
842 tree->Branch(
"Npi0DCALErr", &Npi0DCALErr,
"Npi0DCALErr/D");
843 tree->Branch(
"MeanPosEMCAL", &MeanPosEMCAL,
"MeanPosEMCAL/D");
844 tree->Branch(
"MeanPosEMCALErr", &MeanPosEMCALErr,
"MeanPosEMCALErr/D");
845 tree->Branch(
"MeanPosDCAL", &MeanPosDCAL,
"MeanPosDCAL/D");
846 tree->Branch(
"MeanPosDCALErr", &MeanPosDCALErr,
"MeanPosDCALErr/D");
847 tree->Branch(
"WidthEMCAL", &WidthEMCAL,
"WidthEMCAL/D");
848 tree->Branch(
"WidthEMCALErr", &WidthEMCALErr,
"WidthEMCALErr/D");
849 tree->Branch(
"WidthDCAL", &WidthDCAL,
"WidthDCAL/D");
850 tree->Branch(
"WidthDCALErr", &WidthDCALErr,
"WidthDCALErr/D");
851 tree->Branch(
"Chi2NdfPi0EMCAL", &Chi2NdfPi0EMCAL,
"Chi2NdfPi0EMCAL/D");
852 tree->Branch(
"Chi2NdfPi0DCAL", &Chi2NdfPi0DCAL,
"Chi2NdfPi0DCAL/D");
853 tree->Branch(
"NggEMCAL", &NggEMCAL,
"NggEMCAL/D");
854 tree->Branch(
"NggEMCALErr", &NggEMCALErr,
"NggEMCALErr/D");
855 tree->Branch(
"NggDCAL", &NggDCAL,
"NggDCAL/D");
856 tree->Branch(
"NggDCALErr", &NggDCALErr,
"NggDCALErr/D");
857 tree->Branch(
"SignifEMCAL", &SignifEMCAL,
"SignifEMCAL/D");
858 tree->Branch(
"SignifDCALErr", &SignifDCALErr,
"SignifDCALErr/D");
859 tree->Branch(
"SignifEMCAL", &SignifEMCAL,
"SignifEMCAL/D");
860 tree->Branch(
"SignifDCALErr", &SignifDCALErr,
"SignifDCALErr/D");
862 tree->Branch(
"nSM", &n,
"nSM/I");
872 Double_t CellPerClusterMeanSM[nMax];
891 tree->Branch(
"CellMeanSM", CellMeanSM, TString::Format(
"CellMeanSM[%i]/D", nMax));
892 tree->Branch(
"CellRMSSM", CellRMSSM, TString::Format(
"CellRMSSM[%i]/D", nMax));
893 tree->Branch(
"ClusterMeanSM", ClusterMeanSM, TString::Format(
"ClusterMeanSM[%i]/D", nMax));
894 tree->Branch(
"ClusterTotSM", ClusterTotSM, TString::Format(
"ClusterTotSM[%i]/D", nMax));
895 tree->Branch(
"ClusterRMSSM", ClusterRMSSM, TString::Format(
"ClusterRMSSM[%i]/D", nMax));
896 tree->Branch(
"EtotalMeanSM", EtotalMeanSM, TString::Format(
"EtotalMeanSM[%i]/D", nMax));
897 tree->Branch(
"EtotalRMSSM", EtotalRMSSM, TString::Format(
"EtotalRMSSM[%i]/D", nMax));
898 tree->Branch(
"CellPerClusterMeanSM", CellPerClusterMeanSM, TString::Format(
"CellPerClusterMeanSM[%i]/D", nMax));
899 tree->Branch(
"CellPerClusterRMSSM", CellPerClusterRMSSM, TString::Format(
"CellPerClusterRMSSM[%i]/D", nMax));
900 tree->Branch(
"ECell1MeanSM", ECell1MeanSM, TString::Format(
"ECell1MeanSM[%i]/D", nMax));
901 tree->Branch(
"ECell1RMSSM", ECell1RMSSM, TString::Format(
"ECell1RMSSM[%i]/D", nMax));
903 tree->Branch(
"MeanPosSM", MeanPosSM, TString::Format(
"MeanPosSM[%i]/D", nMax));
904 tree->Branch(
"MeanPosErrSM", MeanPosErrSM, TString::Format(
"MeanPosErrSM[%i]/D", nMax));
905 tree->Branch(
"WidthSM", WidthSM, TString::Format(
"WidthSM[%i]/D", nMax));
906 tree->Branch(
"WidthErrSM", WidthErrSM, TString::Format(
"WidthErrSM[%i]/D", nMax));
907 tree->Branch(
"Npi0SM", Npi0SM, TString::Format(
"Npi0SM[%i]/D", nMax));
908 tree->Branch(
"Npi0ErrSM", Npi0ErrSM, TString::Format(
"Npi0ErrSM[%i]/D", nMax));
909 tree->Branch(
"ETrigMax", ETrigMax, TString::Format(
"EtrigMax[%i]/D", nTRIG));
910 tree->Branch(
"DTrigMax", DTrigMax, TString::Format(
"DtrigMax[%i]/D", nTRIG));
913 TF1* fitMass =
new TF1(
"fitMass",
pi0massP2, 100, 250, 6);
914 fitMass->SetParName(0,
"A");
915 fitMass->SetParName(1,
"m_{0}");
916 fitMass->SetParName(2,
"sigma");
917 fitMass->SetParName(3,
"a_{0}");
918 fitMass->SetParName(4,
"a_{1}");
919 fitMass->SetParName(5,
"a_{2}");
920 fitMass->SetParLimits(0, 1.e-5, 1.e5);
921 fitMass->SetParLimits(1, 0.11, 0.16);
922 fitMass->SetParLimits(2, 0.001, 0.06);
928 TH1F* fhNClusters = 0x0;
930 TH1F* fhNCells = 0x0;
934 TH2F* NCellsPerCluster[n];
968 TPMERegexp r(
"_\\w+");
969 TIter next(TriggersList);
973 fTrigger=
TString(obj->GetName());
974 TString namefile = QAPATH + period +
"_" + pass + fTrigger(r).Data() +
"_" + RunId +
"_data.txt";
975 ofstream QAData(namefile, ios::app);
982 NMatchClustersPRMS=0;
989 CellPerClusterMean=0;
1018 memset (CellMeanSM, 0,
sizeof (
Double_t) * nMax);
1019 memset (CellRMSSM, 0,
sizeof (
Double_t) * nMax);
1020 memset (ClusterMeanSM, 0,
sizeof (
Double_t) * nMax);
1021 memset (ClusterTotSM, 0,
sizeof (
Double_t) * nMax);
1022 memset (ClusterRMSSM, 0,
sizeof (
Double_t) * nMax);
1023 memset (EtotalMeanSM, 0,
sizeof (
Double_t) * nMax);
1024 memset (EtotalRMSSM, 0,
sizeof (
Double_t) * nMax);
1025 memset (CellPerClusterMeanSM, 0,
sizeof (
Double_t) * nMax);
1026 memset (CellPerClusterRMSSM, 0,
sizeof (
Double_t) * nMax);
1027 memset (ECell1MeanSM, 0,
sizeof (
Double_t) * nMax);
1028 memset (ECell1RMSSM, 0,
sizeof (
Double_t) * nMax);
1030 memset (MeanPosSM, 0,
sizeof (
Double_t) * nMax);
1031 memset (MeanPosErrSM, 0,
sizeof (
Double_t) * nMax);
1032 memset (WidthSM, 0,
sizeof (
Double_t) * nMax);
1033 memset (WidthErrSM, 0,
sizeof (
Double_t) * nMax);
1034 memset (Npi0SM, 0,
sizeof (
Double_t) * nMax);
1035 memset (Npi0ErrSM, 0,
sizeof (
Double_t) * nMax);
1036 memset (ETrigMax, 0,
sizeof (
Double_t) * nTRIG);
1037 memset (DTrigMax, 0,
sizeof (
Double_t) * nTRIG);
1040 if(!fTrigger.Contains(
"QA")){
1041 dirname =
"CaloQA_";
1043 dirname += fTrigger;
1045 Bool_t dirok = f->cd(dirname);
1047 Error(__FUNCTION__, Form(
"No input directory %s", dirname.Data()));
1048 tree->Fill(); ftree->cd();
1054 outputList = (
TList*)gDirectory->Get(dirname);
1056 Error(__FUNCTION__, Form(
"No input list! %s", dirname.Data()));
1057 tree->Fill(); ftree->cd();
1062 outputList->SetOwner();
1065 fhNEvents =(TH1F *)outputList->FindObject(
"hNEvents");
1067 Error(__FUNCTION__, Form(
"NEvent histogram not found for trigger %s", fTrigger.Data()));
1068 tree->Fill(); ftree->cd();
1069 tree->Write(); ret=-3;
1073 Nevent=fhNEvents->GetEntries();
1076 Error(__FUNCTION__, Form(
"No event in trigger %s", fTrigger.Data()));
1077 tree->Fill(); ftree->cd();
1083 Error(__FUNCTION__, Form(
"Less than 20 events in trigger %s", fTrigger.Data()));
1084 tree->Fill(); ftree->cd();
1090 TH1F* hE =(TH1F *)outputList->FindObject(
"EMCAL_hE");
1091 if(!hE || (!hE->GetEntries())){
1092 Error(__FUNCTION__, Form(
"hE Histogram not found or it is empty for trigger %s, EMCal was not in this run?", fTrigger.Data())); EtotalMean=0;
1093 tree->Fill(); ftree->cd();
1100 fhE = (TH1F *)outputList->FindObject(fCalorimeter+
"_hE");
1101 fhECharged = (TH1F *)outputList->FindObject(fCalorimeter+
"_hECharged");
1105 for(
Int_t ibin = fhE->FindBin(0.6) ; ibin <fhE->FindBin(50.) ; ibin++){
1106 energy+=fhE->GetBinCenter(ibin)*fhE->GetBinContent(ibin);
1109 if(fhE->Integral(fhE->FindBin(0.6), fhE->FindBin(50.))==0){
1110 Error(__FUNCTION__, Form(
"Not enough events"));
1111 tree->Fill(); ftree->cd();
1117 EtotalMean=energy/fhE->Integral(fhE->FindBin(0.6), fhE->FindBin(50.)) ;
1118 EtotalRMS=fhE->GetMeanError();
1120 TString nameNCell = Form(
"%s_hNCells_Mod", fCalorimeter.Data());
1121 TString nameNCluster = Form(
"%s_hNClusters_Mod", fCalorimeter.Data());
1122 TString nameE = Form(
"%s_hE_Mod", fCalorimeter.Data());
1123 TH2F* hNCellsMod= (
TH2F*)outputList->FindObject(nameNCell.Data());
1124 TH2F* hNClusterMod=(
TH2F*)outputList->FindObject(nameNCluster.Data());
1125 TH2F* hEMod=(
TH2F*)outputList->FindObject(nameE.Data());
1127 if(!hNCellsMod || !hNClusterMod || !hEMod){
1128 Error(__FUNCTION__,
"A requiered histogram was not found (the imput QAresult.root might be too old)!");
1129 tree->Fill(); ftree->cd();
1138 if(fTrigger.Contains(
"EMC"))
1139 trig_title +=
"EMC";
1144 TCanvas* c_TimeSM_BC0 =
new TCanvas(
"TimeSM_BC0",
"Cell Time (for BC/4=0) for each SM", 1200, 1200);
1145 c_TimeSM_BC0->SetFillColor(0);
1146 c_TimeSM_BC0->SetBorderSize(0);
1147 c_TimeSM_BC0->SetFrameBorderMode(0);
1151 c_TimeSM_BC0->Divide(3, n/3+mod3_BC0);
1153 TH2F* hTimeSM_BC0 = (
TH2F*)outputList->FindObject(
"EMCAL_hTimePerSM_BC0");
1154 TH1F* hTimeSM_BC0_proj[n];
1158 cout <<
"---------------------" << endl;
1159 cout <<
" BC/4=0 | Run " << RunId << endl;
1160 for(
Int_t ism = 0 ; ism < n ; ism++){
1161 c_TimeSM_BC0->cd(ism+1);
1162 gPad->SetTopMargin(0.1);
1163 gPad->SetBottomMargin(0.15);
1166 TimeSM_BC0_projName = Form(
"SM_%d", ism);
1167 hTimeSM_BC0_proj[ism] = (TH1F *)hTimeSM_BC0->ProjectionX(TimeSM_BC0_projName.Data(), ism+1, ism+1,
"") ;
1168 hTimeSM_BC0_proj[ism]->Draw(
"hist");
1170 hTimeSM_BC0_proj[ism]->SetTitle(Form(
"#it{t}_{cell} for super module %i (BC/4=0) %s", ism, trig_title.Data()));
1171 hTimeSM_BC0_proj[ism]->SetTitleSize(0.1);
1172 hTimeSM_BC0_proj[ism]->SetXTitle(
"#it{t}_{cell} (ns)");
1173 hTimeSM_BC0_proj[ism]->SetYTitle(
"Nb of entries");
1174 hTimeSM_BC0_proj[ism]->SetStats(kTRUE);
1176 hTimeSM_BC0_proj[ism]->GetXaxis()->SetRangeUser(400, 900);
1177 hTimeSM_BC0_proj[ism]->GetXaxis()->SetLabelSize(0.05);
1178 hTimeSM_BC0_proj[ism]->GetXaxis()->SetLabelOffset(0.015);
1179 hTimeSM_BC0_proj[ism]->GetXaxis()->SetTitleSize(0.075);
1180 hTimeSM_BC0_proj[ism]->GetXaxis()->SetTitleOffset(0.9);
1182 hTimeSM_BC0_proj[ism]->GetYaxis()->SetLabelSize(0.05);
1183 hTimeSM_BC0_proj[ism]->GetYaxis()->SetTitleSize(0.06);
1184 hTimeSM_BC0_proj[ism]->GetYaxis()->SetTitleOffset(0.6);
1187 TString outfilename_BC0 = QAPATH +
"TimeSM_BC0" + fTrigger(r) +
".pdf";
1188 TString outfilename2_BC0 = QAPATH +
"TimeSM_BC0" + fTrigger(r) +
".png";
1190 c_TimeSM_BC0->SaveAs(outfilename_BC0);
1192 c_TimeSM_BC0->SaveAs(outfilename2_BC0);
1196 TCanvas* c_TimeSM_BC1 =
new TCanvas(
"TimeSM_BC1",
"Cell Time (for BC/4=1) for each SM", 1200, 1200);
1197 c_TimeSM_BC1->SetFillColor(0);
1198 c_TimeSM_BC1->SetBorderSize(0);
1199 c_TimeSM_BC1->SetFrameBorderMode(0);
1203 c_TimeSM_BC1->Divide(3, n/3+mod3_BC1);
1205 TH2F* hTimeSM_BC1 = (
TH2F*)outputList->FindObject(
"EMCAL_hTimePerSM_BC1");
1206 TH1F* hTimeSM_BC1_proj[n];
1210 cout <<
"---------------------" << endl;
1211 cout <<
" BC/4=1 | Run " << RunId << endl;
1212 for(
Int_t ism = 0 ; ism < n ; ism++){
1213 c_TimeSM_BC1->cd(ism+1);
1214 gPad->SetTopMargin(0.1);
1215 gPad->SetBottomMargin(0.15);
1218 TimeSM_BC1_projName = Form(
"SM_%d", ism);
1219 hTimeSM_BC1_proj[ism] = (TH1F *)hTimeSM_BC1->ProjectionX(TimeSM_BC1_projName.Data(), ism+1, ism+1,
"") ;
1220 hTimeSM_BC1_proj[ism]->Draw(
"hist");
1222 hTimeSM_BC1_proj[ism]->SetTitle(Form(
"#it{t}_{cell} for super module %i (BC/4=1) %s", ism, trig_title.Data()));
1223 hTimeSM_BC1_proj[ism]->SetTitleSize(0.1);
1224 hTimeSM_BC1_proj[ism]->SetXTitle(
"#it{t}_{cell} (ns)");
1225 hTimeSM_BC1_proj[ism]->SetYTitle(
"Nb of entries");
1226 hTimeSM_BC1_proj[ism]->SetStats(kTRUE);
1228 hTimeSM_BC1_proj[ism]->GetXaxis()->SetRangeUser(400, 900);
1229 hTimeSM_BC1_proj[ism]->GetXaxis()->SetLabelSize(0.05);
1230 hTimeSM_BC1_proj[ism]->GetXaxis()->SetLabelOffset(0.015);
1231 hTimeSM_BC1_proj[ism]->GetXaxis()->SetTitleSize(0.075);
1232 hTimeSM_BC1_proj[ism]->GetXaxis()->SetTitleOffset(0.9);
1234 hTimeSM_BC1_proj[ism]->GetYaxis()->SetLabelSize(0.05);
1235 hTimeSM_BC1_proj[ism]->GetYaxis()->SetTitleSize(0.06);
1236 hTimeSM_BC1_proj[ism]->GetYaxis()->SetTitleOffset(0.6);
1239 TString outfilename_BC1 = QAPATH +
"TimeSM_BC1" + fTrigger(r) +
".pdf";
1240 TString outfilename2_BC1 = QAPATH +
"TimeSM_BC1" + fTrigger(r) +
".png";
1242 c_TimeSM_BC1->SaveAs(outfilename_BC1);
1244 c_TimeSM_BC1->SaveAs(outfilename2_BC1);
1248 TCanvas* c_TimeSM_BC2 =
new TCanvas(
"TimeSM_BC2",
"Cell Time (for BC/4=2) for each SM", 1200, 1200);
1249 c_TimeSM_BC2->SetFillColor(0);
1250 c_TimeSM_BC2->SetBorderSize(0);
1251 c_TimeSM_BC2->SetFrameBorderMode(0);
1255 c_TimeSM_BC2->Divide(3, n/3+mod3_BC2);
1257 TH2F* hTimeSM_BC2 = (
TH2F*)outputList->FindObject(
"EMCAL_hTimePerSM_BC2");
1258 TH1F* hTimeSM_BC2_proj[n];
1262 cout <<
"---------------------" << endl;
1263 cout <<
" BC/4=2 | Run " << RunId << endl;
1264 for(
Int_t ism = 0 ; ism < n ; ism++){
1265 c_TimeSM_BC2->cd(ism+1);
1266 gPad->SetTopMargin(0.1);
1267 gPad->SetBottomMargin(0.15);
1270 TimeSM_BC2_projName = Form(
"SM_%d", ism);
1271 hTimeSM_BC2_proj[ism] = (TH1F *)hTimeSM_BC2->ProjectionX(TimeSM_BC2_projName.Data(), ism+1, ism+1,
"") ;
1272 hTimeSM_BC2_proj[ism]->Draw(
"hist");
1274 hTimeSM_BC2_proj[ism]->SetTitle(Form(
"#it{t}_{cell} for super module %i (BC/4=2) %s", ism, trig_title.Data()));
1275 hTimeSM_BC2_proj[ism]->SetTitleSize(0.1);
1276 hTimeSM_BC2_proj[ism]->SetXTitle(
"#it{t}_{cell} (ns)");
1277 hTimeSM_BC2_proj[ism]->SetYTitle(
"Nb of entries");
1278 hTimeSM_BC2_proj[ism]->SetStats(kTRUE);
1280 hTimeSM_BC2_proj[ism]->GetXaxis()->SetRangeUser(400, 900);
1281 hTimeSM_BC2_proj[ism]->GetXaxis()->SetLabelSize(0.05);
1282 hTimeSM_BC2_proj[ism]->GetXaxis()->SetLabelOffset(0.015);
1283 hTimeSM_BC2_proj[ism]->GetXaxis()->SetTitleSize(0.075);
1284 hTimeSM_BC2_proj[ism]->GetXaxis()->SetTitleOffset(0.9);
1286 hTimeSM_BC2_proj[ism]->GetYaxis()->SetLabelSize(0.05);
1287 hTimeSM_BC2_proj[ism]->GetYaxis()->SetTitleSize(0.06);
1288 hTimeSM_BC2_proj[ism]->GetYaxis()->SetTitleOffset(0.6);
1291 TString outfilename_BC2 = QAPATH +
"TimeSM_BC2" + fTrigger(r) +
".pdf";
1292 TString outfilename2_BC2 = QAPATH +
"TimeSM_BC2" + fTrigger(r) +
".png";
1294 c_TimeSM_BC2->SaveAs(outfilename_BC2);
1296 c_TimeSM_BC2->SaveAs(outfilename2_BC2);
1300 TCanvas* c_TimeSM_BC3 =
new TCanvas(
"TimeSM_BC3",
"Cell Time (for BC/4=3) for each SM", 1200, 1200);
1301 c_TimeSM_BC3->SetFillColor(0);
1302 c_TimeSM_BC3->SetBorderSize(0);
1303 c_TimeSM_BC3->SetFrameBorderMode(0);
1307 c_TimeSM_BC3->Divide(3, n/3+mod3_BC3);
1309 TH2F* hTimeSM_BC3 = (
TH2F*)outputList->FindObject(
"EMCAL_hTimePerSM_BC3");
1310 TH1F* hTimeSM_BC3_proj[n];
1314 cout <<
"---------------------" << endl;
1315 cout <<
" BC/4=3 | Run " << RunId << endl;
1316 for(
Int_t ism = 0 ; ism < n ; ism++){
1317 c_TimeSM_BC3->cd(ism+1);
1318 gPad->SetTopMargin(0.1);
1319 gPad->SetBottomMargin(0.15);
1322 TimeSM_BC3_projName = Form(
"SM_%d", ism);
1323 hTimeSM_BC3_proj[ism] = (TH1F *)hTimeSM_BC3->ProjectionX(TimeSM_BC3_projName.Data(), ism+1, ism+1,
"") ;
1324 hTimeSM_BC3_proj[ism]->Draw(
"hist");
1326 hTimeSM_BC3_proj[ism]->SetTitle(Form(
"#it{t}_{cell} for super module %i (BC/4=3) %s", ism, trig_title.Data()));
1327 hTimeSM_BC3_proj[ism]->SetTitleSize(0.1);
1328 hTimeSM_BC3_proj[ism]->SetXTitle(
"#it{t}_{cell} (ns)");
1329 hTimeSM_BC3_proj[ism]->SetYTitle(
"Nb of entries");
1330 hTimeSM_BC3_proj[ism]->SetStats(kTRUE);
1332 hTimeSM_BC3_proj[ism]->GetXaxis()->SetRangeUser(400, 900);
1333 hTimeSM_BC3_proj[ism]->GetXaxis()->SetLabelSize(0.05);
1334 hTimeSM_BC3_proj[ism]->GetXaxis()->SetLabelOffset(0.015);
1335 hTimeSM_BC3_proj[ism]->GetXaxis()->SetTitleSize(0.075);
1336 hTimeSM_BC3_proj[ism]->GetXaxis()->SetTitleOffset(0.9);
1338 hTimeSM_BC3_proj[ism]->GetYaxis()->SetLabelSize(0.05);
1339 hTimeSM_BC3_proj[ism]->GetYaxis()->SetTitleSize(0.06);
1340 hTimeSM_BC3_proj[ism]->GetYaxis()->SetTitleOffset(0.6);
1343 TString outfilename_BC3 = QAPATH +
"TimeSM_BC3" + fTrigger(r) +
".pdf";
1344 TString outfilename2_BC3 = QAPATH +
"TimeSM_BC3" + fTrigger(r) +
".png";
1346 c_TimeSM_BC3->SaveAs(outfilename_BC3);
1348 c_TimeSM_BC3->SaveAs(outfilename2_BC3);
1353 TCanvas* c1 =
new TCanvas(
"Pi0InvMassSM",
"Pi0 Invariant Mass for each SM", 600, 600);
1354 gStyle->SetOptStat(1);
1355 gStyle->SetOptFit(1);
1356 c1->SetFillColor(0);
1357 c1->SetBorderSize(0);
1358 c1->SetFrameBorderMode(0);
1364 c1->Divide(3, n/3+mod3);
1368 for(
Int_t ism = 0 ; ism < n ; ism++){
1369 cout <<
"#########################"<< endl;
1370 cout <<
" Super Module " << ism <<
" Run " << RunId << endl;
1373 nameNCellPerCluster = Form(
"%s_hNCellsPerCluster_Mod%d", fCalorimeter.Data(), ism);
1374 NCellsPerCluster[ism] = (
TH2F*)outputList->FindObject(nameNCellPerCluster.Data());
1376 if(! (
TH2F*)outputList->FindObject(nameNCellPerCluster.Data()) ){
1377 Error(__FUNCTION__, Form(
"NCellsPerCluster histogram not found for super module %i", ism));
1382 NCellsPerCluster[ism] = (
TH2F*)outputList->FindObject(nameNCellPerCluster.Data());
1383 NCells[ism] = (TH1F*)hNCellsMod->ProjectionX(Form(
"NCells%d", ism), ism+1, ism+1,
"");
1384 NClusters[ism] = (TH1F*)hNClusterMod->ProjectionX(Form(
"NClusters%d", ism), ism+1, ism+1,
"");
1385 E[ism] = (TH1F*)hEMod->ProjectionX(Form(
"E%d", ism), ism+1, ism+1,
"");
1387 CellMeanSM[ism]=NCells[ism]->GetMean();
1388 CellRMSSM[ism]=NCells[ism]->GetMeanError();
1391 binmax = NClusters[ism]->GetNbinsX();
1392 for(
Int_t ibin = 1 ;ibin <=binmax ;ibin++){
1393 ClusterTotSM[ism]+=(NClusters[ism]->GetBinCenter(ibin))*(NClusters[ism]->GetBinContent(ibin));
1395 if(NClusters[ism]->GetEntries()>0)
1396 ClusterTotSM[ism]= ClusterTotSM[ism]/NClusters[ism]->GetEntries();
1399 ClusterMeanSM[ism]=NClusters[ism]->GetMean();
1400 ClusterRMSSM[ism]=NClusters[ism]->GetMeanError();
1401 CellPerClusterMeanSM[ism]=NCellsPerCluster[ism]->GetMean(2);
1402 CellPerClusterRMSSM[ism]=NCellsPerCluster[ism]->GetMeanError(2);
1404 ECell1MeanSM[ism] =NCellsPerCluster[ism]->ProjectionX(
"", 2, 50,
"")->Integral(5, 50)/(Nevent);
1405 ECell1RMSSM[ism] =NCellsPerCluster[ism]->ProjectionX(
"", 2, 50,
"")->GetMeanError();
1408 for(
Int_t ibin = E[ism]->FindBin(0.6) ; ibin <E[ism]->FindBin(50.) ; ibin++){
1409 energySM+=E[ism]->GetBinCenter(ibin)*(E[ism]->GetBinContent(ibin));
1412 if(E[ism]->Integral(E[ism]->FindBin(0.6), E[ism]->FindBin(50.))==0){
1413 Error(__FUNCTION__, Form(
"Energy: Not enough events/SM"));
1417 EtotalMeanSM[ism]=energySM/(E[ism]->Integral(E[ism]->FindBin(0.6), E[ism]->FindBin(50.)));
1418 EtotalRMSSM[ism]=E[ism]->GetMeanError();
1421 fhNCells = (TH1F*)NCells[ism]->Clone(
"NCells");
1422 fhNClusters = (TH1F*)NClusters[ism]->Clone(
"NClusters");
1425 fhNCells->Add(NCells[ism], 1);
1426 fhNClusters->Add(NClusters[ism], 1);
1431 TString namePair = Form(
"%s_hIM_Mod%d", fCalorimeter.Data(), ism);
1432 IM[ism] = (
TH2F*)outputList->FindObject(namePair.Data());
1435 TString projname = Form(
"SM_%d", ism);
1436 MggSM[ism] = (TH1F *)IM[ism]->ProjectionY(projname.Data(), 10, 50,
"") ;
1438 if(MggSM[ism]->GetEntries()>100){
1439 fitMass->SetParameter(0, MggSM[ism]->GetBinContent(MggSM[ism]->GetMaximumBin()));
1440 fitMass->SetParameter(1, mPDG);
1441 fitMass->SetParameter(2, 15.);
1442 fitMass->SetParameter(3, 0.);
1443 fitMass->SetParameter(4, MggSM[ism]->GetBinContent(MggSM[ism]->FindBin(0.11)));
1444 fitMass->SetParameter(5, MggSM[ism]->GetBinContent(MggSM[ism]->FindBin(0.20)));
1446 if(MggSM[ism]->GetEntries()<1000)
1447 MggSM[ism]->Rebin(5);
1449 MggSM[ism]->Rebin();
1451 MggSM[ism]->Fit(
"fitMass",
"WL R +",
"", 0.1, 0.30);
1452 MggSM[ism]->SetTitle(Form(
"Pi0 Mass for super module %i", ism));
1453 MggSM[ism]->SetTitleSize(0.1);
1454 MggSM[ism]->SetXTitle(
"Pi0 Mass");
1455 MggSM[ism]->SetYTitle(
"Nb of entries");
1456 MggSM[ism]->GetXaxis()->SetLabelSize(0.05);
1457 MggSM[ism]->GetXaxis()->SetTitleSize(0.07);
1458 MggSM[ism]->GetXaxis()->SetTitleOffset(0.68);
1459 MggSM[ism]->GetYaxis()->SetLabelSize(0.05);
1460 MggSM[ism]->GetYaxis()->SetTitleSize(0.06);
1461 MggSM[ism]->GetYaxis()->SetTitleOffset(0.78);
1463 MeanPosSM[ism] = MggSM[ism]->GetFunction(
"fitMass")->GetParameter(1)*1000;
1464 MeanPosErrSM[ism] = MggSM[ism]->GetFunction(
"fitMass")->GetParError(1)*1000;
1465 WidthSM[ism] = MggSM[ism]->GetFunction(
"fitMass")->GetParameter(2)*1000;
1466 WidthErrSM[ism] = MggSM[ism]->GetFunction(
"fitMass")->GetParError(2)*1000;
1467 Npi0SM[ism] = MggSM[ism]->GetFunction(
"fitMass")->GetParameter(0)*(MggSM[ism]->GetFunction(
"fitMass")->GetParameter(2))*TMath::Sqrt(2*TMath::Pi())/(Nevent*MggSM[ism]->GetBinWidth(1));
1468 Npi0ErrSM[ism] = TMath::Sqrt((MggSM[ism]->GetFunction(
"fitMass")->GetParError(0)/MggSM[ism]->GetFunction(
"fitMass")->GetParameter(0))*(MggSM[ism]->GetFunction(
"fitMass")->GetParError(0)/MggSM[ism]->GetFunction(
"fitMass")->GetParameter(0))
1469 +(MggSM[ism]->GetFunction(
"fitMass")->GetParError(2)/MggSM[ism]->GetFunction(
"fitMass")->GetParameter(2))*(MggSM[ism]->GetFunction(
"fitMass")->GetParError(2)/MggSM[ism]->GetFunction(
"fitMass")->GetParameter(2)));
1470 Npi0ErrSM[ism] = 0.;
1474 Info(__FUNCTION__, Form(
"Not enough events for Pi0 fit and trending for super module %i", ism));
1478 TCanvas* c2 =
new TCanvas(
"Pi0InvMassEMCAL",
"Pi0 Invariant Mass in EMCal", 600, 600);
1479 c2->SetFillColor(0);
1480 c2->SetBorderSize(0);
1481 c2->SetFrameBorderMode(0);
1484 fhIM = (
TH2F *)outputList->FindObject(fCalorimeter+
"_hIM");
1486 fhMggEMCAL = (TH1F *)fhIM->ProjectionY(
"MggEMCAL", 10, 50,
"") ;
1488 if(fhMggEMCAL->GetEntries()==0){
1489 Error(__FUNCTION__,
"The Pi0 histogram in EMCal is empty !"); tree->Fill();
1494 fitMass->SetParameter(0, 4500);
1495 fitMass->SetParameter(1, mPDG);
1496 fitMass->SetParameter(2, 0.01);
1497 fitMass->SetParameter(3, 0.);
1498 fitMass->SetParameter(4, fhMggEMCAL->GetBinContent(fhMggEMCAL->FindBin(0.11)));
1499 fitMass->SetParameter(5, fhMggEMCAL->GetBinContent(fhMggEMCAL->FindBin(0.20)));
1501 if(fhMggEMCAL->GetEntries()<5000)
1502 fhMggEMCAL->Rebin(5);
1504 fhMggEMCAL->Rebin();
1506 fhMggEMCAL->Fit(
"fitMass",
"L R +",
"", 0.05, 0.20);
1508 fhMggEMCAL->SetTitle(
"Pi0 Mass in EMCal");
1509 fhMggEMCAL->SetTitleSize(0.1);
1510 fhMggEMCAL->SetXTitle(
"Pi0 Mass");
1511 fhMggEMCAL->SetYTitle(
"Nb of entries");
1512 fhMggEMCAL->GetXaxis()->SetLabelSize(0.03);
1513 fhMggEMCAL->GetXaxis()->SetTitleSize(0.03);
1514 fhMggEMCAL->GetXaxis()->SetTitleOffset(1.3);
1515 fhMggEMCAL->GetYaxis()->SetLabelSize(0.03);
1516 fhMggEMCAL->GetYaxis()->SetTitleSize(0.03);
1517 fhMggEMCAL->GetYaxis()->SetTitleOffset(1.3);
1519 MeanPosEMCAL = fhMggEMCAL->GetFunction(
"fitMass")->GetParameter(1)*1000;
1520 MeanPosEMCALErr = fhMggEMCAL->GetFunction(
"fitMass")->GetParError(1)*1000;
1521 WidthEMCAL = fhMggEMCAL->GetFunction(
"fitMass")->GetParameter(2)*1000;
1522 WidthEMCALErr = fhMggEMCAL->GetFunction(
"fitMass")->GetParError(2)*1000;
1523 Chi2NdfPi0EMCAL = fhMggEMCAL->GetFunction(
"fitMass")->GetChisquare()/fhMggEMCAL->GetFunction(
"fitMass")->GetNDF();
1524 Npi0EMCAL = fhMggEMCAL->GetFunction(
"fitMass")->GetParameter(0)*fhMggEMCAL->GetFunction(
"fitMass")->GetParameter(2)*TMath::Sqrt(2*TMath::Pi())/(Nevent*fhMggEMCAL->GetBinWidth(10));
1525 Npi0EMCALErr = TMath::Sqrt((fhMggEMCAL->GetFunction(
"fitMass")->GetParError(0)/fhMggEMCAL->GetFunction(
"fitMass")->GetParameter(0))*(fhMggEMCAL->GetFunction(
"fitMass")->GetParError(0)/fhMggEMCAL->GetFunction(
"fitMass")->GetParameter(0))+(WidthEMCALErr/WidthEMCAL)*(WidthEMCALErr/WidthEMCAL));
1527 NggEMCAL = fhMggEMCAL->GetFunction(
"fitMass")->Integral(0.11, 0.16)/(Nevent*fhMggEMCAL->GetBinWidth(10));
1528 NggEMCALErr = fhMggEMCAL->GetFunction(
"fitMass")->IntegralError(0.11, 0.16)/(fhMggEMCAL->Integral()*fhMggEMCAL->GetBinWidth(10));
1529 SignifEMCAL = Npi0EMCAL/NggEMCAL;
1530 SignifEMCALErr = TMath::Sqrt((Npi0EMCALErr/Npi0EMCAL*(Npi0EMCALErr/Npi0EMCAL)+(NggEMCALErr/NggEMCAL*(NggEMCALErr/NggEMCAL))));
1531 SignifEMCALErr = SignifEMCAL*SignifEMCALErr;
1533 TCanvas* c3 =
new TCanvas(
"Pi0InvMassDCAL",
"Pi0 Invariant Mass in DCal", 600, 600);
1534 c3->SetFillColor(0);
1535 c3->SetBorderSize(0);
1536 c3->SetFrameBorderMode(0);
1538 fhIMDCAL = (
TH2F *)outputList->FindObject(fCalorimeter+
"_hIMDCAL");
1551 fhMggDCAL = (TH1F *)fhIMDCAL->ProjectionY(
"MggDCAL", 10, 50,
"") ;
1552 if(fhMggDCAL->GetEntries()==0){
1553 Error(__FUNCTION__,
"The Pi0 histogram in DCal is empty !"); tree->Fill();
1558 fitMass->SetParameter(0, 4500);
1559 fitMass->SetParameter(1, mPDG);
1560 fitMass->SetParameter(2, 0.01);
1561 fitMass->SetParameter(3, 0.);
1562 fitMass->SetParameter(4, fhMggDCAL->GetBinContent(fhMggDCAL->FindBin(0.11)));
1563 fitMass->SetParameter(5, fhMggDCAL->GetBinContent(fhMggDCAL->FindBin(0.20)));
1565 if(fhMggDCAL->GetEntries()<5000)
1566 fhMggDCAL->Rebin(5);
1570 fhMggDCAL->Fit(
"fitMass",
"L R +",
"", 0.05, 0.20);
1572 fhMggDCAL->SetTitle(
"Pi0 Mass in DCal");
1573 fhMggDCAL->SetTitleSize(0.1);
1574 fhMggDCAL->SetXTitle(
"Pi0 Mass");
1575 fhMggDCAL->SetYTitle(
"Nb of entries");
1576 fhMggDCAL->GetXaxis()->SetLabelSize(0.03);
1577 fhMggDCAL->GetXaxis()->SetTitleSize(0.03);
1578 fhMggDCAL->GetXaxis()->SetTitleOffset(1.3);
1579 fhMggDCAL->GetYaxis()->SetLabelSize(0.03);
1580 fhMggDCAL->GetYaxis()->SetTitleSize(0.03);
1581 fhMggDCAL->GetYaxis()->SetTitleOffset(1.3);
1583 MeanPosDCAL = fhMggDCAL->GetFunction(
"fitMass")->GetParameter(1)*1000;
1584 MeanPosDCALErr = fhMggDCAL->GetFunction(
"fitMass")->GetParError(1)*1000;
1585 WidthDCAL = fhMggDCAL->GetFunction(
"fitMass")->GetParameter(2)*1000;
1586 WidthDCALErr = fhMggDCAL->GetFunction(
"fitMass")->GetParError(2)*1000;
1587 Chi2NdfPi0DCAL = fhMggDCAL->GetFunction(
"fitMass")->GetChisquare()/fhMggDCAL->GetFunction(
"fitMass")->GetNDF();
1588 Npi0DCAL = fhMggDCAL->GetFunction(
"fitMass")->GetParameter(0)*fhMggDCAL->GetFunction(
"fitMass")->GetParameter(2)*TMath::Sqrt(2*TMath::Pi())/(Nevent*fhMggDCAL->GetBinWidth(10));
1589 Npi0DCALErr = TMath::Sqrt((fhMggDCAL->GetFunction(
"fitMass")->GetParError(0)/fhMggDCAL->GetFunction(
"fitMass")->GetParameter(0))*(fhMggDCAL->GetFunction(
"fitMass")->GetParError(0)/fhMggDCAL->GetFunction(
"fitMass")->GetParameter(0))+(WidthDCALErr/WidthDCAL)*(WidthDCALErr/WidthDCAL));
1591 NggDCAL = fhMggDCAL->GetFunction(
"fitMass")->Integral(0.11, 0.16)/(Nevent*fhMggDCAL->GetBinWidth(10));
1592 NggDCALErr = fhMggDCAL->GetFunction(
"fitMass")->IntegralError(0.11, 0.16)/(fhMggDCAL->Integral()*fhMggDCAL->GetBinWidth(10));
1593 SignifDCAL = Npi0DCAL/NggDCAL;
1594 SignifDCALErr = TMath::Sqrt((Npi0DCALErr/Npi0DCAL*(Npi0DCALErr/Npi0DCAL)+(NggDCALErr/NggDCAL*(NggDCALErr/NggDCAL))));
1595 SignifDCALErr = SignifDCAL*SignifDCALErr;
1603 NTClusters=fhE->IntegralAndError(fhE->GetXaxis()->FindBin(0.), fhE->GetXaxis()->FindBin(200.), NTClustersRMS);
1604 NCClusters=fhECharged->IntegralAndError(fhECharged->GetXaxis()->FindBin(0.), fhECharged->GetXaxis()->FindBin(50.), NCClustersRMS);
1607 NMatchClustersP = NCClusters/NTClusters;
1613 NMatchClustersPRMS = NMatchClustersP* TMath::Sqrt(TMath::Power(NCClustersRMS/NCClusters, 2)+TMath::Power(NTClustersRMS/NTClusters, 2));
1615 NMatchClustersPRMS=1;
1617 ClusterMean=fhNClusters->GetMean();
1618 ClusterRMS=fhNClusters->GetMeanError();
1619 CellMean=fhNCells->GetMean();
1620 CellRMS=fhNCells->GetMeanError();
1622 if (fTrigger.Contains(
"default")){
1627 TList *outputListEG2 = (
TList*)gDirectory->Get(
"AliEmcalTriggerQATask_EG2_histos");
1630 TList *outputListEG2N = (
TList*)outputListEG2->FindObject(
"histosAliEmcalTriggerQATask_EG2");
1633 TList *outputListEG1 = (
TList*)gDirectory->Get(
"AliEmcalTriggerQATask_EG1_histos");
1634 TList *outputListEG1N = (
TList*)outputListEG1->FindObject(
"histosAliEmcalTriggerQATask_EG1");
1635 TList *outputListEJ2 = (
TList*)gDirectory->Get(
"AliEmcalTriggerQATask_EJ2_histos");
1636 TList *outputListEJ2N = (
TList*)outputListEJ2->FindObject(
"histosAliEmcalTriggerQATask_EJ2");
1638 TList *outputListEJ1 = (
TList*)gDirectory->Get(
"AliEmcalTriggerQATask_EJ1_histos");
1639 TList *outputListEJ1N = (
TList*)outputListEJ1->FindObject(
"histosAliEmcalTriggerQATask_EJ1");
1640 TList *outputListINT7 = (
TList*)gDirectory->Get(
"AliEmcalTriggerQATask_CINT7_histos");
1641 TList *outputListINT7N = (
TList*)outputListINT7->FindObject(
"histosAliEmcalTriggerQATask_CINT7");
1642 TList *outputListEMC7 = (
TList*)gDirectory->Get(
"AliEmcalTriggerQATask_CEMC7_histos");
1643 TList *outputListEMC7N = (
TList*)outputListEMC7->FindObject(
"histosAliEmcalTriggerQATask_CEMC7");
1645 TList *outputListDG2 = (
TList*)gDirectory->Get(
"AliEmcalTriggerQATask_DG2_histos");
1646 TList *outputListDG2N = (
TList*)outputListDG2->FindObject(
"histosAliEmcalTriggerQATask_DG2");
1649 TList *outputListDG1 = (
TList*)gDirectory->Get(
"AliEmcalTriggerQATask_DG1_histos");
1650 TList *outputListDG1N = (
TList*)outputListDG1->FindObject(
"histosAliEmcalTriggerQATask_DG1");
1651 TList *outputListDJ2 = (
TList*)gDirectory->Get(
"AliEmcalTriggerQATask_DJ2_histos");
1652 TList *outputListDJ2N = (
TList*)outputListDJ2->FindObject(
"histosAliEmcalTriggerQATask_DJ2");
1654 TList *outputListDJ1 = (
TList*)gDirectory->Get(
"AliEmcalTriggerQATask_DJ1_histos");
1655 TList *outputListDJ1N = (
TList*)outputListDJ1->FindObject(
"histosAliEmcalTriggerQATask_DJ1");
1656 TList *outputListDMC7 = (
TList*)gDirectory->Get(
"AliEmcalTriggerQATask_CDMC7_histos");
1657 TList *outputListDMC7N = (
TList*)outputListDMC7->FindObject(
"histosAliEmcalTriggerQATask_CDMC7");
1662 if(!outputListEG2N) cout <<
"NO outputListEG2"<<endl;
1663 if(!outputListEG1N) cout <<
"NO outputListEG1"<<endl;
1664 if(!outputListEJ2N) cout <<
"NO outputListEJ2"<<endl;
1665 if(!outputListEJ1N) cout <<
"NO outputListEJ1"<<endl;
1666 if(!outputListDG2N) cout <<
"NO outputListEG2"<<endl;
1667 if(!outputListDG1N) cout <<
"NO outputListDG1"<<endl;
1668 if(!outputListDJ2N) cout <<
"NO outputListDJ2"<<endl;
1669 if(!outputListDJ1N) cout <<
"NO outputListDJ1"<<endl;
1670 if(!outputListINT7N) cout <<
"NO outputListINT7"<<endl;
1671 if(!outputListEMC7N) cout <<
"NO outputListEMC7"<<endl;
1672 if(!outputListDMC7N) cout <<
"NO outputListDMC7"<<endl;
1678 hEGA2 =(
TH1D*)outputListEG2N->FindObject(
"EMCTRQA_histEMCalMaxPatchAmpEMCGAHRecalc");
1679 hEGA1 =(
TH1D*)outputListEG1N->FindObject(
"EMCTRQA_histEMCalMaxPatchAmpEMCGAHRecalc");
1681 hDGA2 =(
TH1D*)outputListDG2N->FindObject(
"EMCTRQA_histDCalMaxPatchAmpEMCGAHRecalc");
1682 hDGA1 =(
TH1D*)outputListDG1N->FindObject(
"EMCTRQA_histDCalMaxPatchAmpEMCGAHRecalc");
1683 hEJE2 =(
TH1D*)outputListEJ2N->FindObject(
"EMCTRQA_histEMCalMaxPatchAmpEMCJEHRecalc");
1684 hEJE1 =(
TH1D*)outputListEJ1N->FindObject(
"EMCTRQA_histEMCalMaxPatchAmpEMCJEHRecalc");
1685 hDJE2 =(
TH1D*)outputListDJ2N->FindObject(
"EMCTRQA_histDCalMaxPatchAmpEMCJEHRecalc");
1686 hDJE1 =(
TH1D*)outputListDJ1N->FindObject(
"EMCTRQA_histDCalMaxPatchAmpEMCJEHRecalc");
1687 hEMC7 =(
TH1D*)outputListEMC7N->FindObject(
"EMCTRQA_histEMCalMaxPatchAmpEMCL0Recalc");
1688 hDMC7 =(
TH1D*)outputListDMC7N->FindObject(
"EMCTRQA_histDCalMaxPatchAmpEMCL0Recalc");
1693 hEGA2Map =(
TH2D*)outputListEG2N->FindObject(
"EMCTRQA_histFastORL1AccumulatedAmplitude");
1694 hEGA1Map =(
TH2D*)outputListEG1N->FindObject(
"EMCTRQA_histFastORL1AccumulatedAmplitude");
1695 hEJE2Map =(
TH2D*)outputListEJ2N->FindObject(
"EMCTRQA_histFastORL1AccumulatedAmplitude");
1696 hEJE1Map =(
TH2D*)outputListEJ1N->FindObject(
"EMCTRQA_histFastORL1AccumulatedAmplitude");
1697 hEMC7Map =(
TH2D*)outputListEMC7N->FindObject(
"EMCTRQA_histFastORL0AccumulatedAmplitude");
1698 hDGA2Map =(
TH2D*)outputListDG2N->FindObject(
"EMCTRQA_histFastORL1AccumulatedAmplitude");
1699 hDGA1Map =(
TH2D*)outputListDG1N->FindObject(
"EMCTRQA_histFastORL1AccumulatedAmplitude");
1700 hDJE2Map =(
TH2D*)outputListDJ2N->FindObject(
"EMCTRQA_histFastORL1AccumulatedAmplitude");
1701 hDJE1Map =(
TH2D*)outputListDJ1N->FindObject(
"EMCTRQA_histFastORL1AccumulatedAmplitude");
1702 hDMC7Map =(
TH2D*)outputListDMC7N->FindObject(
"EMCTRQA_histFastORL0AccumulatedAmplitude");
1705 TCanvas* c00T =
new TCanvas(
"Occupancy map",
"Occupancy", 1000, 1000);
1707 c00T->SetFillColor(0);
1708 c00T->SetBorderSize(0);
1709 c00T->SetFrameBorderMode(0);
1714 const char* legend=
"";
1715 legend = Form(
" Run %d ", (
int)RunId);
1723 FormatRunHisto2D(hEGA2Map, Form(
"EGA2 FastORL1Amp %s", legend),
"#varphi (bin)");
1724 hEGA2Map->SetXTitle(
"#eta (bin)");
1726 if(hEGA2Map->GetEntries()>10)hEGA2Map->Draw(
"colz");
1732 FormatRunHisto2D(hEGA1Map, Form(
"EGA1 FastORL1Amp %s", legend),
"#varphi (bin)");
1733 hEGA1Map->SetXTitle(
"#eta (bin)");
1734 if(hEGA1Map->GetEntries()>10)hEGA1Map->Draw(
"colz");
1737 hEJE2Map->SetXTitle(
"#eta (bin)");
1739 FormatRunHisto2D(hEJE2Map, Form(
"EJE2 FastORL1Amp %s", legend),
"#varphi (bin)");
1740 if(hEJE2Map->GetEntries()>10)hEJE2Map->Draw(
"colz");
1745 hEJE1Map->SetXTitle(
"#eta (bin)");
1746 FormatRunHisto2D(hEJE1Map, Form(
"EJE1 FastORL1Amp %s", legend),
"#varphi (bin)");
1747 if(hEJE1Map->GetEntries()>10)hEJE1Map->Draw(
"colz");
1751 hEMC7Map->SetXTitle(
"#eta (bin)");
1752 FormatRunHisto2D(hEMC7Map, Form(
"EMC7 FastORL0Amp %s", legend),
"#varphi (bin)");
1753 if(hEMC7Map->GetEntries()>10)hEMC7Map->Draw(
"colz");
1757 TCanvas* c00TD =
new TCanvas(
"Occupancy map DCAL",
"Occupancy", 1000, 1000);
1759 c00TD->SetFillColor(0);
1760 c00TD->SetBorderSize(0);
1761 c00TD->SetFrameBorderMode(0);
1767 hDGA2Map->SetXTitle(
"#eta (bin)");
1768 hDGA2Map->SetTitle(
"DGA2FastORL1Accumulated ");
1769 FormatRunHisto2D(hDGA2Map, Form(
"DGA2 FastORL1Amp %s", legend),
"#varphi (bin)");
1770 if(hDGA2Map->GetEntries()>10)hDGA2Map->Draw(
"colz");
1775 hDGA1Map->SetXTitle(
"#eta (bin)");
1776 hDGA1Map->SetTitle(
"DGA1 FastORL1Accumulated amplitudes");
1777 FormatRunHisto2D(hDGA1Map, Form(
"DGA1 FastORL1Amp %s", legend),
"#varphi (bin)");
1778 if(hDGA1Map->GetEntries()>10)hDGA1Map->Draw(
"colz");
1782 hDJE2Map->SetXTitle(
"#eta (bin)");
1783 hDJE2Map->SetTitle(
"DJE2 FastORL1Accumulated amplitudes");
1784 FormatRunHisto2D(hDJE2Map, Form(
"DJE2 FastORL1Amp %s", legend),
"#varphi (bin)");
1785 if(hDJE2Map->GetEntries()>10)hDJE2Map->Draw(
"colz");
1789 hDJE1Map->SetXTitle(
"#eta (bin)");
1790 hDJE1Map->SetTitle(
"DJE1 FastORL1Accumulated amplitudes");
1791 FormatRunHisto2D(hDJE1Map, Form(
"DJE1 FastORL1Amp %s", legend),
"#varphi (bin)");
1792 if(hDJE1Map->GetEntries()>10)hDJE1Map->Draw(
"colz");
1795 hDMC7Map->SetXTitle(
"#eta (bin)");
1796 hDMC7Map->SetTitle(
"DMC7 FastORL1Accumulated amplitudes");
1797 FormatRunHisto2D(hDMC7Map, Form(
"DMC7 FastORL0Amp %s", legend),
"#varphi (bin)");
1798 if(hDMC7Map->GetEntries()>10)hDMC7Map->Draw(
"colz");
1821 TCanvas* cT =
new TCanvas(
"EMCTriggers",
"EMCTriggers", 600, 600);
1823 cT->SetFillColor(0);
1824 cT->SetBorderSize(0);
1825 cT->SetFrameBorderMode(0);
1827 hEGA2->SetLineColor(2);
1828 hEGA2->SetLineWidth(2);
1829 if(hEGA2->GetEntries()>0)hEGA2->Scale(1./hEGA2->GetEntries());
1830 hEGA2->GetXaxis()->SetTitle(
"(ADC counts)");
1831 hDGA2->GetXaxis()->SetTitle(
" (ADC counts)");
1833 hEGA1->SetLineColor(3);
1834 hEGA1->SetLineWidth(2);
1835 if(hEGA1->GetEntries()>0)hEGA1->Scale(1./hEGA1->GetEntries());
1836 hEJE2->SetLineColor(4);
1837 hEJE2->SetLineWidth(2);
1838 if(hEJE2->GetEntries()>0) hEJE2->Scale(1./hEJE2->GetEntries());
1839 hEJE1->SetLineColor(7);
1840 hEJE1->SetLineWidth(2);
1841 if(hEJE1->GetEntries()>0) hEJE1->Scale(1./hEJE1->GetEntries());
1842 hEMC7->SetLineColor(6);
1843 hEMC7->SetLineWidth(2);
1844 if(hEMC7->GetEntries()>0) hEMC7->Scale(1./hEMC7->GetEntries());
1846 hDGA2->SetLineColor(2);
1847 hDGA2->SetLineWidth(2);
1848 if(hDGA2->GetEntries()>0)hDGA2->Scale(1./hDGA2->GetEntries());
1849 hDGA1->SetLineColor(3);
1850 hDGA1->SetLineWidth(2);
1851 if(hDGA1->GetEntries()>0) hDGA1->Scale(1./hDGA1->GetEntries());
1852 hDJE2->SetLineColor(4);
1853 hDJE2->SetLineWidth(2);
1854 if(hDJE2->GetEntries()>0) hDJE2->Scale(1./hDJE2->GetEntries());
1855 hDJE1->SetLineColor(7);
1856 hDJE1->SetLineWidth(2);
1857 if(hDJE1->GetEntries()>0) hDJE1->Scale(1./hDJE1->GetEntries());
1858 hDMC7->SetLineColor(6);
1859 hDMC7->SetLineWidth(2);
1860 if(hDMC7->GetEntries()>0) hDMC7->Scale(1./hDMC7->GetEntries());
1868 const char* legend2=
"";
1869 legend2 = Form(
" Run %d EMCalMaxPatchAmp ", (
int)RunId);
1870 hEGA2->SetTitle(legend2);
1871 const char* legend3=
"";
1873 legend3 = Form(
" Run %d DMCalMaxPatchAmp ", (
int)RunId);
1875 hDGA2->SetTitle(legend3);
1877 hEGA2->GetXaxis()->SetRangeUser(0.,1000.);
1879 hEGA1->Draw(
"same");
1880 hEJE2->Draw(
"same");
1881 hEJE1->Draw(
"same");
1882 hEMC7->Draw(
"same");
1883 TLegend* lT =
new TLegend(0.123, 0.744, 0.833, 0.894);
1884 lT->SetNColumns((n+1)/2.);
1885 lT->SetFillColor(0);
1886 lT->SetBorderSize(0);
1887 lT->SetTextSize(0.04);
1889 lT->SetHeader(Form(
"Trigger in EMCAL (period %s)",period.Data()));
1892 lT->AddEntry(hEGA2,
" EGA2",
"l");
1893 lT->AddEntry(hEGA1,
" EGA1",
"l");
1894 lT->AddEntry(hEJE2,
" EJE2",
"l");
1895 lT->AddEntry(hEJE1,
" EJE1",
"l");
1896 lT->AddEntry(hEMC7,
" EMC7",
"l");
1901 hDGA2->GetXaxis()->SetRangeUser(0.,1000.);
1903 hDGA1->Draw(
"same");
1904 hDJE2->Draw(
"same");
1905 hDJE1->Draw(
"same");
1906 hDMC7->Draw(
"same");
1907 TLegend* lTD =
new TLegend(0.123, 0.744, 0.833, 0.894);
1908 lTD->SetNColumns((n+1)/2.);
1909 lTD->SetFillColor(0);
1910 lTD->SetBorderSize(0);
1911 lTD->SetTextSize(0.04);
1912 lTD->SetHeader(Form(
"Trigger in DCAL (period %s)",period.Data()));
1916 lTD->AddEntry(hDGA2,
" DGA2",
"l");
1917 lTD->AddEntry(hDGA1,
" DGA1",
"l");
1918 lTD->AddEntry(hDJE2,
" DJE2",
"l");
1919 lTD->AddEntry(hDJE1,
" DJE1",
"l");
1920 lTD->AddEntry(hDMC7,
" DMC7",
"l");
1932 if (hEGA2) ETrigMax[0] = hEGA2->GetMaximumBin()*16.;
1933 if (hEGA1) ETrigMax[1] = hEGA1->GetMaximumBin()*16.;
1934 if (hEJE2) ETrigMax[2] = hEJE2->GetMaximumBin()*16.;
1935 if (hEJE1) ETrigMax[3] = hEJE1->GetMaximumBin()*16.;
1936 if (hEMC7) ETrigMax[4] = hEMC7->GetMaximumBin()*16.;
1938 if (hDGA2) DTrigMax[0] = hDGA2->GetMaximumBin()*16.;
1939 if (hDGA1) DTrigMax[1] = hDGA1->GetMaximumBin()*16.;
1940 if (hDJE2) DTrigMax[2] = hDJE2->GetMaximumBin()*16.;
1941 if (hDJE1) DTrigMax[3] = hDJE1->GetMaximumBin()*16.;
1942 if (hDMC7) DTrigMax[4] = hDMC7->GetMaximumBin()*16.;
1944 TString outfilenameT = QAPATH +
"Triggers" + fTrigger(r) +
".pdf" ;
1945 TString outfilename2T = QAPATH +
"Triggers" + fTrigger(r) +
".png" ;
1948 cT->SaveAs(outfilenameT);
1950 cT->SaveAs(outfilename2T);
1953 fout->Cd(Form(
"%s/%s/%ld/%s/%s", period.Data(), pass.Data(), RunId,
"RunLevelQA", fTrigger.Data()));
1959 TString outfilename7 = QAPATH +
"OccupancyMapTrigger" + fTrigger(r) +
".pdf" ;
1960 TString outfilename8= QAPATH +
"OccupancyMapTrigger" + fTrigger(r) +
".png" ;
1962 if(SavePlots==2) c00T->SaveAs(outfilename7);
1963 if(SavePlots) c00T->SaveAs(outfilename8);
1966 TString outfilename5 = QAPATH +
"OccupancyMapTriggerDCAL" + fTrigger(r) +
".pdf" ;
1967 TString outfilename6 = QAPATH +
"OccupancyMapTriggerDCAL" + fTrigger(r) +
".png" ;
1969 if(SavePlots==2) c00TD->SaveAs(outfilename5);
1970 if(SavePlots) c00TD->SaveAs(outfilename6);
1981 TString outfilename = QAPATH +
"Pi0InvMassEMCAL" + fTrigger(r) +
".pdf";
1982 TString outfilename2 = QAPATH +
"Pi0InvMassEMCAL" + fTrigger(r) +
".png";
1984 c2->SaveAs(outfilename);
1986 c2->SaveAs(outfilename2);
1988 outfilename = QAPATH +
"Pi0InvMassSM" + fTrigger(r) +
".pdf";
1989 outfilename2 = QAPATH +
"Pi0InvMassSM" + fTrigger(r) +
".png";
1991 c1->SaveAs(outfilename);
1993 c1->SaveAs(outfilename2);
1997 TString outfilename4 = QAPATH +
"Pi0InvMassDCAL" + fTrigger(r) +
".pdf";
1998 TString outfilename5= QAPATH +
"Pi0InvMassDCAL" + fTrigger(r) +
".png";
2000 c3->SaveAs(outfilename4);
2002 c3->SaveAs(outfilename5);
2006 fout->Cd(Form(
"%s/%s/%ld/%s/%s", period.Data(), pass.Data(), RunId,
"RunLevelQA", fTrigger.Data()));
2009 if(hTimeSM_BC0) c_TimeSM_BC0->Write();
2010 if(hTimeSM_BC1) c_TimeSM_BC1->Write();
2011 if(hTimeSM_BC2) c_TimeSM_BC2->Write();
2012 if(hTimeSM_BC3) c_TimeSM_BC3->Write();
2016 cout <<
"ca marche la boucle !!!!!!!!!!!" << endl;
2028 if(fhIMDCAL)c3->Write();
2039 if(fhIMDCAL)
delete c3;
2040 if(hTimeSM_BC0)
delete c_TimeSM_BC0;
2041 if(hTimeSM_BC1)
delete c_TimeSM_BC1;
2042 if(hTimeSM_BC2)
delete c_TimeSM_BC2;
2043 if(hTimeSM_BC3)
delete c_TimeSM_BC3;
2044 if(outputList) outputList->Delete();
2046 QAData << RunId <<
" " << Nevent
2064 Error(__FUNCTION__, Form(
"The histogram with title \"%s\" was not found!", title));
2068 aHisto->SetStats(kFALSE);
2069 aHisto->SetTitle(title);
2070 aHisto->SetStats(kFALSE);
2071 aHisto->SetYTitle(YTitle);
2072 aHisto->GetYaxis()->SetTitleOffset(1.2);
2073 aHisto->GetYaxis()->SetLabelSize(0.03);
2074 aHisto->GetZaxis()->SetLabelSize(0.02);
2083 Error(__FUNCTION__, Form(
"The histogram with title \"%s\" was not found!", title));
2087 aHisto->SetStats(kFALSE);
2088 aHisto->SetTitle(title);
2089 aHisto->SetStats(kFALSE);
2090 aHisto->SetYTitle(YTitle);
2091 aHisto->GetYaxis()->SetTitleOffset(1.2);
2092 aHisto->GetYaxis()->SetLabelSize(0.03);
2093 aHisto->GetZaxis()->SetLabelSize(0.02);
2103 Error(__FUNCTION__, Form(
"The histogram with title \"%s\" was not found!", title));
2107 hTmpPerMod->SetStats(kFALSE);
2108 hTmpPerMod->SetTitle(title);
2109 hTmpPerMod->SetTitleSize(0.1);
2110 hTmpPerMod->GetXaxis()->SetTitleOffset(1.1);
2111 hTmpPerMod->GetXaxis()->SetTitleSize(0.05);
2112 hTmpPerMod->GetXaxis()->SetLabelSize(0.06);
2113 hTmpPerMod->GetYaxis()->SetTitleOffset(1.1);
2114 hTmpPerMod->GetYaxis()->SetTitleSize(0.05);
2115 hTmpPerMod->GetYaxis()->SetLabelSize(0.06);
2116 hTmpPerMod->GetZaxis()->SetLabelSize(0.04);
2132 int maxX = H->GetNbinsX();
2133 int New_minX = minX;
2134 int New_maxX = maxX;
2137 int maxY = H->GetNbinsY();
2138 int New_minY = minY;
2139 int New_maxY = maxY;
2141 if(opt.Contains(
"all")) opt =
TString(
"minx, maxx, miny, maxy");
2143 if(opt.Contains(
"maxx")){
2144 for(New_maxX = maxX;New_maxX >=minX; New_maxX--){
2146 for(
int i_y = maxY; i_y >= minY;i_y--){
2147 c = H->GetBinContent(New_maxX, i_y);
2156 if(opt.Contains(
"maxy")){
2157 for(New_maxY = maxY;New_maxY >=minY;New_maxY--){
2159 for(
int i_x=maxX; i_x>=minX;i_x--){
2160 c = H->GetBinContent(i_x, New_maxY );
2169 if(opt.Contains(
"minx")){
2170 for(New_minX = minX;New_minX <=maxX; New_minX++){
2172 for(
int i_y = minY; i_y <= maxY;i_y++){
2173 c = H->GetBinContent(New_minX, i_y);
2182 if(opt.Contains(
"miny")){
2183 for(New_minY = minY;New_minY <=maxY;New_minY++){
2185 for(
int i_x=minX; i_x<=maxX;i_x++){
2186 c = H->GetBinContent(i_x, New_minY );
2195 if(New_maxX!=-1 && New_maxY!=-1)
2196 H->GetXaxis()->SetRange(New_minX - shiftX, New_maxX + shiftX);
2197 if(New_maxX!=-1 && New_maxY!=-1)
2198 H->GetYaxis()->SetRange(New_minY - shiftY, New_maxY + shiftY);
2208 if(!fTrigger.Contains(
"QA")){
2215 if ( year == 2010 ) { nSMt=4; }
2216 else if( year == 2011 || year == 2012 ){ nSMt=10; }
2217 else if( year == 2013 || year == 2014 ){ nSMt=12; }
2221 Bool_t dirok = f->cd(direct);
2231 Error(__FUNCTION__, Form(
"No input directory %s, the number SMs will be returned based on the year!", direct.Data()));
2233 outputList = (
TList*)gDirectory->Get(direct);
2236 Error(__FUNCTION__,
"No input list, the number SMs will be returned based on the year! ");
2238 outputList->SetOwner();
2239 TH2F* hNSM =(
TH2F *)outputList->FindObject(
"EMCAL_hE_Mod");
2240 if(!hNSM || (!hNSM->GetEntries()))
2241 Error(__FUNCTION__,
"hNSM Histogram not found or it is empty, the number SMs will be returned based on the year!");
2243 nSMt = hNSM->GetYaxis()->GetBinUpEdge(hNSM->FindLastBinAbove(0, 2));
2247 outputList->Delete();
TH2F * FormatRunHisto(TH2F *aHisto, const char *title, const char *YTitle="")
TH2D * FormatRunHisto2D(TH2D *aHisto, const char *title, const char *YTitle="")
Int_t DrawOccupancy(Long_t run, TString period, TString pass, TString fTrigger, TString system, TFile *f, TFile *fout, AliEMCALGeometry *geom, Int_t SavePlots)
int FindNumberOfSM(TFile *f, TString fTrigger, TString period)
Double_t pi0massP1(Double_t *x, Double_t *par)
Double_t pi0massP2(Double_t *x, Double_t *par)
Int_t DrawRun(Long_t run, TString period, TString pass, TString fTrigger, TFile *f, TFile *fout, Int_t SavePlots, Int_t nSM, Bool_t kFilter)
Int_t TrendingEMCALTree(Long_t RunId, TString fCalorimeter, TString system, TString period, TString pass, const int n, TList *TriggersList, TFile *f, TFile *fout, Int_t SavePlots)
TH2 * AutoZoom(TH2 *H, Option_t *aType="all", Int_t EntryMin=0)
TH2F * HistoPerMod(TH2F *name, const char *title)
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)
Double_t fitE(Double_t *x, Double_t *par)
TFile * fout
input train file
int CreateEMCALRunQA(const char *filename, TString RunId, TString period, TString pass, Int_t SavePlots=0, Bool_t filter=0, TString fTrigger="", TString system="", TString fCalorimeter="EMCAL")