TENDER becomes Tender, removing .so
[u/mrichter/AliRoot.git] / ANALYSIS / macros / QAtrain_duo.C
CommitLineData
c53f5f63 1// QAtrain_duo - assumes having 2 sets of input data files using 2 suffixes:
2// AliESDs_barrel.root AliESDfriends_barrel.root ... suffix = _barrel
3// AliESDs_outer.root AliESDfriends_outer.root ... suffix = _outer
4// HOW TO RUN (for run_no=158285):
5// QA job: should call:
6// ln -fs AliESDs_barrel.root AliESDs.root
7// ln -fs AliESDfriends_barrel.root AliESDfriends.root
8// ... same for all specific reco files
9// aliroot -b -q QAtrain_duo.C\(\"_barrel\"\,158285\) producing:
10// -> EventStat_temp_barrel.root QAresults_barrel.root 400_400_0_350.stat
11//
12// ln -fs AliESDs_outer.root AliESDs.root
13// ln -fs AliESDfriends_outer.root AliESDfriends.root
14// ... same for all specific reco files
15// aliroot QAtrain_duo.C\(\"_outer\"\,158285\) producing:
16// -> EventStat_temp_outer.root QAresults_outer.root 400_400_0_380.stat
17//
18// Each merging job:
19// for stages i < 5
20// aliroot -b -q QAtrain_duo.C\(\"_barrel\"\,158285\,\"wn.xml\"\,i\)
21// aliroot -b -q QAtrain_duo.C\(\"_outer\"\,158285\,\"wn.xml\"\,i\)
22// -> same output files as the QA jobs (except .stat)
23// for stage 5
24// aliroot -b -q QAtrain_duo.C\(\"_barrel\"\,158285\,\"Stage_5.xml\"\,5\)
25// -> event_stat_barrel.root trending_barrel.root 145230_145230_0_120345.stat
26// aliroot -b -q QAtrain_duo.C\(\"_outer\"\,158285\,\"Stage_5.xml\"\,5\)
27// -> event_stat_outer.root trending_outer.root 145230_145230_0_132897.stat
28#include "Riostream.h"
29void LoadLibraries();
69df31bd 30void AddAnalysisTasks(const char *, const char *);
c53f5f63 31void QAmerge(const char *,const char *, Int_t);
06da1340 32void ProcessEnvironmentVars();
33void SetDoQA(Bool_t &var, Bool_t onoff, const char* name);
34Bool_t CheckEnvS(const char* var,TString& envString);
c53f5f63 35
36Int_t iCollisionType = 0; // 0=pp, 1=PbPb
37// Trigger mask.
38
39UInt_t kTriggerInt = AliVEvent::kAnyINT;
05ce1e04 40UInt_t kTriggerMuonBarrel = AliVEvent::kMUU7 | AliVEvent::kMuonUnlikeLowPt8 | AliVEvent::kMuonUnlikeLowPt0;
69df31bd 41UInt_t kTriggerEMC = AliVEvent::kEMC7 | AliVEvent::kEMC8 | AliVEvent::kEMCEJE | AliVEvent::kEMCEGA;
c53f5f63 42UInt_t kTriggerHM = AliVEvent::kHighMult;
43// Main trigger mask used:
44UInt_t kTriggerMask = kTriggerInt;
45
46Int_t runNumbers[5] = {158626};
47
06da1340 48Bool_t doStatistics = 1;
c53f5f63 49Bool_t doCDBconnect = 1;
50Bool_t doEventStat = 1;
742c2aa4 51Bool_t doCentrality = 0;
52Bool_t doQAsym = 0;
c53f5f63 53Bool_t doVZERO = 1; // there is a 2nd file
54Bool_t doVZEROPbPb = 1;
55Bool_t doVertex = 1;
56Bool_t doSPD = 1; // needs RP
57Bool_t doTPC = 1;
58Bool_t doHLT = 1;
59Bool_t doSDD = 1; // needs RP
60Bool_t doSSDdEdx = 1;
61
62Bool_t doTRD = 1;
63Bool_t doITS = 1;
64Bool_t doITSsaTracks = 1;
65Bool_t doITSalign = 1;
66Bool_t doCALO = 1;
67Bool_t doMUONTrig = 1;
68Bool_t doImpParRes = 1;
69Bool_t doMUON = 1;
70Bool_t doTOF = 1;
71Bool_t doHMPID = 1;
72Bool_t doT0 = 1;
73Bool_t doZDC = 1;
74Bool_t doPIDResponse = 1;
75Bool_t doPIDqa = 1; //new
76Bool_t doFMD = 1; // new
77Bool_t doPHOS = 1; // new
78Bool_t doPHOSTrig = 1; // new
06da1340 79Bool_t doEMCAL = 0;
c53f5f63 80Bool_t doFBFqa = 1; // new - not ported yet to revision
81
742c2aa4 82Bool_t doTaskFilteredTree = 0; // high pt filter task
83
c53f5f63 84 // Debug level
85Int_t debug_level = 1; // Debugging
86Int_t run_number = 0;
87
06da1340 88
05ce1e04 89void QAtrain_duo(const char *suffix="", Int_t run = 0,
90 const char *xmlfile = "wn.xml",
91 Int_t stage = 0, /*0 = QA train, 1...n - merging stage*/
92 const char *cdb = "raw://")
7941f520 93// const char *cdb = "local://$ALICE_ROOT/OCDB")
c53f5f63 94{
95 run_number = run;
69df31bd 96 TString ss(suffix);
97 ss.ToLower();
98 Bool_t ibarrel = (ss.Contains("barrel"))?kTRUE:kFALSE;
c53f5f63 99
06da1340 100 ProcessEnvironmentVars();
101
05ce1e04 102 TString cdbString(cdb);
103 if (cdbString.Contains("raw://"))
104 {
105 TGrid::Connect("alien://");
106 if (!gGrid || !gGrid->IsConnected()) {
107 ::Error("QAtrain", "No grid connection");
108 return;
109 }
110 }
c53f5f63 111 // Set temporary merging directory to current one
112 gSystem->Setenv("TMPDIR", gSystem->pwd());
113 // Set temporary compilation directory to current one
114 gSystem->SetBuildDir(gSystem->pwd(), kTRUE);
115 // Load libraries
116 LoadLibraries();
117 printf("Include path: %s\n", gSystem->GetIncludePath());
118 // Create manager
119 AliAnalysisManager *mgr = new AliAnalysisManager("PilotAnalysis", "Production train");
120 mgr->SetRunFromPath(run_number);
06da1340 121 mgr->SetCacheSize(0);
c53f5f63 122 // Input handler
123 AliESDInputHandlerRP *esdHandler = new AliESDInputHandlerRP();
69df31bd 124 if (ibarrel) {
125 esdHandler->SetReadFriends(kTRUE);
126 esdHandler->SetActiveBranches("ESDfriend");
127 }
c53f5f63 128 mgr->SetInputEventHandler(esdHandler);
129 mgr->SetDebugLevel(debug_level);
69df31bd 130 mgr->SetFileInfoLog("fileinfo.log");
c53f5f63 131
132 // AnalysisTasks
69df31bd 133 AddAnalysisTasks(suffix, cdb);
c53f5f63 134 if (stage>0) {
135 QAmerge(suffix, xmlfile, stage);
136 return;
137 }
138 // Input chain
139 TChain *chain = new TChain("esdTree");
140 chain->Add("AliESDs.root");
141 TStopwatch timer;
142 timer.Start();
143 if (mgr->InitAnalysis()) {
144 mgr->PrintStatus();
145 mgr->SetSkipTerminate(kTRUE);
06da1340 146 // mgr->SetNSysInfo(100);
c53f5f63 147 mgr->StartAnalysis("local", chain);
148 }
149 timer.Print();
150}
151
152void LoadLibraries()
153{
06da1340 154 gSystem->SetIncludePath("-I. -I$ROOTSYS/include -I$ALICE_ROOT/include -I$ALICE_ROOT -I$ALICE_ROOT/ITS -I$ALICE_ROOT/TRD -I$ALICE_ROOT/PWGPP -I$ALICE_ROOT/PWGPP/TRD -I$ALICE_ROOT/ANALYSIS");
c53f5f63 155 gSystem->Load("libANALYSIS");
156 gSystem->Load("libANALYSISalice");
230b7aff 157 gSystem->Load("libESDfilter");
c53f5f63 158 gSystem->Load("libCORRFW");
230b7aff 159 gSystem->Load("libTender");
160 gSystem->Load("libPWGPP");
161 gSystem->Load("libAliHLTTrigger");
c53f5f63 162
163 if (doEMCAL || doPHOS || doCALO) {
164 gSystem->Load("libEMCALUtils");
165 gSystem->Load("libPHOSUtils");
166 gSystem->Load("libPWGCaloTrackCorrBase");
167 gSystem->Load("libPWGGACaloTrackCorrelations");
168 gSystem->Load("libPWGGACaloTasks");
169 gSystem->Load("libPWGGAPHOSTasks");
7941f520 170 gSystem->Load("libPWGTools");
05ce1e04 171 gSystem->Load("libPWGEMCAL");
c53f5f63 172 gSystem->Load("libPWGGAEMCALTasks");
173 }
174 if(doMUON || doMUONTrig) {
175 gSystem->Load("libPWGmuon");
176 gSystem->Load("libPWGPPMUONlite");
177 gSystem->Load("libPWGmuondep");
178 }
179 if (doFMD) {
180 gSystem->Load("libPWGLFforward2");
181 }
182}
183
69df31bd 184void AddAnalysisTasks(const char *suffix, const char *cdb_location)
c53f5f63 185{
186 TString ss(suffix);
187 ss.ToLower();
188 Bool_t ibarrel = (ss.Contains("barrel"))?kTRUE:kFALSE;
69df31bd 189 Bool_t iall = ss.IsNull();
c53f5f63 190 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
191 mgr->SetCommonFileName(Form("QAresults%s.root",suffix));
192 // Statistics task
06da1340 193 if (doStatistics) mgr->AddStatisticsTask(kTriggerMask);
194
195 // Clean Geometry: Ruben
196 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/CalibMacros/commonMacros/CleanGeom.C++");
197 CleanGeom* clgmTask = new CleanGeom("cleanGeom");
198 mgr->AddTask(clgmTask);
199 AliAnalysisDataContainer *dummyInp = mgr->GetCommonInputContainer();
200 if (dummyInp) mgr->ConnectInput(clgmTask,0,dummyInp);
201
c53f5f63 202 //
203 // CDB connection
204 //
205 if (doCDBconnect) {
206 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/PilotTrain/AddTaskCDBconnect.C");
f37b73fe 207 AliTaskCDBconnect *taskCDB = AddTaskCDBconnect(cdb_location, run_number);
208// AliTaskCDBconnect *taskCDB = AddTaskCDBconnect();
c53f5f63 209 if (!taskCDB) return;
742c2aa4 210// AliCDBManager *cdb = AliCDBManager::Instance();
211// cdb->SetDefaultStorage(cdb_location);
f37b73fe 212// taskCDB->SetRunNumber(run_number);
c53f5f63 213 }
214
215 //
216 // Event Statistics (Jan Fiete)
217 //
218 if (doEventStat) {
219 gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
220 AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(kFALSE /*MC*/);
221 AliAnalysisDataContainer *cstatsout = (AliAnalysisDataContainer*)mgr->GetOutputs()->FindObject("cstatsout");
222 cstatsout->SetFileName(Form("EventStat_temp%s.root", suffix));
223 }
224
06da1340 225 //
226 // PIDResponse(JENS)
227 //
228 if (doPIDResponse && (ibarrel || iall)) {
229 gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C");
230 AliAnalysisTaskPIDResponse *PIDResponse = AddTaskPIDResponse();
231 PIDResponse->SetUserDataRecoPass(1);
232 PIDResponse->SelectCollisionCandidates(kTriggerMask);
233 }
234
235
c53f5f63 236 //
237 // Centrality (A. Toia)
238 //
239 if (doCentrality) {
69df31bd 240// if (!iCollisionType) {
241// printf("Disabling centrality task for p-p\n");
242// doCentrality = kFALSE;
243// } else {
c53f5f63 244 gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskCentrality.C");
245 AliCentralitySelectionTask *taskCentrality = AddTaskCentrality();
69df31bd 246 AliAnalysisDataContainer *centralityout = (AliAnalysisDataContainer*)mgr->GetOutputs()->FindObject("CentralityStat");
247 centralityout->SetFileName(Form("EventStat_temp%s.root", suffix));
248// }
c53f5f63 249 }
250
251 // Vertexing (A. Dainese)
252 //
69df31bd 253 if (doVertex && (ibarrel || iall)) {
c53f5f63 254 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/macros/AddTaskVertexESD.C");
255 AliAnalysisTaskVertexESD* taskvertexesd = AddTaskVertexESD(kFALSE, kTriggerMask);
256 taskvertexesd->SelectCollisionCandidates(kTriggerMask);
257 }
258
259 // TPC QA (E. Sicking)
260 //
69df31bd 261 if (doQAsym && (ibarrel || iall)) {
c53f5f63 262 // offline trigger in AddTask
263 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/PilotTrain/AddTaskQAsym.C");
69df31bd 264 AliAnalysisTaskSE * taskqasim = AddTaskQAsym(0, kTriggerMask, kTriggerHM, kTriggerEMC, kTriggerMuonBarrel);
c53f5f63 265 }
266 //
267 // VZERO QA (C. Cheshkov)
268 //
69df31bd 269 if (doVZERO && (ibarrel || iall)) {
c53f5f63 270 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/PilotTrain/AddTaskVZEROQA.C");
271 AliAnalysisTaskSE * taskv0qa = AddTaskVZEROQA(0);
272// taskv0qa->SelectCollisionCandidates();
05ce1e04 273 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/PilotTrain/AddTaskVZEROQATrig.C");
274 AliAnaVZEROQA *taskv0qatrig = AddTaskVZEROQATrig(0);
275 taskv0qatrig->SelectCollisionCandidates(AliVEvent::kINT8);
276
c53f5f63 277 }
c2de0acd 278 if (doVZEROPbPb && iCollisionType==0) {
c53f5f63 279 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/VZERO/AddTaskVZEROPbPb.C");
c2de0acd 280 AliAnaVZEROPbPb* taskV0PbPb = (AliAnaVZEROPbPb*)AddTaskVZEROPbPb(run_number);
c53f5f63 281// taskV0PbPb->SetClassesNames("CTRUE-,C0HWU-,CPBI2WU_B1-,CPBI2_B1-,CPBI1WU-,CPBI1-,CVHNWU-,CVHN-,CVLNWU-,CVLN-");
282// taskV0PbPb->SetClassesNames("CTRUE-,C0HWU-,CPBI2WU,CPBI2,CPBI1WU-,CPBI1-,CVHNWU,CVHN,CVLNWU,CVLN");
283// taskV0PbPb->SetClassesNames("CTRUE-,C0HWU-,CPBI2WU-,CPBI2-,CPBI2WU_B1-,CPBI2_B1-,CPBI1WU-,CPBI1-,CVHNWU-,CVHN-,CVHN_R2-,CVHNWU_R2-,CVLNWU-,CVLN-,CVLN_B2-,CVLNWU_B2-");
284// taskV0PbPb->SetClassesNames("CTRUE-,C0HWU-,CPBI2WU-,CPBI2-,CPBI2WU_B1-,CPBI2_B1-,CPBI1WU-,CPBI1-,CVHNWU-,CVHN-,CVHN_R2-,CVHNWU_R2-,CVLNWU-,CVLN-,CVLN_R1-,CVLN_B2-,CVLNWU_R1-,CVLNWU_B2-");
c2de0acd 285// taskV0PbPb->SetClassesNames("CTRUE-,C0HWU-,CPBI2WU-,CPBI2-,CPBI2WU_B1-,CPBI2_B1-,CPBI1WU-,CPBI1-,CVHNWU-,CVHN-,CVHN_R2-,CVHNWU_R2-,CVLNWU-,CVLN-,CVLN_R1-,CVLN_B2-,CVLNWU_R1-,CVLNWU_B2-,CSEMI_R1-,CSEMIWU_R1-,CCENT_R2-,CCENTWU_R2-");
c53f5f63 286 }
287 //
288 // TPC (Jacek Otwinowski & Michael Knichel)
289 //
290 //
291 // Optionally MC information can be used by setting the 1st argument to true
292 // Optionally friends information can be switched off by setting the 2st argument
293 // to false
294 // Optionally highMult axis can be used by setting the 3st argument to true (for PbPb)
69df31bd 295 if (doTPC && (ibarrel || iall)) {
c53f5f63 296 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/TPC/macros/AddTaskPerformanceTPCdEdxQA.C");
297 AliPerformanceTask *tpcQA = 0;
298 if (iCollisionType) {
299 // High multiplicity Pb-Pb
300 tpcQA = AddTaskPerformanceTPCdEdxQA(kFALSE, kTRUE, kTRUE);
301 } else {
302 // Low multiplicity (pp)
303 tpcQA = AddTaskPerformanceTPCdEdxQA(kFALSE, kTRUE, kFALSE);
304 }
305 tpcQA->SelectCollisionCandidates(kTriggerMask);
306 }
307
308 // HLT (Alberica Toia)
69df31bd 309 if (doHLT && (ibarrel || iall)) {
c53f5f63 310 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/TPC/macros/AddTaskPerformanceTPCdEdxQA.C");
311 AliPerformanceTask *hltQA = AddTaskPerformanceTPCdEdxQA(kFALSE, kTRUE, kFALSE,0,kTRUE);
312 hltQA->SelectCollisionCandidates(kTriggerMask);
313 }
314 //
315 // SPD (A. Mastroserio)
316 //
69df31bd 317 if (doSPD && (ibarrel || iall)) {
c53f5f63 318 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/PilotTrain/AddTaskSPDQA.C");
319 AliAnalysisTaskSPD* taskspdqa = (AliAnalysisTaskSPD*)AddTaskSPDQA();
320 // Request from Annalisa
321 if (iCollisionType) taskspdqa->SetHeavyIonMode();
322 taskspdqa->SelectCollisionCandidates(kTriggerMask);
69df31bd 323 taskspdqa->SetOCDBInfo(run_number, cdb_location);
c53f5f63 324 }
325 //
326 // SDD (F. Prino)
327 //
69df31bd 328 if (doSDD && (ibarrel || iall)) {
c53f5f63 329 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/PilotTrain/AddSDDPoints.C");
330 AliAnalysisTaskSE* tasksdd = AddSDDPoints();
331 tasksdd->SelectCollisionCandidates(kTriggerMask);
332 }
333 //
334 // SSD dEdx (Marek Chojnacki)
335 //
69df31bd 336 if (doSSDdEdx && (ibarrel || iall)) {
c53f5f63 337 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/PilotTrain/AddTaskdEdxSSDQA.C");
338 AliAnalysisTaskSE* taskssddedx = AddTaskdEdxSSDQA();
339 taskssddedx->SelectCollisionCandidates(kTriggerMask);
340 }
341
342 //
343 // ITS
344 //
69df31bd 345 if (doITS && (ibarrel || iall)) {
c53f5f63 346 // hardcoded non-zero trigger mask
347 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/macros/AddTaskPerformanceITS.C");
348 AliAnalysisTaskITSTrackingCheck *itsQA = 0;
349 AliAnalysisTaskITSTrackingCheck *itsQACent0010 = 0;
350 AliAnalysisTaskITSTrackingCheck *itsQACent3050 = 0;
351 AliAnalysisTaskITSTrackingCheck *itsQACent6080 = 0;
352 if(iCollisionType==0) {
353 itsQA = AddTaskPerformanceITS(kFALSE);
354 } else {
355 itsQA = AddTaskPerformanceITS(kFALSE);
356 itsQACent0010 = AddTaskPerformanceITS(kFALSE,kFALSE,kFALSE,3500,10000);
357 itsQACent3050 = AddTaskPerformanceITS(kFALSE,kFALSE,kFALSE,590,1570);
358 itsQACent6080 = AddTaskPerformanceITS(kFALSE,kFALSE,kFALSE,70,310);
359 }
360 }
361 //
362 // ITS saTracks, align (F.Prino)
363 //
69df31bd 364 if (doITSsaTracks && (ibarrel || iall)) {
c53f5f63 365 // offline trigger in AddTask
366 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/macros/AddTaskITSsaTracks.C");
367 AliAnalysisTaskITSsaTracks *itssaTracks = AddTaskITSsaTracks(kFALSE,kFALSE);
368 itssaTracks->SelectCollisionCandidates(kTriggerMask);
369 }
69df31bd 370 if (doITSalign && (ibarrel || iall)) {
c53f5f63 371 // no offline trigger selection
372 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/macros/AddTaskITSAlign.C");
69df31bd 373 AliAnalysisTaskITSAlignQA *itsAlign = AddTaskITSAlign(0,2012);
c53f5f63 374 }
375 //
376 // TRD (Alex Bercuci, M. Fasel)
377 //
69df31bd 378 if(doTRD && (ibarrel || iall)) {
c53f5f63 379 // no offline trigger selection
380 gROOT->LoadMacro("$ALICE_ROOT/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, doResolution, doCheckPID, doV0Monitor));
390 }
391
392 //
393 // ZDC (Chiara Oppedisano)
394 //
69df31bd 395 if(doZDC && (ibarrel || iall)) {
c53f5f63 396 // hardcoded kMB trigger mask
397 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/ZDC/AddTaskZDCQA.C");
398 AliAnalysisTaskSE *taskZDC = AddTaskZDCQA();
399 taskZDC->SelectCollisionCandidates(kTriggerMask);
400 }
401 //
402 // Calorimetry (Gustavo Conesa)
403 //
404
405 if(doCALO) {
05ce1e04 406 // - In case of MC analysis, it skips the triggered events wagon (given that
407 //the normal wagon is always suffixed as "default")
408 //- No need to pass the type of data
409 //- No need to specify the year. In principle the year is only needed when
410 //setting the size of some histograms (change in number of SM along the years),
411 //I do not know how to access automatically the run number when the histograms
412 // are created in the UserCreateOutput. By default I set them to the maximum
413 //expected size, but I still let the possibility to check the year.
414
415 //So the way to initialize the task in trunk is now
416
417 //AddTaskCalorimeterQA(Bool_t kSimulation = kFALSE,
418 // const char *suffix="default",
419 // TString outputFile = "",
420 // Int_t year = 2012,
421 // Bool_t kPrintSettings = kFALSE)
422
423 //So, in principle only the first 2 need to be specified.
424
425
c53f5f63 426 gROOT->LoadMacro("$ALICE_ROOT/PWGGA/CaloTrackCorrelations/macros/QA/AddTaskCalorimeterQA.C");
742c2aa4 427 AliAnalysisTaskCaloTrackCorrelation *taskCaloQA = AddTaskCalorimeterQA("default");
c53f5f63 428 taskCaloQA->SetDebugLevel(0);
429 // offline mask set in AddTask to kMB
430 taskCaloQA->SelectCollisionCandidates(kTriggerMask);
431 // Add a new calo task with EMC1 trigger only
06da1340 432 // taskCaloQA = AddTaskCalorimeterQA("trigEMC"); // for 2011 data, not 2010
433 // taskCaloQA->SelectCollisionCandidates(kTriggerEMC); // for 2011 data, not 2010
c53f5f63 434 taskCaloQA->SetDebugLevel(0);
c53f5f63 435 }
436
437 //
438 // Muon Trigger
439 //
440
441 if(doMUONTrig) {
442 // no offline trigger selection
443 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/macros/AddTaskMTRchamberEfficiency.C");
444 AliAnalysisTaskTrigChEff *taskMuonTrig = AddTaskMTRchamberEfficiency();
c2de0acd 445// taskMuonTrig->GetMuonTrackCuts()->SetCustomParamFromRun(160000,2);
c53f5f63 446 }
447
448 //
449 // Impact parameter resolution (xianbao.yuan@pd.infn.it, andrea.dainese@pd.infn.it)
450 //
69df31bd 451 if (doImpParRes && (ibarrel || iall)) {
c53f5f63 452 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/macros/AddTaskImpParRes.C");
453 AliAnalysisTaskSE* taskimpparres=0;
454 if(iCollisionType==0) {
455 taskimpparres= AddTaskImpParRes();
456 } else {
457 taskimpparres= AddTaskImpParRes(kFALSE,-1,kFALSE,kFALSE);
458 }
459 taskimpparres->SelectCollisionCandidates(kTriggerMask);
460 }
461 //
462 // MUON QA (Philippe Pillot)
463 //
464 if (doMUON) {
465 // trigger analysis internal
466 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/PilotTrain/AddTaskMuonQA.C");
f9cd4014 467 AliAnalysisTaskMuonQA* taskmuonqa= AddTaskMuonQA();
c2de0acd 468// taskmuonqa->GetTrackCuts()->SetCustomParamFromRun(160000,2);
c53f5f63 469 }
470 //
471 // TOF (Francesca Bellini)
472 //
69df31bd 473 if (doTOF && (ibarrel || iall)) {
c53f5f63 474 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/TOF/AddTaskTOFQA.C");
06da1340 475 AliAnalysisTaskTOFqa *tofQA = AddTaskTOFQA(kFALSE);
c53f5f63 476 tofQA->SelectCollisionCandidates(kTriggerMask);
477 }
c53f5f63 478 //
479 // PIDqa(JENS)
480 //
69df31bd 481 if (doPIDqa && (ibarrel || iall)) {
c53f5f63 482 gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDqa.C");
483 AliAnalysisTaskPIDqa *PIDQA = AddTaskPIDqa();
484 PIDQA->SelectCollisionCandidates(kTriggerMask);
485 }
486
487 //
488 // HMPID QA (Giacomo Volpe)
489 //
69df31bd 490 if (doHMPID && (ibarrel || iall)) {
c53f5f63 491 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/HMPID/AddTaskHmpidQA.C");
492 AliAnalysisTaskSE* taskhmpidqa= AddTaskHmpidQA(kFALSE);
493 // offline mask set in AddTask to kMB
494 taskhmpidqa->SelectCollisionCandidates(kTriggerMask);
495 }
496
497
498 // T0 QA (Alla Mayevskaya)
69df31bd 499 if (doT0 && (ibarrel || iall)) {
c53f5f63 500 // no offline trigger selection
501 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/T0/AddTaskT0QA.C");
502 AliT0AnalysisTaskQA* taskt0qa= AddTaskT0QA();
503 taskt0qa->SelectCollisionCandidates(kTriggerMask);
504 }
505 // FMD QA (Christian Holm Christiansen)
69df31bd 506 if (doFMD && (ibarrel || iall)) {
c53f5f63 507 gROOT->LoadMacro("$ALICE_ROOT/PWGLF/FORWARD/analysis2/AddTaskForwardQA.C");
508 // Parameters: usemc, usecentrality
69df31bd 509 AliForwardQATask *forwardQA = (AliAnalysisTaskSE *)AddTaskForwardQA(kFALSE, kFALSE);
510 forwardQA->SetDebug(0);
c53f5f63 511 // No offline trigger config. needed (see #84077)
512 }
513 //
514 // PHOS QA (Boris Polishchuk)
515 //
516 if (doPHOS) {
517 gROOT->LoadMacro("$ALICE_ROOT/PWGGA/PHOSTasks/CaloCellQA/macros/AddTaskCaloCellsQA.C");
518 AliAnalysisTaskCaloCellsQA *taskPHOSCellQA1 = AddTaskCaloCellsQA(4, 1, NULL,"PHOSCellsQA_AnyInt");
519 taskPHOSCellQA1->SelectCollisionCandidates(kTriggerMask);
520 taskPHOSCellQA1->GetCaloCellsQA()->SetClusterEnergyCuts(0.3,0.3,1.0);
521 AliAnalysisTaskCaloCellsQA *taskPHOSCellQA2 = AddTaskCaloCellsQA(4, 1, NULL,"PHOSCellsQA_PHI7");
522 taskPHOSCellQA2->SelectCollisionCandidates(AliVEvent::kPHI7);
523 taskPHOSCellQA2->GetCaloCellsQA()->SetClusterEnergyCuts(0.3,0.3,1.0);
524 // Pi0 QA fo PbPb
c2de0acd 525 if (iCollisionType == 0) {
c53f5f63 526 gROOT->LoadMacro("$ALICE_ROOT/PWGGA/PHOSTasks/PHOS_PbPbQA/macros/AddTaskPHOSPbPb.C");
527 AliAnalysisTaskPHOSPbPbQA* phosPbPb = AddTaskPHOSPbPbQA(0);
528 }
529 }
530 if (doPHOSTrig) {
531 gROOT->LoadMacro("$ALICE_ROOT/PWGGA/PHOSTasks/PHOS_TriggerQA/macros/AddTaskPHOSTriggerQA.C");
532 AliAnalysisTaskPHOSTriggerQA *taskPHOSTrig = AddTaskPHOSTriggerQA(NULL);
533 }
534 //
535 // EMCAL QA (Gustavo Conesa)
536 //
537 if (doEMCAL) {
538 gROOT->LoadMacro("$ALICE_ROOT/PWGGA/EMCALTasks/macros/AddTaskEMCALTriggerQA.C");
539 AliAnalysisTaskEMCALTriggerQA *emctrig = AddTaskEMCALTriggerQA();
69df31bd 540// emctrig->GetRecoUtils()->SwitchOffBadChannelsRemoval();
c53f5f63 541 }
542 //
543 // FLOW and BF QA (C.Perez && A.Rodriguez)
544 //
69df31bd 545 if (doFBFqa && (ibarrel || iall)) {
c53f5f63 546 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/macros/AddTaskFBFqa.C");
547 AliAnalysisTaskSE *qaFBFMB = (AliAnalysisTaskSE*) AddTaskFBFqa("qaFBFmb",kFALSE);
548 qaFBFMB->SelectCollisionCandidates(AliVEvent::kMB);
549 AliAnalysisTaskSE *qaFBFSC = (AliAnalysisTaskSE*) AddTaskFBFqa("qaFBFsc",kFALSE);
550 qaFBFSC->SelectCollisionCandidates(AliVEvent::kSemiCentral);
551 AliAnalysisTaskSE *qaFBFCE = (AliAnalysisTaskSE*) AddTaskFBFqa("qaFBFce",kFALSE);
552 qaFBFCE->SelectCollisionCandidates(AliVEvent::kCentral);
553 }
742c2aa4 554
555//Jacek
556 if (gSystem->Getenv("QA_TaskFilteredTree")) doTaskFilteredTree=1;
557 if (doTaskFilteredTree) {
558 gROOT->LoadMacro("$ALICE_ROOT/PWGPP/macros/AddTaskFilteredTree.C");
559 AddTaskFilteredTree("FilterEvents_Trees.root");
560 }
561
c53f5f63 562}
563
564void QAmerge(const char *suffix, const char *dir, Int_t stage)
565{
566// Merging method
567 TStopwatch timer;
568 timer.Start();
569 TString outputDir = dir;
742c2aa4 570 TString outputFiles = Form("QAresults%s.root,EventStat_temp%s.root,RecoQAresults%s.root,FilterEvents_trees%s.root",suffix,suffix,suffix);
c53f5f63 571 TString mergeExcludes = "";
572 TObjArray *list = outputFiles.Tokenize(",");
573 TIter *iter = new TIter(list);
574 TObjString *str;
575 TString outputFile;
576 Bool_t merged = kTRUE;
577 while((str=(TObjString*)iter->Next())) {
578 outputFile = str->GetString();
579 // Skip already merged outputs
580 if (!gSystem->AccessPathName(outputFile)) {
581 printf("Output file <%s> found. Not merging again.",outputFile.Data());
582 continue;
583 }
584 if (mergeExcludes.Contains(outputFile.Data())) continue;
585 merged = AliAnalysisAlien::MergeOutput(outputFile, outputDir, 10, stage);
06da1340 586 if (!merged && !outputFile.Contains("RecoQAresults") && !outputFile.Contains("FilterEvents_trees")) {
c53f5f63 587 printf("ERROR: Cannot merge %s\n", outputFile.Data());
06da1340 588 return;
c53f5f63 589 }
590 }
591 // read the analysis manager from file
69df31bd 592 TString infolog = "fileinfo.log";
593 AliAnalysisAlien::MergeInfo(infolog, dir);
c53f5f63 594 if (!outputDir.Contains("Stage")) {
595 ofstream out;
596 out.open("outputs_valid", ios::out);
597 out.close();
598 return;
599 }
600 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
601 mgr->SetRunFromPath(mgr->GetRunFromAlienPath(dir));
602 mgr->SetSkipTerminate(kFALSE);
603 if (!mgr->InitAnalysis()) return;
604 mgr->PrintStatus();
605 AliLog::SetGlobalLogLevel(AliLog::kError);
606 TTree *tree = NULL;
69df31bd 607 gROOT->cd();
c53f5f63 608 mgr->StartAnalysis("gridterminate", tree);
609 if (strlen(suffix)) {
610 if (gSystem->Exec(Form("mv trending.root trending%s.root", suffix)))
611 ::Error("QAmerge", "File trending.root was not produced");
612 if (gSystem->Exec(Form("mv event_stat.root event_stat%s.root", suffix)))
613 ::Error("QAmerge", "File trending.root was not produced");
614 }
615 ofstream out;
616 out.open("outputs_valid", ios::out);
617 out.close();
618 timer.Print();
619}
06da1340 620
621void ProcessEnvironmentVars()
622{
623 int var=0;
624 TString envS;
625 //
626 if ( !(envS=gSystem->Getenv("CDBconnect")).IsNull() && CheckEnvS("CDBconnect",envS) ) {
627 doCDBconnect = atoi(envS.Data());
628 printf("Set doCDBconnect=%d according to environment variables\n",doCDBconnect);
629 }
630 //
631 if ( !(envS=gSystem->Getenv("Statistics")).IsNull() && CheckEnvS("Statistics",envS) ) {
632 doStatistics = atoi(envS.Data());
633 printf("Set doStatistics=%d according to environment variables\n",doStatistics);
634 }
635 //
636 if ( !(envS=gSystem->Getenv("EventStat")).IsNull() && CheckEnvS("EventStat",envS) ) {
637 doEventStat = atoi(envS.Data());
638 printf("Set doEventStat=%d according to environment variables\n",doEventStat);
639 }
640 //
641 if ( !(envS=gSystem->Getenv("Centrality")).IsNull() && CheckEnvS("Centrality",envS) ) {
642 doCentrality = atoi(envS.Data());
643 printf("Set doCentrality=%d according to environment variables\n",doCentrality);
644 }
645 //
646 if ( !(envS=gSystem->Getenv("QAsym")).IsNull() && CheckEnvS("QAsym",envS) ) {
647 doQAsym = atoi(envS.Data());
648 printf("Set doQAsym=%d according to environment variables\n",doQAsym);
649 }
650 //
651 if ( !(envS=gSystem->Getenv("VZERO")).IsNull() && CheckEnvS("VZERO",envS) ) {
652 doVZERO = atoi(envS.Data());
653 printf("Set doVZERO=%d according to environment variables\n",doVZERO);
654 }
655 //
656 if ( !(envS=gSystem->Getenv("VZEROPbPb")).IsNull() && CheckEnvS("VZEROPbPb",envS) ) {
657 doVZEROPbPb = atoi(envS.Data());
658 printf("Set doVZEROPbPb=%d according to environment variables\n",doVZEROPbPb);
659 }
660 //
661 if ( !(envS=gSystem->Getenv("Vertex")).IsNull() && CheckEnvS("Vertex",envS) ) {
662 doVertex = atoi(envS.Data());
663 printf("Set doVertex=%d according to environment variables\n",doVertex);
664 }
665 //
666 if ( !(envS=gSystem->Getenv("SPD")).IsNull() && CheckEnvS("SPD",envS) ) {
667 doSPD = atoi(envS.Data());
668 printf("Set doSPD=%d according to environment variables\n",doSPD);
669 }
670 //
671 if ( !(envS=gSystem->Getenv("TPC")).IsNull() && CheckEnvS("TPC",envS) ) {
672 doTPC = atoi(envS.Data());
673 printf("Set doTPC=%d according to environment variables\n",doTPC);
674 }
675 //
676 if ( !(envS=gSystem->Getenv("HLT")).IsNull() && CheckEnvS("HLT",envS) ) {
677 doHLT = atoi(envS.Data());
678 printf("Set doHLT=%d according to environment variables\n",doHLT);
679 }
680 //
681 if ( !(envS=gSystem->Getenv("SDD")).IsNull() && CheckEnvS("SDD",envS) ) {
682 doSDD = atoi(envS.Data());
683 printf("Set doSDD=%d according to environment variables\n",doSDD);
684 }
685 //
686 if ( !(envS=gSystem->Getenv("SSDdEdx")).IsNull() && CheckEnvS("SSDdEdx",envS) ) {
687 doSSDdEdx = atoi(envS.Data());
688 printf("Set doSSDdEdx=%d according to environment variables\n",doSSDdEdx);
689 }
690 //
691 if ( !(envS=gSystem->Getenv("TRD")).IsNull() && CheckEnvS("TRD",envS) ) {
692 doTRD = atoi(envS.Data());
693 printf("Set doTRD=%d according to environment variables\n",doTRD);
694 }
695 //
696 if ( !(envS=gSystem->Getenv("ITS")).IsNull() && CheckEnvS("ITS",envS) ) {
697 doITS = atoi(envS.Data());
698 printf("Set doITS=%d according to environment variables\n",doITS);
699 }
700 //
701 if ( !(envS=gSystem->Getenv("ITSsaTracks")).IsNull() && CheckEnvS("ITSsaTracks",envS) ) {
702 doITSsaTracks = atoi(envS.Data());
703 printf("Set doITSsaTracks=%d according to environment variables\n",doITSsaTracks);
704 }
705 //
706 if ( !(envS=gSystem->Getenv("ITSalign")).IsNull() && CheckEnvS("ITSalign",envS) ) {
707 doITSalign = atoi(envS.Data());
708 printf("Set doITSalign=%d according to environment variables\n",doITSalign);
709 }
710 //
711 if ( !(envS=gSystem->Getenv("CALO")).IsNull() && CheckEnvS("CALO",envS) ) {
712 doCALO = atoi(envS.Data());
713 printf("Set doCALO=%d according to environment variables\n",doCALO);
714 }
715 //
716 if ( !(envS=gSystem->Getenv("MUONTrig")).IsNull() && CheckEnvS("MUONTrig",envS) ) {
717 doMUONTrig = atoi(envS.Data());
718 printf("Set doMUONTrig=%d according to environment variables\n",doMUONTrig);
719 }
720 //
721 if ( !(envS=gSystem->Getenv("ImpParRes")).IsNull() && CheckEnvS("ImpParRes",envS) ) {
722 doImpParRes = atoi(envS.Data());
723 printf("Set doImpParRes=%d according to environment variables\n",doImpParRes);
724 }
725 //
726 if ( !(envS=gSystem->Getenv("MUON")).IsNull() && CheckEnvS("MUON",envS) ) {
727 doMUON = atoi(envS.Data());
728 printf("Set doMUON=%d according to environment variables\n",doMUON);
729 }
730 //
731 if ( !(envS=gSystem->Getenv("TOF")).IsNull() && CheckEnvS("TOF",envS) ) {
732 doTOF = atoi(envS.Data());
733 printf("Set doTOF=%d according to environment variables\n",doTOF);
734 }
735 //
736 if ( !(envS=gSystem->Getenv("HMPID")).IsNull() && CheckEnvS("HMPID",envS) ) {
737 doHMPID = atoi(envS.Data());
738 printf("Set doHMPID=%d according to environment variables\n",doHMPID);
739 }
740 //
741 if ( !(envS=gSystem->Getenv("T0")).IsNull() && CheckEnvS("T0",envS) ) {
742 doT0 = atoi(envS.Data());
743 printf("Set doT0=%d according to environment variables\n",doT0);
744 }
745 //
746 if ( !(envS=gSystem->Getenv("ZDC")).IsNull() && CheckEnvS("ZDC",envS) ) {
747 doZDC = atoi(envS.Data());
748 printf("Set doZDC=%d according to environment variables\n",doZDC);
749 }
750 //
751 if ( !(envS=gSystem->Getenv("PIDResponse")).IsNull() && CheckEnvS("PIDResponse",envS) ) {
752 doPIDResponse = atoi(envS.Data());
753 printf("Set doPIDResponse=%d according to environment variables\n",doPIDResponse);
754 }
755 //
756 if ( !(envS=gSystem->Getenv("PIDqa")).IsNull() && CheckEnvS("PIDqa",envS) ) {
757 doPIDqa = atoi(envS.Data());
758 printf("Set doPIDqa=%d according to environment variables\n",doPIDqa);
759 }
760 //
761 if ( !(envS=gSystem->Getenv("FMD")).IsNull() && CheckEnvS("FMD",envS) ) {
762 doFMD = atoi(envS.Data());
763 printf("Set doFMD=%d according to environment variables\n",doFMD);
764 }
765 //
766 if ( !(envS=gSystem->Getenv("PHOS")).IsNull() && CheckEnvS("PHOS",envS) ) {
767 doPHOS = atoi(envS.Data());
768 printf("Set doPHOS=%d according to environment variables\n",doPHOS);
769 }
770 //
771 if ( !(envS=gSystem->Getenv("PHOSTrig")).IsNull() && CheckEnvS("PHOSTrig",envS) ) {
772 doPHOSTrig = atoi(envS.Data());
773 printf("Set doPHOSTrig=%d according to environment variables\n",doPHOSTrig);
774 }
775 //
776 if ( !(envS=gSystem->Getenv("EMCAL")).IsNull() && CheckEnvS("EMCAL",envS) ) {
777 doEMCAL = atoi(envS.Data());
778 printf("Set doEMCAL=%d according to environment variables\n",doEMCAL);
779 }
780 //
781 if ( !(envS=gSystem->Getenv("FBFqa")).IsNull() && CheckEnvS("FBFqa",envS) ) {
782 doFBFqa = atoi(envS.Data());
783 printf("Set doFBFqa=%d according to environment variables\n",doFBFqa);
784 }
785 //
786 if ( !(envS=gSystem->Getenv("TaskFilteredTree")).IsNull() && CheckEnvS("TaskFilteredTree",envS) ) {
787 doTaskFilteredTree = atoi(envS.Data());
788 printf("Set doTaskFilteredTree=%d according to environment variables\n",doTaskFilteredTree);
789 }
790 //-----------------------------------------------------------
791 // combinations
792 if ( !(envS=gSystem->Getenv("QAGROUP")).IsNull() ) {
793 int qaGRP = atoi(envS.Data());
794 switch (qaGRP) {
795 case 0:
796 SetDoQA(doStatistics, 1, "Statistics");
797 SetDoQA(doVZERO, 1, "VZERO");
798 SetDoQA(doVZEROPbPb, 1, "VZEROPbPb");
799 SetDoQA(doVertex, 1, "Vertex");
800 SetDoQA(doSPD, 1, "SPD");
801 SetDoQA(doTPC, 0, "TPC");
802 SetDoQA(doHLT, 0, "HLT");
803 SetDoQA(doSDD, 0, "SDD");
804 SetDoQA(doSSDdEdx, 0, "SSDdEdx");
805 SetDoQA(doTRD, 1, "TRD");
806 SetDoQA(doITS, 0, "ITS");
807 SetDoQA(doITSsaTracks, 0, "ITSsaTracks");
808 SetDoQA(doITSalign, 0, "ITSalign");
809 SetDoQA(doCALO , 1, "CALO");
810 SetDoQA(doMUONTrig, 0, "MUONTrig");
811 SetDoQA(doImpParRes, 1, "ImpParRes");
812 SetDoQA(doMUON, 0, "MUON");
813 SetDoQA(doTOF, 0, "TOF");
814 SetDoQA(doHMPID, 1, "HMPID");
815 SetDoQA(doT0, 1, "T0");
816 SetDoQA(doZDC, 1, "ZDC");
817 // SetDoQA(doPIDResponse, 1, "PIDResponse");
818 SetDoQA(doPIDqa, 1, "PIDqa");
819 SetDoQA(doFMD, 1, "FMD");
820 SetDoQA(doPHOS, 1, "PHOS");
821 SetDoQA(doPHOSTrig, 1, "PHOSTrig");
822 SetDoQA(doEMCAL, 0, "EMCAL");
823 SetDoQA(doFBFqa, 1, "FBFqa");
824 break;
825 case 1:
826 SetDoQA(doStatistics, 0, "Statistics");
827 SetDoQA(doVZERO, 0, "VZERO");
828 SetDoQA(doVZEROPbPb, 0, "VZEROPbPb");
829 SetDoQA(doVertex, 0, "Vertex");
830 SetDoQA(doSPD, 0, "SPD");
831 SetDoQA(doTPC, 1, "TPC");
832 SetDoQA(doHLT, 1, "HLT");
833 SetDoQA(doSDD, 0, "SDD");
834 SetDoQA(doSSDdEdx, 0, "SSDdEdx");
835 SetDoQA(doTRD, 0, "TRD");
836 SetDoQA(doITS, 0, "ITS");
837 SetDoQA(doITSsaTracks, 0, "ITSsaTracks");
838 SetDoQA(doITSalign, 0, "ITSalign");
839 SetDoQA(doCALO , 0, "CALO");
840 SetDoQA(doMUONTrig, 0, "MUONTrig");
841 SetDoQA(doImpParRes, 0, "ImpParRes");
842 SetDoQA(doMUON, 0, "MUON");
843 SetDoQA(doTOF, 0, "TOF");
844 SetDoQA(doHMPID, 0, "HMPID");
845 SetDoQA(doT0, 0, "T0");
846 SetDoQA(doZDC, 0, "ZDC");
847 // SetDoQA(doPIDResponse, 0, "PIDResponse");
848 SetDoQA(doPIDqa, 0, "PIDqa");
849 SetDoQA(doFMD, 0, "FMD");
850 SetDoQA(doPHOS, 0, "PHOS");
851 SetDoQA(doPHOSTrig, 0, "PHOSTrig");
852 SetDoQA(doEMCAL, 0, "EMCAL");
853 SetDoQA(doFBFqa, 0, "FBFqa");
854 break;
855 case 2:
856 SetDoQA(doStatistics, 0, "Statistics");
857 SetDoQA(doVZERO, 0, "VZERO");
858 SetDoQA(doVZEROPbPb, 0, "VZEROPbPb");
859 SetDoQA(doVertex, 0, "Vertex");
860 SetDoQA(doSPD, 0, "SPD");
861 SetDoQA(doTPC, 0, "TPC");
862 SetDoQA(doHLT, 0, "HLT");
863 SetDoQA(doSDD, 0, "SDD");
864 SetDoQA(doSSDdEdx, 0, "SSDdEdx");
865 SetDoQA(doTRD, 0, "TRD");
866 SetDoQA(doITS, 0, "ITS");
867 SetDoQA(doITSsaTracks, 1, "ITSsaTracks");
868 SetDoQA(doITSalign, 1, "ITSalign");
869 SetDoQA(doCALO , 0, "CALO");
870 SetDoQA(doMUONTrig, 0, "MUONTrig");
871 SetDoQA(doImpParRes, 0, "ImpParRes");
872 SetDoQA(doMUON, 0, "MUON");
873 SetDoQA(doTOF, 0, "TOF");
874 SetDoQA(doHMPID, 0, "HMPID");
875 SetDoQA(doT0, 0, "T0");
876 SetDoQA(doZDC, 0, "ZDC");
877 // SetDoQA(doPIDResponse, 0, "PIDResponse");
878 SetDoQA(doPIDqa, 0, "PIDqa");
879 SetDoQA(doFMD, 0, "FMD");
880 SetDoQA(doPHOS, 0, "PHOS");
881 SetDoQA(doPHOSTrig, 0, "PHOSTrig");
882 SetDoQA(doEMCAL, 0, "EMCAL");
883 SetDoQA(doFBFqa, 0, "FBFqa");
884 break;
885 case 3:
886 SetDoQA(doStatistics, 0, "Statistics");
887 SetDoQA(doVZERO, 0, "VZERO");
888 SetDoQA(doVZEROPbPb, 0, "VZEROPbPb");
889 SetDoQA(doVertex, 0, "Vertex");
890 SetDoQA(doSPD, 0, "SPD");
891 SetDoQA(doTPC, 0, "TPC");
892 SetDoQA(doHLT, 0, "HLT");
893 SetDoQA(doSDD, 1, "SDD");
894 SetDoQA(doSSDdEdx, 1, "SSDdEdx");
895 SetDoQA(doTRD, 0, "TRD");
896 SetDoQA(doITS, 1, "ITS");
897 SetDoQA(doITSsaTracks, 0, "ITSsaTracks");
898 SetDoQA(doITSalign, 0, "ITSalign");
899 SetDoQA(doCALO , 0, "CALO");
900 SetDoQA(doMUONTrig, 0, "MUONTrig");
901 SetDoQA(doImpParRes, 0, "ImpParRes");
902 SetDoQA(doMUON, 0, "MUON");
903 SetDoQA(doTOF, 1, "TOF");
904 SetDoQA(doHMPID, 0, "HMPID");
905 SetDoQA(doT0, 0, "T0");
906 SetDoQA(doZDC, 0, "ZDC");
907 // SetDoQA(doPIDResponse, 0, "PIDResponse");
908 SetDoQA(doPIDqa, 0, "PIDqa");
909 SetDoQA(doFMD, 0, "FMD");
910 SetDoQA(doPHOS, 0, "PHOS");
911 SetDoQA(doPHOSTrig, 0, "PHOSTrig");
912 SetDoQA(doEMCAL, 0, "EMCAL");
913 SetDoQA(doFBFqa, 0, "FBFqa");
914 break;
915 case 4:
916 SetDoQA(doStatistics, 0, "Statistics");
917 SetDoQA(doVZERO, 0, "VZERO");
918 SetDoQA(doVZEROPbPb, 0, "VZEROPbPb");
919 SetDoQA(doVertex, 0, "Vertex");
920 SetDoQA(doSPD, 0, "SPD");
921 SetDoQA(doTPC, 0, "TPC");
922 SetDoQA(doHLT, 0, "HLT");
923 SetDoQA(doSDD, 0, "SDD");
924 SetDoQA(doSSDdEdx, 0, "SSDdEdx");
925 SetDoQA(doTRD, 0, "TRD");
926 SetDoQA(doITS, 0, "ITS");
927 SetDoQA(doITSsaTracks, 0, "ITSsaTracks");
928 SetDoQA(doITSalign, 0, "ITSalign");
929 SetDoQA(doCALO , 0, "CALO");
930 SetDoQA(doMUONTrig, 1, "MUONTrig");
931 SetDoQA(doImpParRes, 0, "ImpParRes");
932 SetDoQA(doMUON, 1, "MUON");
933 SetDoQA(doTOF, 0, "TOF");
934 SetDoQA(doHMPID, 0, "HMPID");
935 SetDoQA(doT0, 0, "T0");
936 SetDoQA(doZDC, 0, "ZDC");
937 // SetDoQA(doPIDResponse, 0, "PIDResponse");
938 SetDoQA(doPIDqa, 0, "PIDqa");
939 SetDoQA(doFMD, 0, "FMD");
940 SetDoQA(doPHOS, 0, "PHOS");
941 SetDoQA(doPHOSTrig, 0, "PHOSTrig");
942 SetDoQA(doEMCAL, 1, "EMCAL");
943 SetDoQA(doFBFqa, 0, "FBFqa");
944 break;
945 };
946
947 printf("Set doTaskFilteredTree=%d according to environment variables\n",doTaskFilteredTree);
948 }
949
950
951}
952
953void SetDoQA(Bool_t& var, Bool_t onoff, const char* name)
954{
955 // set to ON only if previous value is not off
956 if (var) var = onoff;
957 if (name) printf("Set %-15s to %s\n",name,var ? "ON":"OFF");
958}
959
960Bool_t CheckEnvS(const char* var,TString& envString)
961{
962 if (envString=="0" || envString=="1") return kTRUE;
963 else printf("Ignoring wrong value %s for environment variable %s\n",envString.Data(),var);
964 return kFALSE;
965}