19 #include <Riostream.h>
29 #include <AliEMCALGeometry.h>
31 #include <AliAODEvent.h>
50 fCurrentRunNumber(-1),
55 fCellStartDCal(12288),
66 fExternalFileName(
""),
67 fExternalBadMapName(
""),
102 fCurrentRunNumber(-1),
107 fCellStartDCal(12288),
119 fExternalFileName(
""),
120 fExternalBadMapName(
""),
155 gROOT->ProcessLine(
"gErrorIgnoreLevel = kWarning;");
178 fRootFile =
new TFile(fileName,
"recreate");
193 Int_t array_StartCellSM_Value[21] ={0,1152,2304,3456,4608,5760,6912,8064,9216,10368,11520,11904,12288,13056,13824,14592,15360,16128,16896,17280,17664};
198 cout<<
"Number of supermod: "<<nModules<<endl;
262 cout<<
". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ."<<endl;
263 cout<<
". . .Start process by converting files. . . . . . . . . . . ."<<endl;
268 Printf(
"File not produced, exit");
276 cout<<
". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ."<<endl;
277 cout<<
". . .Start process by loading external file. . . . . . . . . . ."<<endl;
283 cout<<
". . .Load inputfile with name: "<<
fMergedFileName<<
" . . . . . . . ."<<endl;
288 if(!mergedFileInput->IsOpen())
290 Printf(
"Error! Input file not found, abort");
301 cout<<
". . .Continue process by . . . . . . . . . . . ."<<endl;
307 cout<<
"o o o Flag dead cells o o o"<<endl;
316 cout<<
"o o o Flag bad cells o o o"<<endl;
323 if(
fPrint==1)cout<<
"o o o Write .txt for each period analyis with bad cells o o o"<<endl;
334 if(
fPrint==1)cout<<
"o o o Create summary documents for the entire analysis o o o"<<endl;
345 Int_t binHeightOne = hRefDistr->FindLastBinAbove(1.0/totalevents);
346 Double_t binCentreHeightOne = hRefDistr->GetBinCenter(binHeightOne);
347 cout<<
". . .Recomendation:"<<endl;
348 cout<<
". . .With the current statistic on average a cell has 1 hit at "<<binCentreHeightOne<<
" GeV"<<endl;
349 cout<<
". . .so it makes no sense to select energy ranges >"<<binCentreHeightOne<<
"GeV as cells will be"<<endl;
350 cout<<
". . .marked bad just due to the lack of statistic"<<endl;
351 cout<<
". . .your selected lower bond is "<<
fEndLowerBound<<
" GeV"<<endl;
352 if(binCentreHeightOne>=
fEndLowerBound) cout<<
". . .This means you are OK!"<<endl;
353 if(binCentreHeightOne<
fEndLowerBound) cout<<
". . .#!#!#!#! CAREFUL THIS COULD CAUSE TROUBLE AND THROW OUT MORE CELLS THAN NECESSARY #!#!#!#! "<<endl;
354 cout<<
". . .End of process . . . . . . . . . . . . . . . . . . . . ."<<endl;
355 cout<<
". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ."<<endl;
366 cout<<
"o o o Start conversion process o o o"<<endl;
370 TH1F *hNEventsProcessedPerRun=
new TH1F(
"hNEvents",
"Number of processed events in analyzed runs",1,0,1);
371 TH2F *hCellAmplitude;
375 cout<<
"o o o Open .txt file with run indices. Name = " <<
fRunList << endl;
376 FILE *pFile = fopen(
fRunList.Data(),
"r");
379 cout<<
"couldn't open file!"<<endl;
390 ncols = fscanf(pFile,
" %d ",&q);
399 const Int_t nRun = nlines ;
404 cout<<
"o o o Start merging process of " << nRun <<
" files"<< endl;
407 for(
Int_t i = 0 ; i < nRun ; i++)
411 infile = Form(
"%s.root",base.Data()) ;
413 cout<<
" o Open .root file with name: "<<infile<<endl;
414 TFile *f = TFile::Open(infile);
419 cout<<
"Couldn't open/find .root file: "<<infile<<endl;
422 TDirectoryFile *
dir = (TDirectoryFile *)f->Get(
fQADirect);
425 cout<<
"Couln't open directory file in .root file: "<<infile<<
", directory: "<<
fQADirect<<endl;
431 cout <<
"Couln't get TList from directory file: "<<
fQADirect<<endl;
439 hAmpId =(
TH2F*)outputList->FindObject(
"EMCAL_hAmpId");
442 Printf(
"hAmpId not found");
448 hAmpId->SetName(
"hCellAmplitude");
449 hAmpId->SetTitle(
"Cell Amplitude");
452 hTimeId =(
TH2F*)outputList->FindObject(
"EMCAL_hTimeId");
455 Printf(
"hTimeId not found");
461 hTimeId->SetName(
"hCellTime");
462 hTimeId->SetTitle(
"Cell Time");
468 hCellAmplitude=(
TH2F*)hAmpId->Clone(
"DummyName1");
469 hCellAmplitude->Reset();
470 hCellAmplitude->SetDirectory(0);
472 hCellTime=(
TH2F*)hTimeId->Clone(
"DummyName2");
474 hCellTime->SetDirectory(0);
477 hNEvents =(TH1F *)outputList->FindObject(
"hNEvents");
480 Printf(
"hNEvents not found");
484 nEntr = (
Int_t)hNEvents->GetEntries();
489 cout <<
" o File to small to be merged. Only N entries " << nEntr << endl;
492 cout <<
" o File with N entries " << nEntr<<
" will be merged"<< endl;
494 hCellAmplitude->Add(hAmpId);
495 hCellTime->Add(hTimeId);
496 hNEventsProcessedPerRun->Add(hNEvents);
501 TFile *singleRunFile = TFile::Open(singleRunFileName,
"recreate");
508 singleRunFile->Close();
510 outputList->Delete();
519 cout<<
"o o o Save the merged histogramms to .root file with name: "<<
fMergedFileName<<endl;
520 cout<<
"o o o "<<nEntrTot<<
" events were merged"<<endl;
524 hNEventsProcessedPerRun->Write();
525 hCellAmplitude->SetName(
"hCellAmplitude");
526 hCellAmplitude->SetTitle(
"Cell Amplitude");
527 hCellAmplitude->Write();
528 hCellTime->SetName(
"hCellTime");
529 hCellTime->SetTitle(
"Cell Time");
532 cout<<
"o o o End conversion process o o o"<<endl;
551 TFile* outputRoot = TFile::Open(extRootFileName.Data());
553 TH1F* hFlags =(TH1F*)outputRoot->Get(
"fhCellFlag");
559 Double_t extFlag = hFlags->GetBinContent(cell+1);
562 fFlag[cell] =extFlag;
582 PeriodAnalysis(periodArray.At(0),periodArray.At(1),periodArray.At(2),periodArray.At(3));
587 cout<<
"o o o End of bad channel analysis o o o"<<endl;
597 cout<<
"o o o Manually mask SM "<<iSM<<
" o o o"<<endl;
621 periodArray.AddAt((
Double_t)criteria,0);
622 periodArray.AddAt(nsigma,1);
623 periodArray.AddAt(emin,2);
624 periodArray.AddAt(emax,3);
646 if(
fPrint==1)cout<<
"o o o o o o o o o o o o o o o o o o o o o o o o o"<<endl;
647 if(
fPrint==1)cout<<
"o o o PeriodAnalysis for flag "<<criterion<<
" o o o"<<endl;
648 if(
fPrint==1 && criterion < 3)cout<<
"o o o Done in the energy range E "<<emin<<
" - "<<emax<<endl;
649 if(
fPrint==1 && criterion == 3)cout<<
"o o o Done in the time range t "<<emin<<
" - "<<emax<<endl;
660 if(
fPrint==1)cout<<
"o o o Analyze average cell distributions o o o"<<endl;
663 if(criterion == 3) histogram =
BuildTimeMean(criterion, emin, emax);
669 else FlagAsBad(criterion, histogram, nsigma, 200);
675 else FlagAsBad(criterion, histogram, nsigma, 601);
677 if(criterion==3)
FlagAsBad(criterion, histogram, nsigma, 602);
691 if(
fPrint==1)cout<<
" o Calculate average cell hit per event and average cell energy per hit "<<endl;
693 if(crit==1)histogram =
new TH1F(Form(
"hCellEtoN_E%.2f-%.2f",emin,emax),Form(
"Energy per hit, %.2f < E < %.2f GeV",emin,emax),
fNoOfCells,0,
fNoOfCells);
694 if(crit==2)histogram =
new TH1F(Form(
"hCellNtoEvt_E%.2f-%.2f",emin,emax),Form(
"Number of hits in cell, %.2f < E < %.2f GeV",emin,emax),
fNoOfCells,0,
fNoOfCells);
695 histogram->SetXTitle(
"Abs. Cell Id");
696 if(crit==1)histogram->SetYTitle(
"Energy per hit");
697 if(crit==2)histogram->SetYTitle(
"Number of hits in cell");
698 histogram->GetXaxis()->SetNdivisions(510);
701 TH1F* pojection = (TH1F*)
fCellAmplitude->ProjectionX(
"Intermediate");
702 fnEventsInRange = pojection->Integral(pojection->GetBinContent(emin),pojection->GetBinContent(emax));
716 if (E < emin || E > emax ||
fFlag[cell]!=0)
continue;
723 if(crit==2) histogram->SetBinContent(cell+1, Nsum);
724 if(Nsum > 0. && crit==1)histogram->SetBinContent(cell+1, Esum/(Nsum));
736 if(
fPrint==1)cout<<
" o Calculate maximum of cell time distribution "<<endl;
739 histogram =
new TH1F(Form(
"timeMax_t%.2f-%.2f",tmin,tmax),Form(
"Maximum of time distr., %.2f < t < %.2f GeV",tmin,tmax),
fNoOfCells,0,
fNoOfCells);
740 histogram->SetXTitle(
"Abs. Cell Id");
741 histogram->SetYTitle(
"time max");
742 histogram->GetXaxis()->SetNdivisions(510);
749 name=Form(
"Cell %d",cell);
751 TH1 *hCell =
fCellTime->ProjectionX(name,cell+1,cell+1);
752 hCell->GetXaxis()->SetRangeUser(tmin,tmax);
754 timeMax = hCell->GetXaxis()->GetBinCenter(hCell->GetMaximumBin());
755 if(cell>55 &&cell<65)cout<<
"Integral: "<<hCell->Integral()<<endl;
756 if(hCell->Integral()<=0)timeMax=-40;
760 histogram->SetBinContent(cell+1, timeMax);
764 histogram->SetBinContent(cell+1, -50);
779 Int_t manualMaskCounter=0;
796 if(nSum == 0 &&
fFlag[cell]==0)
810 if(
fPrint==1)cout<<
" o Number of dead cells: "<<sumOfExcl<<endl;
811 if(
fPrint==1)cout<<
" ("<<sumOfExcl<<
")"<<endl;
831 gStyle->SetOptStat(0);
832 gStyle->SetOptFit(0);
833 if(
fPrint==1 && crit==1)cout<<
" o Fit average energy per hit distribution"<<endl;
834 if(
fPrint==1 && crit==2)cout<<
" o Fit average hit per event distribution"<<endl;
835 if(
fPrint==1 && crit==3)cout<<
" o Fit average hit maximum distribution"<<endl;
837 Int_t cellColumn=0,cellRow=0;
838 Int_t cellColumnAbs=0,cellRowAbs=0;
841 TString histoName=inhisto->GetName();
846 Double_t dminVal = inhisto->GetMinimum(0);
847 Double_t dmaxVal = inhisto->GetMaximum();
854 if(crit==2 && inputBins==-1) dnbins=dmaxVal-dminVal;
855 if(crit==1 && inputBins==-1) dnbins=200;
862 Int_t numBins = inhisto->GetXaxis()->GetNbins();
867 for (
int i = 0; i < numBins; i++)
873 Double_t medianOfHisto = TMath::Median(numBins,x,y);
878 if(medianOfHisto*10<dmaxVal)
881 dmaxVal=medianOfHisto+0.2*(dmaxVal-medianOfHisto);
886 dnbins=dmaxVal-dminVal;
889 if(dnbins>2000)dnbins=0.01*(dmaxVal-dminVal);
890 if(dnbins>2000)dnbins=0.001*(dmaxVal-dminVal);
891 if(dnbins<100) dnbins=0.02*(dmaxVal-dminVal);
896 dnbins=(dmaxVal-dminVal)*500;
905 dnbins =
fCellTime->GetXaxis()->GetNbins();
906 dminVal=
fCellTime->GetXaxis()->GetBinCenter(1)-(binWidth*1.0)/2.0;
907 dmaxVal=
fCellTime->GetXaxis()->GetBinCenter(dnbins)+(binWidth*1.0)/2.0;
908 cout<<
"set the new histo with following settings- bins: "<<dnbins<<
", min val = "<<dminVal<<
", max val:"<<dmaxVal<<endl;
911 TH1F *distrib =
new TH1F(Form(
"%sDistr",(
const char*)histoName),
"", dnbins, dminVal, dmaxVal);
912 distrib->SetXTitle(inhisto->GetYaxis()->GetTitle());
913 distrib->SetYTitle(
"Entries");
914 TH1F *distrib_wTRDStruc =
new TH1F(Form(
"%sDistr_wTRD",(
const char*)histoName),
"", dnbins, dminVal, dmaxVal);
915 TH1F *distrib_woTRDStruc=
new TH1F(Form(
"%sDistr_woTRD",(
const char*)histoName),
"", dnbins, dminVal, dmaxVal);
919 plot2D->GetXaxis()->SetTitle(
"cell column (#eta direction)");
920 plot2D->GetYaxis()->SetTitle(
"cell row (#phi direction)");
934 distrib->Fill(inhisto->GetBinContent(cell+1));
941 cout<<
"Problem! wrong calculated number of max col and max rows"<<endl;
942 cout<<
"current col: "<<cellColumnAbs<<
", max col"<<
fNMaxColsAbs<<endl;
943 cout<<
"current row: "<<cellRowAbs<<
", max row"<<
fNMaxRowsAbs<<endl;
945 plot2D->SetBinContent(cellColumnAbs,cellRowAbs,inhisto->GetBinContent(cell+1));
949 distrib_wTRDStruc->Fill(inhisto->GetBinContent(cell+1));
953 distrib_woTRDStruc ->Fill(inhisto->GetBinContent(cell+1));
961 TCanvas *c1 =
new TCanvas(histoName,histoName,900,900);
962 c1->ToggleEventStatus();
963 TPad* upperPad =
new TPad(
"upperPad",
"upperPad",.005, .5, .995, .995);
964 TPad* lowerPadLeft =
new TPad(
"lowerPadL",
"lowerPadL",.005, .005, .5, .5);
965 TPad* lowerPadRight =
new TPad(
"lowerPadR",
"lowerPadR",.5, .005, .995, .5);
967 lowerPadLeft->Draw();
968 lowerPadRight->Draw();
971 upperPad->SetLeftMargin(0.05);
972 upperPad->SetRightMargin(0.05);
973 if(crit<3)upperPad->SetLogy();
974 inhisto->SetTitleOffset(0.6,
"Y");
975 inhisto->GetXaxis()->SetRangeUser(0,fNoOfCells+1);
976 inhisto->GetYaxis()->SetTitleOffset(0.7);
977 inhisto->SetLineColor(kBlue+1);
981 lowerPadRight->SetLeftMargin(0.09);
982 lowerPadRight->SetRightMargin(0.12);
983 plot2D->GetYaxis()->SetTitleOffset(1.3);
984 plot2D->Draw(
"colz");
987 lowerPadLeft->SetLeftMargin(0.09);
988 lowerPadLeft->SetRightMargin(0.07);
989 lowerPadLeft->SetLogy();
990 distrib->SetLineColor(kBlue+1);
991 distrib->GetYaxis()->SetTitleOffset(1.3);
993 distrib_wTRDStruc->SetLineColor(kGreen+1);
994 distrib_wTRDStruc->DrawCopy(
"same");
995 distrib_woTRDStruc->SetLineColor(kMagenta+1);
996 distrib_woTRDStruc->DrawCopy(
"same");
1003 distrib->GetXaxis()->SetRangeUser(distrib->GetBinCenter(2),distrib->GetBinCenter(dnbins));
1004 Double_t maxDistr = distrib->GetMaximum();
1005 Int_t maxBin = distrib->GetMaximumBin();
1006 Double_t maxCenter = distrib->GetBinCenter(maxBin);
1010 for(
Int_t i = maxBin ; i<=dnbins ; i++)
1012 if(distrib->GetBinContent(i)<2)
break ;
1013 goodmax = distrib->GetBinCenter(i);
1015 for(
Int_t i = maxBin ; i>2 ; i--)
1017 if(distrib->GetBinContent(i)<2)
break ;
1018 goodmin = distrib->GetBinLowEdge(i);
1027 if(crit==3)minFitRange=-20;
1028 if(crit==3)maxFitRange=20;
1033 TF1 *fit2 =
new TF1(
"fit2",
"gaus",minFitRange,maxFitRange);
1035 fit2->SetParLimits(0,0,maxDistr);
1036 fit2->SetParameter(1,maxCenter);
1037 fit2->SetParLimits(1,0,dmaxVal);
1040 distrib->Fit(fit2,
"0LQEM",
"", minFitRange, maxFitRange);
1042 mean = fit2->GetParameter(1);
1043 sig = fit2->GetParameter(2);
1046 if(crit<3 && mean <0.) mean=0.;
1048 goodmin = mean - nsigma*sig ;
1049 goodmax = mean + nsigma*sig ;
1051 if(crit<3 && goodmin <0.) goodmin=0.;
1054 if(inputBins==-1) goodmin=-1;
1055 if(
fPrint==1)cout<<
" o Result of fit: "<<endl;
1056 if(
fPrint==1)cout<<
" o "<<endl;
1057 if(
fPrint==1)cout<<
" o Mean: "<<mean <<
" sigma: "<<sig<<endl;
1058 if(
fPrint==1)cout<<
" o good range : "<<goodmin <<
" - "<<goodmax<<endl;
1063 TLine *lline =
new TLine(goodmin, 0, goodmin, distrib->GetMaximum());
1064 lline->SetLineColor(kGreen+2);
1065 lline->SetLineStyle(7);
1068 TLine *rline =
new TLine(goodmax, 0, goodmax, distrib->GetMaximum());
1069 rline->SetLineColor(kGreen+2);
1070 rline->SetLineStyle(7);
1073 TLegend *leg =
new TLegend(0.60,0.70,0.9,0.85);
1074 leg->AddEntry(lline,
"Good region boundary",
"l");
1075 leg->AddEntry(distrib_wTRDStruc,
"Covered by TRD",
"l");
1076 leg->AddEntry(distrib_woTRDStruc,
"wo TRD structure",
"l");
1077 leg->SetBorderSize(0);
1080 fit2->SetLineColor(kOrange-3);
1081 fit2->SetLineStyle(1);
1085 if(crit==1) text =
new TLatex(0.12,0.85,Form(
"Good range: %.2f-%.2f",goodmin,goodmax));
1086 if(crit==2) text =
new TLatex(0.12,0.85,Form(
"Good range: %.2f-%.2f",goodmin,goodmax));
1087 if(crit==3) text =
new TLatex(0.12,0.85,Form(
"Good range: %.2f-%.2f",goodmin,goodmax));
1088 text->SetTextSize(0.06);
1090 text->SetTextColor(1);
1094 TLine *uline =
new TLine(0, goodmax,fNoOfCells,goodmax);
1095 uline->SetLineColor(kGreen+2);
1096 uline->SetLineStyle(7);
1098 TLine *lowline =
new TLine(0, goodmin,fNoOfCells,goodmin);
1099 lowline->SetLineColor(kGreen+2);
1100 lowline->SetLineStyle(7);
1107 if(crit==1)name=Form(
"%s/%s/AverageEperHit_%s.gif",
fWorkdir.Data(),
fAnalysisOutput.Data(), (
const char*)histoName);
1108 if(crit==2)name=Form(
"%s/%s/AverageHitperEvent_%s.gif",
fWorkdir.Data(),
fAnalysisOutput.Data(), (
const char*)histoName);
1109 if(crit==3)name=Form(
"%s/%s/AverageTimeMax_%s.gif",
fWorkdir.Data(),
fAnalysisOutput.Data(), (
const char*)histoName);
1112 fRootFile->WriteObject(c1,c1->GetName());
1113 fRootFile->WriteObject(plot2D,plot2D->GetName());
1114 fRootFile->WriteObject(distrib,distrib->GetName());
1115 fRootFile->WriteObject(inhisto,inhisto->GetName());
1122 if(
fPrint==1)cout<<
" o Flag bad cells that are outside the good range "<<endl;
1127 if(inhisto->GetBinContent(cell+1) <= goodmin &&
fFlag[cell]==0)
1132 if(inhisto->GetBinContent(cell+1) > goodmax && fFlag[cell]==0)
1138 if(
fPrint==1)cout<<
" o o o o o o o o o o o o o o o o o o o o o o o"<<endl;
1164 ofstream file2(aliceTwikiTable, ios::out | ios::trunc);
1167 file2<<
"|*Criterium* | *E_min !GeV* | *E_max !GeV* | *sigma* | *Excluded Cells* |"<<endl;
1174 criterion =periodArray.At(0);
1175 emin =periodArray.At(2);
1176 emax =periodArray.At(3);
1177 sig =periodArray.At(1);
1181 output.Form(
"%s/%s/Criterion%d_Emin-%.2f_Emax-%.2f.txt",
fWorkdir.Data(),
fAnalysisOutput.Data(), criterion,emin,emax);
1182 ofstream
file(output, ios::out | ios::trunc);
1185 cout<<
"#### Major Error. Check the textfile!"<<endl;
1187 file<<
"fFlag="<<i+2<<
"means Criterion : "<<criterion<<
", emin = "<<emin<<
" GeV"<<
", emax = "<<emax<<
" GeV"<<endl;
1188 if(
fPrint==1)cout<<
" o Criterion : "<<criterion<<
", emin = "<<emin<<
" GeV"<<
", emax = "<<emax<<
" GeV"<<
" (Method "<<i<<
")"<<endl;
1193 if(
fFlag[cellID]==(i+2))
1199 file<<
"Total number of bad cells with fFlag=="<<i+2<<endl;
1200 file<<
"("<<nb1<<
")"<<endl;
1202 if(
fPrint==1)cout<<
" o Total number of bad cells ("<<nb1<<
")"<<endl;
1207 ofstream file2(aliceTwikiTable, ios::out | ios::app);
1210 file2<<
"| "<<criterion<<
" | "<<emin<<
" | "<<emax<<
" | "<<sig<<
" | "<<nb1<<
" |"<<endl;
1224 Int_t cellID, nDeadDCalCells = 0, nDeadEMCalCells = 0, nDCalCells = 0, nEMCalCells = 0;
1225 Double_t perDeadEMCal,perDeadDCal,perBadEMCal,perBadDCal,perWarmEMCal,perWarmDCal;
1226 TString aliceTwikiTable, cellSummaryFile, deadPdfName, badPdfName, ratioOfBad,goodCells,goodCellsRatio,cellProp;
1239 cout<<
" o Final results o "<<endl;
1251 cellAmp_masked->SetBinContent(amp,cell+1,0);
1260 cellTime_masked->SetBinContent(time,cell+1,0);
1267 TCanvas *c1 =
new TCanvas(
"CellProp",
"I summary of cell properties",1000,1000);
1268 c1->ToggleEventStatus();
1270 c1->cd(1)->SetLogz();
1277 c1->cd(2)->SetLogz();
1280 fCellTime->GetYaxis()->SetTitleOffset(1.6);
1282 c1->cd(3)->SetLogz();
1285 cellAmp_masked->SetTitle(
"Masked Cell Amplitude");
1286 cellAmp_masked->SetXTitle(
"Cell Energy [GeV]");
1287 cellAmp_masked->SetYTitle(
"Abs. Cell Id");
1288 cellAmp_masked->GetYaxis()->SetTitleOffset(1.6);
1289 cellAmp_masked->Draw(
"colz");
1290 c1->cd(4)->SetLogz();
1291 cellTime_masked->SetTitle(
"Masked Cell Time");
1292 cellTime_masked->SetXTitle(
"Cell Time [ns]");
1293 cellTime_masked->SetYTitle(
"Abs. Cell Id");
1294 cellTime_masked->GetYaxis()->SetTitleOffset(1.6);
1295 cellTime_masked->Draw(
"colz");
1298 TCanvas *c1_ratio =
new TCanvas(
"CellPropRatio",
"II summary of cell properties ratio",1000,500);
1299 c1_ratio->ToggleEventStatus();
1300 c1_ratio->Divide(2);
1301 c1_ratio->cd(1)->SetLogz();
1302 cellAmp_masked->SetTitle(
"Masked Cell Amplitude");
1303 cellAmp_masked->GetZaxis()->SetRangeUser(0.0001,10e7);
1304 cellAmp_masked->Draw(
"colz");
1305 c1_ratio->cd(2)->SetLogz();
1308 TH2F* ratio2DAmp =(
TH2F*)cellAmp_masked->Clone(
"ratio2DAmp");
1309 TH2F* Sum2DIdeal =(
TH2F*)cellAmp_masked->Clone(
"Sum2DIdeal");
1310 Sum2DIdeal->Reset();
1314 for(
Int_t eBin=0;eBin<Sum2DIdeal->GetNbinsX();eBin++)
1316 Double_t binVal=hRefDistr->GetBinContent(eBin+1);
1317 for(
Int_t icell=0;icell<Sum2DIdeal->GetNbinsY();icell++)
1319 Sum2DIdeal->SetBinContent(eBin+1,icell+1,binVal);
1322 ratio2DAmp->SetTitle(
"Ratio of cell Amplitude to mean cell ampl.");
1323 ratio2DAmp->Divide(Sum2DIdeal);
1324 ratio2DAmp->GetZaxis()->UnZoom();
1325 ratio2DAmp->Draw(
"colz");
1327 TLatex* textSM =
new TLatex(0.1,0.1,
"*test*");
1328 textSM->SetTextSize(0.06);
1329 textSM->SetTextColor(1);
1332 TCanvas *c1_proj =
new TCanvas(
"CellPropPProj",
"III summary of cell properties",1000,500);
1333 c1_proj->ToggleEventStatus();
1335 c1_proj->cd(1)->SetLogy();
1336 TH1* projEnergyMask = cellAmp_masked->ProjectionX(Form(
"%sMask_Proj",cellAmp_masked->GetName()),
fStartCell,fNoOfCells);
1337 projEnergyMask->SetXTitle(
"Cell Energy [GeV]");
1338 projEnergyMask->GetYaxis()->SetTitleOffset(1.6);
1339 projEnergyMask->SetLineColor(kGreen+1);
1340 projEnergyMask->DrawCopy(
" hist");
1342 projEnergy->DrawCopy(
"same hist");
1343 TLegend *leg =
new TLegend(0.50,0.75,0.7,0.87);
1344 leg->AddEntry(projEnergy,
"all cells",
"l");
1345 leg->AddEntry(projEnergyMask,
"good cells",
"l");
1346 leg->SetTextSize(0.05);
1347 leg->SetBorderSize(0);
1348 leg->SetFillColorAlpha(10, 0);
1350 TLegend *legBig = (TLegend*)leg->Clone(
"legBig");
1351 legBig->SetTextSize(0.08);
1352 legBig->SetX1NDC(0.2);
1354 c1_proj->cd(2)->SetLogy();
1355 TH1* projTimeMask = cellTime_masked->ProjectionX(Form(
"%s_Proj",cellTime_masked->GetName()),
fStartCell,fNoOfCells);
1356 projTimeMask->SetXTitle(
"Cell Time [ns]");
1357 projTimeMask->GetYaxis()->SetTitleOffset(1.6);
1358 projTimeMask->GetYaxis()->SetRangeUser(1,projTimeMask->GetMaximum()*20);
1359 projTimeMask->SetLineColor(kGreen+1);
1360 projTimeMask->DrawCopy(
"hist");
1362 projTime->DrawCopy(
"same hist");
1366 TCanvas *c1_projSM =
new TCanvas(
"CellPropPProjSM",
"III summary of cell Energy per SM",1200,900);
1367 c1_projSM->Divide(5,4,0.001,0.001);
1368 TH1* projEnergyMaskSM[20];
1369 TH1* projEnergySM[20];
1370 for(
Int_t iSM=0;iSM<20;iSM++)
1372 c1_projSM->cd(iSM+1)->SetLogy();
1373 gPad->SetTopMargin(0.03);
1374 gPad->SetBottomMargin(0.11);
1375 projEnergyMaskSM[iSM] = cellAmp_masked->ProjectionX(Form(
"%sMask_ProjSM%i",cellAmp_masked->GetName(),iSM),
fStartCellSM[iSM]+1,
fStartCellSM[iSM+1]);
1376 projEnergyMaskSM[iSM]->SetTitle(
"");
1377 projEnergyMaskSM[iSM]->SetXTitle(Form(
"Cell Energy [GeV], SM%i",iSM));
1378 projEnergyMaskSM[iSM]->GetYaxis()->SetTitleOffset(1.6);
1379 projEnergyMaskSM[iSM]->GetYaxis()->SetLabelSize(0.06);
1380 projEnergyMaskSM[iSM]->GetXaxis()->SetLabelSize(0.06);
1381 projEnergyMaskSM[iSM]->GetXaxis()->SetRangeUser(0,20);
1382 projEnergyMaskSM[iSM]->GetXaxis()->SetTitleSize(0.06);
1383 projEnergyMaskSM[iSM]->SetLineColor(kGreen+1);
1384 projEnergyMaskSM[iSM]->DrawCopy(
" hist");
1387 projEnergySM[iSM]->DrawCopy(
"same hist");
1388 if(iSM==0)legBig->Draw(
"same");
1394 TCanvas *c1_projRSM =
new TCanvas(
"CellPropPProjRSM",
"III summary of cell Energy Ratio per SM",1200,900);
1395 c1_projRSM->Divide(5,4,0.001,0.001);
1396 for(
Int_t iSM=0;iSM<20;iSM++)
1398 c1_projRSM->cd(iSM+1)->SetLogy();
1399 gPad->SetTopMargin(0.03);
1400 gPad->SetBottomMargin(0.11);
1402 projEnergyMaskSM[iSM]->SetLineColor(kGray+1);
1403 projEnergyMaskSM[iSM]->Divide(hRefDistr);
1404 projEnergyMaskSM[iSM]->DrawCopy(
"hist");
1407 TCanvas *c1_projTimeSM =
new TCanvas(
"CellPropPProjTimeSM",
"III summary of cell Time per SM",1200,900);
1408 c1_projTimeSM->Divide(5,4,0.001,0.001);
1409 TH1* projTimeMaskSM[20];
1410 TH1* projTimeSM[20];
1411 for(
Int_t iSM=0;iSM<20;iSM++)
1413 c1_projTimeSM->cd(iSM+1)->SetLogy();
1414 gPad->SetTopMargin(0.03);
1415 gPad->SetBottomMargin(0.11);
1416 projTimeMaskSM[iSM] = cellTime_masked->ProjectionX(Form(
"%sMask_ProjSMTime%i",cellAmp_masked->GetName(),iSM),
fStartCellSM[iSM]+1,
fStartCellSM[iSM+1]);
1417 projTimeMaskSM[iSM]->SetTitle(
"");
1418 projTimeMaskSM[iSM]->SetXTitle(Form(
"Cell Time [ns], SM%i",iSM));
1419 projTimeMaskSM[iSM]->GetYaxis()->SetTitleOffset(1.6);
1420 projTimeMaskSM[iSM]->GetYaxis()->SetLabelSize(0.06);
1421 projTimeMaskSM[iSM]->GetXaxis()->SetLabelSize(0.06);
1423 projTimeMaskSM[iSM]->GetXaxis()->SetTitleSize(0.06);
1424 projTimeMaskSM[iSM]->SetLineColor(kGreen+1);
1425 projTimeMaskSM[iSM]->DrawCopy(
" hist");
1427 if(iSM==0)legBig->Draw(
"same");
1429 projTimeSM[iSM]->DrawCopy(
"same hist");
1433 c1 ->Print(Form(
"%s(",cellProp.Data()));
1434 c1_ratio ->Print(Form(
"%s",cellProp.Data()));
1435 c1_proj ->Print(Form(
"%s",cellProp.Data()));
1436 c1_projSM ->Print(Form(
"%s",cellProp.Data()));
1437 c1_projRSM ->Print(Form(
"%s",cellProp.Data()));
1438 c1_projTimeSM->Print(Form(
"%s)",cellProp.Data()));
1445 cellAmp_masked ->Scale(1.0/totalevents);
1451 ofstream
file(cellSummaryFile, ios::out | ios::trunc);
1454 file<<
"Dead cells : "<<endl;
1455 cout<<
" o Dead cells : "<<endl;
1460 file<<
"In EMCal: "<<endl;
1465 file<<
"In DCal: "<<endl;
1467 if(
fFlag[cellID]==1)
1471 else nDeadDCalCells++;
1477 file<<
"EMCal ("<<nDeadEMCalCells<<
" ="<<perDeadEMCal<<
"%), DCal ("<<nDeadDCalCells<<
" ="<<perDeadDCal<<
"%)"<<endl;
1478 cout<<
" o EMCal ("<<nDeadEMCalCells<<
" ="<<perDeadEMCal<<
"%), DCal ("<<nDeadDCalCells<<
" ="<<perDeadDCal<<
"%)"<<endl;
1480 file<<
"Bad cells: "<<endl;
1481 cout<<
" o Bad cells: "<<endl;
1486 file<<
"In EMCal: "<<endl;
1491 file<<
"In DCal: "<<endl;
1503 file<<
"EMCal ("<<nEMCalCells<<
" ="<<perBadEMCal<<
"%), DCal ("<<nDCalCells<<
" ="<<perBadDCal<<
"%)"<<endl;
1504 cout<<
" o EMCal ("<<nEMCalCells<<
" ="<<perBadEMCal<<
"%), DCal ("<<nDCalCells<<
" ="<<perBadDCal<<
"%)"<<endl;
1507 cout<<
" o Total: "<<endl;
1508 cout<<
" o Bad+Dead cells: "<<nDeadEMCalCells+nEMCalCells+nDeadDCalCells+nDCalCells<<
", this is "<<(nDeadEMCalCells+nEMCalCells+nDeadDCalCells+nDCalCells)*100/(1.0*fNoOfCells)<<
"% of the whole detector"<<endl;
1513 if(
fPrint==1)cout<<
" o Save the bad channel spectra to a .pdf file"<<endl;
1527 TCanvas *c2 =
new TCanvas(
"CellFlag",
"summary of cell flags",1200,800);
1528 c2->ToggleEventStatus();
1533 fhCellFlag->SetYTitle(
"flag by which cell was excluded");
1553 TString name1,name2,name3,name4,name5,name6;
1555 c1_ratio->SaveAs(name1);
1559 c1_proj->SaveAs(name3);
1561 c1_projSM->SaveAs(name4);
1563 c1_projRSM->SaveAs(name5);
1565 c1_projTimeSM->SaveAs(name6);
1567 fRootFile->WriteObject(c1,c1->GetName());
1568 fRootFile->WriteObject(c1_ratio,c1_ratio->GetName());
1569 fRootFile->WriteObject(c1_proj,c1_proj->GetName());
1570 fRootFile->WriteObject(c1_projSM,c1_projSM->GetName());
1571 fRootFile->WriteObject(c1_projRSM,c1_projRSM->GetName());
1572 fRootFile->WriteObject(c1_projTimeSM,c1_projTimeSM->GetName());
1573 fRootFile->WriteObject(c2,c2->GetName());
1575 fRootFile->WriteObject(cellAmp_masked,cellAmp_masked->GetName());
1576 fRootFile->WriteObject(ratio2DAmp,ratio2DAmp->GetName());
1581 fRootFile->WriteObject(projEnergyMask,projEnergyMask->GetName());
1582 fRootFile->WriteObject(projEnergy,projEnergy->GetName());
1589 Int_t nWEMCalCells =0;
1590 Int_t nWDCalCells =0;
1591 file.open(cellSummaryFile, ios::out | ios::app);
1594 file<<
"Warm cells : "<<endl;
1595 if(
fPrint==1)cout<<
" o Warm cells : "<<endl;
1600 file<<
"In EMCal: "<<endl;
1605 file<<
"In DCal: "<<endl;
1617 file<<
"EMCal ("<<nWEMCalCells<<
" ="<<perWarmEMCal<<
"%), DCal ("<<nWDCalCells<<
" ="<<perWarmDCal<<
"%)"<<endl;
1618 if(
fPrint==1)cout<<
" o EMCal ("<<nWEMCalCells<<
" ="<<perWarmEMCal<<
"%), DCal ("<<nWDCalCells<<
" ="<<perWarmDCal<<
"%)"<<endl;
1624 ofstream file2(aliceTwikiTable, ios::out | ios::app);
1627 file2<<
"1=energy/hit, 2= hit/event"<<endl;
1629 file2<<
"| *Detector* | *No of cells* | *percentage* |"<<endl;
1630 file2<<
"| Dead EMCal | "<<nDeadEMCalCells<<
" | "<<perDeadEMCal<<
"% |"<<endl;
1631 file2<<
"| Bad EMCal | "<<nEMCalCells<<
" | "<<perBadEMCal<<
"% |"<<endl;
1632 file2<<
"| - Warm EMCal | "<<nWEMCalCells<<
" | "<<perWarmEMCal<<
"% |"<<endl;
1633 file2<<
"| Dead DCal | "<<nDeadDCalCells<<
" | "<<perDeadDCal<<
"% |"<<endl;
1634 file2<<
"| Bad DCal | "<<nDCalCells<<
" | "<<perBadDCal<<
"% |"<<endl;
1635 file2<<
"| - Warm DCal | "<<nWDCalCells<<
" | "<<perWarmDCal<<
"% |"<<endl;
1636 file2<<
"| Summ D+B | "<<nDeadEMCalCells+nEMCalCells+nDeadDCalCells+nDCalCells<<
" | "<<(nDeadEMCalCells+nEMCalCells+nDeadDCalCells+nDCalCells)*100/(1.0*fNoOfCells)<<
"% |"<<endl;
1661 gROOT->SetStyle(
"Plain");
1662 gStyle->SetOptStat(0);
1663 gStyle->SetFillColor(kWhite);
1664 gStyle->SetTitleFillColor(kWhite);
1665 gStyle->SetPalette(1);
1671 fRootFile->WriteObject(hRefDistr,hRefDistr->GetName());
1672 Int_t firstCanvas=0;
1674 TLatex*
text =
new TLatex(0.2,0.8,
"*Candidate*");
1675 text->SetTextSize(0.07);
1676 text->SetTextColor(kOrange-3);
1679 TLatex* text2 =
new TLatex(0.2,0.8,
"*Not a Candidate*");
1680 text2->SetTextSize(0.08);
1681 text2->SetTextColor(8);
1684 TLatex* textA =
new TLatex(0.65,0.62,
"*test*");
1685 textA->SetTextSize(0.04);
1686 textA->SetTextColor(1);
1692 std::vector<Int_t> channelVector;
1693 channelVector.clear();
1694 cout<<
" o Start printing into .pdf for version: "<<version<<endl;
1697 if(
fFlag[cell]==1 && version==0)channelVector.push_back(cell);
1698 if(
fFlag[cell]>1 && version==1)channelVector.push_back(cell);
1699 if(
fFlag[cell]==0 && version==2)channelVector.push_back(cell);
1700 if(
fFlag[cell]>1 && version==10)channelVector.push_back(cell);
1701 if(
fFlag[cell]==0 && version==20)channelVector.push_back(cell);
1703 if(cell%2000==0)cout<<
"...cell No."<<cell<<endl;
1705 if(channelVector.size()==9 || cell == fNoOfCells-1)
1710 TCanvas *c1 =
new TCanvas(
"badcells",
"badcells",1000,750);
1711 if(channelVector.size() > 6) c1->Divide(3,3);
1712 else if (channelVector.size() > 3) c1->Divide(3,2);
1713 else c1->Divide(3,1);
1715 TLegend *leg =
new TLegend(0.7, 0.7, 0.9, 0.9);
1716 for(
Int_t i=0; i< (
Int_t)channelVector.size() ; i++)
1718 sprintf(name,
"Cell %d",channelVector.at(i)) ;
1719 TH1 *hCell =
fCellAmplitude->ProjectionX(name,channelVector.at(i)+1,channelVector.at(i)+1);
1720 sprintf(title,
"Cell No: %d Entries: %d",channelVector.at(i), (
Int_t)hCell->GetEntries()) ;
1723 c1->cd(i%9 + 1)->SetLogy();
1726 leg->AddEntry(hRefDistr,
"mean of good",
"l");
1727 leg->AddEntry(hCell,
"current",
"l");
1731 if(candidate==1)
fWarmCell[channelVector.at(i)]=candidate;
1734 hCell->Divide(hRefDistr);
1742 hCell->SetLineColor(kBlue+1);
1743 hCell->GetXaxis()->SetTitle(
"E (GeV)");
1744 hCell->GetYaxis()->SetTitle(
"N Entries");
1745 hCell->GetXaxis()->SetRangeUser(0.,10.);
1746 hCell->SetLineWidth(1) ;
1747 hCell->SetTitle(title);
1748 hRefDistr->SetLineColor(kGray+2);
1749 hRefDistr->SetLineWidth(1);
1751 hCell->Draw(
"hist");
1753 if(version==1 || version==2)hRefDistr->Draw(
"same") ;
1756 if(candidate==1 && (version==1 || version==10))
1758 gPad->SetFrameFillColor(kYellow-10);
1763 textA->SetTitle(Form(
"Excluded by No. %d",
fFlag[channelVector.at(i)]));
1764 textA->DrawLatex(0.65,0.62,Form(
"Excluded by No. %d",
fFlag[channelVector.at(i)]));
1766 if(candidate==0 && (version==2 || version==20))
1768 gPad->SetFrameFillColor(kYellow-10);
1772 if(version<2)leg->Draw();
1775 if(channelVector.size()<9 || cell == fNoOfCells-1)
1777 internal_pdfName +=
")";
1778 c1->Print(internal_pdfName.Data());
1780 else if(firstCanvas==0)
1782 internal_pdfName +=
"(";
1783 c1->Print(internal_pdfName.Data());
1788 c1->Print(internal_pdfName.Data());
1792 channelVector.clear();
1818 if(warmIn==0 &&
fFlag[cell]!=0 )
continue;
1820 if(warmIn==2 &&
fWarmCell[cell]==0)
continue;
1824 hgoodMean->Add(hGoodAmp);
1826 hgoodMean->Scale(1.0/NrGood);
1843 TString Name = Form(
"%s_ratio",histogram->GetName());
1844 TH1* ratio=(
TH1*)histogram->Clone(Name);
1845 ratio->Divide(reference);
1858 Int_t binHeightOne = reference->FindLastBinAbove(1.0/totalevents);
1859 Double_t binCentreHeightOne = reference->GetBinCenter(binHeightOne);
1860 Double_t thirdBinCentre = reference->GetBinCenter(3);
1869 if(ratio->FindLastBinAbove(0)<ratio->FindBin(binCentreHeightOne*percentageOfLast))
1878 ratio->GetXaxis()->SetRangeUser(thirdBinCentre,10);
1879 if(ratio->GetMaximum()>highestRatio)
1889 Int_t nullEntries=0;
1890 for(
Int_t i=2;i<binHeightOne;i++)
1892 if(ratio->GetBinContent(i)!=0)mean+=ratio->GetBinContent(i);
1895 mean*=1.0/(binHeightOne-1-nullEntries);
1896 if(mean>maxMean || mean<minMean)
1908 ratio->GetXaxis()->SetRangeUser(0,binCentreHeightOne);
1909 Double_t localMaxBin=ratio->GetMaximumBin();
1911 for(
Int_t i=2;i<binHeightOne;i++)
1914 if(ratio->GetBinContent(i)<=0)
continue;
1915 if(i>localMaxBin-3 && i<localMaxBin+3)
continue;
1916 mean+=ratio->GetBinContent(i);
1918 mean*=1.0/(binHeightOne-1);
1919 ratio->GetXaxis()->SetRangeUser(thirdBinCentre,binCentreHeightOne);
1921 if(ratio->GetMaximum()>mean*higherThanMean)
1933 Int_t cliffBin = ratio->FindBin(4);
1934 for(
Int_t i=cliffBin-10;i<cliffBin+11;i++)
1937 if(ratio->GetBinContent(i)<=0)
continue;
1938 if(i<=cliffBin) binsBefore++;
1939 if(i>cliffBin) binsAfter++;
1940 if(i<=cliffBin) beforeCliff+=ratio->GetBinContent(i);
1941 if(i>cliffBin) afterCliff+=ratio->GetBinContent(i);
1942 beforeCliff*=1.0/binsBefore;
1943 afterCliff*=1.0/binsAfter;
1945 if((beforeCliff-afterCliff)>cliffSize*afterCliff)
1947 if(beforeCliff!=0 && afterCliff!=0)candidate=0;
1948 if(beforeCliff!=0 && afterCliff!=0)cout<<
"5"<<endl;
1979 Bool_t coveredByTRDSupportStruc=0;
1981 if((collumn>3 && collumn<9) || (collumn>32 && collumn<37) || (collumn>57 && collumn<61) || (collumn>84 && collumn<90) ||
1982 (row==1) ||(row>20 && row<25) || (row>44 && row<49) || (row>68 && row<73) || (row>91 && row<96) ||
1983 (row>116 && row<120)|| row==127 || (row>148 && row<152) || (row>172 && row<177) || (row>197 && row<201)
1986 coveredByTRDSupportStruc=1;
1988 return coveredByTRDSupportStruc;
2003 histoName = Form(
"2DChannelMap_Flag%d",flagBegin);
2004 if(flagBegin==0 && flagEnd==0)histoName = Form(
"2DChannelMap_Flag100");
2007 plot2D->GetXaxis()->SetTitle(
"cell column (#eta direction)");
2008 plot2D->GetYaxis()->SetTitle(
"cell row (#phi direction)");
2010 Int_t cellColumn=0,cellRow=0;
2011 Int_t cellColumnAbs=0,cellRowAbs=0;
2023 cout<<
"Problem! wrong calculated number of max col and max rows"<<endl;
2024 cout<<
"current col: "<<cellColumnAbs<<
", max col"<<
fNMaxColsAbs<<endl;
2025 cout<<
"current row: "<<cellRowAbs<<
", max row"<<
fNMaxRowsAbs<<endl;
2027 if(flagEnd==-1 &&
fFlag[cell]==flagBegin) plot2D->SetBinContent(cellColumnAbs,cellRowAbs,1);
2028 if(flagEnd!=0 && flagEnd!=-1 &&
fFlag[cell]>=flagBegin &&
fFlag[cell]<=flagEnd)plot2D->SetBinContent(cellColumnAbs,cellRowAbs,1);
2029 if(flagBegin==0 && flagEnd==0 &&
fWarmCell[cell]==1) plot2D->SetBinContent(cellColumnAbs,cellRowAbs,1);
2033 TCanvas *c1 =
new TCanvas(histoName,histoName,500,500);
2034 c1->ToggleEventStatus();
2038 plot2D->Draw(
"colz");
2041 if(flagBegin==0 && flagEnd==-1) text =
new TLatex(0.2,0.8,
"Good Cells");
2042 if(flagBegin==1) text =
new TLatex(0.2,0.8,
"Dead Cells");
2043 if(flagBegin>1) text =
new TLatex(0.2,0.8,
"Bad Cells");
2044 if(flagBegin==0 && flagEnd==0) text =
new TLatex(0.2,0.8,
"Warm Cells");
2045 text->SetTextSize(0.06);
2047 text->SetTextColor(1);
2054 fRootFile->WriteObject(plot2D,plot2D->GetName());
2066 sprintf(name,
"Cell %d",cell) ;
TH2F * fCellTime
! possible histogram for the analysis. Cell ID vs. time, read from the input merged file ...
TString fAnalysisOutput
The list with bad channels and histograms are saved in this folder.
TList * fOutputListGood
! list with good channel amplitudes, stored in fRootFile
TH1F * fProcessedEvents
! Stores the number of events in the run
void Run(Bool_t mergeOnly=0)
TString fQADirect
Dierctory in the QA.root files where the input histograms are stored.
TList * fOutputListBadRatio
! list with bad channel amplitude ratios, stored in fRootFile
void PlotFlaggedCells2D(Int_t flagBegin, Int_t flagEnd=-1)
void SetRunNumber(Int_t run)
void SaveBadCellsToPDF(Int_t version, TString pdfName)
TString fPeriod
The name of the analyzed period.
TString fWorkdir
Directory which contains the folders fMergeOutput, fAnalysisInput and fAnalysisOutput. By default it is './'.
TH1D * BuildMeanFromGood(Int_t warmIn=0)
Bool_t CheckDistribution(TH1 *ratio, TH1 *reference)
Bool_t fTestRoutine
This is a flag, if set true will produce some extra quality check histograms.
TString fRunListFileName
This is the name of the file with the run numbers to be merged, by default it's 'runList.txt'.
TList * fOutputListBad
! list with bad channel amplitudes, stored in fRootFile
Double_t fEndLowerBound
Lower bound.
TLatex * text[5]
option to what and if export to output file
void AddPeriodAnalysis(Int_t criteria, Double_t nsigma, Double_t emin, Double_t emax)
void FlagAsBad(Int_t crit, TH1F *inhisto, Double_t nsigma=4., Double_t dnbins=200)
Int_t * fFlag
! fFlag[CellID] = 0 (ok),1 (dead),2 and higher (bad certain criteria) start at 0 (cellID 0 = histobin...
Int_t fCriterionCounter
! This value will be written in fflag and updates after each PeriodAnalysis, to distinguish the steps...
Bool_t fPrint
If set true more couts with information of the excluded cells will be printed.
AliEMCALGeometry * GetEMCALGeometry() const
Analyses cell properties and identifies bad cells.
Int_t fStartCellSM[21]
CellIDs of first cell in the 20SMs plus last cell ID.
TList * fOutputListGoodRatio
! list with good channel amplitude ratios, stored in fRootFile
TString fExternalBadMapName
Load an external bad map to test the effect on block or a given run.
TString fTrainNo
Train number of the analyszed data (can deduce pass & trigger from that etc.)
Int_t fNMaxColsAbs
Maximum No of colums in Calorimeter.
Int_t fNoOfCells
Number of cells in EMCal and DCal.
void PeriodAnalysis(Int_t criterum=7, Double_t nsigma=4.0, Double_t emin=0.1, Double_t emax=2.0)
std::vector< Int_t > fManualMask
! Is a list of cells that should be addidionally masked by hand.
void LoadExternalBadMap()
TH1F * fhCellWarm
! histogram that stores whether the cell was marked as warm
Bool_t * fWarmCell
! fWarmCell[CellID] = 0 (really bad), fWarmCell[CellID] = 1 (candidate for warm), ...
TH2F * fCellAmplitude
! main histogram for the analysis. Cell ID vs. amplitude, read from the input merged file ...
void SummarizeResultsByFlag()
TH1F * BuildTimeMean(Int_t crit, Double_t tmin, Double_t tmax)
std::vector< TArrayD > fAnalysisVector
Vector of analysis information. Each place is filled with 4 doubles: version, sigma, lower, and upper energy range.
Int_t fNMaxRows
Maximum No of rows in module (phi direction)
TString fMergedFileName
Filename of the .root file containing the merged runs.
Int_t fCurrentRunNumber
A run number of an analyzed period. This is important for the AliCalorimeterUtils initialization...
void AddMaskSM(Int_t iSM)
TString fExternalFileName
If you have already a file that contains many runs merged together you can place it in fMergeOutput a...
TString fRunList
Thats the full path and name of the file which contains a list of all runs to be merged together...
AliCalorimeterUtils * fCaloUtils
! Calorimeter information for the investigated runs
TH1F * BuildHitAndEnergyMean(Int_t crit, Double_t emin=0.1, Double_t emax=2.)
TFile * file
TList with histograms for a given trigger.
Int_t fTrial
Number of trial that this specific analyis is. By default '0' so one can try different settings witho...
Bool_t IsCoveredByTRD(Int_t row, Int_t collumn)
Int_t fStartCell
ID of the first cell you want to check.
Int_t fNMaxCols
Maximum No of colums in module (eta direction)
TString fTrigger
Selected trigger for the analysis.
Class with utils specific to calorimeter clusters/cells.
void AccessGeometry(AliVEvent *inputEvent)
TH1F * fhCellFlag
! histogram that stores by which flag the cell has been excluded
TFile * fRootFile
! root file with all histograms from this analysis
Int_t fCellStartDCal
ID of the first cell in the DCal.
TString fAnalysisInput
Here the .root files of each run of the period are saved.
Int_t fNMaxRowsAbs
Maximum No of rows in Calorimeter.
Int_t GetModuleNumberCellIndexesAbsCaloMap(Int_t absId, Int_t calo, Int_t &icol, Int_t &irow, Int_t &iRCU, Int_t &icolAbs, Int_t &irowAbs) const