19 #include <Riostream.h> 29 #include <AliEMCALGeometry.h> 31 #include <AliAODEvent.h> 50 fCurrentRunNumber(-1),
55 fCellStartDCal(12288),
66 fExternalFileName(
""),
67 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;
1227 TString OADBFile_bad, OADBFile_dead, OADBFile_warm;
1243 cout<<
" o Final results o "<<endl;
1255 cellAmp_masked->SetBinContent(amp,cell+1,0);
1264 cellTime_masked->SetBinContent(time,cell+1,0);
1271 TCanvas *c1 =
new TCanvas(
"CellProp",
"I summary of cell properties",1000,1000);
1272 c1->ToggleEventStatus();
1274 c1->cd(1)->SetLogz();
1281 c1->cd(2)->SetLogz();
1284 fCellTime->GetYaxis()->SetTitleOffset(1.6);
1286 c1->cd(3)->SetLogz();
1289 cellAmp_masked->SetTitle(
"Masked Cell Amplitude");
1290 cellAmp_masked->SetXTitle(
"Cell Energy [GeV]");
1291 cellAmp_masked->SetYTitle(
"Abs. Cell Id");
1292 cellAmp_masked->GetYaxis()->SetTitleOffset(1.6);
1293 cellAmp_masked->Draw(
"colz");
1294 c1->cd(4)->SetLogz();
1295 cellTime_masked->SetTitle(
"Masked Cell Time");
1296 cellTime_masked->SetXTitle(
"Cell Time [ns]");
1297 cellTime_masked->SetYTitle(
"Abs. Cell Id");
1298 cellTime_masked->GetYaxis()->SetTitleOffset(1.6);
1299 cellTime_masked->Draw(
"colz");
1302 TCanvas *c1_ratio =
new TCanvas(
"CellPropRatio",
"II summary of cell properties ratio",1000,500);
1303 c1_ratio->ToggleEventStatus();
1304 c1_ratio->Divide(2);
1305 c1_ratio->cd(1)->SetLogz();
1306 cellAmp_masked->SetTitle(
"Masked Cell Amplitude");
1307 cellAmp_masked->GetZaxis()->SetRangeUser(0.0001,10e7);
1308 cellAmp_masked->Draw(
"colz");
1309 c1_ratio->cd(2)->SetLogz();
1312 TH2F* ratio2DAmp =(
TH2F*)cellAmp_masked->Clone(
"ratio2DAmp");
1313 TH2F* Sum2DIdeal =(
TH2F*)cellAmp_masked->Clone(
"Sum2DIdeal");
1314 Sum2DIdeal->Reset();
1318 for(
Int_t eBin=0;eBin<Sum2DIdeal->GetNbinsX();eBin++)
1320 Double_t binVal=hRefDistr->GetBinContent(eBin+1);
1321 for(
Int_t icell=0;icell<Sum2DIdeal->GetNbinsY();icell++)
1323 Sum2DIdeal->SetBinContent(eBin+1,icell+1,binVal);
1326 ratio2DAmp->SetTitle(
"Ratio of cell Amplitude to mean cell ampl.");
1327 ratio2DAmp->Divide(Sum2DIdeal);
1328 ratio2DAmp->GetZaxis()->UnZoom();
1329 ratio2DAmp->Draw(
"colz");
1331 TLatex* textSM =
new TLatex(0.1,0.1,
"*test*");
1332 textSM->SetTextSize(0.06);
1333 textSM->SetTextColor(1);
1336 TCanvas *c1_proj =
new TCanvas(
"CellPropPProj",
"III summary of cell properties",1000,500);
1337 c1_proj->ToggleEventStatus();
1339 c1_proj->cd(1)->SetLogy();
1340 TH1* projEnergyMask = cellAmp_masked->ProjectionX(Form(
"%sMask_Proj",cellAmp_masked->GetName()),
fStartCell,fNoOfCells);
1341 projEnergyMask->SetXTitle(
"Cell Energy [GeV]");
1342 projEnergyMask->GetYaxis()->SetTitleOffset(1.6);
1343 projEnergyMask->SetLineColor(kGreen+1);
1344 projEnergyMask->DrawCopy(
" hist");
1346 projEnergy->DrawCopy(
"same hist");
1347 TLegend *leg =
new TLegend(0.50,0.75,0.7,0.87);
1348 leg->AddEntry(projEnergy,
"all cells",
"l");
1349 leg->AddEntry(projEnergyMask,
"good cells",
"l");
1350 leg->SetTextSize(0.05);
1351 leg->SetBorderSize(0);
1352 leg->SetFillColorAlpha(10, 0);
1354 TLegend *legBig = (TLegend*)leg->Clone(
"legBig");
1355 legBig->SetTextSize(0.08);
1356 legBig->SetX1NDC(0.2);
1358 c1_proj->cd(2)->SetLogy();
1359 TH1* projTimeMask = cellTime_masked->ProjectionX(Form(
"%s_Proj",cellTime_masked->GetName()),
fStartCell,fNoOfCells);
1360 projTimeMask->SetXTitle(
"Cell Time [ns]");
1361 projTimeMask->GetYaxis()->SetTitleOffset(1.6);
1362 projTimeMask->GetYaxis()->SetRangeUser(1,projTimeMask->GetMaximum()*20);
1363 projTimeMask->SetLineColor(kGreen+1);
1364 projTimeMask->DrawCopy(
"hist");
1366 projTime->DrawCopy(
"same hist");
1370 TCanvas *c1_projSM =
new TCanvas(
"CellPropPProjSM",
"III summary of cell Energy per SM",1200,900);
1371 c1_projSM->Divide(5,4,0.001,0.001);
1372 TH1* projEnergyMaskSM[20];
1373 TH1* projEnergySM[20];
1374 for(
Int_t iSM=0;iSM<20;iSM++)
1376 c1_projSM->cd(iSM+1)->SetLogy();
1377 gPad->SetTopMargin(0.03);
1378 gPad->SetBottomMargin(0.11);
1379 projEnergyMaskSM[iSM] = cellAmp_masked->ProjectionX(Form(
"%sMask_ProjSM%i",cellAmp_masked->GetName(),iSM),
fStartCellSM[iSM]+1,
fStartCellSM[iSM+1]);
1380 projEnergyMaskSM[iSM]->SetTitle(
"");
1381 projEnergyMaskSM[iSM]->SetXTitle(Form(
"Cell Energy [GeV], SM%i",iSM));
1382 projEnergyMaskSM[iSM]->GetYaxis()->SetTitleOffset(1.6);
1383 projEnergyMaskSM[iSM]->GetYaxis()->SetLabelSize(0.06);
1384 projEnergyMaskSM[iSM]->GetXaxis()->SetLabelSize(0.06);
1385 projEnergyMaskSM[iSM]->GetXaxis()->SetRangeUser(0,20);
1386 projEnergyMaskSM[iSM]->GetXaxis()->SetTitleSize(0.06);
1387 projEnergyMaskSM[iSM]->SetLineColor(kGreen+1);
1388 projEnergyMaskSM[iSM]->DrawCopy(
" hist");
1391 projEnergySM[iSM]->DrawCopy(
"same hist");
1392 if(iSM==0)legBig->Draw(
"same");
1398 TCanvas *c1_projRSM =
new TCanvas(
"CellPropPProjRSM",
"III summary of cell Energy Ratio per SM",1200,900);
1399 c1_projRSM->Divide(5,4,0.001,0.001);
1400 for(
Int_t iSM=0;iSM<20;iSM++)
1402 c1_projRSM->cd(iSM+1)->SetLogy();
1403 gPad->SetTopMargin(0.03);
1404 gPad->SetBottomMargin(0.11);
1406 projEnergyMaskSM[iSM]->SetLineColor(kGray+1);
1407 projEnergyMaskSM[iSM]->Divide(hRefDistr);
1408 projEnergyMaskSM[iSM]->DrawCopy(
"hist");
1411 TCanvas *c1_projTimeSM =
new TCanvas(
"CellPropPProjTimeSM",
"III summary of cell Time per SM",1200,900);
1412 c1_projTimeSM->Divide(5,4,0.001,0.001);
1413 TH1* projTimeMaskSM[20];
1414 TH1* projTimeSM[20];
1415 for(
Int_t iSM=0;iSM<20;iSM++)
1417 c1_projTimeSM->cd(iSM+1)->SetLogy();
1418 gPad->SetTopMargin(0.03);
1419 gPad->SetBottomMargin(0.11);
1420 projTimeMaskSM[iSM] = cellTime_masked->ProjectionX(Form(
"%sMask_ProjSMTime%i",cellAmp_masked->GetName(),iSM),
fStartCellSM[iSM]+1,
fStartCellSM[iSM+1]);
1421 projTimeMaskSM[iSM]->SetTitle(
"");
1422 projTimeMaskSM[iSM]->SetXTitle(Form(
"Cell Time [ns], SM%i",iSM));
1423 projTimeMaskSM[iSM]->GetYaxis()->SetTitleOffset(1.6);
1424 projTimeMaskSM[iSM]->GetYaxis()->SetLabelSize(0.06);
1425 projTimeMaskSM[iSM]->GetXaxis()->SetLabelSize(0.06);
1427 projTimeMaskSM[iSM]->GetXaxis()->SetTitleSize(0.06);
1428 projTimeMaskSM[iSM]->SetLineColor(kGreen+1);
1429 projTimeMaskSM[iSM]->DrawCopy(
" hist");
1431 if(iSM==0)legBig->Draw(
"same");
1433 projTimeSM[iSM]->DrawCopy(
"same hist");
1437 c1 ->Print(Form(
"%s(",cellProp.Data()));
1438 c1_ratio ->Print(Form(
"%s",cellProp.Data()));
1439 c1_proj ->Print(Form(
"%s",cellProp.Data()));
1440 c1_projSM ->Print(Form(
"%s",cellProp.Data()));
1441 c1_projRSM ->Print(Form(
"%s",cellProp.Data()));
1442 c1_projTimeSM->Print(Form(
"%s)",cellProp.Data()));
1449 cellAmp_masked ->Scale(1.0/totalevents);
1455 ofstream
file(cellSummaryFile, ios::out | ios::trunc);
1456 ofstream fileBad(OADBFile_bad, ios::out | ios::trunc);
1457 ofstream fileDead(OADBFile_dead, ios::out | ios::trunc);
1458 ofstream fileWarm(OADBFile_warm, ios::out | ios::trunc);
1461 file<<
"Dead cells : "<<endl;
1462 cout<<
" o Dead cells : "<<endl;
1467 file<<
"In EMCal: "<<endl;
1472 file<<
"In DCal: "<<endl;
1474 if(
fFlag[cellID]==1)
1478 else nDeadDCalCells++;
1480 if(
fFlag[cellID]==1)fileDead<<cellID<<endl;
1481 if(
fFlag[cellID]>1)fileBad<<cellID<<endl;
1486 file<<
"EMCal ("<<nDeadEMCalCells<<
" ="<<perDeadEMCal<<
"%), DCal ("<<nDeadDCalCells<<
" ="<<perDeadDCal<<
"%)"<<endl;
1487 cout<<
" o EMCal ("<<nDeadEMCalCells<<
" ="<<perDeadEMCal<<
"%), DCal ("<<nDeadDCalCells<<
" ="<<perDeadDCal<<
"%)"<<endl;
1489 file<<
"Bad cells: "<<endl;
1490 cout<<
" o Bad cells: "<<endl;
1495 file<<
"In EMCal: "<<endl;
1500 file<<
"In DCal: "<<endl;
1512 file<<
"EMCal ("<<nEMCalCells<<
" ="<<perBadEMCal<<
"%), DCal ("<<nDCalCells<<
" ="<<perBadDCal<<
"%)"<<endl;
1513 cout<<
" o EMCal ("<<nEMCalCells<<
" ="<<perBadEMCal<<
"%), DCal ("<<nDCalCells<<
" ="<<perBadDCal<<
"%)"<<endl;
1516 cout<<
" o Total: "<<endl;
1517 cout<<
" o Bad+Dead cells: "<<nDeadEMCalCells+nEMCalCells+nDeadDCalCells+nDCalCells<<
", this is "<<(nDeadEMCalCells+nEMCalCells+nDeadDCalCells+nDCalCells)*100/(1.0*fNoOfCells)<<
"% of the whole detector"<<endl;
1522 if(
fPrint==1)cout<<
" o Save the bad channel spectra to a .pdf file"<<endl;
1535 if(
fWarmCell[cell]==1)fileWarm<<cell<<endl;
1537 TCanvas *c2 =
new TCanvas(
"CellFlag",
"summary of cell flags",1200,800);
1538 c2->ToggleEventStatus();
1543 fhCellFlag->SetYTitle(
"flag by which cell was excluded");
1563 TString name1,name2,name3,name4,name5,name6;
1565 c1_ratio->SaveAs(name1);
1569 c1_proj->SaveAs(name3);
1571 c1_projSM->SaveAs(name4);
1573 c1_projRSM->SaveAs(name5);
1575 c1_projTimeSM->SaveAs(name6);
1577 fRootFile->WriteObject(c1,c1->GetName());
1578 fRootFile->WriteObject(c1_ratio,c1_ratio->GetName());
1579 fRootFile->WriteObject(c1_proj,c1_proj->GetName());
1580 fRootFile->WriteObject(c1_projSM,c1_projSM->GetName());
1581 fRootFile->WriteObject(c1_projRSM,c1_projRSM->GetName());
1582 fRootFile->WriteObject(c1_projTimeSM,c1_projTimeSM->GetName());
1583 fRootFile->WriteObject(c2,c2->GetName());
1585 fRootFile->WriteObject(cellAmp_masked,cellAmp_masked->GetName());
1586 fRootFile->WriteObject(ratio2DAmp,ratio2DAmp->GetName());
1591 fRootFile->WriteObject(projEnergyMask,projEnergyMask->GetName());
1592 fRootFile->WriteObject(projEnergy,projEnergy->GetName());
1599 Int_t nWEMCalCells =0;
1600 Int_t nWDCalCells =0;
1601 file.open(cellSummaryFile, ios::out | ios::app);
1604 file<<
"Warm cells : "<<endl;
1605 if(
fPrint==1)cout<<
" o Warm cells : "<<endl;
1610 file<<
"In EMCal: "<<endl;
1615 file<<
"In DCal: "<<endl;
1627 file<<
"EMCal ("<<nWEMCalCells<<
" ="<<perWarmEMCal<<
"%), DCal ("<<nWDCalCells<<
" ="<<perWarmDCal<<
"%)"<<endl;
1628 if(
fPrint==1)cout<<
" o EMCal ("<<nWEMCalCells<<
" ="<<perWarmEMCal<<
"%), DCal ("<<nWDCalCells<<
" ="<<perWarmDCal<<
"%)"<<endl;
1634 ofstream file2(aliceTwikiTable, ios::out | ios::app);
1637 file2<<
"1=energy/hit, 2= hit/event"<<endl;
1639 file2<<
"| *Detector* | *No of cells* | *percentage* |"<<endl;
1640 file2<<
"| Dead EMCal | "<<nDeadEMCalCells<<
" | "<<perDeadEMCal<<
"% |"<<endl;
1641 file2<<
"| Bad EMCal | "<<nEMCalCells<<
" | "<<perBadEMCal<<
"% |"<<endl;
1642 file2<<
"| - Warm EMCal | "<<nWEMCalCells<<
" | "<<perWarmEMCal<<
"% |"<<endl;
1643 file2<<
"| Dead DCal | "<<nDeadDCalCells<<
" | "<<perDeadDCal<<
"% |"<<endl;
1644 file2<<
"| Bad DCal | "<<nDCalCells<<
" | "<<perBadDCal<<
"% |"<<endl;
1645 file2<<
"| - Warm DCal | "<<nWDCalCells<<
" | "<<perWarmDCal<<
"% |"<<endl;
1646 file2<<
"| Summ D+B | "<<nDeadEMCalCells+nEMCalCells+nDeadDCalCells+nDCalCells<<
" | "<<(nDeadEMCalCells+nEMCalCells+nDeadDCalCells+nDCalCells)*100/(1.0*fNoOfCells)<<
"% |"<<endl;
1671 gROOT->SetStyle(
"Plain");
1672 gStyle->SetOptStat(0);
1673 gStyle->SetFillColor(kWhite);
1674 gStyle->SetTitleFillColor(kWhite);
1675 gStyle->SetPalette(1);
1681 fRootFile->WriteObject(hRefDistr,hRefDistr->GetName());
1682 Int_t firstCanvas=0;
1684 TLatex*
text =
new TLatex(0.2,0.8,
"*Candidate*");
1685 text->SetTextSize(0.07);
1686 text->SetTextColor(kOrange-3);
1689 TLatex* text2 =
new TLatex(0.2,0.8,
"*Not a Candidate*");
1690 text2->SetTextSize(0.08);
1691 text2->SetTextColor(8);
1694 TLatex* textA =
new TLatex(0.65,0.62,
"*test*");
1695 textA->SetTextSize(0.04);
1696 textA->SetTextColor(1);
1702 std::vector<Int_t> channelVector;
1703 channelVector.clear();
1704 cout<<
" o Start printing into .pdf for version: "<<version<<endl;
1707 if(
fFlag[cell]==1 && version==0)channelVector.push_back(cell);
1708 if(
fFlag[cell]>1 && version==1)channelVector.push_back(cell);
1709 if(
fFlag[cell]==0 && version==2)channelVector.push_back(cell);
1710 if(
fFlag[cell]>1 && version==10)channelVector.push_back(cell);
1711 if(
fFlag[cell]==0 && version==20)channelVector.push_back(cell);
1713 if(cell%2000==0)cout<<
"...cell No."<<cell<<endl;
1715 if(channelVector.size()==9 || cell == fNoOfCells-1)
1720 TCanvas *c1 =
new TCanvas(
"badcells",
"badcells",1000,750);
1721 if(channelVector.size() > 6) c1->Divide(3,3);
1722 else if (channelVector.size() > 3) c1->Divide(3,2);
1723 else c1->Divide(3,1);
1725 TLegend *leg =
new TLegend(0.7, 0.7, 0.9, 0.9);
1726 for(
Int_t i=0; i< (
Int_t)channelVector.size() ; i++)
1728 sprintf(name,
"Cell %d",channelVector.at(i)) ;
1729 TH1 *hCell =
fCellAmplitude->ProjectionX(name,channelVector.at(i)+1,channelVector.at(i)+1);
1730 sprintf(title,
"Cell No: %d Entries: %d",channelVector.at(i), (
Int_t)hCell->GetEntries()) ;
1733 c1->cd(i%9 + 1)->SetLogy();
1736 leg->AddEntry(hRefDistr,
"mean of good",
"l");
1737 leg->AddEntry(hCell,
"current",
"l");
1741 if(candidate==1)
fWarmCell[channelVector.at(i)]=candidate;
1744 hCell->Divide(hRefDistr);
1752 hCell->SetLineColor(kBlue+1);
1753 hCell->GetXaxis()->SetTitle(
"E (GeV)");
1754 hCell->GetYaxis()->SetTitle(
"N Entries");
1755 hCell->GetXaxis()->SetRangeUser(0.,10.);
1756 hCell->SetLineWidth(1) ;
1757 hCell->SetTitle(title);
1758 hRefDistr->SetLineColor(kGray+2);
1759 hRefDistr->SetLineWidth(1);
1761 hCell->Draw(
"hist");
1763 if(version==1 || version==2)hRefDistr->Draw(
"same") ;
1766 if(candidate==1 && (version==1 || version==10))
1768 gPad->SetFrameFillColor(kYellow-10);
1773 textA->SetTitle(Form(
"Excluded by No. %d",
fFlag[channelVector.at(i)]));
1774 textA->DrawLatex(0.65,0.62,Form(
"Excluded by No. %d",
fFlag[channelVector.at(i)]));
1776 if(candidate==0 && (version==2 || version==20))
1778 gPad->SetFrameFillColor(kYellow-10);
1782 if(version<2)leg->Draw();
1785 if(channelVector.size()<9 || cell == fNoOfCells-1)
1787 internal_pdfName +=
")";
1788 c1->Print(internal_pdfName.Data());
1790 else if(firstCanvas==0)
1792 internal_pdfName +=
"(";
1793 c1->Print(internal_pdfName.Data());
1798 c1->Print(internal_pdfName.Data());
1802 channelVector.clear();
1828 if(warmIn==0 &&
fFlag[cell]!=0 )
continue;
1830 if(warmIn==2 &&
fWarmCell[cell]==0)
continue;
1834 hgoodMean->Add(hGoodAmp);
1836 hgoodMean->Scale(1.0/NrGood);
1853 TString Name = Form(
"%s_ratio",histogram->GetName());
1854 TH1* ratio=(
TH1*)histogram->Clone(Name);
1855 ratio->Divide(reference);
1868 Int_t binHeightOne = reference->FindLastBinAbove(1.0/totalevents);
1869 Double_t binCentreHeightOne = reference->GetBinCenter(binHeightOne);
1870 Double_t thirdBinCentre = reference->GetBinCenter(3);
1879 if(ratio->FindLastBinAbove(0)<ratio->FindBin(binCentreHeightOne*percentageOfLast))
1888 ratio->GetXaxis()->SetRangeUser(thirdBinCentre,10);
1889 if(ratio->GetMaximum()>highestRatio)
1899 Int_t nullEntries=0;
1900 for(
Int_t i=2;i<binHeightOne;i++)
1902 if(ratio->GetBinContent(i)!=0)mean+=ratio->GetBinContent(i);
1905 mean*=1.0/(binHeightOne-1-nullEntries);
1906 if(mean>maxMean || mean<minMean)
1918 ratio->GetXaxis()->SetRangeUser(0,binCentreHeightOne);
1919 Double_t localMaxBin=ratio->GetMaximumBin();
1921 for(
Int_t i=2;i<binHeightOne;i++)
1924 if(ratio->GetBinContent(i)<=0)
continue;
1925 if(i>localMaxBin-3 && i<localMaxBin+3)
continue;
1926 mean+=ratio->GetBinContent(i);
1928 mean*=1.0/(binHeightOne-1);
1929 ratio->GetXaxis()->SetRangeUser(thirdBinCentre,binCentreHeightOne);
1931 if(ratio->GetMaximum()>mean*higherThanMean)
1943 Int_t cliffBin = ratio->FindBin(4);
1944 for(
Int_t i=cliffBin-10;i<cliffBin+11;i++)
1947 if(ratio->GetBinContent(i)<=0)
continue;
1948 if(i<=cliffBin) binsBefore++;
1949 if(i>cliffBin) binsAfter++;
1950 if(i<=cliffBin) beforeCliff+=ratio->GetBinContent(i);
1951 if(i>cliffBin) afterCliff+=ratio->GetBinContent(i);
1952 beforeCliff*=1.0/binsBefore;
1953 afterCliff*=1.0/binsAfter;
1955 if((beforeCliff-afterCliff)>cliffSize*afterCliff)
1957 if(beforeCliff!=0 && afterCliff!=0)candidate=0;
1958 if(beforeCliff!=0 && afterCliff!=0)cout<<
"5"<<endl;
1989 Bool_t coveredByTRDSupportStruc=0;
1991 if((collumn>3 && collumn<9) || (collumn>32 && collumn<37) || (collumn>57 && collumn<61) || (collumn>84 && collumn<90) ||
1992 (row==1) ||(row>20 && row<25) || (row>44 && row<49) || (row>68 && row<73) || (row>91 && row<96) ||
1993 (row>116 && row<120)|| row==127 || (row>148 && row<152) || (row>172 && row<177) || (row>197 && row<201)
1996 coveredByTRDSupportStruc=1;
1998 return coveredByTRDSupportStruc;
2013 histoName = Form(
"2DChannelMap_Flag%d_V%i",flagBegin,
fTrial);
2014 if(flagBegin==0 && flagEnd==0)histoName = Form(
"2DChannelMap_Flag100_V%i",
fTrial);
2017 plot2D->GetXaxis()->SetTitle(
"cell column (#eta direction)");
2018 plot2D->GetYaxis()->SetTitle(
"cell row (#phi direction)");
2020 Int_t cellColumn=0,cellRow=0;
2021 Int_t cellColumnAbs=0,cellRowAbs=0;
2033 cout<<
"Problem! wrong calculated number of max col and max rows"<<endl;
2034 cout<<
"current col: "<<cellColumnAbs<<
", max col"<<
fNMaxColsAbs<<endl;
2035 cout<<
"current row: "<<cellRowAbs<<
", max row"<<
fNMaxRowsAbs<<endl;
2037 if(flagEnd==-1 &&
fFlag[cell]==flagBegin) plot2D->SetBinContent(cellColumnAbs,cellRowAbs,1);
2038 if(flagEnd!=0 && flagEnd!=-1 &&
fFlag[cell]>=flagBegin &&
fFlag[cell]<=flagEnd)plot2D->SetBinContent(cellColumnAbs,cellRowAbs,1);
2039 if(flagBegin==0 && flagEnd==0 &&
fWarmCell[cell]==1) plot2D->SetBinContent(cellColumnAbs,cellRowAbs,1);
2043 TCanvas *c1 =
new TCanvas(histoName,histoName,500,500);
2044 c1->ToggleEventStatus();
2048 plot2D->Draw(
"colz");
2051 if(flagBegin==0 && flagEnd==-1) text =
new TLatex(0.2,0.8,
"Good Cells");
2052 if(flagBegin==1) text =
new TLatex(0.2,0.8,
"Dead Cells");
2053 if(flagBegin>1) text =
new TLatex(0.2,0.8,
"Bad Cells");
2054 if(flagBegin==0 && flagEnd==0) text =
new TLatex(0.2,0.8,
"Warm Cells");
2055 text->SetTextSize(0.06);
2057 text->SetTextColor(1);
2064 fRootFile->WriteObject(plot2D,plot2D->GetName());
2076 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