AliPhysics  6bc8652 (6bc8652)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
QA.C
Go to the documentation of this file.
1 
26 // Trigger mask.
27 UInt_t kTriggerInt = AliVEvent::kAnyINT;
28 UInt_t kTriggerMuonAll = (AliVEvent::kMUL7 |
29  AliVEvent::kMUSH7 |
30  AliVEvent::kMUU7 |
31  AliVEvent::kMUS7 |
32  AliVEvent::kMUSPB |
33  AliVEvent::kMUSHPB |
34  AliVEvent::kMuonLikePB |
35  AliVEvent::kMuonUnlikePB);
36 UInt_t kTriggerMuonBarell = AliVEvent::kMUU7;
37 UInt_t kTriggerEMC = (AliVEvent::kEMC7 |
38  AliVEvent::kEMC8 |
39  AliVEvent::kEMCEJE |
40  AliVEvent::kEMCEGA);
41 UInt_t kTriggerHM = AliVEvent::kHighMult;
43 
49 {
51  virtual Bool_t DoCDBconnect() const = 0;
53  virtual Bool_t DoEventStat() const = 0;
55  virtual Bool_t DoCentrality() const = 0;
57  virtual Bool_t DoQAsym() const = 0;
59  virtual Bool_t DoVZERO() const = 0;
61  virtual Bool_t DoVZEROPbPb() const = 0;
63  virtual Bool_t DoVertex() const = 0;
65  virtual Bool_t DoSPD() const = 0;
67  virtual Bool_t DoTPC() const = 0;
69  virtual Bool_t DoHLT() const = 0;
71  virtual Bool_t DoSDD() const = 0;
73  virtual Bool_t DoSSDdEdx() const = 0;
75  virtual Bool_t DoTRD() const = 0;
77  virtual Bool_t DoITS() const = 0;
79  virtual Bool_t DoITSsaTracks() const = 0;
81  virtual Bool_t DoITSalign() const = 0;
83  virtual Bool_t DoCALO() const = 0;
85  virtual Bool_t DoMUONTrig() const = 0;
87  virtual Bool_t DoImpParRes() const = 0;
89  virtual Bool_t DoMUON() const = 0;
91  virtual Bool_t DoTOF() const = 0;
93  virtual Bool_t DoHMPID() const = 0;
95  virtual Bool_t DoT0() const = 0;
97  virtual Bool_t DoZDC() const = 0;
99  virtual Bool_t DoPIDResponse() const = 0;
101  virtual Bool_t DoPIDqa() const = 0;
103  virtual Bool_t DoFWD() const = 0;
105  virtual Bool_t DoPHOS() const = 0;
107  virtual Bool_t DoPHOSTrig() const = 0;
109  virtual Bool_t DoEMCAL() const = 0;
111  virtual Bool_t DoFBFqa() const = 0;
113  virtual Bool_t DoMUONEff() const = 0;
115  virtual Bool_t DoV0() const = 0;
117  virtual Int_t DebugLevel() const = 0;
118 
119  virtual void PrintOne(const char* title, Bool_t use) const
120  {
121  Printf("%-30s : %3s", title, use ? "yes" : "no");
122  }
123  virtual void Print() const
124  {
125  PrintOne("CDBconnect ", DoCDBconnect());
126  PrintOne("EventStat ", DoEventStat());
127  PrintOne("Centrality ", DoCentrality());
128  PrintOne("QAsym ", DoQAsym());
129  PrintOne("VZERO", DoVZERO());
130  PrintOne("VZEROPbPb ", DoVZEROPbPb());
131  PrintOne("Vertex ", DoVertex());
132  PrintOne("SPD needs RP ", DoSPD());
133  PrintOne("TPC ", DoTPC());
134  PrintOne("HLT ", DoHLT());
135  PrintOne("SDD needs RP", DoSDD());
136  PrintOne("SSDdEdx ", DoSSDdEdx());
137  PrintOne("TRD ", DoTRD());
138  PrintOne("ITS ", DoITS());
139  PrintOne("ITSsaTracks ", DoITSsaTracks());
140  PrintOne("ITSalign ", DoITSalign());
141  PrintOne("CALO ", DoCALO());
142  PrintOne("MUONTrig ", DoMUONTrig());
143  PrintOne("ImpParRes ", DoImpParRes());
144  PrintOne("MUON ", DoMUON());
145  PrintOne("TOF ", DoTOF());
146  PrintOne("HMPID ", DoHMPID());
147  PrintOne("T0 ", DoT0());
148  PrintOne("ZDC ", DoZDC());
149  PrintOne("PIDResponse ", DoPIDResponse());
150  PrintOne("PIDqa ", DoPIDqa());
151  PrintOne("FWD ", DoFWD());
152  PrintOne("PHOS ", DoPHOS());
153  PrintOne("PHOSTrig ", DoPHOSTrig());
154  PrintOne("EMCAL ", DoEMCAL());
155  PrintOne("FBFqa ", DoFBFqa());
156  PrintOne("MUONEff NEEDS geometry", DoMUONEff());
157  PrintOne("V0 NEEDS MCtruth ", DoV0());
158  }
159 };
161 
162 //====================================================================
168 {
169  Bool_t is10h = grp->period.EqualTo("LHC10h",TString::kIgnoreCase);
170  gSystem->SetIncludePath("-I. "
171  "-I$ROOTSYS/include "
172  "-I$ALICE_ROOT/include "
173  "-I$ALICE_ROOT "
174  "-I$ALICE_ROOT/ITS "
175  "-I$ALICE_ROOT/TRD "
176  "-I$ALICE_PHYSICS/PWGPP "
177  "-I$ALICE_PHYSICS/PWGPP/TRD");
178  gSystem->Load("libANALYSIS");
179  gSystem->Load("libANALYSISalice");
180  gSystem->Load("libOADB");
181  gSystem->Load("libESDfilter");
182  gSystem->Load("libCORRFW");
183  gSystem->Load("libTender");
184  gSystem->Load("libPWGPP");
185  gSystem->Load("libAliHLTTrigger");
186 
187  if ((qaCfg->DoEMCAL() && detCfg->UseEMCAL()) ||
188  ((qaCfg->DoPHOS() || qaCfg->DoPHOSTrig()) && detCfg->UsePHOS()) ||
189  (qaCfg->DoCALO() && !is10h)) {
190  gSystem->Load("libEMCALUtils");
191  gSystem->Load("libPHOSUtils");
192  gSystem->Load("libPWGCaloTrackCorrBase");
193  gSystem->Load("libPWGGACaloTrackCorrelations");
194  gSystem->Load("libPWGGACaloTasks");
195  gSystem->Load("libPWGGAPHOSTasks");
196  gSystem->Load("libPWGTools");
197  gSystem->Load("libPWGEMCAL");
198  gSystem->Load("libPWGGAEMCALTasks");
199  }
200  if((qaCfg->DoMUON() || qaCfg->DoMUONTrig()) && detCfg->UseMUON()) {
201  gSystem->Load("libPWGmuon");
202  gSystem->Load("libPWGPPMUONlite");
203  gSystem->Load("libPWGmuondep");
204  }
205  if (qaCfg->DoFWD() && detCfg->UseFMD()) {
206  gSystem->Load("libPWGLFforward2");
207  }
208 }
209 
210 //====================================================================
216 void AddAnalysisTasks(const char *cdb_location)
217 {
218  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
219  mgr->SetCommonFileName("QAresults.root");
220 
221  Bool_t is10h = grp->period.EqualTo("LHC10h",TString::kIgnoreCase);
222  // --- Some short-hands --------------------------------------------
223  TString ali = "$ALICE_PHYSICS";
224  TString ana = "$ALICE_ROOT/ANALYSIS";
225  TString oadb = ali + "/OADB";
226  TString pwghf = ali + "/PWGHF";
227  TString pwglf = ali + "/PWGLF";
228  TString pwgje = ali + "/PWGJE";
229  TString pwgdq = ali + "/PWGDQ";
230  TString pwgpp = ali + "/PWGPP";
231  TString pwgga = ali + "/PWGGA";
232 
233  // --- Statistics task ---------------------------------------------
234  mgr->AddStatisticsTask(kTriggerMask);
235 
236  // --- CDB connection ----------------------------------------------
237  if (qaCfg->DoCDBconnect()) {
238  gROOT->LoadMacro(pwgpp+"/PilotTrain/AddTaskCDBconnect.C");
239  AliTaskCDBconnect *taskCDB = AddTaskCDBconnect(cdb_location, grp->run);
240  if (!taskCDB) return;
241  }
242 
243  // --- Event Statistics (Jan Fiete) --------------------------------
244  if (qaCfg->DoEventStat()) {
245  gROOT->LoadMacro(oadb+"/macros/AddTaskPhysicsSelection.C");
246  AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(kTRUE/*MC*/);
247  // Hack by Alexander for LHC10h
248  // gROOT->LoadMacro("LHC10hPS.C");
249  // AliOADBPhysicsSelection* ops = LHC10hPS(grp->period, grp->run);
250  // if (ops)
251  // physSelTask->GetPhysicsSelection()->SetCustomOADBObjects(ops,0);
252  }
253  // --- PIDResponse(JENS) -------------------------------------------
254  if (qaCfg->DoPIDResponse() && !is10h) {
255  gROOT->LoadMacro(ana+"/macros/AddTaskPIDResponse.C");
256  AliAnalysisTaskPIDResponse *PIDResponse = AddTaskPIDResponse(kTRUE);
257  PIDResponse->SelectCollisionCandidates(kTriggerMask);
258  }
259  // --- Centrality (A. Toia) ----------------------------------------
260  if (qaCfg->DoCentrality()) {
261  gROOT->LoadMacro(oadb+"/macros/AddTaskCentrality.C");
262  AliCentralitySelectionTask *taskCentrality = AddTaskCentrality();
263  taskCentrality->SetMCInput();
264  }
265 
266  // --- Vertexing (A. Dainese) --------------------------------------
267  if (qaCfg->DoVertex()) {
268  gROOT->LoadMacro(pwgpp+"/macros/AddTaskVertexESD.C");
269  // Specific setting for MC
270  AliAnalysisTaskVertexESD* taskvertexesd =
271  AddTaskVertexESD(kTRUE, kTriggerMask);
272  taskvertexesd->SelectCollisionCandidates(kTriggerMask);
273  }
274 
275  // --- TPC QA (E. Sicking) -----------------------------------------
276  if (qaCfg->DoQAsym()) {
277  // offline trigger in AddTask
278  gROOT->LoadMacro(pwgpp+"/PilotTrain/AddTaskQAsym.C");
279  AliAnalysisTaskSE * taskqasim = AddTaskQAsym(0,
280  kTriggerMask,
281  kTriggerHM,
282  kTriggerEMC,
284  }
285  // --- VZERO QA (C. Cheshkov) -------------------------------------
286  if (qaCfg->DoVZERO() && detCfg->UseVZERO()) {
287  gROOT->LoadMacro(pwgpp+"/PilotTrain/AddTaskVZEROQA.C");
288  AliAnalysisTaskSE * taskv0qa = AddTaskVZEROQA(0);
289  }
290  if (qaCfg->DoVZEROPbPb() && detCfg->UseVZERO() && grp->IsAA()) {
291  gROOT->LoadMacro(pwgpp+"/VZERO/AddTaskVZEROPbPb.C");
292  AliAnaVZEROPbPb* taskV0PbPb =
293  (AliAnaVZEROPbPb*)AddTaskVZEROPbPb(Int_t(grp->run));
294  }
295  // --- TPC (Jacek Otwinowski & Michael Knichel) --------------------
296  //
297  //
298  // - Optionally MC information can be used by setting the 1st
299  // argument to true
300  // - Optionally friends information can be switched off by setting
301  // the 2st argument to false
302  // - Optionally highMult axis can be used by setting the 3st
303  // argument to true (for PbPb)
304  if (qaCfg->DoTPC() && detCfg->UseTPC()) {
305  gROOT->LoadMacro(pwgpp+"/TPC/macros/AddTaskPerformanceTPCdEdxQA.C");
306  AliPerformanceTask *tpcQA = 0;
307  if (grp->IsAA()) {
308  // High multiplicity Pb-Pb
309  tpcQA = AddTaskPerformanceTPCdEdxQA(kTRUE, kTRUE, kTRUE);
310  } else {
311  // Low multiplicity (pp)
312  tpcQA = AddTaskPerformanceTPCdEdxQA(kTRUE, kTRUE, kFALSE);
313  }
314  tpcQA->SelectCollisionCandidates(kTriggerMask);
315  AliPerformanceRes::SetMergeEntriesCut(5000000);
316  }
317 
318  // --- HLT (Alberica Toia) -----------------------------------------
319  if (qaCfg->DoHLT() && detCfg->UseTPC()) {
320  gROOT->LoadMacro(pwgpp+"/TPC/macros/AddTaskPerformanceTPCdEdxQA.C");
321  AliPerformanceTask *hltQA = AddTaskPerformanceTPCdEdxQA(kTRUE, kTRUE,
322  kFALSE,0,kTRUE);
323  hltQA->SelectCollisionCandidates(kTriggerMask);
324  }
325  // --- SPD (A. Mastroserio) ----------------------------------------
326  if (qaCfg->DoSPD() && detCfg->UseITS()) {
327  gROOT->LoadMacro(pwgpp+"/PilotTrain/AddTaskSPDQA.C");
328  AliAnalysisTaskSPD* taskspdqa = (AliAnalysisTaskSPD*)AddTaskSPDQA();
329  // Request from Annalisa
330  if (grp->IsAA()) taskspdqa->SetHeavyIonMode();
331  taskspdqa->SelectCollisionCandidates(kTriggerMask);
332  taskspdqa->SetOCDBInfo(grp->run, "raw://");
333  }
334  // --- SDD (F. Prino) ----------------------------------------------
335  if (qaCfg->DoSDD() && detCfg->UseITS()) {
336  gROOT->LoadMacro(pwgpp+"/PilotTrain/AddSDDPoints.C");
337  AliAnalysisTaskSE* tasksdd = AddSDDPoints();
338  tasksdd->SelectCollisionCandidates(kTriggerMask);
339  }
340  // --- SSD dEdx (Marek Chojnacki) ----------------------------------
341  if (qaCfg->DoSSDdEdx() && detCfg->UseITS()) {
342  gROOT->LoadMacro(pwgpp+"/PilotTrain/AddTaskdEdxSSDQA.C");
343  AliAnalysisTaskSE* taskssddedx = AddTaskdEdxSSDQA();
344  taskssddedx->SelectCollisionCandidates(kTriggerMask);
345  }
346 
347  // --- ITS ---------------------------------------------------------
348  if (qaCfg->DoITS() && detCfg->UseITS()) {
349  // hardcoded non-zero trigger mask
350  gROOT->LoadMacro(pwgpp+"/macros/AddTaskPerformanceITS.C");
351  AliAnalysisTaskITSTrackingCheck *itsQA = 0;
352  AliAnalysisTaskITSTrackingCheck *itsQACent0010 = 0;
353  AliAnalysisTaskITSTrackingCheck *itsQACent3050 = 0;
354  AliAnalysisTaskITSTrackingCheck *itsQACent6080 = 0;
355  if(grp->IsPP()) {
356  itsQA = AddTaskPerformanceITS(kTRUE);
357  } else {
358  itsQA = AddTaskPerformanceITS(kTRUE);
359  itsQACent0010 = AddTaskPerformanceITS(kTRUE,kFALSE,kFALSE,3500,10000);
360  itsQACent3050 = AddTaskPerformanceITS(kTRUE,kFALSE,kFALSE,590,1570);
361  itsQACent6080 = AddTaskPerformanceITS(kTRUE,kFALSE,kFALSE,70,310);
362  }
363  }
364  // --- ITS saTracks, align (F.Prino) -------------------------------
365  if (qaCfg->DoITSsaTracks() && detCfg->UseITS()) {
366  // offline trigger in AddTask
367  gROOT->LoadMacro(pwgpp+"/macros/AddTaskITSsaTracks.C");
368  AliAnalysisTaskITSsaTracks *itssaTracks = AddTaskITSsaTracks(kTRUE,kFALSE);
369  itssaTracks->SelectCollisionCandidates(kTriggerMask);
370  }
371  if (qaCfg->DoITSalign() && detCfg->UseITS()) {
372  // no offline trigger selection
373  gROOT->LoadMacro(pwgpp+"/macros/AddTaskITSAlign.C");
374  AliAnalysisTaskITSAlignQA *itsAlign = AddTaskITSAlign(0,2011);
375  }
376 
377  // --- TRD (Alex Bercuci, M. Fasel) --------------------------------
378  if(qaCfg->DoTRD() && detCfg->UseTRD()) {
379  // no offline trigger selection
380  gROOT->LoadMacro(pwgpp+"/macros/AddTrainPerformanceTRD.C");
381  // steer individual TRD tasks
382  Bool_t
383  doCheckESD(kTRUE), // AliTRDcheckESD
384  doCheckDET(kTRUE), // AliTRDcheckDET
385  doEffic(kTRUE), // AliTRDefficiency
386  doResolution(kTRUE),// AliTRDresolution
387  doCheckPID(kTRUE), // AliTRDcheckPID
388  doV0Monitor(kFALSE);// AliTRDv0Monitor
389  AddTrainPerformanceTRD(Translate(doCheckESD, doCheckDET, doEffic,
390  doResolution, doCheckPID, doV0Monitor));
391  }
392 
393  // --- ZDC (Chiara Oppedisano) -------------------------------------
394  if(qaCfg->DoZDC() && detCfg->UseZDC()) {
395  // hardcoded kMB trigger mask
396  gROOT->LoadMacro(pwgpp+"/ZDC/AddTaskZDCQA.C");
397  AliAnalysisTaskSE *taskZDC = AddTaskZDCQA();
398  taskZDC->SelectCollisionCandidates(kTriggerMask);
399  }
400 
401  // --- Calorimetry (Gustavo Conesa) --------------------------------
402  if(qaCfg->DoCALO() && !is10h) {
403  gROOT->LoadMacro(pwgga+
404  "/CaloTrackCorrelations/macros/QA/AddTaskCalorimeterQA.C");
406  AddTaskCalorimeterQA("default");
407  taskCaloQA->SetDebugLevel(0);
408  // offline mask set in AddTask to kMB
409  taskCaloQA->SelectCollisionCandidates(kTriggerMask);
410  // Add a new calo task with EMC1 trigger only
411  if (!is10h) {
412  taskCaloQA = AddTaskCalorimeterQA("trigEMC");
413  taskCaloQA->SetDebugLevel(0);
414  taskCaloQA->SelectCollisionCandidates(kTriggerEMC);
415  }
416  }
417 
418  // --- Muon Trigger ------------------------------------------------
419  if(qaCfg->DoMUONTrig() && detCfg->UseMUON()) {
420  // no offline trigger selection
421  gROOT->LoadMacro(pwgpp+"/macros/AddTaskMTRchamberEfficiency.C");
422  AliAnalysisTaskTrigChEff *taskMuonTrig = AddTaskMTRchamberEfficiency();
423  }
424 
425  // --- Muon Efficiency (not used) ----------------------------------
426  if(qaCfg->DoMUONEff() && detCfg->UseMUON()) {
427  gROOT->LoadMacro(ali+"/PWG3/muondep/AddTaskMUONTrackingEfficiency.C");
428  AliAnalysisTaskMuonTrackingEff *taskMuonTrackEff =
430  }
431 
432  // --- V0-Decay Reconstruction (Ana Marin) (not used) --------------
433  if (qaCfg->DoV0()) {
434  gROOT->LoadMacro(pwgpp+"/macros/AddTaskV0QA.C");
435  AliAnalysisTaskV0QA *taskv0QA = AddTaskV0QA(kTRUE);
436  }
437 
438  // -- Impact parameter resolution ----------------------------------
439  // (xianbao.yuan@pd.infn.it, andrea.dainese@pd.infn.it)
440  if (qaCfg->DoImpParRes()) {
441  gROOT->LoadMacro(pwgpp+"/macros/AddTaskImpParRes.C");
442  AliAnalysisTaskSE* taskimpparres=0;
443  // Specific setting for MC
444  if(grp->IsPP()) {
445  taskimpparres= AddTaskImpParRes(kTRUE);
446  } else {
447  taskimpparres= AddTaskImpParRes(kTRUE,-1,kTRUE,kFALSE);
448  }
449  taskimpparres->SelectCollisionCandidates(kTriggerMask);
450  }
451 
452  // --- MUON QA (Philippe Pillot) -----------------------------------
453  if (qaCfg->DoMUON() && detCfg->UseMUON()) {
454  // trigger analysis internal
455  gROOT->LoadMacro(pwgpp+"/PilotTrain/AddTaskMuonQA.C");
456  AliAnalysisTaskSE* taskmuonqa= AddTaskMuonQA();
457  }
458 
459  // --- TOF (Francesca Bellini) -------------------------------------
460  if (qaCfg->DoTOF() && detCfg->UseTOF()) {
461  gROOT->LoadMacro(pwgpp+"/TOF/AddTaskTOFQA.C");
462  AliAnalysisTaskTOFqa *tofQA = AddTaskTOFQA(kFALSE);
463  tofQA->SelectCollisionCandidates(kTriggerMask);
464  }
465 
466  // --- PIDqa(JENS) -------------------------------------------------
467  if (qaCfg->DoPIDqa() && !is10h) {
468  gROOT->LoadMacro(ana+"/macros/AddTaskPIDqa.C");
469  AliAnalysisTaskPIDqa *PIDQA = AddTaskPIDqa();
470  PIDQA->SelectCollisionCandidates(kTriggerMask);
471  }
472 
473  // --- HMPID QA (Giacomo Volpe) ------------------------------------
474  //
475  if (qaCfg->DoHMPID() && detCfg->UseHMPID()) {
476  gROOT->LoadMacro(pwgpp+"/HMPID/AddTaskHmpidQA.C");
477  AliAnalysisTaskSE* taskhmpidqa= AddTaskHmpidQA(kTRUE);
478  // offline mask set in AddTask to kMB
479  taskhmpidqa->SelectCollisionCandidates(kTriggerMask);
480  }
481 
482  // --- T0 QA (Alla Mayevskaya) -------------------------------------
483  if (qaCfg->DoT0() && detCfg->UseT0()) {
484  // no offline trigger selection
485  gROOT->LoadMacro(pwgpp+"/T0/AddTaskT0QA.C");
486  AliT0AnalysisTaskQA* taskt0qa= AddTaskT0QA();
487  taskt0qa->SelectCollisionCandidates(kTriggerMask);
488  }
489 
490  // ---- FMD QA (Christian Holm Christiansen) -----------------------
491  if (qaCfg->DoFWD() && detCfg->UseFMD()) {
492  gROOT->LoadMacro(pwglf+"/FORWARD/analysis2/AddTaskForwardQA.C");
493  // Parameters: usemc, usecentrality
494  // AliAnalysisTaskSE *forwardQA = (AliAnalysisTaskSE *)
495  AddTaskForwardQA(kTRUE, qaCfg->DoCentrality());
496  // HACK: to read corrections from current directory
497  const char* hack="AliForwardCorrectionManager::Instance().SetPrefix(\".\")";
498  gROOT->ProcessLine(hack);
499  const char* hack2="AliForwardCorrectionManager::Instance().Print(\"R\")";
500  gROOT->ProcessLine(hack2);
501  // No offline trigger config. needed (see #84077)
502  }
503 
504  // --- PHOS QA (Boris Polishchuk) ----------------------------------
505  if (qaCfg->DoPHOS()&& detCfg->UsePHOS()) {
506  gROOT->LoadMacro(pwgga+"/PHOSTasks/CaloCellQA/macros/AddTaskCaloCellsQA.C");
507  AliAnalysisTaskCaloCellsQA *taskPHOSCellQA1 =
508  AddTaskCaloCellsQA(4, 1, NULL,"PHOSCellsQA_AnyInt");
509  taskPHOSCellQA1->SelectCollisionCandidates(kTriggerMask);
510  taskPHOSCellQA1->GetCaloCellsQA()->SetClusterEnergyCuts(0.3,0.3,1.0);
511 
512  AliAnalysisTaskCaloCellsQA *taskPHOSCellQA2 =
513  AddTaskCaloCellsQA(4, 1, NULL,"PHOSCellsQA_PHI7");
514  taskPHOSCellQA2->SelectCollisionCandidates(AliVEvent::kPHI7);
515  taskPHOSCellQA2->GetCaloCellsQA()->SetClusterEnergyCuts(0.3,0.3,1.0);
516 
517  // Pi0 QA fo PbPb
518  if (grp->IsAA()) {
519  gROOT->LoadMacro(pwgga+"/PHOSTasks/PHOS_PbPbQA/macros/AddTaskPHOSPbPb.C");
520  AliAnalysisTaskPHOSPbPbQA* phosPbPb = AddTaskPHOSPbPbQA(0);
521  }
522  }
523  if (qaCfg->DoPHOSTrig() && detCfg->UsePHOS()) {
524  gROOT->LoadMacro(pwgga+
525  "/PHOSTasks/PHOS_TriggerQA/macros/AddTaskPHOSTriggerQA.C");
526  AliAnalysisTaskPHOSTriggerQA *taskPHOSTrig = AddTaskPHOSTriggerQA(0,0);
527  }
528 
529  // --- EMCAL QA (Gustavo Conesa) -----------------------------------
530  if (qaCfg->DoEMCAL() && detCfg->UseEMCAL()) {
531  gROOT->LoadMacro(pwgga+"/EMCALTasks/macros/AddTaskEMCALTriggerQA.C");
533  }
534 
535  // --- FLOW and BF QA (C.Perez && A.Rodriguez) ---------------------
536  if (qaCfg->DoFBFqa()) {
537  gROOT->LoadMacro(pwgpp+"/macros/AddTaskFBFqa.C");
538  AliAnalysisTaskSE *qaFBFMB = (AliAnalysisTaskSE*)AddTaskFBFqa("qaFBFmb",
539  kFALSE);
540  qaFBFMB->SelectCollisionCandidates(AliVEvent::kMB);
541  AliAnalysisTaskSE *qaFBFSC = (AliAnalysisTaskSE*)AddTaskFBFqa("qaFBFsc",
542  kFALSE);
543  qaFBFSC->SelectCollisionCandidates(AliVEvent::kSemiCentral);
544  AliAnalysisTaskSE *qaFBFCE = (AliAnalysisTaskSE*)AddTaskFBFqa("qaFBFce",
545  kFALSE);
546  qaFBFCE->SelectCollisionCandidates(AliVEvent::kCentral);
547  }
548 }
554 {
555  std::ofstream out;
556  out.open("outputs_valid", ios::out);
557  out.close();
558 }
559 
560 //====================================================================
567 void QAMerge(const char *dir, Int_t stage)
568 {
569 // Merging method
570  TStopwatch timer; timer.Start();
571  TString outputDir = dir;
572  TObjArray outputFiles;
573  outputFiles.Add(new TObjString("QAresults.root"));
574  outputFiles.Add(new TObjString("EventStat_temp.root"));
575 
576  TString mergeExcludes = "";
577  TIter iter(&outputFiles);
578  TObjString* str = 0;
579  Bool_t merged = kTRUE;
580  while((str = static_cast<TObjString*>(iter()))) {
581  TString& outputFile = str->GetString();
582  // Skip already merged outputs
583  if (!gSystem->AccessPathName(outputFile)) {
584  ::Warning("Merge","Output file <%s> found. Not merging again.",
585  outputFile.Data());
586  continue;
587  }
588  if (mergeExcludes.Contains(outputFile.Data())) continue;
589  merged = AliAnalysisAlien::MergeOutput(outputFile,
590  outputDir,
591  10,
592  stage);
593  if (!merged) {
594  ::Error("Merge", "Cannot merge %s\n", outputFile.Data());
595  continue;
596  }
597  }
598  TString infolog = "fileinfo.log";
599  AliAnalysisAlien::MergeInfo(infolog, dir);
600 
601  if (!outputDir.Contains("Stage")) {
602  ValidateOutput();
603  timer.Print();
604  return;
605  }
606  // --- Set up to run terminate -------------------------------------
607  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
608  mgr->SetSkipTerminate(kFALSE);
609  if (!mgr->InitAnalysis()) return;
610 
611  mgr->PrintStatus();
612  mgr->StartAnalysis("gridterminate", (TTree*)0);
613  ValidateOutput();
614  timer.Print();
615 }
616 
617 //====================================================================
626 void QA(UInt_t run,
627  const char* xmlfile = "wn.xml",
628  Int_t stage = 0, /*0 = QA train, 1...n - merging stage*/
629  const char* cdb = "raw://")
630 {
631  // -----------------------------------------------------------------
632  //
633  // Get GRP parameters. Defines global "grp" as a pointer to GRPData
634  //
635  gROOT->Macro(Form("GRP.C(%d)", run));
636  gROOT->Macro("BaseConfig.C");
637  gROOT->Macro("QAConfig.C");
638  gROOT->Macro("DetConfig.C");
639  qaCfg->Print();
640  Int_t debug_level = qaCfg->DebugLevel(); // Debugging
641  TString cdbString(cdb);
642  if (cdbString.Contains("raw://")) {
643  TGrid::Connect("alien://");
644  if (!gGrid || !gGrid->IsConnected()) {
645  ::Error("QAtrain", "No grid connection");
646  return;
647  }
648  }
649 
650  // --- Some settings -----------------------------------------------
651  // Set temporary merging directory to current one
652  gSystem->Setenv("TMPDIR", gSystem->pwd());
653  // Set temporary compilation directory to current one
654  gSystem->SetBuildDir(gSystem->pwd(), kTRUE);
655  // Load common libraries and set include path
656  LoadLibraries();
657  printf("Include path: %s\n", gSystem->GetIncludePath());
658 
659  // === Make the analysis manager and connect event handlers ========
660  //
661  // --- Analysis manager and load libraries -------------------------
662  AliAnalysisManager *mgr = new AliAnalysisManager("QA", "Production train");
663  mgr->SetRunFromPath(grp->run);
664 
665  // --- Create ESD input handler ------------------------------------
666  AliESDInputHandlerRP *esdHandler = new AliESDInputHandlerRP();
667  esdHandler->SetReadFriends(kTRUE);
668  esdHandler->SetActiveBranches("ESDfriend");
669  mgr->SetInputEventHandler(esdHandler);
670 
671  // --- Monte Carlo handler -----------------------------------------
672  if (true) {
673  AliMCEventHandler* mcHandler = new AliMCEventHandler();
674  mgr->SetMCtruthEventHandler(mcHandler);
675  mcHandler->SetPreReadMode(1);
676  mcHandler->SetReadTR(true);
677  }
678 
679  // === Set up tasks ================================================
680  //
681  // --- Create tasks ------------------------------------------------
682  AddAnalysisTasks(cdb);
683 
684  // --- Debugging if needed -----------------------------------------
685  if (debug_level > 0) mgr->SetDebugLevel(debug_level);
686 
687  // --- If merging, do so here and exit -----------------------------
688  if (stage>0) {
689  QAMerge(xmlfile, stage);
690  return;
691  }
692 
693  // === Run the analysis ============================================
694  //
695  // --- Make our chain ----------------------------------------------
696  TChain *chain = new TChain("esdTree");
697  chain->Add("AliESDs.root");
698 
699  // --- Run the thing -----------------------------------------------
700  TStopwatch timer;
701  timer.Start();
702  if (!mgr->InitAnalysis()) return;
703 
704  mgr->PrintStatus();
705  mgr->SetSkipTerminate(kTRUE);
706  mgr->SetNSysInfo(1);
707  mgr->StartAnalysis("local", chain);
708  timer.Print();
709 }
710 
711 //
712 // EOF
713 //
714 
virtual Int_t DebugLevel() const =0
UInt_t run
Definition: GRP.C:102
return jsonbuilder str().c_str()
virtual Bool_t DoTOF() const =0
UInt_t kTriggerMask
Definition: QA.C:42
void ana(Int_t mode=mGRID)
Definition: ana.C:86
UInt_t kTriggerMuonAll
Definition: QA.C:28
UInt_t kTriggerMuonBarell
Definition: QA.C:36
virtual Bool_t DoTRD() const =0
virtual Bool_t DoCentrality() const =0
const char * title
Definition: MakeQAPdf.C:26
virtual Bool_t DoHLT() const =0
virtual Bool_t DoVertex() const =0
void LoadLibraries()
Definition: QA.C:167
AliAnalysisTask * AddTaskForwardQA(Bool_t mc=false, Bool_t useCent=false)
TSystem * gSystem
virtual Bool_t DoCDBconnect() const =0
AliAnalysisTaskEMCALTriggerQA * AddTaskEMCALTriggerQA(Bool_t kSimulation=kFALSE, TString outputFile="")
virtual Bool_t DoImpParRes() const =0
virtual Bool_t DoITS() const =0
virtual Bool_t UseFMD() const
Definition: BaseConfig.C:21
virtual Bool_t DoQAsym() const =0
virtual Bool_t DoHMPID() const =0
virtual Bool_t DoFWD() const =0
virtual Bool_t UseT0() const
Definition: BaseConfig.C:32
virtual Bool_t DoZDC() const =0
tracking chamber efficiency from ESD data
virtual void PrintOne(const char *title, Bool_t use) const
Definition: QA.C:119
virtual Bool_t UsePHOS() const
Definition: BaseConfig.C:27
void QA(UInt_t run, const char *xmlfile="wn.xml", Int_t stage=0, const char *cdb="raw://")
Definition: QA.C:626
VirtualQACfg * qaCfg
Definition: QA.C:160
virtual Bool_t UseMUON() const
Definition: BaseConfig.C:26
Bool_t IsAA() const
Definition: GRP.C:159
AliAnalysisTaskCaloTrackCorrelation * AddTaskCalorimeterQA(const char *suffix="default", Bool_t simulation=kFALSE, TString outputFile="", Int_t year=2015, Bool_t printSettings=kFALSE, Bool_t calibrate=kTRUE)
void QAMerge(const char *dir, Int_t stage)
Definition: QA.C:567
int Int_t
Definition: External.C:63
virtual Bool_t DoTPC() const =0
unsigned int UInt_t
Definition: External.C:33
virtual Bool_t DoSSDdEdx() const =0
virtual Bool_t DoMUONEff() const =0
virtual Bool_t UseTPC() const
Definition: BaseConfig.C:34
UInt_t kTriggerInt
Definition: QA.C:27
void ValidateOutput()
Definition: QA.C:553
virtual void Print() const
Definition: QA.C:123
virtual Bool_t DoVZEROPbPb() const =0
virtual Bool_t DoMUONTrig() const =0
virtual Bool_t DoPHOSTrig() const =0
TString period
Definition: GRP.C:101
virtual Bool_t UseITS() const
Definition: BaseConfig.C:24
virtual Bool_t DoSDD() const =0
GRPData * grp
Definition: GRP.C:361
Bool_t IsPP() const
Definition: GRP.C:141
UInt_t kTriggerEMC
Definition: QA.C:37
virtual Bool_t DoVZERO() const =0
virtual Bool_t DoEMCAL() const =0
virtual Bool_t UseTRD() const
Definition: BaseConfig.C:35
virtual Bool_t DoCALO() const =0
virtual Bool_t DoITSalign() const =0
virtual Bool_t UseVZERO() const
Definition: BaseConfig.C:36
virtual Bool_t DoSPD() const =0
void AddAnalysisTasks(const char *cdb_location)
Definition: QA.C:216
Main class conecting the CaloTrackCorrelations package and Analysis Frame.
virtual Bool_t UseZDC() const
Definition: BaseConfig.C:37
virtual Bool_t DoPIDqa() const =0
VirtualDetCfg * detCfg
Definition: BaseConfig.C:139
virtual Bool_t UseEMCAL() const
Definition: BaseConfig.C:20
virtual Bool_t DoFBFqa() const =0
UInt_t kTriggerHM
Definition: QA.C:41
virtual Bool_t DoITSsaTracks() const =0
bool Bool_t
Definition: External.C:53
Fill histograms with basic QA information for EMCAL offline trigger.
AliAnalysisTaskMuonTrackingEff * AddTaskMUONTrackingEfficiency(Bool_t setDefaultTrackCuts, Bool_t isMC, TString extension="")
virtual Bool_t DoEventStat() const =0
virtual Bool_t DoT0() const =0
virtual Bool_t UseTOF() const
Definition: BaseConfig.C:33
virtual Bool_t DoMUON() const =0
virtual Bool_t UseHMPID() const
Definition: BaseConfig.C:30
virtual Bool_t DoV0() const =0
virtual Bool_t DoPHOS() const =0
virtual Bool_t DoPIDResponse() const =0