AliPhysics  4646b6b (4646b6b)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
helperMacrosOADBBC.C
Go to the documentation of this file.
1 
20 
21 
22 // --- ROOT system ---
23 #include <Riostream.h>
24 #include <TH2D.h>
25 #include <TFile.h>
26 #include <TCanvas.h>
27 #include <TLatex.h>
28 #include <TLegend.h>
29 #include <TStyle.h>
30 
31 // --- ANALYSIS system ---
32 #include "AliEMCALGeometry.h" //include when compile
33 #include "AliCalorimeterUtils.h" //include when compile
34 #include "AliAODEvent.h" //include when compile
35 #include "AliOADBContainer.h" //include when compile
36 
37 void SetHisto(TH1 *Histo,TString Xtitel,TString Ytitel);
38 void CanvasPartition(TCanvas *C,const Int_t Nx = 2,const Int_t Ny = 2, Float_t lMargin = 0.15, Float_t rMargin = 0.05, Float_t bMargin = 0.15, Float_t tMargin = 0.05);
39 
44 void Sort_RunNumbers(TString period="LHC15n",Int_t trainNo=603,TString runList="")
45 {
46  //......................................................
47  //..open the text file and save the run IDs into the RunId[] array
48  cout<<"o o o Open .txt file with run indices. Name = " << runList << endl;
49  TString RunPath1 = Form("./AnalysisInput/%s/Train_%i/%s",period.Data(),trainNo,runList.Data());
50  cout<<"o o o Open .txt file with run indices = " << RunPath1 << endl;
51  FILE *pFile1 = fopen(RunPath1.Data(), "r");
52  if(!pFile1)
53  {
54  cout<<"couldn't open file "<<RunPath1<<"!"<<endl;
55  return;
56  }
57  Int_t q1;
58  Int_t ncols1;
59  Int_t nlines1 = 0 ;
60  std::vector<Int_t> RunIdVec1;
61  while (1)
62  {
63  ncols1 = fscanf(pFile1," %d ",&q1);
64  if (ncols1< 0) break;
65  RunIdVec1.push_back(q1);
66  nlines1++;
67  }
68  fclose(pFile1);
69  std::sort (RunIdVec1.begin(), RunIdVec1.end());
70  //.......................................................
71  cout<<"Runs in Order: "<<endl;
72  for(Int_t iRun = 0; iRun < (Int_t)RunIdVec1.size(); iRun++)
73  {
74  cout<<RunIdVec1.at(iRun)<<", "<<flush;
75  }
76  cout<<endl;
77 }
84 void Test_OADB(TString period="LHC15n",Int_t trainNo=603,TString version="INT7Emc",TString runList="")
85 {
86  gStyle->SetOptStat(0); //..Do not plot stat boxes
87  //......................................................
88  // Test if the file committed to OADB is correct
89  //......................................................
90  Int_t nSM = 20;
91  TH1C *h[20];
92  Int_t cellColumnAbs,cellRowAbs,trash,cellID;
93  TString summaryPDF=Form("./AnalysisOutput/%s/Train_%i/OADB_Summary.pdf",period.Data(),trainNo);
94 
95  //......................................................
96  //..open the text file and save the run IDs into the RunId[] array
97  cout<<"o o o Open .txt file with run indices. Name = " << runList << endl;
98  TString RunPath = Form("./AnalysisInput/%s/Train_%i/%s",period.Data(),trainNo,runList.Data());
99  cout<<"o o o Open .txt file with run indices = " << RunPath << endl;
100  FILE *pFile = fopen(RunPath.Data(), "r");
101  if(!pFile)
102  {
103  cout<<"couldn't open file "<<RunPath<<"!"<<endl;
104  return;
105  }
106  Int_t q;
107  Int_t ncols;
108  Int_t nlines = 0 ;
109  Int_t RunId[500] ;
110  std::vector<Int_t> RunIdVec;
111  while (1)
112  {
113  ncols = fscanf(pFile," %d ",&q);
114  if (ncols< 0) break;
115  RunId[nlines]=q;
116  RunIdVec.push_back(q);
117  nlines++;
118  }
119  fclose(pFile);
120  //..sort the vector by size to be shure to use the right order
121  std::sort (RunIdVec.begin(), RunIdVec.end());
122  Int_t nRuns=RunIdVec.size();
123  //......................................................
124  //..Get the OADB information
125  //TString fBasePath="/Users/Eliane/Software/alice/sw/osx_x86-64/AliPhysics/latest-ali-master/OADB/EMCAL"; //..from AliPhysics
126  TString fBasePath="."; //..locally from OADB commit/e-mail to test quickly
127 
128  AliOADBContainer *cont=new AliOADBContainer("");
129  cont->InitFromFile(Form("%s/EMCALBadChannels.root",fBasePath.Data()),"AliEMCALBadChannels");
130  //......................................................
131  //..Get the .root file with the original histogram to compare if they coincide
132  //TString path = Form("/Users/Eliane/Software/BadChannelAnalysis/AnalysisOutput/%s/Train_%i/VersionINT7Glob",period.Data(),trainNo);
133  //TString path = Form("/Users/Eliane/Software/BadChannelAnalysis/AnalysisOutput/%s/Train_%i/Version4ManMasked",period.Data(),trainNo);
134  TString path = Form("./AnalysisOutput/%s/Train_%i/Version%s",period.Data(),trainNo,version.Data());
135  TString rootFileName= Form("%s_INT7_Histograms_V%s.root",period.Data(),version.Data());
136  TFile* outputRoot = TFile::Open(Form("%s/%s",path.Data(),rootFileName.Data()));
137 
138  if(!outputRoot)cout<<"File "<<outputRoot->GetName()<<" does not exist"<<endl;
139  TH2F* h2DChannelMap_FlagBad =(TH2F*)outputRoot->Get("2DChannelMap_Flag2");
140  TH2F* h2DChannelMap_FlagDead=(TH2F*)outputRoot->Get("2DChannelMap_Flag1");
141 
142  //......................................................
143  //..Initialize EMCal/DCal geometry
144  AliCalorimeterUtils* fCaloUtils = new AliCalorimeterUtils();
145  //..Create a dummy event for the CaloUtils
146  AliAODEvent* aod = new AliAODEvent();
147  fCaloUtils->SetRunNumber(RunIdVec.at(0));
148  fCaloUtils->AccessGeometry(aod);
149  AliEMCALGeometry * geom = fCaloUtils->GetEMCALGeometry();
150 
151  //.......................................................
152  //..build two dimensional histogram with values row vs. column
153  //..with info from OADB
154  Int_t fNMaxCols = 48; //eta direction
155  Int_t fNMaxRows = 24; //phi direction
156 
157  Int_t fNMaxColsAbs = 2*fNMaxCols;
158  Int_t fNMaxRowsAbs = Int_t (nSM/2)*fNMaxRows; //multiply by number of supermodules
159  TString histoName;
160  histoName = Form("2DChannelMap_Flag_Bad");
161  TH2F *plot2D_Bad_OADB = new TH2F(histoName,histoName,fNMaxColsAbs+1,-0.5,fNMaxColsAbs+0.5, fNMaxRowsAbs+1,-0.5,fNMaxRowsAbs+0.5);
162  //*OADB looks like Marcels figures*/ TH2F *plot2D_Bad_OADB = new TH2F(histoName,histoName,fNMaxColsAbs,0,fNMaxColsAbs, fNMaxRowsAbs,0,fNMaxRowsAbs);
163  plot2D_Bad_OADB->GetXaxis()->SetTitle("cell column (#eta direction)");
164  plot2D_Bad_OADB->GetYaxis()->SetTitle("cell row (#phi direction)");
165  histoName = Form("2DChannelMap_Flag_Dead");
166  TH2F *plot2D_Dead_OADB = new TH2F(histoName,histoName,fNMaxColsAbs+1,-0.5,fNMaxColsAbs+0.5, fNMaxRowsAbs+1,-0.5,fNMaxRowsAbs+0.5);
167  //*OADB looks like Marcels figures*/ TH2F *plot2D_Dead_OADB = new TH2F(histoName,histoName,fNMaxColsAbs,0,fNMaxColsAbs, fNMaxRowsAbs,0,fNMaxRowsAbs);
168  plot2D_Dead_OADB->GetXaxis()->SetTitle("cell column (#eta direction)");
169  plot2D_Dead_OADB->GetYaxis()->SetTitle("cell row (#phi direction)");
170 
171  //.......................................................
172  //.. Read the Bad Channel map from OADB
173  TCanvas* C2 = new TCanvas("CompareCanvas","Compare OADB to LocalFile",1400,800);
174  C2->Divide(4,2);
175  TLatex* textA = new TLatex(0.5,0.8,"If empty -> good!");
176  textA->SetTextSize(0.04);
177  textA->SetTextColor(1);
178  textA->SetNDC();
179 
180  cout<<"Checking "<<nRuns<<" runs: "<<endl;
181  std::vector<Int_t> RunsWithoutMap;
182  std::vector<Int_t> RunsWithMap;
183 
184  for(Int_t iRun = 0; iRun < nRuns; iRun++)
185  {
186  //cout<<"------ run "<<RunIdVec.at(iRun)<<endl;
187  if(iRun%5==0)cout<<"."<<flush;
188  if(iRun%20==0)cout<<"Run No."<<iRun<<endl;
189  TObjArray *recal=(TObjArray*)cont->GetObject(RunIdVec.at(iRun));
190  if(!recal)
191  {
192  cout<<"Error - No bad map for run Number "<<RunIdVec.at(iRun)<<" online!!"<<endl;
193  RunsWithoutMap.push_back(RunIdVec.at(iRun));
194  continue;
195  }
196  RunsWithMap.push_back(RunIdVec.at(iRun));
197 
198  plot2D_Bad_OADB ->Reset();
199  plot2D_Dead_OADB->Reset();
200  for(Int_t iSM = 0; iSM < nSM; iSM++)
201  {
202  //..Bad map fore each module
203  h[iSM]=(TH1C *)recal->FindObject(Form("EMCALBadChannelMap_Mod%d",iSM));
204  //..Loop though the SM to set which cells are bad
205  for(Int_t column=0;column<48;column++)
206  {
207  for(Int_t row=0;row<24;row++)
208  {
209  Int_t inRow=row;
210  Int_t inCol=column;
211  cellID=geom->GetAbsCellIdFromCellIndexes(iSM,inRow,inCol);
212  fCaloUtils->GetModuleNumberCellIndexesAbsCaloMap(cellID,0,inCol,inRow,trash,cellColumnAbs,cellRowAbs);
213  if(h[iSM]->GetBinContent(column,row)>1)//..bad and warm
214  {
215  plot2D_Bad_OADB->SetBinContent(cellColumnAbs,cellRowAbs,1);
216  }
217  if(h[iSM]->GetBinContent(column,row)==1)//..dead
218  {
219  plot2D_Dead_OADB->SetBinContent(cellColumnAbs,cellRowAbs,1);
220  }
221  }
222  }
223  }
224  //..................................................................
225  TLatex* text=new TLatex(0.15,0.85,Form("Run Number %i",RunIdVec.at(iRun)));
226  text->SetTextSize(0.05);
227  text->SetNDC();
228  text->SetTextColor(1);
229  text->SetTextAngle(0);
230 
231 
232  C2->cd(1);
233  plot2D_Dead_OADB->SetTitle("Dead Cells OADB");
234  plot2D_Dead_OADB->DrawCopy("colz");
235  text->Draw();
236  C2->cd(5);
237  plot2D_Bad_OADB->SetTitle("Bad Cells OADB");
238  plot2D_Bad_OADB->DrawCopy("colz");
239  C2->cd(2);
240  h2DChannelMap_FlagDead->SetTitle("Dead Cells LocalFile");
241  h2DChannelMap_FlagDead->DrawCopy("colz");
242  C2->cd(6);
243  h2DChannelMap_FlagBad->SetTitle("Bad Cells LocalFile");
244  h2DChannelMap_FlagBad->DrawCopy("colz");
245 
246  //..................................................................
247  C2->cd(4);
248  plot2D_Dead_OADB->SetTitle("OADB-Local File (Dead)");
249  plot2D_Dead_OADB->Add(h2DChannelMap_FlagDead,-1);
250  plot2D_Dead_OADB->DrawCopy("colz");
251  plot2D_Dead_OADB->Add(h2DChannelMap_FlagDead,+1);
252  textA->Draw();
253  C2->cd(8);
254  plot2D_Bad_OADB->SetTitle("OADB-Local File (Bad)");
255  plot2D_Bad_OADB->Add(h2DChannelMap_FlagBad,-1);
256  plot2D_Bad_OADB->DrawCopy("colz");
257  plot2D_Bad_OADB->Add(h2DChannelMap_FlagBad,+1);
258  textA->Draw();
259  C2->cd(3);
260  plot2D_Dead_OADB->SetTitle("OADB/Local File (Dead)");
261  plot2D_Dead_OADB->Divide(h2DChannelMap_FlagDead);
262  plot2D_Dead_OADB->DrawCopy("colz");
263  C2->cd(7);
264  plot2D_Bad_OADB->SetTitle("OADB/Local File (Bad)");
265  plot2D_Bad_OADB->Divide(h2DChannelMap_FlagBad);
266  plot2D_Bad_OADB->DrawCopy("colz");
267 
268  //..................................................................
269  //..Save to PDF
270  //..Add figures to the summary canvas
271  if(iRun==0) C2 ->Print(Form("%s(",summaryPDF.Data()));
272  else if (iRun==nRuns-1) C2 ->Print(Form("%s)",summaryPDF.Data()));
273  else C2 ->Print(Form("%s",summaryPDF.Data()));
274  }//end of run loop
275  cout<<"==Total Summary=="<<endl;
276  //..print runs without a correct map.
277  cout<<"Runs with a bad map ("<<RunsWithMap.size()<<"): "<<flush;
278  for(Int_t i=0;i<(Int_t)RunsWithMap.size();i++)
279  {
280  cout<<RunsWithMap.at(i)<<","<<flush;
281  }
282  cout<<endl;
283  cout<<"Runs without a bad map ("<<RunsWithoutMap.size()<<"): "<<flush;
284  for(Int_t i=0;i<(Int_t)RunsWithoutMap.size();i++)
285  {
286  cout<<RunsWithoutMap.at(i)<<","<<flush;
287  }
288  cout<<endl;
289 }
295 void Plot_CellList(TString period="LHC15n",Int_t trainNo=603,TString cellList="")
296 {
297  gStyle->SetPadTopMargin(0.05);//0.05
298  gStyle->SetPadBottomMargin(0.18);//0.15
299  gStyle->SetPadRightMargin(0.05);
300  gStyle->SetPadLeftMargin(0.17);
301  gStyle->SetFrameFillColor(10);
302 
303  const Int_t nBlocks=4; //..number of different runblocks of the period
304 
305  //......................................................
306  //..open the text file and save the run IDs into the RunId[] array
307  TString ListName = Form("./AnalysisOutput/%s/Train_%i/%s",period.Data(),trainNo,cellList.Data());
308  cout<<"o o o Open .txt suggested cell IDs. Name = " << ListName << endl;
309  FILE *pFile = fopen(ListName.Data(), "r");
310  if(!pFile)
311  {
312  cout<<"couldn't open file "<<ListName<<"!"<<endl;
313  return;
314  }
315  Int_t q;
316  Int_t ncols;
317  Int_t nlines = 0 ;
318  Int_t cellId[500] ;
319  std::vector<Int_t> cellIdVec;
320  while (1)
321  {
322  ncols = fscanf(pFile," %d ",&q);
323  if (ncols< 0) break;
324  cellId[nlines]=q;
325  cellIdVec.push_back(q);
326  nlines++;
327  }
328  fclose(pFile);
329  //..sort the vector by size to be shure to use the right order
330  std::sort (cellIdVec.begin(), cellIdVec.end());
331  Int_t nCells=cellIdVec.size();
332 
333  //......................................................
334  //..Get the .root file with the original histogram to compare if they coincide
335  TString path = Form("./AnalysisOutput/%s/Train_%i",period.Data(),trainNo);
336  TString rootFileName[nBlocks];
337  TFile* outputRoot[nBlocks];
338  TH2F* h2DAmp[nBlocks];
339  TH2F* h2DRatio[nBlocks];
340  TH2F* h2DCellTime[nBlocks];
341  //TString rootFileName= Form("Version%s/%s_INT7_Histograms_V%s.root",period.Data(),version.Data());
342  for(Int_t iBlock=0;iBlock<nBlocks;iBlock++)
343  {
344  //..mostly set by hand
345  //15l
346  if(iBlock==0)rootFileName[iBlock]= Form("Version1OADB/%s_INT7_Histograms_V1.root",period.Data());
347  if(iBlock==1)rootFileName[iBlock]= Form("Version2OADB/%s_INT7_Histograms_V2.root",period.Data());
348  if(iBlock==2)rootFileName[iBlock]= Form("Version3OADB/%s_INT7_Histograms_V3.root",period.Data());
349  if(iBlock==3)rootFileName[iBlock]= Form("Version4OADB/%s_INT7_Histograms_V4.root",period.Data());
350 
351  //..15o
352  /*if(iBlock==0)rootFileName[iBlock]= Form("Version1ManMasked/%s_INT7_Histograms_V1.root",period.Data());
353  if(iBlock==1)rootFileName[iBlock]= Form("Version2ManMasked/%s_INT7_Histograms_V2.root",period.Data());
354  if(iBlock==2)rootFileName[iBlock]= Form("Version3ManMasked/%s_INT7_Histograms_V3.root",period.Data());
355  if(iBlock==3)rootFileName[iBlock]= Form("Version4ManMasked/%s_INT7_Histograms_V4.root",period.Data());
356  */
357  /*16s
358  if(iBlock==0)rootFileName[iBlock]= Form("Version1OADB/%s_INT7_Histograms_V1.root",period.Data());
359  if(iBlock==1)rootFileName[iBlock]= Form("Version2OADB/%s_INT7_Histograms_V2.root",period.Data());
360  if(iBlock==2)rootFileName[iBlock]= Form("Version4OADB/%s_INT7_Histograms_V4.root",period.Data());
361  */
362  outputRoot[iBlock] = TFile::Open(Form("%s/%s",path.Data(),rootFileName[iBlock].Data()));
363  if(!outputRoot[iBlock])cout<<"File "<<outputRoot[iBlock]->GetName()<<" does not exist"<<endl;
364  h2DAmp[iBlock] =(TH2F*)outputRoot[iBlock]->Get("hCellAmplitude");
365  h2DRatio[iBlock] =(TH2F*)outputRoot[iBlock]->Get("ratio2DAmp");
366  h2DCellTime[iBlock]=(TH2F*)outputRoot[iBlock]->Get("hCellTime");
367  }
368 
369  TCanvas *c1 = new TCanvas(1);
370  c1->Divide(2);
371  c1->cd(1);
372  SetHisto(h2DAmp[0],"","");
373  h2DAmp[0]->Draw("colz");
374  c1->cd(2);
375  SetHisto(h2DRatio[0],"","");
376  h2DRatio[0]->Draw("colz");
377 
378  //.. be aware of the special sturcture of the canvas
379  //.. canvas has totalperCv*2 pads
380 // Int_t totalperCv = 4;
381  Int_t totalperCv = 8;
382  Int_t nPad = TMath::Sqrt(totalperCv);
383  Int_t nCv = nCells/totalperCv+1;
384  if(nCv<1)nCv=1;
385 
386  cout<<" o create: "<<nCv<<" Canvases with "<<nPad*nPad<<" pads"<<endl;
387  //..to compare specific cells over the runs
388  TCanvas **cCompAll = new TCanvas*[nCv];
389  TCanvas **cCompTimeAll = new TCanvas*[nCv];
390  for(Int_t i=0;i<nCv;i++)
391  {
392  cCompAll[i] = new TCanvas(TString::Format("CompareGoodAll%d", i), TString::Format("V) Both (%d/%d)", i+1, nCv), 1000,750);
393  CanvasPartition(cCompAll[i],4,totalperCv/2,0.15,0.02,0.13,0.05);
394  cCompTimeAll[i] = new TCanvas(TString::Format("CompareGoodTimeAll%d", i), TString::Format("V) Time (%d/%d)", i+1, nCv), 1000,750);
395  cCompTimeAll[i]->Divide(4,4,0.001,0.001);
396  //CanvasPartition(cCompTimeAll[i],4,totalperCv/2,0.15,0.02,0.13,0.05);
397  }
398  TLegend *leg2 = new TLegend(0.60,0.60,0.9,0.85);
399  cout<<" o Fill Canvases with bad cells histograms"<<endl;
400 
401  Int_t zoomRange=20;
402  Double_t range=5; //10 GeV
403  Double_t tRange1=-200;
404  Double_t tRange2=400;
405  //..uncalibrated:
406  tRange1 =400;
407  tRange2 =900;
408  Int_t shift=0;
409  TH1D *htmpCellAllRuns[nBlocks];
410  TH1D *htmpCellTimeRuns[nBlocks];
411  TH1D *htmpCellRatioAllRuns[nBlocks];
412  cout<<"cell number: "<<endl;
413  for(Int_t icell = 0; icell < nCells; icell++)
414  {
415  Int_t cellID=cellIdVec.at(icell);
416  cout<<cellID<<", "<<flush;
417 
418  for(Int_t iBlock=0;iBlock<nBlocks;iBlock++)
419  {
420  htmpCellAllRuns[iBlock] =h2DAmp[iBlock] ->ProjectionX(TString::Format("hIDProj%i_cell%d",iBlock, cellID), cellID+1, cellID+1);
421  SetHisto(htmpCellAllRuns[iBlock],Form("Energy [cell %i]",cellID),"Number of Hits/Events");
422  htmpCellRatioAllRuns[iBlock] =h2DRatio[iBlock]->ProjectionX(TString::Format("hIDRProj%i_cell%d", iBlock, cellID), cellID+1, cellID+1);
423  SetHisto(htmpCellRatioAllRuns[iBlock],Form("Energy [cell %i]",cellID),"No. Hits/av. No. Hits");
424 
425  htmpCellTimeRuns[iBlock] =h2DCellTime[iBlock]->ProjectionX(TString::Format("hIDTimeProj%i_cell%d", iBlock, cellID), cellID+1, cellID+1);
426  SetHisto(htmpCellTimeRuns[iBlock],Form("Time, ns [cell %i]",cellID),"Entries/Events");
427 
428  if(((icell)%8)<4) shift=0;
429  else shift=8;
430  //..Amplitude
431  cCompAll[(icell)/totalperCv]->cd(((icell)%4)+1+shift)->SetLogy();
432  if(iBlock==0)htmpCellAllRuns[iBlock]->GetXaxis()->SetRangeUser(0,range);
433  if(iBlock==0)htmpCellAllRuns[iBlock]->Draw("hist");
434  if(iBlock==1)htmpCellAllRuns[iBlock]->SetLineColor(kBlue-7);
435  if(iBlock==2)htmpCellAllRuns[iBlock]->SetLineColor(kGreen-2);
436  if(iBlock==3)htmpCellAllRuns[iBlock]->SetLineColor(kViolet-1);
437  if(iBlock>0)htmpCellAllRuns[iBlock]->DrawCopy("same hist");
438 
439  if(icell==0)
440  {
441  leg2->AddEntry(htmpCellAllRuns[iBlock],Form("Block%i",iBlock),"l");
442  leg2->SetTextSize(0.07);
443  leg2->SetBorderSize(0);
444  leg2->SetFillColorAlpha(10, 0);
445  leg2->Draw("same");
446  }
447  else if((icell)%4==0)
448  {
449  leg2->Draw("same");
450  }
451 
452  //..Ratio
453  cCompAll[(icell)/totalperCv]->cd(((icell)%4)+5+shift)->SetLogy();
454  if(iBlock==0)htmpCellRatioAllRuns[iBlock]->GetXaxis()->SetRangeUser(0,range);
455  if(iBlock==0)htmpCellRatioAllRuns[iBlock]->Draw("hist");
456  if(iBlock==1)htmpCellRatioAllRuns[iBlock]->SetLineColor(kBlue-7);
457  if(iBlock==2)htmpCellRatioAllRuns[iBlock]->SetLineColor(kGreen-2);
458  if(iBlock==3)htmpCellRatioAllRuns[iBlock]->SetLineColor(kViolet-1);
459  if(iBlock>0)htmpCellRatioAllRuns[iBlock]->DrawCopy("same hist");
460 
461  //..Time
462  cCompTimeAll[(icell)/totalperCv]->cd(((icell)%4)+1+shift)->SetLogy();
463  if(iBlock==0)htmpCellTimeRuns[iBlock]->GetXaxis()->SetRangeUser(tRange1,tRange2);
464  if(iBlock==0)htmpCellTimeRuns[iBlock]->Draw("hist");
465  if(iBlock==1)htmpCellTimeRuns[iBlock]->SetLineColor(kBlue-7);
466  if(iBlock==2)htmpCellTimeRuns[iBlock]->SetLineColor(kGreen-2);
467  if(iBlock==3)htmpCellTimeRuns[iBlock]->SetLineColor(kViolet-1);
468  if(iBlock>0)htmpCellTimeRuns[iBlock]->DrawCopy("same hist");
469  }
470  }
471  cout<<endl;
472 // TString pdfName= Form("%s_MoreBadCellsCandidates.pdf",period.Data());
473  TString pdfName= Form("./AnalysisOutput/%s/Train_%i/%s_MoreBadCellsCandidates.pdf",period.Data(),trainNo,period.Data());
474  //..plot the canvases of cells into a .pdf file
475  for(Int_t can=0;can<nCv;can++)
476  {
477  //TString internal_pdfName1=pdfName+"Low.pdf";
478  if(can==0)
479  {
480  //..first pad
481  cCompAll[can] ->Print(Form("%s(",pdfName.Data()));
482  cCompTimeAll[can] ->Print(Form("%s",pdfName.Data()));
483  }
484  else if(can==(nCv-1))//..last canvas
485  {
486  //..last pad
487  cCompAll[can] ->Print(Form("%s",pdfName.Data()));
488  cCompTimeAll[can] ->Print(Form("%s)",pdfName.Data()));
489  }
490  else
491  {
492  //..all pads in between
493  cCompAll[can] ->Print(Form("%s",pdfName.Data()));
494  cCompTimeAll[can] ->Print(Form("%s",pdfName.Data()));
495  }
496  }
497 }
501 //________________________________________________________________________
502 void SetHisto(TH1 *Histo,TString Xtitel,TString Ytitel)
503 {
504  Histo->SetStats(0);
505  Histo->SetTitle("");
506 
507  Histo->GetYaxis()->SetTitleOffset(1.1);
508  Histo->GetXaxis()->SetTitleOffset(1.1);
509  Histo->GetXaxis()->SetLabelSize(0.05);
510  Histo->GetYaxis()->SetLabelSize(0.05);
511  Histo->GetXaxis()->SetTitleSize(0.06);
512  Histo->GetYaxis()->SetTitleSize(0.06);
513  Histo->GetXaxis()->SetNdivisions(505);
514  Histo->GetYaxis()->SetNdivisions(505);
515 
516  Histo->GetXaxis()->SetLabelFont(42);
517  Histo->GetYaxis()->SetLabelFont(42);
518  Histo->GetXaxis()->SetTitleFont(42);
519  Histo->GetYaxis()->SetTitleFont(42);
520  if(Xtitel!="")Histo->GetXaxis()->SetTitle(Xtitel);
521  if(Ytitel!="")Histo->GetYaxis()->SetTitle(Ytitel);
522 
523  Histo->SetLineColor(1);
524  Histo->SetMarkerColor(1);
525  Histo->SetMarkerStyle(20);
526  Histo->SetMarkerSize(0.5);
527 }
531 //___________________________________________
532 void CanvasPartition(TCanvas *C,const Int_t Nx,const Int_t Ny,
533  Float_t lMargin, Float_t rMargin,
534  Float_t bMargin, Float_t tMargin)
535 {
536  if (!C) return;
537 
538  C->Divide(Nx,Ny,0.000,0.000);
539  //..Top row
540  for (Int_t i=0;i<Nx;i++)
541  {
542  C->cd(i+1)->SetLogy();
543  gPad->SetLeftMargin(lMargin);
544  gPad->SetRightMargin(rMargin);
545  gPad->SetBottomMargin(0);
546  gPad->SetTopMargin(tMargin);
547  //pad->Draw();??
548  }
549  //..Bottom row
550  for (Int_t i=0;i<Nx;i++)
551  {
552  C->cd(i+1+Nx);
553  gPad->SetLeftMargin(lMargin);
554  gPad->SetRightMargin(rMargin);
555  gPad->SetBottomMargin(bMargin);
556  gPad->SetTopMargin(0);
557  }
558  //..Top row
559  for (Int_t i=0;i<Nx;i++)
560  {
561  C->cd(i+1+2*Nx)->SetLogy();
562  gPad->SetLeftMargin(lMargin);
563  gPad->SetRightMargin(rMargin);
564  gPad->SetBottomMargin(0);
565  gPad->SetTopMargin(tMargin);
566  }
567  //..Bottom row
568  for (Int_t i=0;i<Nx;i++)
569  {
570  C->cd(i+1+3*Nx);
571  gPad->SetLeftMargin(lMargin);
572  gPad->SetRightMargin(rMargin);
573  gPad->SetBottomMargin(bMargin);
574  gPad->SetTopMargin(0);
575  }
576 }
double Double_t
Definition: External.C:58
void SetRunNumber(Int_t run)
Definition: External.C:236
TLatex * text[5]
option to what and if export to output file
void CanvasPartition(TCanvas *C, const Int_t Nx=2, const Int_t Ny=2, Float_t lMargin=0.15, Float_t rMargin=0.05, Float_t bMargin=0.15, Float_t tMargin=0.05)
void Test_OADB(TString period="LHC15n", Int_t trainNo=603, TString version="INT7Emc", TString runList="")
AliEMCALGeometry * GetEMCALGeometry() const
void SetHisto(TH1 *Histo, TString Xtitel, TString Ytitel)
int Int_t
Definition: External.C:63
void Sort_RunNumbers(TString period="LHC15n", Int_t trainNo=603, TString runList="")
float Float_t
Definition: External.C:68
Definition: External.C:212
const char * pdfName
Definition: DrawAnaELoss.C:30
void Plot_CellList(TString period="LHC15n", Int_t trainNo=603, TString cellList="")
Class with utils specific to calorimeter clusters/cells.
void AccessGeometry(AliVEvent *inputEvent)
Definition: External.C:196
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