AliPhysics  251aa1e (251aa1e)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
QATrain.C
Go to the documentation of this file.
1 
12 #include "TrainSetup.C"
13 #include <AliESDInputHandlerRP.h>
14 #include <AliCDBManager.h>
15 
16 //====================================================================
22 class QATrain : public TrainSetup
23 {
24 public:
25  enum {
26  kCDBConnect = 0x1,
27  kEventStats = 0x2, // Event Statistics (Jan Fiete)
28  kCentrality = 0x4, // Centrality (A. Toia)
30  };
31  enum {
32  kVertex = 0x000001, // Vertexing (A. Dainese)
33  kSymmetric = 0x000002, // TPC QA (E. Sicking)
34  kVZERO = 0x000004, // VZERO QA (C. Cheshkov)
35  kTPC = 0x000008, // TPC (Jacek Otwinowski & Michael Knichel)
36  kSPD = 0x000010, // SPD (A. Mastroserio) - Needs RP
37  kSDD = 0x000020, // SDD (F. Prino) Needs RP
38  kSSD = 0x000040, // SSD dEdx (Marek Chojnacki)
39  kITS = 0x000080, //
40  kITSSA = 0x000100, // ITS saTracks (F.Prino)
41  kITSAlign = 0x000200, // ITS align (F.Prino)
42  kTRD = 0x000400, // TRD (Alex Bercuci, M. Fasel)
43  kZDC = 0x000800, // ZDC (Chiara Oppedisano)
44  kCALO = 0x001000, // Calorimetry (Gustavo Conesa)
45  kMUONTRG = 0x002000, // Muon Trigger
46  kMUONEff = 0x004000, // Muon Efficiency (not used) Need geo
47  kV0 = 0x008000, // V0-Decay Reconstruction (Ana Marin)
48  // (not used) Need MC truth
49  kBRes = 0x010000, // Impact parameter resolution
50  // (xianbao.yuan@pd.infn.it,
51  // andrea.dainese@pd.infn.it)
52  kMUON = 0x020000, // MUON QA (Philippe Pillot)
53  kTOF = 0x040000, // TOF (Francesca Bellini)
54  kPIDRes = 0x080000, // PIDResponse (Jens)
55  kPID = 0x100000, // PIDqa (Jens)
56  kHMPID = 0x200000, // HMPID QA (Giacomo Volpe)
57  kT0 = 0x400000, // T0 QA (Alla Mayevskaya)
58  kFMD = 0x800000, // FMD QA (Christian Holm Christiansen)
62  };
63 
64 
65 
72  QATrain(const char* name="PilotAnalysis")
73  : TrainSetup(name, false, 0, 0, 0, 0, 0),
74  fRun(0),
77  fTriggerMask(AliVEvent::kAnyINT),
78  fTriggerHM(AliVEvent::kHighMult),
79  fTriggerEMC(AliVEvent::kEMC7),
80  fTriggerMUONBarrel(AliVEvent::kMUU7),
81  fCollisionType(0) // 0: pp, 1: PbPb
82  {}
83  void SetFlags(UShort_t flags) { fFlags = flags; }
84  void SetRun(UInt_t run) { fRun = run; }
85  void SetModules(UInt_t m) { fModules = m; }
86 protected:
87  AliVEventHandler* CreateInputHandler(EType type)
88  {
89  if (type != kESD) return 0;
90  AliAnalysisManager::GetAnalysisManager()->SetRunFromPath(fRun);
91 
92  AliESDInputHandlerRP* ih = new AliESDInputHandlerRP();
93  ih->SetReadFriends(kTRUE);
94  ih->SetActiveBranches("ESDfriend");
95  return ih;
96  }
98  const char* args="")
99  {
100  AliAnalysisTaskSE* task = CoupleSECar(macro, args);
101  if (task) task->SelectCollisionCandidates(fTriggerMask);
102  return task;
103  }
105  {
106  ::Info("CreateCDBConnect", "Loading CDB connect w/run=%d", fRun);
107  AliAnalysisTask* task = CoupleCar("AddTaskCDBconnect.C", Form("%d", fRun));
108  ::Info("CreateCDBConnect", "Loaded %p", task);
109  if (!task) return;
110  AliCDBManager::Instance()->SetDefaultStorage("raw://");
111  }
113  AliAnalysisManager* mgr)
114  {
115  // Event Statistics (Jan Fiete)
116  if (!(fFlags & kEventStats)) return;
118  }
120  {
121  // Centrality (A. Toia)
122  if (!(fFlags & kCentrality)) return;
124  }
126  {
127  // Vertexing (A. Dainese)
128  CoupleCar("AddTaskVertexESD.C", Form("kFALSE,0x%x", fTriggerMask));
129  }
131  {
132  // TPC QA (E. Sicking)
133  CoupleCar("AddTaskQAsym.C", Form("0,0x%x,0x%x,0x%x,0x%x",
136  }
137  void CreateVZERO()
138  {
139  // VZERO QA (C. Cheshkov)
140  CoupleCar("AddTaskVZEROQA.C", "0");
141  }
142  void CreateTPC()
143  {
144  // TPC (Jacek Otwinowski & Michael Knichel)
145  //
146  // Optionally MC information can be used by setting the 1st
147  // argument to true
148  //
149  // Optionally friends information can be switched off by setting
150  // the 2st argument to false
151  //
152  // Optionally highMult axis can be used by setting the 3st
153  // argument to true (for PbPb)
154  gROOT->SetMacroPath(Form("%s:$(ALICE_PHYSICS)/PWGPP/TPC/macros",
155  gROOT->GetMacroPath()));
156  CreateTaskAndSetCollisionCandidates("AddTaskPerformanceTPCdEdxQA.C",
157  "kFALSE,kTRUE,kFALSE");
158  }
159  void CreateSPD()
160  {
161  // SPD (A. Mastroserio)
162  CreateTaskAndSetCollisionCandidates("AddTaskSPDQA.C");
163  // AliAnalysisTask* task =
164  // CreateTaskAndSetCollisionCandidates("AddTaskSPDQA.C");
165  // if (!task) return;
166  // task->SetOCDBInfo(fRun, "raw://");
167  }
168  void CreateSDD()
169  {
170  // SDD (F. Prino)
171  CreateTaskAndSetCollisionCandidates("AddSDDPoints.C");
172  }
173  void CreateSSD()
174  {
175  // SSD dEdx (Marek Chojnacki)
176  CreateTaskAndSetCollisionCandidates("AddTaskdEdxSSDQA.C");
177  }
178  void CreateITS()
179  {
180  CoupleCar("AddTaskPerformanceITS.C","false");
181  if (fCollisionType == 0) return;
182 
183  gROOT->ProcessLine("AddTaskPerformanceITS(false,false,false,3500,10000)");
184  gROOT->ProcessLine("AddTaskPerformanceITS(false,false,false,590,1570)");
185  gROOT->ProcessLine("AddTaskPerformanceITS(false,false,false,70,310)");
186  }
187  void CreateITSSA()
188  {
189  // ITS saTracks, align (F.Prino)
190  CreateTaskAndSetCollisionCandidates("AddTaskITSsaTracks.C",
191  "false,false)");
192  }
194  {
195  // ITS saTracks, align (F.Prino)
196  CoupleCar("AddTaskITSAlign.C","0,2011");
197  }
198  void CreateTRD()
199  {
200  // TRD (Alex Bercuci, M. Fasel)
201  gSystem->AddIncludePath("-I${ALICE_PHYSICS}/PWGPP/TRD");
202  CoupleCar("AddTrainPerformanceTRD.C","\"ESD DET EFF RES PID\"");
203  }
204  void CreateZDC()
205  {
206  // ZDC (Chiara Oppedisano)
207  gROOT->SetMacroPath(Form("%s:$(ALICE_PHYSICS)/PWGPP/ZDC",
208  gROOT->GetMacroPath()));
209  CreateTaskAndSetCollisionCandidates("AddTaskZDCQA.C");
210  }
211  void CreateCALO(EMode mode, Bool_t par)
212  {
213  // Calorimetry (Gustavo Conesa)
214  LoadLibrary("EMCALUtils", mode, par, true);
215  LoadLibrary("PHOSUtils", mode, par, true);
216  LoadLibrary("PWG4PartCorrBase", mode, par, true);
217  LoadLibrary("PWG4PartCorrDep", mode, par, true);
218 
219  gROOT->SetMacroPath(Form("%s:$(ALICE_PHYSICS)/PWG4/macros/QA",
220  gROOT->GetMacroPath()));
221  CreateTaskAndSetCollisionCandidates("AddTaskCalorimeterQA.C",
222  "\"ESD\",20011,false,false)");
223  Long_t ret =
224  gROOT->ProcessLine("AddTaskCalorimeterQA(\"ESD\",2011,false,false,\"\",\"EMC7\")");
225  if (!ret) return;
226  AliAnalysisTaskSE* task = reinterpret_cast<AliAnalysisTaskSE*>(ret);
227  task->SelectCollisionCandidates(fTriggerEMC);
228  }
229  void CreateMUONTRG(EMode mode, Bool_t par)
230  {
231  // Muon Trigger
232  LoadLibrary("PWG3base", mode, par, true);
233  LoadLibrary("PWG3muon", mode, par, true);
234  LoadLibrary("PWG3muondep", mode, par, true);
235 
236  CoupleCar("AddTaskMTRchamberEfficiency.C");
237  }
239  {
240  gROOT->SetMacroPath(Form("%s:$(ALICE_PHYSICS)/PWG3/muondep",
241  gROOT->GetMacroPath()));
242  CoupleCar("AddTaskMUONTrackingEfficiency.C");
243  }
244  void CreateV0()
245  {
246  // V0-Decay Reconstruction (Ana Marin) (not used)
247  CoupleCar("AddTaskV0QA.C","false");
248  }
249  void CreateBRes()
250  {
251  // Impact parameter resolution (xianbao.yuan@pd.infn.it,
252  // andrea.dainese@pd.infn.it)
253  CreateTaskAndSetCollisionCandidates(Form("AddTaskImpParRes.C",
254  fCollisionType == 0 ?
255  "" :
256  "false,-1,false,false"));
257  }
258  void CreateMUON(EMode mode, Bool_t par)
259  {
260  // MUON QA (Philippe Pillot)
261  LoadLibrary("PWG3base", mode, par, true);
262  LoadLibrary("PWG3muon", mode, par, true);
263  LoadLibrary("PWG3muondep", mode, par, true);
264  gROOT->SetMacroPath(Form("%s:$(ALICE_PHYSICS)/PWG3/muon",
265  gROOT->GetMacroPath()));
266  CoupleCar("AddTaskMuonQA.C");
267  }
268  void CreateTOF()
269  {
270  // TOF (Francesca Bellini)
271  gROOT->SetMacroPath(Form("%s:$(ALICE_PHYSICS)/PWGPP/TOF",
272  gROOT->GetMacroPath()));
273  CreateTaskAndSetCollisionCandidates("AddTaskTOFQA.C");
274  }
276  {
277  // PIDResponse (Jens)
278  CreateTaskAndSetCollisionCandidates("AddTaskPIDResponse.C");
279  }
280 
281  void CreatePID()
282  {
283  // PIDqa (Jens)
284  CreateTaskAndSetCollisionCandidates("AddTaskPIDqa.C");
285  }
286  void CreateHMPID()
287  {
288  // HMPID QA (Giacomo Volpe)
289  gROOT->SetMacroPath(Form("%s:$(ALICE_PHYSICS)/PWGPP/HMPID",
290  gROOT->GetMacroPath()));
291  CreateTaskAndSetCollisionCandidates("AddTaskHmpidQA.C");
292  }
293  void CreateT0()
294  {
295  // T0 QA (Alla Mayevskaya)
296  gROOT->SetMacroPath(Form("%s:$(ALICE_PHYSICS)/PWGPP/T0",
297  gROOT->GetMacroPath()));
298  CreateTaskAndSetCollisionCandidates("AddTaskT0QA.C");
299  }
300  void CreateFMD(EMode mode, Bool_t par)
301  {
302  // FMD QA (Christian Holm Christiansen)
303  LoadLibrary("PWGLFforward2", mode, par, true);
304  Bool_t mc = AliAnalysisManager::GetAnalysisManager()
305  ->GetMCtruthEventHandler() != 0;
306  CoupleCar("AddTaskForwardQA.C", Form("(%d,%d)",mc,(fFlags & kCentrality)));
307  }
308  //__________________________________________________________________
316  void CreateTasks(EMode mode, Bool_t par, AliAnalysisManager* mgr)
317  {
318  // --- Output file name ------------------------------------------
319  AliAnalysisManager::SetCommonFileName("QAResults.root");
320 
321  LoadLibrary("CORRFW", mode, par);
322  LoadLibrary("TENDER", mode, par);
323  LoadLibrary("PWG0base", mode, par);
324  LoadLibrary("PWG0dep", mode, par);
325  LoadLibrary("PWG0selectors", mode, par);
326  LoadLibrary("PWGPP", mode, par);
327 
328  gROOT->SetMacroPath(Form("%s:$(ALICE_PHYSICS)/PWGPP/PilotTrain"
329  ":$(ALICE_PHYSICS)/PWGPP/macros",
330  gROOT->GetMacroPath()));
331 
332  mgr->AddStatisticsTask(fTriggerMask);
334  if (fModules & kVertex) CreateVertex();
336  if (fModules & kVZERO) CreateVZERO();
337  if (fModules & kTPC) CreateTPC();
338  if (fModules & kSPD) CreateSPD();
339  if (fModules & kSDD) CreateSDD();
340  if (fModules & kSSD) CreateSSD();
341  if (fModules & kITS) CreateITS();
342  if (fModules & kITSSA) CreateITSSA();
344  if (fModules & kTRD) CreateTRD();
345  if (fModules & kZDC) CreateZDC();
346  if (fModules & kCALO) CreateCALO(mode, par);
347  if (fModules & kMUONTRG) CreateMUONTRG(mode, par);
348  if (fModules & kMUONEff) CreateMUONEff();
349  if (fModules & kV0) CreateV0();
350  if (fModules & kBRes) CreateBRes();
351  if (fModules & kMUON) CreateMUON(mode, par);
352  if (fModules & kTOF) CreateTOF();
353  if (fModules & kPIDRes) CreatePIDRes();
354  if (fModules & kPID) CreatePID();
355  if (fModules & kHMPID) CreateHMPID();
356  if (fModules & kT0) CreateT0();
357  if (fModules & kFMD) CreateFMD(mode, par);
358  }
364  AliVEventHandler* CreateOutputHandler(EType) { return 0; }
365  UInt_t fRun; // Run number
366  UShort_t fFlags; // Flags
367  UInt_t fModules; // Modules to load
372  UShort_t fCollisionType; // 0: pp, 1: PbPb
373 
374 
375  Bool_t fUseCent; // Whether to use centrality or not
376 };
377 
378 //
379 // EOF
380 //
virtual void CreateCentralitySelection(Bool_t mc)
Definition: TrainSetup.C:759
void CreateZDC()
Definition: QATrain.C:204
UInt_t fTriggerMUONBarrel
Definition: QATrain.C:371
void CreateCALO(EMode mode, Bool_t par)
Definition: QATrain.C:211
void CreateTasks(EMode mode, Bool_t par, AliAnalysisManager *mgr)
Definition: QATrain.C:316
AliVEventHandler * CreateOutputHandler(EType)
Definition: QATrain.C:364
void CreateBRes()
Definition: QATrain.C:249
void SetFlags(UShort_t flags)
Definition: QATrain.C:83
void CreateHMPID()
Definition: QATrain.C:286
void CreateVZERO()
Definition: QATrain.C:137
TSystem * gSystem
void CreateFMD(EMode mode, Bool_t par)
Definition: QATrain.C:300
void CreateSDD()
Definition: QATrain.C:168
void CreateMUON(EMode mode, Bool_t par)
Definition: QATrain.C:258
void CreateMUONEff()
Definition: QATrain.C:238
AliVEventHandler * CreateInputHandler(EType type)
Definition: QATrain.C:87
UInt_t fTriggerEMC
Definition: QATrain.C:370
unsigned int UInt_t
Definition: External.C:33
void CreateSymmetric()
Definition: QATrain.C:130
UInt_t fModules
Definition: QATrain.C:367
UInt_t fTriggerMask
Definition: QATrain.C:368
Bool_t fUseCent
Definition: QATrain.C:375
void CreateTRD()
Definition: QATrain.C:198
void CreateT0()
Definition: QATrain.C:293
void CreateCDBConnect()
Definition: QATrain.C:104
void CreateTOF()
Definition: QATrain.C:268
void CreateSSD()
Definition: QATrain.C:173
Int_t mode
Definition: anaM.C:40
void CreateVertex()
Definition: QATrain.C:125
void CreateITSAlign()
Definition: QATrain.C:193
void CreateITSSA()
Definition: QATrain.C:187
Base classs for train specifications.
void CreateITS()
Definition: QATrain.C:178
void CreatePhysicsSelection(Bool_t mc, AliAnalysisManager *mgr)
Definition: QATrain.C:112
UInt_t fTriggerHM
Definition: QATrain.C:369
void CreateSPD()
Definition: QATrain.C:159
QATrain(const char *name="PilotAnalysis")
Definition: QATrain.C:72
unsigned short UShort_t
Definition: External.C:28
UShort_t fCollisionType
Definition: QATrain.C:372
void CreateCentralitySelection(Bool_t mc, AliAnalysisManager *mgr)
Definition: QATrain.C:119
UShort_t fFlags
Definition: QATrain.C:366
Bool_t LoadLibrary(const char *module)
Definition: AOD.C:144
bool Bool_t
Definition: External.C:53
void CreateV0()
Definition: QATrain.C:244
virtual AliAnalysisTask * CoupleCar(const TString &macro, const TString &args)
Definition: TrainSetup.C:833
void CreateMUONTRG(EMode mode, Bool_t par)
Definition: QATrain.C:229
virtual void CreatePhysicsSelection(Bool_t mc, AliAnalysisManager *mgr)
Definition: TrainSetup.C:693
void CreateTPC()
Definition: QATrain.C:142
virtual AliAnalysisTaskSE * CoupleSECar(const TString &macro, const TString &args, UInt_t mask=0)
Definition: TrainSetup.C:875
void CreatePIDRes()
Definition: QATrain.C:275
void SetRun(UInt_t run)
Definition: QATrain.C:84
UInt_t fRun
Definition: QATrain.C:365
void CreatePID()
Definition: QATrain.C:281
AliAnalysisTaskSE * CreateTaskAndSetCollisionCandidates(const char *macro, const char *args="")
Definition: QATrain.C:97
void SetModules(UInt_t m)
Definition: QATrain.C:85