AliPhysics  vAN-20150319 (55be083)
 All Classes Files Functions Variables Enumerations Enumerator Macros
trigEffQA.C
Go to the documentation of this file.
1 
2 #if !defined(__CINT__) || defined(__MAKECINT__)
3 // ROOT includes
4 #include "TFile.h"
5 #include "TH1.h"
6 #include "TH2.h"
7 #include "TGraphAsymmErrors.h"
8 #include "TSystem.h"
9 #include "Riostream.h"
10 #include "TCanvas.h"
11 #include "TStyle.h"
12 #include "TROOT.h"
13 #include "TLegend.h"
14 #include "TMath.h"
15 #include "TObjArray.h"
16 #include "TList.h"
17 #include "TObjString.h"
18 #include "TString.h"
19 #include "TGrid.h"
20 #include "TArrayD.h"
21 #include "TArrayI.h"
22 #include "TMap.h"
23 #include "TGridResult.h"
24 
25 #include "AliCDBManager.h"
26 #include "AliCDBEntry.h"
27 #include "AliCDBPath.h"
28 #include "AliCDBStorage.h"
29 #include "AliMUONTriggerEfficiencyCells.h"
30 #include "AliMUONTriggerChamberEfficiency.h"
31 #include "AliMUONTriggerUtilities.h"
32 #include "AliMUONDigitMaker.h"
33 #include "AliMUONVDigit.h"
34 #include "AliMUONDigitStoreV2R.h"
35 #include "AliMUONCalibrationData.h"
36 #include "AliAnalysisTriggerScalers.h"
37 #include "AliCounterCollection.h"
38 #include "AliTriggerConfiguration.h"
39 #endif
40 
41 const Int_t kNch = 4;
42 const Double_t kZero = 1.e-7; // Avoid problems when comparing to 0.
43 
44 //_____________________________________________________________________________
45 void SetMyStyle()
46 {
48  gStyle->SetCanvasColor(10);
49  gStyle->SetFrameFillColor(10);
50  gStyle->SetStatColor(10);
51  gStyle->SetFillColor(10);
52  gStyle->SetTitleFillColor(10);
53 
54  gStyle->SetTitleXSize(0.03);
55  gStyle->SetTitleXOffset(1.1);
56  gStyle->SetTitleYSize(0.03);
57  gStyle->SetTitleYOffset(1.9);
58 
59  gStyle->SetMarkerSize(0.7);
60  gStyle->SetHistLineWidth(2);
61 
62  gStyle->SetPadLeftMargin(0.12);
63  gStyle->SetPadRightMargin(0.04);
64  gStyle->SetPadBottomMargin(0.08);
65  gStyle->SetPadTopMargin(0.08);
66 
67  gROOT->ForceStyle();
68 }
69 
70 //_____________________________________________________________________________
71 Bool_t IsRunNum ( TString stringToken )
72 {
73  return ( stringToken.IsDigit() && stringToken.Length()>=6 && stringToken.Length()<=9 );
74 }
75 
76 
77 //_____________________________________________________________________________
78 void SetRunAxisRange ( TAxis* axis )
79 {
81  for ( Int_t ibin=1; ibin<=axis->GetNbins(); ibin++ ) {
82  TString binLabel = axis->GetBinLabel(ibin);
83  if ( ! binLabel.IsNull()) continue;
84  axis->SetRange(1, ibin-1);
85  return;
86  }
87 }
88 
89 //_____________________________________________________________________________
90 Int_t GetRunNumber(TString filePath)
91 {
93  TObjArray* array = filePath.Tokenize("/");
94  array->SetOwner();
95  TString auxString = "";
96  Int_t runNum = -1;
97  for ( Int_t ientry=0; ientry<array->GetEntries(); ientry++ ) {
98  auxString = array->At(ientry)->GetName();
99  if ( IsRunNum(auxString) ) {
100  runNum = auxString.Atoi();
101  break;
102  }
103  }
104  delete array;
105 
106  if ( runNum < 0 ) {
107  array = auxString.Tokenize("_");
108  array->SetOwner();
109  auxString = array->Last()->GetName();
110  auxString.ReplaceAll(".root","");
111  if ( IsRunNum(auxString) ) runNum = auxString.Atoi();
112  delete array;
113  }
114 
115  return runNum;
116 }
117 
118 //_____________________________________________________________________________
119 Bool_t ChangeFilenames ( TObjArray &fileNameArray )
120 {
127  TString newBaseName = "trigChEff_ANY_Apt_allTrig.root";
128  for ( Int_t ifile=0; ifile<fileNameArray.GetEntries(); ifile++ ) {
129  TObjString* currObjString = static_cast<TObjString*>(fileNameArray.At(ifile));
130  TString currFile = currObjString->GetString();
131  TString baseName = gSystem->BaseName(currFile.Data());
132  // In the old scripts, the run number is in the QA filename
133  Int_t runNum = GetRunNumber(baseName);
134  TString newFilename = "";
135  if ( runNum < 0 ) {
136  // New central script: the re-created trigger output is in the same directory
137  newFilename = currFile;
138  newFilename.ReplaceAll(baseName.Data(),newBaseName.Data());
139  }
140  else {
141  // Old script. The re-creaated trigger output is in terminateRuns
142  TString dirName = gSystem->DirName(currFile.Data());
143  newFilename = Form("%s/terminateRuns/%i/%s",dirName.Data(),runNum,newBaseName.Data());
144  }
145  if ( gSystem->AccessPathName(newFilename.Data()) ) {
146  printf("New output not found. Use the standard efficiency instead\n");
147  return kFALSE;
148  }
149  else printf("Using re-built output in %s\n",newBaseName.Data());
150  currObjString->SetString(newFilename);
151  }
152  return kTRUE;
153 }
154 
155 //_____________________________________________________________________________
156 Double_t* GetProdErr(Double_t* effErr, Int_t exclude, Int_t nFactors = kNch)
157 {
159  Double_t prod = 1.;
160  Double_t relErr = 0., relProdErrSquare = 0.;
161  for ( Int_t iprod=0; iprod<nFactors; iprod++ ) {
162  if ( iprod == exclude ) continue;
163  prod *= effErr[iprod];
164  relErr = ( effErr[iprod] > kZero ) ? effErr[iprod+nFactors]/effErr[iprod] : 0.;
165  relProdErrSquare += relErr*relErr;
166  //printf("%f +- %f ", effErr[iprod], effErr[iprod+nFactors]); // alBER TO CUT
167  }
168  Double_t* prodErr = new Double_t[2];
169  prodErr[0] = prod;
170  prodErr[1] = prod*TMath::Sqrt(relProdErrSquare);
171  //printf("-> %f %f\n", prodErr[0], prodErr[1]); // REMEMBER TO CUT
172  return prodErr;
173 }
174 
175 
176 //_____________________________________________________________________________
177 Double_t* GetConditionalEffErr(Double_t* effErr1, Double_t* effErr2, Double_t* effErrBoth, Int_t exclude = -1)
178 {
180  Double_t* effErr = new Double_t[2*kNch];
181  for ( Int_t ich=0; ich<kNch; ich++ ) {
182  if ( ich == exclude ) {
183  effErr[ich] = ( effErr1[ich] < 1. ) ? ( effErr2[ich] - effErrBoth[ich] ) / ( 1. - effErr1[ich] ) : 0.;
184  effErr[ich+kNch] = 0;
185  if ( effErr1[ich] < 1. ) {
186  Double_t err2 = effErr2[ich+kNch] / ( 1. - effErr1[ich] );
187  Double_t errBoth = effErrBoth[ich+kNch] / ( 1. - effErr1[ich] );
188  Double_t err1 = effErr1[ich+kNch] * effErr[ich] / ( 1. - effErr1[ich] );
189  effErr[ich+kNch] = TMath::Sqrt(err2*err2 + errBoth*errBoth + err1*err1);
190  }
191  }
192  else {
193  effErr[ich] = ( effErr1[ich] > kZero ) ? effErrBoth[ich]/effErr1[ich] : 0.;
194  Double_t relErr1 = ( effErr1[ich] > kZero ) ? effErr1[ich+kNch]/effErr1[ich] : 0.;
195  Double_t relErrBoth = ( effErrBoth[ich] > kZero ) ? effErrBoth[ich+kNch]/effErrBoth[ich] : 0.;
196  effErr[ich+kNch] = effErr[ich] * TMath::Sqrt(relErr1*relErr1 + relErrBoth*relErrBoth);
197  }
198  //printf("%f %f %f -> %f\n", effErr1[ich], effErr2[ich], effErrBoth[ich], effErr[ich]); // REMEMBER TO CUT
199  } // loop on chambers
200  return effErr;
201 }
202 
203 
204 //_____________________________________________________________________________
205 Double_t* GetBinomial(Double_t* effErr1, Double_t* effErr2 = 0x0, Double_t* effErrBoth = 0x0)
206 {
208  Double_t effProd[4];
209  Double_t defaultEffErr[2] = {1.,0.};
210  Double_t* auxBinomial = 0x0;
211  Double_t* currEffErr44 = 0x0;
212  Double_t* effErrBinomial = new Double_t[2];
213  effErrBinomial[0] = 0.;
214  effErrBinomial[1] = 0.;
215 
216  for ( Int_t ich = -1; ich<kNch; ich++ ) {
217  Double_t* currEffErr = GetProdErr(effErr1, ich);
218  if ( ich >= 0 ) {
219  currEffErr[0] = currEffErr[0] - currEffErr44[0];
220  currEffErr[1] = TMath::Sqrt(currEffErr[1]*currEffErr[1] + currEffErr44[1]*currEffErr44[1]);
221  }
222  if ( effErr2 ) {
223  Double_t* auxEffErr = GetConditionalEffErr(effErr1, effErr2, effErrBoth, ich);
224  auxBinomial = GetBinomial(auxEffErr);
225  delete auxEffErr;
226  }
227  for ( Int_t ival=0; ival<2; ival++ ) {
228  effProd[2*ival] = currEffErr[ival];
229  effProd[2*ival+1] = ( effErr2 ) ? auxBinomial[ival] : defaultEffErr[ival];
230  }
231  if ( ich < 0 ) currEffErr44 = currEffErr;
232  else delete currEffErr;
233  delete auxBinomial;
234 
235  Double_t* effErr = GetProdErr(effProd, -1, 2);
236  //printf("%f * %f = %f\n", effProd[0], effProd[1], effErr[0]); // REMEMBER TO CUT
237  effErrBinomial[0] += effErr[0];
238  effErrBinomial[1] += effErr[1]*effErr[1];
239  delete effErr;
240  } // loop on chambers
241 
242  delete currEffErr44;
243 
244  effErrBinomial[1] = TMath::Sqrt(effErrBinomial[1]);
245 
246  return effErrBinomial;
247 }
248 
249 
250 //_____________________________________________________________________________
251 TH1* GetHisto(TString histoName, TFile* file, TList* histoList)
252 {
254  TH1* histo = 0x0;
255  if ( histoList )
256  histo = (TH1*)histoList->FindObject(histoName.Data());
257  else
258  histo = (TH1*)file->FindObjectAny(histoName.Data());
259 
260  return histo;
261 }
262 
263 //_____________________________________________________________________________
264 Int_t GetEffIndex ( Int_t iel, Int_t icount, Int_t ich = -1 )
265 {
267  if ( iel == 0 ) return icount;
268  return 3 + 4*3*(iel-1) + 3*ich + icount;
269 }
270 
271 //_____________________________________________________________________________
272 TList* GetOCDBList ( TString ocdbDirs )
273 {
275  TString storageType = AliCDBManager::Instance()->GetDefaultStorage()->GetType();
276  Bool_t isGrid = storageType.Contains("alien");
277  TString baseFolder = AliCDBManager::Instance()->GetDefaultStorage()->GetBaseFolder();
278 
279  TList* outList = new TList();
280  outList->SetOwner();
281  TObjArray* dirNameList = ocdbDirs.Tokenize(",");
282  for ( Int_t idir=0; idir<dirNameList->GetEntries(); idir++ ) {
283  TString fullPath = Form("%s/%s",baseFolder.Data(),dirNameList->At(idir)->GetName());
284  if ( isGrid ) {
285  TGridResult *res = gGrid->Ls(fullPath.Data());
286  if (!res) return 0x0;
287  for ( Int_t ires=0; ires<res->GetEntries(); ires++ ) {
288  TString currFile = static_cast<TMap*>(res->At(ires))->GetValue("name")->GetName();
289  outList->Add(new TObjString(currFile));
290  }
291  delete res;
292  }
293  else {
294  TString fileListStr = gSystem->GetFromPipe(Form("ls %s",fullPath.Data()));
295  TObjArray* fileList = fileListStr.Tokenize("\n");
296  for ( Int_t ires=0; ires<fileList->GetEntries(); ires++ ) {
297  TString currFile = fileList->At(ires)->GetName();
298  outList->Add(new TObjString(currFile));
299  }
300  delete fileList;
301  }
302  }
303  delete dirNameList;
304  return outList;
305 }
306 
307 //_____________________________________________________________________________
308 Bool_t SetAndCheckOCDB ( TString defaultStorage )
309 {
311  if ( defaultStorage.IsNull() ) {
312  printf("Default storage not specified. Nothing done\n");
313  return kFALSE;
314  }
315 
316  if ( AliCDBManager::Instance()->IsDefaultStorageSet() ) {
317  printf("Default storage already set: nothing done\n");
318  return kTRUE;
319  }
320 
321  if ( defaultStorage.Contains("alien://") || defaultStorage.Contains("raw://") ) {
322  if ( ! gGrid ) TGrid::Connect("alien://");
323  if ( ! gGrid ) {
324  printf("Error: Problem connetting to grid: default storage not set\n");
325  return kFALSE;
326  }
327  }
328 
329  AliCDBManager::Instance()->SetDefaultStorage(defaultStorage.Data());
330 
331  if ( defaultStorage.Contains("raw://") ) return kTRUE;
332 
333  Bool_t isOk = kTRUE;
334 
335  if ( AliCDBManager::Instance()->IsDefaultStorageSet() ) {
336  TString searchDir = "MUON/Calib/MappingData";
337  TString fullPath = Form("%s/%s",defaultStorage.Data(),searchDir.Data());
338  TList* ocdbList = GetOCDBList(searchDir);
339  if ( ocdbList->GetEntries() == 0 ) {
340  printf("No entries in %s\n",fullPath.Data());
341  isOk = kFALSE;
342  }
343  else {
344  TString checkFile = Form("%s/%s",fullPath.Data(),ocdbList->At(0)->GetName());
345  checkFile.ReplaceAll("local://","");
346  TFile* file = TFile::Open(checkFile.Data());
347  if ( ! file ) {
348  printf("Cannot access test file: %s\n", checkFile.Data());
349  isOk = kFALSE;
350  }
351  delete file;
352  }
353  delete ocdbList;
354  }
355  else {
356  printf("Tried to set the default storage, but something went wrong.\n");
357  isOk = kFALSE;
358  }
359 
360  if ( ! isOk ) printf("Please check path %s\n",defaultStorage.Data());
361 
362  return isOk;
363 }
364 
365 //_____________________________________________________________________________
366 Bool_t IsOCDBChanged ( Int_t currRun, Int_t previousRun, TList* fileList )
367 {
369  if ( ! fileList ) return kTRUE;
370  for ( Int_t ifile=0; ifile<fileList->GetEntries(); ifile++ ) {
371  TString filename = static_cast<TObjString*>(fileList->At(ifile))->GetString();
372  filename.ReplaceAll("Run","");
373  TObjArray* array = filename.Tokenize("_");
374  Int_t firstRun = static_cast<TObjString*>(array->At(0))->GetString().Atoi();
375  Int_t lastRun = static_cast<TObjString*>(array->At(1))->GetString().Atoi();
376  delete array;
377  Bool_t isCurrRunInside = ( currRun >= firstRun && currRun <= lastRun );
378  Bool_t isPreviousRunInside = ( previousRun >= firstRun && previousRun <= lastRun );
379  if ( isCurrRunInside != isPreviousRunInside ) return kTRUE;
380  }
381  return kFALSE;
382 }
383 
384 //_____________________________________________________________________________
385 void TrigEffTrending(TObjArray runNumArray, TObjArray fileNameArray, TList& outCanList, TList& outList)
386 {
388  TString elementName[3] = { "Chamber", "RPC", "Board" };
389  TString countTypeName[4] = { "allTracks", "bendPlane", "nonBendPlane", "bothPlanes" };
390 
391  TString filename = "", effName = "", effTitle = "";
392 
393  SetMyStyle();
394  Double_t effValues[3][2*kNch];
395  const Int_t kNgraphs = kNch*3*2+3;
396  TObjArray effList(kNgraphs);
397  effList.SetOwner();
398  const Int_t kNeffVsRun = kNgraphs+1;
399  TObjArray effVsRunList(kNeffVsRun);
400 
401  effName = "totalEffEvolution";
402  effTitle = "Multinomial probability of firing at least 3/4 chambers";
403  TH1D* totalEff = new TH1D(effName.Data(), effTitle.Data(), 1, 0., 1.);
404  effVsRunList.AddAt(totalEff, kNeffVsRun-1);
405 
406  TString runNumString = "";
407  for ( Int_t irun=0; irun<runNumArray.GetEntries(); irun++ ) {
408  effList.Clear();
409  runNumString = runNumArray.At(irun)->GetName();
410 
411  // Search corresponding file (for sorting)
412  for ( Int_t ifile=0; ifile<fileNameArray.GetEntries(); ifile++ ) {
413  filename = fileNameArray.At(ifile)->GetName();
414  if ( filename.Contains(runNumString.Data()) ) break;
415  }
416 
417  if ( filename.Contains("alien://") && ! gGrid ) gGrid->Connect("alien://");
418 
419  //
420  // First get the list of efficiency graphs
421  //
422 
423  // Chamber efficiency
424  TFile* file = TFile::Open(filename.Data());
425  if ( ! file ) {
426  printf("Warning: cannot find %s\n", filename.Data());
427  continue;
428  }
429 
430  TList* trigEffList = (TList*)file->FindObjectAny("triggerChamberEff");
431  if ( ! trigEffList ) printf("Warning: histo list not found in %s. Check directly in file\n", filename.Data());
432  if ( trigEffList->GetEntries() == 0 ) {
433  printf("Warning: empty trigger list in file %s. Probably no MUON info there. Skip.\n", filename.Data());
434  continue;
435  }
436 
437  TH1* histoDen = 0x0;
438  for ( Int_t icount=0; icount<AliMUONTriggerEfficiencyCells::kNcounts; icount++ ) {
439  effName = countTypeName[icount] + "Count" + elementName[0];
440  if ( icount == 0 ) {
441  histoDen = GetHisto(effName, file, trigEffList);
442  continue;
443  }
444 
445  TH1* histoNum = GetHisto(effName, file, trigEffList);
446  TGraphAsymmErrors* graph = new TGraphAsymmErrors(histoNum, histoDen,"e0");
447  effName.ReplaceAll("Count","Eff");
448  graph->SetName(effName.Data());
449  effList.AddAt(graph, GetEffIndex(0, icount-1));
450  }
451  file->Close();
452 
453  if ( ! histoDen ) {
454  printf("Error: cannot find histograms in file %s. Skip to next\n", filename.Data());
455  continue;
456  }
457 
458  // RPC/board efficiency
459  AliMUONTriggerChamberEfficiency trigChEff(filename);
460  for ( Int_t iel=1; iel<3; iel++ ) {
461  for ( Int_t ich=0; ich<kNch; ich++ ) {
462  for ( Int_t icount=0; icount<AliMUONTriggerEfficiencyCells::kNcounts-1; icount++ ) {
463  TObject* obj = trigChEff.GetEffObject(2-iel, icount, ich);
464  effList.AddAt(obj->Clone(Form("%s_cloned",obj->GetName())), GetEffIndex(iel, icount, ich));
465  }
466  }
467  }
468 
469  // Fill efficiency vs run
470  for ( Int_t iel=0; iel<3; iel++ ) {
471  for ( Int_t ich=0; ich<kNch; ich++ ) {
472  for ( Int_t icount=0; icount<AliMUONTriggerEfficiencyCells::kNcounts-1; icount++ ) {
473  TGraphAsymmErrors* graph = static_cast<TGraphAsymmErrors*>(effList.At(GetEffIndex(iel, icount, ich)));
474  Int_t nPoints = ( iel == 0 ) ? 1 : graph->GetN();
475  for ( Int_t ipoint=0; ipoint<nPoints; ipoint++ ) {
476  Int_t currPoint = ( iel == 0 ) ? ich : ipoint;
477  Double_t xpt, ypt;
478  graph->GetPoint(currPoint, xpt, ypt);
479  effValues[icount][ich] = ypt;
480  Int_t ihisto = GetEffIndex(iel,icount,ich);
481  TH2* effHisto = static_cast<TH2*>(effVsRunList.At(ihisto));
482  if ( ! effHisto ) {
483  effName = Form("effEvolution%s%s", countTypeName[icount+1].Data(), elementName[iel].Data());
484  effTitle = Form("Trigger chamber efficiency vs run");
485  if ( iel>0 ) {
486  effName += Form("Ch%i", 11+ich);
487  effTitle += Form(" for chamber %i", 11+ich);
488  }
489  effHisto = new TH2D(effName.Data(), effTitle.Data(), 1, 0., 1., graph->GetN(), xpt-0.5, xpt-0.5+(Double_t)graph->GetN());
490  effVsRunList.AddAt(effHisto, ihisto);
491  }
492  Int_t currBin = effHisto->Fill(runNumString.Data(), xpt, ypt);
493  Double_t err = 0.5*(graph->GetErrorYlow(ipoint) + graph->GetErrorYhigh(ipoint));
494  Int_t binx, biny, binz;
495  effHisto->GetBinXYZ(currBin, binx, biny, binz);
496  effHisto->SetBinError(binx, biny, err);
497  effValues[icount][ich+kNch] = err;
498  } // loop on points
499  } // loop on counts
500  } // loop on chambers
501  if ( iel > 0 ) continue;
502  Double_t* binomialEff = GetBinomial(effValues[0], effValues[1], effValues[2]);
503  Int_t currBin = totalEff->Fill(runNumString, binomialEff[0]);
504  // CAVEAT!!!!
505  // Well, error calculation of the binomial efficiency is a mess...
506  // Sometimes it happens that efficiency + error > 1.
507  // In that case reduce the error.
508  totalEff->SetBinError(currBin, TMath::Min(binomialEff[1], 1.-binomialEff[0]));
509  delete binomialEff;
510  } // loop on detection elements
511  } // loop on runs
512 
513  // Set correct range (do not show last empty bins)
514  for ( Int_t ihisto=0; ihisto<effVsRunList.GetEntries(); ihisto++ ) {
515  TH1* histo = static_cast<TH1*>(effVsRunList.At(ihisto));
516  if ( ! histo ) continue;
517  SetRunAxisRange(histo->GetXaxis());
518  outList.Add(histo);
519  //histo->GetXaxis()->SetLabelSize(0.03);
520  }
521 
522  TString canName = "totalEff";
523  TCanvas* can = new TCanvas(canName.Data(), canName.Data(), 200, 10, 600, 600);
524  TH1* totEff = (TH1*)effVsRunList.At(kNeffVsRun-1);
525  totEff->GetYaxis()->SetRangeUser(0.9,1.05);
526  totEff->GetYaxis()->SetTitle("Probability to satisfy trigger conditions (3/4)");
527  totEff->SetStats(kFALSE);
528  totEff->DrawCopy();
529  outCanList.Add(can);
530 
531  Int_t color[3] = {kBlack, kRed, kBlue};
532  Int_t markStyle[3] = {20, 24, 26};
533  TLegend* leg = 0x0;
534 
535  for ( Int_t ich=0; ich<kNch; ich++ ) {
536  canName = Form("trigEffCh%i", 11+ich);
537  can = new TCanvas(canName.Data(), canName.Data(), 200, 10, 600, 600);
538  can->SetGridy();
539  leg = new TLegend(0.6, 0.2, 0.9, 0.4);
540  leg->SetBorderSize(1);
541  //can->Divide(2,2);
542  TString drawOpt = "e";
543  for(Int_t icount=0; icount<AliMUONTriggerEfficiencyCells::kNcounts-1; icount++) {
544  //can->cd(icount+1);
545  TH2* histo = static_cast<TH2*>(effVsRunList.At(GetEffIndex(0, icount)));
546  if ( ! histo ) continue;
547  TH1* chEff = histo->ProjectionX(Form("effEvolutionCh%i",11+ich), ich+1, ich+1);
548  chEff->SetTitle(Form("%s for chamber %i", histo->GetTitle(), 11+ich));
549  chEff->GetYaxis()->SetRangeUser(0.9,1.);
550  chEff->SetStats(kFALSE);
551  chEff->GetYaxis()->SetTitle("Trigger chamber efficiency");
552  TH1* copyEff = chEff->DrawCopy(drawOpt.Data());
553  copyEff->SetLineColor(color[icount]);
554  copyEff->SetMarkerColor(color[icount]);
555  copyEff->SetMarkerStyle(markStyle[icount]);
556  leg->AddEntry(copyEff, countTypeName[icount+1].Data(), "lp");
557  drawOpt = "esame";
558  } // loop on counts
559  leg->Draw("same");
560  outCanList.Add(can);
561  } // loop on chambers
562 
563  for ( Int_t iel=1; iel<3; iel++ ) {
564  for ( Int_t ich=0; ich<kNch; ich++ ) {
565  Int_t icount = AliMUONTriggerEfficiencyCells::kBothPlanesEff; // Just plot the efficiency for both
566 // for ( Int_t icount=0; icount<AliMUONTriggerEfficiencyCells::kNcounts-1; icount++ ) {
567  canName = Form("trigEff%sCh%i", elementName[iel].Data(), 11+ich);
568  can = new TCanvas(canName.Data(), canName.Data(), 200, 10, 600, 600);
569  can->SetRightMargin(0.14);
570  TH2* histo = static_cast<TH2*>(effVsRunList.At(GetEffIndex(iel, icount,ich)));
571  if ( ! histo ) continue;
572  histo->SetStats(kFALSE);
573  histo->GetYaxis()->SetTitle(elementName[iel].Data());
574  histo->DrawCopy("COLZ");
575 // } // loop on counts
576  outCanList.Add(can);
577  } // loop on chambers
578  } // loop on detection element type
579 }
580 
581 //_____________________________________________________________________________
582 void MaskTrending ( TObjArray runNumArray, TString defaultStorage, TList& outCanList, TList& outList )
583 {
585 
586  if ( ! SetAndCheckOCDB(defaultStorage) ) return;
587 
588  TObjArray maskedList(8);
589  TObjArray auxList(8);
590  auxList.SetOwner();
591  TString histoName = "", histoTitle = "";
592  for(Int_t icath=0; icath<2; icath++){
593  TString cathName = ( icath==0 ) ? "bendPlane" : "nonBendPlane";
594  for(Int_t ich=0; ich<kNch; ich++){
595  histoName = Form("%sMaskCh%i", cathName.Data(), 11+ich);
596  histoTitle = Form("Chamber %i - %s: fraction of masked channels", 11+ich, cathName.Data());
597  TH2* histo = new TH2D(histoName.Data(), histoTitle.Data(),1,0.,1., 234, 0.5, 234. + 0.5);
598  histo->GetYaxis()->SetTitle("Board Id");
599  histo->SetOption("COLZ");
600  Int_t imask = 2*ich + icath;
601  maskedList.AddAt(histo, imask);
602  auxList.AddAt(histo->Clone(Form("%s_aux",histoName.Data())), imask);
603  } // loop on chambers
604  } // loop on cathodes
605 
606  TArrayS xyPatternAll[2];
607  for(Int_t icath=0; icath<2; icath++){
608  xyPatternAll[icath].Set(kNch);
609  xyPatternAll[icath].Reset(0xFFFF);
610  }
611 
612  TList* ocdbFileList = 0x0;
613  Int_t previousRun = -1;
614  AliMUONDigitMaker* digitMaker = 0x0;
615  AliMUONDigitStoreV2R digitStore;
616 
617  AliMUONCalibrationData* calibData = 0x0;
618  AliMUONTriggerUtilities* trigUtilities = 0x0;
619  for ( Int_t irun=0; irun<runNumArray.GetEntries(); irun++ ) {
620  TString runNumString = runNumArray.At(irun)->GetName();
621  Int_t runNumber = runNumString.Atoi();
622 
623  if ( IsOCDBChanged(runNumber, previousRun, ocdbFileList) ) {
624  AliCDBManager::Instance()->SetRun(runNumber);
625 
626  if ( ! digitMaker ) {
627  digitMaker = new AliMUONDigitMaker(kFALSE);
628  // Create a store with all digits in trigger
629  for ( Int_t iboard=1; iboard<=234; iboard++ ) {
630  digitMaker->TriggerDigits(iboard, xyPatternAll, digitStore, kFALSE);
631  }
632  }
633 
634  if ( ! ocdbFileList ) ocdbFileList = GetOCDBList("MUON/Calib/GlobalTriggerCrateConfig,MUON/Calib/RegionalTriggerConfig,MUON/Calib/LocalTriggerBoardMasks");
635 
636  delete calibData;
637  calibData = new AliMUONCalibrationData (runNumber);
638  delete trigUtilities;
639  trigUtilities = new AliMUONTriggerUtilities (calibData);
640  }
641 
642  previousRun = runNumber;
643 
644  TIter next(digitStore.CreateIterator());
645  AliMUONVDigit* dig = 0x0;
646  while ( ( dig = static_cast<AliMUONVDigit*>(next()) ) ) {
647  Int_t icath = dig->Cathode();
648  Int_t detElemId = dig->DetElemId();
649  Int_t ich = detElemId/100-11;
650  Int_t iboard = dig->ManuId();
651  Int_t imask = 2*ich + icath;
652  static_cast<TH2*>(auxList.At(imask))->Fill(runNumString.Data(),iboard,1.);
653  static_cast<TH2*>(maskedList.At(imask))->Fill(runNumString.Data(),iboard,(Double_t)trigUtilities->IsMasked(*dig));
654  }
655  } // loop on runs
656  delete calibData;
657  delete trigUtilities;
658  delete digitMaker;
659 
660  TString canName = "";
661  for ( Int_t imask=0; imask<maskedList.GetEntries(); imask++ ) {
662  TH2* histo = static_cast<TH2*>(maskedList.At(imask));
663  histo->Divide(static_cast<TH2*>(auxList.At(imask)));
664  SetRunAxisRange(histo->GetXaxis());
665  outList.Add(histo);
666 
667  canName = Form("%sCan", histo->GetName());
668  TCanvas* can = new TCanvas(canName.Data(), canName.Data(), 200, 10, 600, 600);
669  can->SetRightMargin(0.14);
670  histo->SetStats(kFALSE);
671  histo->DrawCopy("COLZ");
672  outCanList.Add(can);
673  }
674 }
675 
676 //_____________________________________________________________________________
677 Bool_t CheckPattern ( TString trigName, TObjArray* keepArray, TObjArray* rejectArray )
678 {
680  for ( Int_t ipat=0; ipat<rejectArray->GetEntries(); ++ipat ) {
681  if ( trigName.Contains(rejectArray->At(ipat)->GetName() ) ) return kFALSE;
682  } // loop on reject pattern
683 
684  for ( Int_t ipat=0; ipat<keepArray->GetEntries(); ++ipat ) {
685  if ( trigName.Contains(keepArray->At(ipat)->GetName() ) ) return kTRUE;
686  } // loop on keep pattern
687 
688  return ( keepArray->GetEntries() == 0 ) ? kTRUE : kFALSE;
689 }
690 
691 //_____________________________________________________________________________
692 TObjArray* BuildListOfTrigger ( const TObjArray* triggerArray, TString keepPattern = "", TString rejectPattern="OTHER,TRUE,PHI,ANY,EMC,-ACE-,-ABCE-,WU,MUP,SPI,SHM" )
693 {
695  TObjArray* selectedList = new TObjArray();
696  selectedList->SetOwner();
697  TObjArray* rejectArray = rejectPattern.Tokenize(",");
698  TObjArray* keepArray = keepPattern.Tokenize(",");
699 
700  for ( Int_t iTrig = 0; iTrig < triggerArray->GetEntries(); iTrig++ ){
701  TString currTrigName = ((TObjString*)triggerArray->At(iTrig))->GetName();
702  if ( CheckPattern(currTrigName, keepArray, rejectArray) ) selectedList->AddLast(new TObjString(currTrigName.Data()));
703  }
704 
705  delete rejectArray;
706  delete keepArray;
707 
708  return selectedList;
709 
710 }
711 
712 //_____________________________________________________________________________
713 TString FindCorrespondingTrigger ( TString checkTrigger, TObjArray* triggerArray )
714 {
716  TString foundName = "";
717  for ( Int_t iTrig = 0; iTrig < triggerArray->GetEntries(); iTrig++ ){
718  TString currTrigName = ((TObjString*)triggerArray->At(iTrig))->GetName();
719  TObjArray* array = currTrigName.Tokenize("-");
720  TString collisionType = array->At(1)->GetName();
721  delete array;
722  collisionType.Append("-");
723  collisionType.Prepend("-");
724  if ( checkTrigger.Contains(collisionType.Data()) ) {
725  foundName = currTrigName;
726  break;
727  }
728  }
729 
730  return foundName;
731 }
732 
733 //_____________________________________________________________________________
734 void ScalerTrending ( TObjArray runNumArray, TString mergedFileName, TString defaultStorage, TList& outCanList, TList& outList )
735 {
737  if ( ! SetAndCheckOCDB(defaultStorage) ) return;
738 
739  //trigger count from ESDs
740  TFile *file = TFile::Open(mergedFileName.Data());
741  AliCounterCollection* ccol = (AliCounterCollection*)((TDirectoryFile*)file->FindObjectAny("MUON_QA"))->FindObjectAny("eventCounters");
742 
743  //Build the trigger list for trigger with muon only in readout and min. bias triggers
744  TString triggerListName = ccol->GetKeyWords("trigger");
745 
746  TObjArray selectedTriggerArray, selectedL0TriggerArray;
747  selectedTriggerArray.SetOwner();
748  selectedL0TriggerArray.SetOwner();
749 
750  const Int_t nScaler = 3;
751  TString sScaler[nScaler] = {"L0B","L2A","L0BRATE"};
752  enum eScaler {kL0B = 0, kL2A=1, kL0BRATE=2};
753  Float_t maxScaler[nScaler] = {1e8,1e7,1e6};
754  TObjArray hFromQA;
755  TObjArray hFromScalers;
756  TObjArray hOutput;
757 
758 
759  TString sHistName, sHistNameFull, sTitleName;
760  Int_t nRuns = runNumArray.GetEntries();
761 
762  //
763  //Fill histos for Scalers and QA
764  //
765  //loop on run list
766  for ( Int_t iRun = 0; iRun < runNumArray.GetEntries(); iRun++ ) {
767 
768  TString sRunNr = ((TObjString*)runNumArray.At(iRun))->GetString();
769  Int_t runNr = sRunNr.Atoi();
770  AliAnalysisTriggerScalers triggerScaler(runNr);
771  AliTriggerConfiguration* tc = static_cast<AliTriggerConfiguration*>(triggerScaler.GetOCDBObject("GRP/CTP/Config",runNr));
772  const TObjArray& trClasses = tc->GetClasses();
773 
774  Int_t ibin = iRun+1;
775 
776  for ( Int_t itype=0; itype<2; itype++ ) {
777  TObjArray* currSelectedList = ( itype == 0 ) ? &selectedTriggerArray : &selectedL0TriggerArray;
778  TString matchTrig = ( itype == 0 ) ? "" : "C0TVX";
779  TObjArray* selectedTrigArrayForRun = BuildListOfTrigger(&trClasses, matchTrig);
780 
781  //loop on trigger list
782  for ( Int_t iTrig = 0; iTrig < selectedTrigArrayForRun->GetEntries(); iTrig++ ) {
783 
784  TString currTrigName = selectedTrigArrayForRun->At(iTrig)->GetName();
785  if ( itype == 0 && ! triggerListName.Contains(currTrigName.Data()) ) continue;
786  if ( ! currSelectedList->FindObject(currTrigName.Data()) ) currSelectedList->Add(new TObjString(currTrigName));
787 
788  //loop on scaler list
789  for ( Int_t iScaler = 0; iScaler < nScaler; iScaler++ ) {
790 
791  if ( itype == 1 && iScaler != kL0B ) continue;
792 
793  //from Scalers
794  TGraph* graph = triggerScaler.PlotTrigger(currTrigName.Data(),sScaler[iScaler].Data());
795 
796  sHistName = Form("%s_%s",currTrigName.Data(),sScaler[iScaler].Data());
797  sHistNameFull = Form("Scalers_%s",sHistName.Data());
798 
799  TH1* hist = (TH1*) hFromScalers.FindObject(sHistNameFull);
800  if ( ! hist ) {
801  hist = new TH1D(sHistNameFull,sHistName,nRuns,1.,1.+(Double_t)nRuns);
802  hist->SetDirectory(0);
803  hist->SetMinimum(1);
804  hist->SetMaximum(maxScaler[0]);
805  hFromScalers.AddLast(hist);
806  hOutput.AddLast(hist);
807  if ( iScaler == kL2A ) {
808  sHistNameFull = "QA_" + sHistName;
809  hFromQA.AddLast(hist->Clone(sHistNameFull.Data()));
810  }
811  }
812  Double_t *tab = (Double_t*) graph->GetY();
813  if ( tab ) hist->SetBinContent(ibin,tab[0]);
814  hist->GetXaxis()->SetBinLabel(ibin,sRunNr.Data());
815  delete graph;
816 
817  //from QA
818  if ( iScaler != kL2A ) continue;
819  TH1* histCounters = static_cast<TH1*>(ccol->Get("run",Form("run:%s/trigger:%s",sRunNr.Data(),currTrigName.Data())));
820  sHistNameFull = sHistNameFull = "QA_" + sHistName;
821  hist = (TH1*) hFromQA.FindObject(sHistNameFull);
822  if ( histCounters ) hist->SetBinContent(ibin,histCounters->GetSumOfWeights());
823  hist->GetXaxis()->SetBinLabel(ibin,sRunNr.Data());
824  delete histCounters;
825  }//end loop on scaler list
826  }//end loop on trigger list
827  } // end loop on type
828  }//end loop on run list
829 
830 
831  if ( selectedTriggerArray.GetEntries() == 0 ) {
832  printf("No trigger selected from trigger list %s\n",triggerListName.Data());
833  return;
834  }
835  printf("Nr of triggers selected %i\n",selectedTriggerArray.GetEntries());
836 
837  printf("Nr of T0 triggers selected %i\n",selectedL0TriggerArray.GetEntries());
838 
839  //Set options for QA and Scalers histos
840 
841  for ( Int_t itype=0; itype<2; itype++ ) {
842  TObjArray* currList = ( itype == 0 ) ? &hFromScalers : &hFromQA;
843  for ( Int_t ihisto=0; ihisto<currList->GetEntriesFast(); ihisto++ ) {
844  TH1* histo = static_cast<TH1*> ( currList->At(ihisto) );
845  if (!histo) continue;
846  // Write run number to each bin
847  for ( Int_t iRun = 0; iRun < runNumArray.GetEntries(); iRun++ ) {
848  TString sRunNr = ((TObjString*)runNumArray.At(iRun))->GetString();
849  Int_t ibin = iRun+1;
850  TString binLabel = histo->GetXaxis()->GetBinLabel(ibin);
851  if ( ! binLabel.IsNull() ) continue;
852  histo->GetXaxis()->SetBinLabel(ibin,sRunNr.Data());
853  }
854  histo->SetStats(kFALSE);
855  }
856  }
857 
858 
859  //Loop on histos from scalers and QA and create resulting histos from scalers
860  const Int_t nHisto = 3;
861  TString sHisto[nHisto] = {"L0BoverL0BC0TVX","L2AoverL0B","L2AQAoverSCALERS"};
862  TString sTitleHisto[nHisto] = {"L0B trigger / L0BC0TVX","L2A / L0B","L2A from QA / L2A from SCALERS"};
863  // TString sHisto[nHisto] = {"L2AoverL0B","L2AQAoverSCALERS"};
864 
865  //loop on trigger list
866  for ( Int_t iTrig = 0; iTrig < selectedTriggerArray.GetEntries(); iTrig++ ) {
867 
868  sHistNameFull = Form("Scalers_%s_L0B",((TObjString*) selectedTriggerArray.At(iTrig))->GetName());
869  TH1* histo1 = static_cast<TH1*> ( hFromScalers.FindObject(sHistNameFull) );
870  if (!histo1) continue;
871 
872 
873  //C0TVX
874  TString sTrig = ( (TObjString*) selectedTriggerArray.At(iTrig) )->GetName();
875  TString sL0Trig = FindCorrespondingTrigger(sTrig, &selectedL0TriggerArray);
876 
877  sHistNameFull = Form("Scalers_%s_L0B",sL0Trig.Data());
878 
879  TH1* histo0 = static_cast<TH1*> ( hFromScalers.FindObject(sHistNameFull) );
880  if ( histo0 ) {
881  sHistNameFull = Form("%s_%s",sHisto[0].Data(),((TObjString*) selectedTriggerArray.At(iTrig))->GetName());
882  TH1* histo10 = (TH1*) histo1->Clone(sHistNameFull);
883  histo10->SetTitle(sTitleHisto[0].Data());
884  histo10->Sumw2();
885  histo10->Divide(histo0);
886  histo10->SetMaximum(10);
887  histo10->SetMinimum(1e-5);
888  //outList.Add(histo10);
889  hOutput.AddLast(histo10);
890  //outList.Add(histo0);
891  //outList.Add(histo1);
892  }
893 
894  //DEADTIME
895  sHistNameFull = Form("Scalers_%s_L2A",((TObjString*) selectedTriggerArray.At(iTrig))->GetName());
896  TH1* histo2 = static_cast<TH1*> ( hFromScalers.FindObject(sHistNameFull) );
897  if (!histo2) continue;
898 
899  sHistNameFull = Form("%s_%s",sHisto[1].Data(),((TObjString*) selectedTriggerArray.At(iTrig))->GetName());
900  TH1* histo3 = (TH1*) histo2->Clone(sHistNameFull);
901  histo3->SetTitle(sTitleHisto[1]);
902  histo3->Sumw2();
903  histo3->Divide(histo1);
904  histo3->SetMaximum(1.2);
905  histo3->SetMinimum(1e-5);
906  //outList.Add(histo3);
907  hOutput.AddLast(histo3);
908 
909  //QA over Scalers
910  sHistNameFull = Form("QA_%s_L2A",((TObjString*) selectedTriggerArray.At(iTrig))->GetName());
911  TH1* histo4 = static_cast<TH1*> ( hFromQA.FindObject(sHistNameFull) );
912  if (!histo4) continue;
913 
914  sHistNameFull = Form("%s_%s",sHisto[2].Data(),((TObjString*) selectedTriggerArray.At(iTrig))->GetName());
915  TH1* histo5 = (TH1*) histo4->Clone(sHistNameFull);
916  histo5->SetTitle(sTitleHisto[2]);
917  histo5->Sumw2();
918  histo5->Divide(histo2);
919  histo5->SetMaximum(1.2);
920  histo5->SetMinimum(5e-1);
921  //outList.Add(histo5);
922  hOutput.AddLast(histo5);
923  }
924 
925  // Plot all on canvases (only canvases will be saved)
926  const Int_t nCanvases = nScaler + nHisto;
927  TString sCanvases[nCanvases];
928  for (Int_t iScaler = 0; iScaler < nScaler; iScaler++) sCanvases[iScaler] = sScaler[iScaler];
929  for (Int_t iHisto = 0; iHisto < nHisto; iHisto++) sCanvases[nScaler+iHisto] = sHisto[iHisto];
930 
931  //loop on canvases
932  for ( Int_t iCan = 0; iCan < nCanvases; iCan++) {
933  TCanvas* canvas = new TCanvas(sCanvases[iCan],sCanvases[iCan],200,10,600,600);
934  TLegend* leg = new TLegend(0.72,0.7,0.9,0.85);
935  leg->SetBorderSize(1);
936  if ( iCan != 4 ) canvas->SetLogy();
937  TString optDraw = "e";
938 
939  //loop on trigger list
940  Int_t icolor = 1;
941  for ( Int_t iTrig = 0; iTrig < selectedTriggerArray.GetEntries(); iTrig++ ) {
942 
943  if ( iCan < nScaler ) sHistNameFull = Form("Scalers_%s_%s",selectedTriggerArray.At(iTrig)->GetName(),sCanvases[iCan].Data());
944  else sHistNameFull = Form("%s_%s",sCanvases[iCan].Data(),selectedTriggerArray.At(iTrig)->GetName());
945  TH1* histo1 = static_cast<TH1*> ( hOutput.FindObject(sHistNameFull) );
946  if (!histo1) continue;
947 
948  if ( icolor == 10 ) icolor++;
949  histo1->SetLineColor(icolor++);
950  histo1->Draw(optDraw);
951  optDraw = "esame";
952 
953  leg->AddEntry(histo1,selectedTriggerArray.At(iTrig)->GetName(),"l");
954  }
955 
956  leg->Draw();
957  outList.Add(canvas);
958  outCanList.Add(canvas);
959  }
960 
961  file->Close();
962 }
963 
964 //_____________________________________________________________________________
965 void trigEffQA(TString fileListName, TString outFilename = "", TString defaultStorage = "raw://", Bool_t doScalers = kFALSE, TString trackerQAmergedOut="QAresults_merged.root")
966 {
968  ifstream inFile(fileListName.Data());
969  TObjArray fileNameArray, runNumArray;
970  fileNameArray.SetOwner();
971  runNumArray.SetOwner();
972  TString currString = "";
973  if (inFile.is_open()) {
974  while (! inFile.eof() ) {
975  currString.ReadLine(inFile); // Read line
976  if ( ! currString.Contains(".root") ||
977  currString.BeginsWith("#") ) continue;
978  fileNameArray.AddLast(new TObjString(currString.Data()));
979  Int_t runNum = GetRunNumber(currString);
980  runNumArray.AddLast(new TObjString(Form("%i",runNum)));
981  }
982  inFile.close();
983  }
984  else {
985  printf("Fatal: cannot open input file %s\n",fileListName.Data());
986  return;
987  }
988 
989  runNumArray.Sort();
990 
991  // Instead of using the efficiency stored in the QA output
992  // search for the new efficiency produced with trigger tracks only
993  TObjArray tmpArray = fileNameArray;
994  TObjArray* finalFileNameArray = ChangeFilenames(tmpArray) ? &tmpArray : &fileNameArray;
995 
996  TList outCanList, outList;
997  TrigEffTrending(runNumArray, *finalFileNameArray, outCanList, outList);
998  if ( SetAndCheckOCDB(defaultStorage) ) {
999  MaskTrending(runNumArray, defaultStorage, outCanList, outList);
1000  if ( doScalers ) {
1001  if ( gSystem->AccessPathName(trackerQAmergedOut.Data()) ) {
1002  printf("Warning: cannot perform scaler trending:\n merged QA from tracker\n %s\n does not exist\n",trackerQAmergedOut.Data());
1003  }
1004  else {
1005  ScalerTrending(runNumArray, trackerQAmergedOut, defaultStorage, outCanList, outList);
1006  }
1007  }
1008  }
1009 
1010  if ( outFilename.IsNull() ) return;
1011 
1012  TString outCanName = outFilename;
1013  outCanName.ReplaceAll(".root",".pdf");
1014  for ( Int_t ican=0; ican<outCanList.GetEntries(); ican++ ) {
1015  TString canName = outCanName;
1016  if ( ican == 0 ) canName.Append("("); // open pdf file
1017  else if ( ican == outCanList.GetEntries()-1 ) canName.Append(")"); // close pdf file
1018  static_cast<TCanvas*>(outCanList.At(ican))->Print(canName.Data());
1019  }
1020  // There is a bug when creating a pdf
1021  // So create a ps and then convert via epstopdf
1022  if ( outCanName.Contains(".ps") || outCanName.Contains(".eps") ) {
1023  gSystem->Exec(Form("epstopdf %s", outCanName.Data()));
1024  gSystem->Exec(Form("rm %s", outCanName.Data()));
1025  }
1026 
1027  TFile* outFile = new TFile(outFilename.Data(), "recreate");
1028  outList.Write();
1029  outFile->Close();
1030 }
Bool_t ChangeFilenames(TObjArray &fileNameArray)
Definition: trigEffQA.C:119
const Int_t kNch
Definition: trigEffQA.C:41
void SetRunAxisRange(TAxis *axis)
Definition: trigEffQA.C:78
void SetMyStyle()
Definition: trigEffQA.C:45
Bool_t SetAndCheckOCDB(TString defaultStorage)
Definition: trigEffQA.C:308
TH1 * GetHisto(TString histoName, TFile *file, TList *histoList)
Definition: trigEffQA.C:251
TString FindCorrespondingTrigger(TString checkTrigger, TObjArray *triggerArray)
Definition: trigEffQA.C:713
Double_t * GetConditionalEffErr(Double_t *effErr1, Double_t *effErr2, Double_t *effErrBoth, Int_t exclude=-1)
Definition: trigEffQA.C:177
const Double_t kZero
Definition: trigEffQA.C:42
Double_t * GetProdErr(Double_t *effErr, Int_t exclude, Int_t nFactors=kNch)
Definition: trigEffQA.C:156
Bool_t IsRunNum(TString stringToken)
Definition: trigEffQA.C:71
TObjArray * BuildListOfTrigger(const TObjArray *triggerArray, TString keepPattern="", TString rejectPattern="OTHER,TRUE,PHI,ANY,EMC,-ACE-,-ABCE-,WU,MUP,SPI,SHM")
Definition: trigEffQA.C:692
Int_t GetRunNumber(TString filePath)
Definition: trigEffQA.C:90
void ScalerTrending(TObjArray runNumArray, TString mergedFileName, TString defaultStorage, TList &outCanList, TList &outList)
Definition: trigEffQA.C:734
Double_t * GetBinomial(Double_t *effErr1, Double_t *effErr2=0x0, Double_t *effErrBoth=0x0)
Definition: trigEffQA.C:205
Bool_t IsOCDBChanged(Int_t currRun, Int_t previousRun, TList *fileList)
Definition: trigEffQA.C:366
void MaskTrending(TObjArray runNumArray, TString defaultStorage, TList &outCanList, TList &outList)
Definition: trigEffQA.C:582
void TrigEffTrending(TObjArray runNumArray, TObjArray fileNameArray, TList &outCanList, TList &outList)
Definition: trigEffQA.C:385
Int_t GetEffIndex(Int_t iel, Int_t icount, Int_t ich=-1)
Definition: trigEffQA.C:264
TList * GetOCDBList(TString ocdbDirs)
Definition: trigEffQA.C:272
Bool_t CheckPattern(TString trigName, TObjArray *keepArray, TObjArray *rejectArray)
Definition: trigEffQA.C:677
void trigEffQA(TString fileListName, TString outFilename="", TString defaultStorage="raw://", Bool_t doScalers=kFALSE, TString trackerQAmergedOut="QAresults_merged.root")
Definition: trigEffQA.C:965