AliPhysics  d565ceb (d565ceb)
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 
304  //......................................................
305  //..Settings
306  const Int_t nBlocks=1; //..number of different runblocks of the period
307 
308  Int_t zoomRange=20;
309  Double_t range=5; //10 GeV
310  Double_t tRange1=-200;
311  Double_t tRange2=400;
312  //..uncalibrated:
313  //tRange1 =400;
314  //tRange2 =900;
315  Int_t shift=0;
316 
317  //......................................................
318  //..open the text file and save the run IDs into the RunId[] array
319  TString ListName = Form("./AnalysisOutput/%s/Train_%i/%s",period.Data(),trainNo,cellList.Data());
320  cout<<"o o o Open .txt suggested cell IDs. Name = " << ListName << endl;
321  FILE *pFile = fopen(ListName.Data(), "r");
322  if(!pFile)
323  {
324  cout<<"couldn't open file "<<ListName<<"!"<<endl;
325  return;
326  }
327  Int_t q;
328  Int_t ncols;
329  Int_t nlines = 0 ;
330  Int_t cellId[500] ;
331  std::vector<Int_t> cellIdVec;
332  while (1)
333  {
334  ncols = fscanf(pFile," %d ",&q);
335  if (ncols< 0) break;
336  cellId[nlines]=q;
337  cellIdVec.push_back(q);
338  nlines++;
339  }
340  fclose(pFile);
341  //..sort the vector by size to be shure to use the right order
342  std::sort (cellIdVec.begin(), cellIdVec.end());
343  Int_t nCells=cellIdVec.size();
344 
345  //......................................................
346  //..Get the .root file with the original histogram to compare if they coincide
347  TString path = Form("./AnalysisOutput/%s/Train_%i",period.Data(),trainNo);
348  TString rootFileName[nBlocks];
349  TFile* outputRoot[nBlocks];
350  TH2F* h2DAmp[nBlocks];
351  TH2F* h2DRatio[nBlocks];
352  TH2F* h2DCellTime[nBlocks];
353  //TString rootFileName= Form("Version%s/%s_INT7_Histograms_V%s.root",period.Data(),version.Data());
354  for(Int_t iBlock=0;iBlock<nBlocks;iBlock++)
355  {
356  //..mostly set by hand
357  //..15l
358  /*
359  if(iBlock==0)rootFileName[iBlock]= Form("Version1OADB/%s_INT7_Histograms_V1.root",period.Data());
360  if(iBlock==1)rootFileName[iBlock]= Form("Version2OADB/%s_INT7_Histograms_V2.root",period.Data());
361  if(iBlock==2)rootFileName[iBlock]= Form("Version3OADB/%s_INT7_Histograms_V3.root",period.Data());
362  if(iBlock==3)rootFileName[iBlock]= Form("Version4OADB/%s_INT7_Histograms_V4.root",period.Data());
363  */
364  //..15o
365  /*if(iBlock==0)rootFileName[iBlock]= Form("Version1ManMasked/%s_INT7_Histograms_V1.root",period.Data());
366  if(iBlock==1)rootFileName[iBlock]= Form("Version2ManMasked/%s_INT7_Histograms_V2.root",period.Data());
367  if(iBlock==2)rootFileName[iBlock]= Form("Version3ManMasked/%s_INT7_Histograms_V3.root",period.Data());
368  if(iBlock==3)rootFileName[iBlock]= Form("Version4ManMasked/%s_INT7_Histograms_V4.root",period.Data());
369  */
370  /*
371  //..16s
372  if(iBlock==0)rootFileName[iBlock]= Form("Version1OADB/%s_INT7_Histograms_V1.root",period.Data());
373  if(iBlock==1)rootFileName[iBlock]= Form("Version2OADB/%s_INT7_Histograms_V2.root",period.Data());
374  if(iBlock==2)rootFileName[iBlock]= Form("Version4OADB/%s_INT7_Histograms_V4.root",period.Data());
375  */
376  //..16k
377  if(iBlock==0)rootFileName[iBlock]= Form("Version0/%s_INT7_Histograms_V0.root",period.Data());
378 
379  outputRoot[iBlock] = TFile::Open(Form("%s/%s",path.Data(),rootFileName[iBlock].Data()));
380  if(!outputRoot[iBlock])cout<<"File "<<outputRoot[iBlock]->GetName()<<" does not exist"<<endl;
381  h2DAmp[iBlock] =(TH2F*)outputRoot[iBlock]->Get("hCellAmplitude");
382  h2DRatio[iBlock] =(TH2F*)outputRoot[iBlock]->Get("ratio2DAmp");
383  h2DCellTime[iBlock]=(TH2F*)outputRoot[iBlock]->Get("hCellTime");
384  }
385 
386  TCanvas *c1 = new TCanvas(1);
387  c1->Divide(2);
388  c1->cd(1);
389  SetHisto(h2DAmp[0],"","");
390  h2DAmp[0]->Draw("colz");
391  c1->cd(2);
392  SetHisto(h2DRatio[0],"","");
393  h2DRatio[0]->Draw("colz");
394 
395  //.. be aware of the special sturcture of the canvas
396  //.. canvas has totalperCv*2 pads
397 // Int_t totalperCv = 4;
398  Int_t totalperCv = 8;
399  Int_t nPad = TMath::Sqrt(totalperCv);
400  Int_t nCv = nCells/totalperCv+1;
401  if(nCv<1)nCv=1;
402 
403  cout<<" o create: "<<nCv<<" Canvases with "<<nPad*nPad<<" pads"<<endl;
404  //..to compare specific cells over the runs
405  TCanvas **cCompAll = new TCanvas*[nCv];
406  TCanvas **cCompTimeAll = new TCanvas*[nCv];
407  for(Int_t i=0;i<nCv;i++)
408  {
409  cCompAll[i] = new TCanvas(TString::Format("CompareGoodAll%d", i), TString::Format("V) Both (%d/%d)", i+1, nCv), 1000,750);
410  CanvasPartition(cCompAll[i],4,totalperCv/2,0.15,0.02,0.13,0.05);
411  cCompTimeAll[i] = new TCanvas(TString::Format("CompareGoodTimeAll%d", i), TString::Format("V) Time (%d/%d)", i+1, nCv), 1000,750);
412  cCompTimeAll[i]->Divide(4,4,0.001,0.001);
413  //CanvasPartition(cCompTimeAll[i],4,totalperCv/2,0.15,0.02,0.13,0.05);
414  }
415  TLegend *leg2 = new TLegend(0.60,0.60,0.9,0.85);
416  cout<<" o Fill Canvases with bad cells histograms"<<endl;
417 
418  TH1D *htmpCellAllRuns[nBlocks];
419  TH1D *htmpCellTimeRuns[nBlocks];
420  TH1D *htmpCellRatioAllRuns[nBlocks];
421  cout<<"cell number: "<<endl;
422  for(Int_t icell = 0; icell < nCells; icell++)
423  {
424  Int_t cellID=cellIdVec.at(icell);
425  cout<<cellID<<", "<<flush;
426 
427  for(Int_t iBlock=0;iBlock<nBlocks;iBlock++)
428  {
429  htmpCellAllRuns[iBlock] =h2DAmp[iBlock] ->ProjectionX(TString::Format("hIDProj%i_cell%d",iBlock, cellID), cellID+1, cellID+1);
430  SetHisto(htmpCellAllRuns[iBlock],Form("Energy [cell %i]",cellID),"Number of Hits/Events");
431  htmpCellRatioAllRuns[iBlock] =h2DRatio[iBlock]->ProjectionX(TString::Format("hIDRProj%i_cell%d", iBlock, cellID), cellID+1, cellID+1);
432  SetHisto(htmpCellRatioAllRuns[iBlock],Form("Energy [cell %i]",cellID),"No. Hits/av. No. Hits");
433 
434  htmpCellTimeRuns[iBlock] =h2DCellTime[iBlock]->ProjectionX(TString::Format("hIDTimeProj%i_cell%d", iBlock, cellID), cellID+1, cellID+1);
435  SetHisto(htmpCellTimeRuns[iBlock],Form("Time, ns [cell %i]",cellID),"Entries/Events");
436 
437  if(((icell)%8)<4) shift=0;
438  else shift=8;
439  //..Amplitude
440  cCompAll[(icell)/totalperCv]->cd(((icell)%4)+1+shift)->SetLogy();
441  if(iBlock==0)htmpCellAllRuns[iBlock]->GetXaxis()->SetRangeUser(0,range);
442  if(iBlock==0)htmpCellAllRuns[iBlock]->Draw("hist");
443  if(iBlock==1)htmpCellAllRuns[iBlock]->SetLineColor(kBlue-7);
444  if(iBlock==2)htmpCellAllRuns[iBlock]->SetLineColor(kGreen-2);
445  if(iBlock==3)htmpCellAllRuns[iBlock]->SetLineColor(kViolet-1);
446  if(iBlock>0)htmpCellAllRuns[iBlock]->DrawCopy("same hist");
447 
448  if(icell==0)
449  {
450  leg2->AddEntry(htmpCellAllRuns[iBlock],Form("Block%i",iBlock),"l");
451  leg2->SetTextSize(0.07);
452  leg2->SetBorderSize(0);
453  leg2->SetFillColorAlpha(10, 0);
454  leg2->Draw("same");
455  }
456  else if((icell)%4==0)
457  {
458  leg2->Draw("same");
459  }
460 
461  //..Ratio
462  cCompAll[(icell)/totalperCv]->cd(((icell)%4)+5+shift)->SetLogy();
463  if(iBlock==0)htmpCellRatioAllRuns[iBlock]->GetXaxis()->SetRangeUser(0,range);
464  if(iBlock==0)htmpCellRatioAllRuns[iBlock]->Draw("hist");
465  if(iBlock==1)htmpCellRatioAllRuns[iBlock]->SetLineColor(kBlue-7);
466  if(iBlock==2)htmpCellRatioAllRuns[iBlock]->SetLineColor(kGreen-2);
467  if(iBlock==3)htmpCellRatioAllRuns[iBlock]->SetLineColor(kViolet-1);
468  if(iBlock>0)htmpCellRatioAllRuns[iBlock]->DrawCopy("same hist");
469 
470  //..Time
471  cCompTimeAll[(icell)/totalperCv]->cd(((icell)%4)+1+shift)->SetLogy();
472  if(iBlock==0)htmpCellTimeRuns[iBlock]->GetXaxis()->SetRangeUser(tRange1,tRange2);
473  if(iBlock==0)htmpCellTimeRuns[iBlock]->Draw("hist");
474  if(iBlock==1)htmpCellTimeRuns[iBlock]->SetLineColor(kBlue-7);
475  if(iBlock==2)htmpCellTimeRuns[iBlock]->SetLineColor(kGreen-2);
476  if(iBlock==3)htmpCellTimeRuns[iBlock]->SetLineColor(kViolet-1);
477  if(iBlock>0)htmpCellTimeRuns[iBlock]->DrawCopy("same hist");
478  }
479  }
480  cout<<endl;
481 // TString pdfName= Form("%s_MoreBadCellsCandidates.pdf",period.Data());
482  TString pdfName= Form("./AnalysisOutput/%s/Train_%i/%s_MoreBadCellsCandidates.pdf",period.Data(),trainNo,period.Data());
483  //..plot the canvases of cells into a .pdf file
484  for(Int_t can=0;can<nCv;can++)
485  {
486  //TString internal_pdfName1=pdfName+"Low.pdf";
487  if(can==0)
488  {
489  //..first pad
490  if(nCv>1)
491  {
492  cCompAll[can] ->Print(Form("%s(",pdfName.Data()));
493  cCompTimeAll[can]->Print(Form("%s",pdfName.Data()));
494  }
495  else
496  {
497  cCompAll[can] ->Print(Form("%s(",pdfName.Data()));
498  cCompTimeAll[can]->Print(Form("%s)",pdfName.Data()));
499  }
500  }
501  else if(can==(nCv-1))//..last canvas
502  {
503  //..last pad
504  cCompAll[can] ->Print(Form("%s",pdfName.Data()));
505  cCompTimeAll[can]->Print(Form("%s)",pdfName.Data()));
506  }
507  else
508  {
509  //..all pads in between
510  cCompAll[can] ->Print(Form("%s",pdfName.Data()));
511  cCompTimeAll[can] ->Print(Form("%s",pdfName.Data()));
512  }
513  }
514 }
518 //________________________________________________________________________
519 void SetHisto(TH1 *Histo,TString Xtitel,TString Ytitel)
520 {
521  Histo->SetStats(0);
522  Histo->SetTitle("");
523 
524  Histo->GetYaxis()->SetTitleOffset(1.1);
525  Histo->GetXaxis()->SetTitleOffset(1.1);
526  Histo->GetXaxis()->SetLabelSize(0.05);
527  Histo->GetYaxis()->SetLabelSize(0.05);
528  Histo->GetXaxis()->SetTitleSize(0.06);
529  Histo->GetYaxis()->SetTitleSize(0.06);
530  Histo->GetXaxis()->SetNdivisions(505);
531  Histo->GetYaxis()->SetNdivisions(505);
532 
533  Histo->GetXaxis()->SetLabelFont(42);
534  Histo->GetYaxis()->SetLabelFont(42);
535  Histo->GetXaxis()->SetTitleFont(42);
536  Histo->GetYaxis()->SetTitleFont(42);
537  if(Xtitel!="")Histo->GetXaxis()->SetTitle(Xtitel);
538  if(Ytitel!="")Histo->GetYaxis()->SetTitle(Ytitel);
539 
540  Histo->SetLineColor(1);
541  Histo->SetMarkerColor(1);
542  Histo->SetMarkerStyle(20);
543  Histo->SetMarkerSize(0.5);
544 }
548 //___________________________________________
549 void CanvasPartition(TCanvas *C,const Int_t Nx,const Int_t Ny,
550  Float_t lMargin, Float_t rMargin,
551  Float_t bMargin, Float_t tMargin)
552 {
553  if (!C) return;
554 
555  C->Divide(Nx,Ny,0.000,0.000);
556  //..Top row
557  for (Int_t i=0;i<Nx;i++)
558  {
559  C->cd(i+1)->SetLogy();
560  gPad->SetLeftMargin(lMargin);
561  gPad->SetRightMargin(rMargin);
562  gPad->SetBottomMargin(0);
563  gPad->SetTopMargin(tMargin);
564  //pad->Draw();??
565  }
566  //..Bottom row
567  for (Int_t i=0;i<Nx;i++)
568  {
569  C->cd(i+1+Nx);
570  gPad->SetLeftMargin(lMargin);
571  gPad->SetRightMargin(rMargin);
572  gPad->SetBottomMargin(bMargin);
573  gPad->SetTopMargin(0);
574  }
575  //..Top row
576  for (Int_t i=0;i<Nx;i++)
577  {
578  C->cd(i+1+2*Nx)->SetLogy();
579  gPad->SetLeftMargin(lMargin);
580  gPad->SetRightMargin(rMargin);
581  gPad->SetBottomMargin(0);
582  gPad->SetTopMargin(tMargin);
583  }
584  //..Bottom row
585  for (Int_t i=0;i<Nx;i++)
586  {
587  C->cd(i+1+3*Nx);
588  gPad->SetLeftMargin(lMargin);
589  gPad->SetRightMargin(rMargin);
590  gPad->SetBottomMargin(bMargin);
591  gPad->SetTopMargin(0);
592  }
593 }
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