Adding the QA plot for the pid efficiency/contamination vs the number of TPC points...
[u/mrichter/AliRoot.git] / PWG2 / SPECTRA / macros / runProtonAnalysisQA.C
CommitLineData
57e749bb 1void runProtonAnalysisQA(const char* esdAnalysisType = "Hybrid",
e7df5638 2 const char* pidMode = "Bayesian") {
9e2392b0 3 //Macro to run the proton QA analysis tested for local, proof & GRID.
e7df5638 4 //Local: Takes four arguments, the analysis mode, the type of the ESD
5 // analysis, the PID mode and the path where the tag and ESD or
6 // AOD files reside.
7 //Interactive: Takes four arguments, the analysis mode, the type of the ESD
8 // analysis, the PID mode and the name of the collection of tag
9 // files.
10 //Batch: Takes four arguments, the analysis mode, the type of the ESD
11 // analysis, the PID mode and the name of the collection file with
12 // the event list for each file.
13 //Proof: Takes five arguments, the analysis level, the analysis mode in
14 // case of ESD, the PID mode, the number of events and the dataset
15 // name and .
16 //Analysis mode can be: "MC", "ESD", "AOD"
17 //ESD analysis type can be one of the three: "TPC", "Hybrid", "Global"
87a55728 18 //PID mode can be one of the four: "Bayesian" (standard Bayesian approach)
e7df5638 19 // "Ratio" (ratio of measured over expected/theoretical dE/dx a la STAR)
87a55728 20 // "Sigma1" (N-sigma area around the fitted dE/dx vs P band)
21 // "Sigma2" (same as previous but taking into account the No of TPC points)
7b59a00b 22 TStopwatch timer;
23 timer.Start();
24
e7df5638 25 runLocal("ESD",
26 esdAnalysisType,
27 pidMode,
28 "/home/pchrist/ALICE/Baryons/QA/Local");
9a316962 29 //runProof("ESD",esdAnalysisType,pidMode,200000,"/COMMON/COMMON/LHC08c11_10TeV_0.5T");
30 //runInteractive("ESD",esdAnalysisType,pidMode,"wn.xml");
31 //runBatch("ESD",esdAnalysisType,pidMode,"wn.xml");
75decd62 32
7b59a00b 33 timer.Stop();
34 timer.Print();
35}
36
37//_________________________________________________//
e7df5638 38void runLocal(const char* mode = "ESD",
39 const char* analysisType = 0x0,
40 const char* pidMode = 0x0,
57e749bb 41 const char* path = 0x0) {
75decd62 42 TString outputFilename1 = "Protons.QA."; outputFilename1 += analysisType;
43 outputFilename1 += ".root"; //main QA file
44 TString outputFilename2 = "Protons.MC.QA."; outputFilename2 += analysisType;
45 outputFilename2 += ".root"; //MC process QA
46 TString outputFilename3 = "Protons.QA.Histograms.";
47 outputFilename3 += analysisType;
48 outputFilename3 += ".root"; //Accepted cut distributions
49 TString outputFilename4 = "Protons.Efficiency.";
50 outputFilename4 += analysisType;
51 outputFilename4 += ".root"; //Reco and PID efficiency
52 TString outputFilename5 = "Vertex.QA.root"; //vertex QA
53
54 gSystem->Load("libProofPlayer.so");
55
56 //Setup the par files
57 setupPar("STEERBase");
58 gSystem->Load("libSTEERBase.so");
59 setupPar("ESD");
60 gSystem->Load("libESD.so");
61 setupPar("AOD");
62 gSystem->Load("libAOD.so");
63 setupPar("ANALYSIS");
64 gSystem->Load("libANALYSIS.so");
65 setupPar("ANALYSISalice");
66 gSystem->Load("libANALYSISalice.so");
67 setupPar("CORRFW");
68 gSystem->Load("libCORRFW.so");
69 setupPar("PWG2spectra");
70 gSystem->Load("libPWG2spectra.so");
71
e7df5638 72 //____________________________________________//
73 AliTagAnalysis *tagAnalysis = new AliTagAnalysis("ESD");
74 tagAnalysis->ChainLocalTags(path);
75
76 AliRunTagCuts *runCuts = new AliRunTagCuts();
77 AliLHCTagCuts *lhcCuts = new AliLHCTagCuts();
78 AliDetectorTagCuts *detCuts = new AliDetectorTagCuts();
79 AliEventTagCuts *evCuts = new AliEventTagCuts();
75decd62 80
e7df5638 81 TChain* chain = 0x0;
82 chain = tagAnalysis->QueryTags(runCuts,lhcCuts,detCuts,evCuts);
83 chain->SetBranchStatus("*Calo*",0);
84
85 //____________________________________________//
86 gROOT->LoadMacro("configProtonAnalysis.C");
87 AliProtonQAAnalysis *analysis = GetProtonQAAnalysisObject(mode,
88 analysisType,
89 pidMode);
75decd62 90 //____________________________________________//
91 // Make the analysis manager
e7df5638 92 AliAnalysisManager *mgr = new AliAnalysisManager("protonAnalysisQAManager");
75decd62 93 AliVEventHandler* esdH = new AliESDInputHandler;
94 mgr->SetInputEventHandler(esdH);
95 AliMCEventHandler *mc = new AliMCEventHandler();
96 mgr->SetMCtruthEventHandler(mc);
97
98 //____________________________________________//
99 // 1st Proton task
100 AliAnalysisTaskProtonsQA *taskProtonsQA = new AliAnalysisTaskProtonsQA("TaskProtonsQA");
e7df5638 101 taskProtonsQA->SetAnalysisObject(analysis);
75decd62 102 mgr->AddTask(taskProtonsQA);
103
104 // Create containers for input/output
105 AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("dataChain",
106 TChain::Class(),
107 AliAnalysisManager::kInputContainer);
108 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("globalQAList",
109 TList::Class(),
110 AliAnalysisManager::kOutputContainer,
111 outputFilename1.Data());
112 AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("pdgCodeList",
113 TList::Class(),
114 AliAnalysisManager::kOutputContainer,
115 outputFilename2.Data());
116 AliAnalysisDataContainer *coutput3 = mgr->CreateContainer("mcProcessList",
117 TList::Class(),
118 AliAnalysisManager::kOutputContainer,
119 outputFilename2.Data());
120 AliAnalysisDataContainer *coutput4 = mgr->CreateContainer("acceptedCutList",
121 TList::Class(),
122 AliAnalysisManager::kOutputContainer,
123 outputFilename3.Data());
5661e210 124 AliAnalysisDataContainer *coutput5 = mgr->CreateContainer("rejectedCutList",
75decd62 125 TList::Class(),
126 AliAnalysisManager::kOutputContainer,
127 outputFilename3.Data());
5661e210 128 AliAnalysisDataContainer *coutput6 = mgr->CreateContainer("acceptedDCAList",
129 TList::Class(),
130 AliAnalysisManager::kOutputContainer,
131 outputFilename3.Data());
132 AliAnalysisDataContainer *coutput7 = mgr->CreateContainer("efficiencyList",
75decd62 133 TList::Class(),
134 AliAnalysisManager::kOutputContainer,
135 outputFilename4.Data());
5661e210 136 AliAnalysisDataContainer *coutput8 = mgr->CreateContainer("vertexList",
75decd62 137 TList::Class(),
138 AliAnalysisManager::kOutputContainer,
139 outputFilename5.Data());
e7df5638 140
75decd62 141 //____________________________________________//
142 mgr->ConnectInput(taskProtonsQA,0,cinput1);
143 mgr->ConnectOutput(taskProtonsQA,0,coutput1);
144 mgr->ConnectOutput(taskProtonsQA,1,coutput2);
145 mgr->ConnectOutput(taskProtonsQA,2,coutput3);
146 mgr->ConnectOutput(taskProtonsQA,3,coutput4);
147 mgr->ConnectOutput(taskProtonsQA,4,coutput5);
148 mgr->ConnectOutput(taskProtonsQA,5,coutput6);
149 mgr->ConnectOutput(taskProtonsQA,6,coutput7);
5661e210 150 mgr->ConnectOutput(taskProtonsQA,7,coutput8);
75decd62 151 if (!mgr->InitAnalysis()) return;
152 mgr->PrintStatus();
153 mgr->StartAnalysis("local",chain);
154}
155
156//_________________________________________________//
e7df5638 157void runInteractive(const char* mode = "ESD",
158 const char* analysisType = 0x0,
159 const char* pidMode = 0x0,
160 const char* collectionName = "tag.xml") {
1b309669 161 TString outputFilename1 = "Protons.QA."; outputFilename1 += analysisType;
162 outputFilename1 += ".root"; //main QA file
163 TString outputFilename2 = "Protons.MC.QA."; outputFilename2 += analysisType;
164 outputFilename2 += ".root"; //MC process QA
165 TString outputFilename3 = "Protons.QA.Histograms.";
166 outputFilename3 += analysisType;
167 outputFilename3 += ".root"; //Accepted cut distributions
168 TString outputFilename4 = "Protons.Efficiency.";
169 outputFilename4 += analysisType;
170 outputFilename4 += ".root"; //Reco and PID efficiency
75decd62 171 TString outputFilename5 = "Vertex.QA.root"; //vertex QA
1b309669 172
173 TGrid::Connect("alien://");
1b309669 174
175 //Setup the par files
176 setupPar("STEERBase");
177 gSystem->Load("libSTEERBase.so");
178 setupPar("ESD");
179 gSystem->Load("libESD.so");
180 setupPar("AOD");
181 gSystem->Load("libAOD.so");
182 setupPar("ANALYSIS");
183 gSystem->Load("libANALYSIS.so");
184 setupPar("ANALYSISalice");
185 gSystem->Load("libANALYSISalice.so");
186 setupPar("CORRFW");
187 gSystem->Load("libCORRFW.so");
188 setupPar("PWG2spectra");
189 gSystem->Load("libPWG2spectra.so");
190
1b309669 191 //____________________________________________//
e7df5638 192 AliTagAnalysis *tagAnalysis = new AliTagAnalysis("ESD");
193
194 AliRunTagCuts *runCuts = new AliRunTagCuts();
195 AliLHCTagCuts *lhcCuts = new AliLHCTagCuts();
196 AliDetectorTagCuts *detCuts = new AliDetectorTagCuts();
197 AliEventTagCuts *evCuts = new AliEventTagCuts();
198
199 //grid tags
200 TAlienCollection* coll = TAlienCollection::Open(collectionName);
201 TGridResult* TagResult = coll->GetGridResult("",0,0);
202 tagAnalysis->ChainGridTags(TagResult);
203 TChain* chain = 0x0;
204 chain = tagAnalysis->QueryTags(runCuts,lhcCuts,detCuts,evCuts);
205 chain->SetBranchStatus("*Calo*",0);
206
207 //____________________________________________//
208 gROOT->LoadMacro("configProtonAnalysis.C");
209 AliProtonQAAnalysis *analysis = GetProtonQAAnalysisObject(mode,
210 analysisType,
211 pidMode);
1b309669 212 //____________________________________________//
213 // Make the analysis manager
e7df5638 214 AliAnalysisManager *mgr = new AliAnalysisManager("protonAnalysisQAManager");
1b309669 215 AliVEventHandler* esdH = new AliESDInputHandler;
216 mgr->SetInputEventHandler(esdH);
217 AliMCEventHandler *mc = new AliMCEventHandler();
218 mgr->SetMCtruthEventHandler(mc);
219
220 //____________________________________________//
221 // 1st Proton task
222 AliAnalysisTaskProtonsQA *taskProtonsQA = new AliAnalysisTaskProtonsQA("TaskProtonsQA");
e7df5638 223 taskProtonsQA->SetAnalysisObject(analysis);
1b309669 224 mgr->AddTask(taskProtonsQA);
225
226 // Create containers for input/output
e7df5638 227 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
1b309669 228 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("globalQAList",
229 TList::Class(),
230 AliAnalysisManager::kOutputContainer,
231 outputFilename1.Data());
232 AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("pdgCodeList",
233 TList::Class(),
234 AliAnalysisManager::kOutputContainer,
235 outputFilename2.Data());
236 AliAnalysisDataContainer *coutput3 = mgr->CreateContainer("mcProcessList",
237 TList::Class(),
238 AliAnalysisManager::kOutputContainer,
239 outputFilename2.Data());
240 AliAnalysisDataContainer *coutput4 = mgr->CreateContainer("acceptedCutList",
241 TList::Class(),
242 AliAnalysisManager::kOutputContainer,
243 outputFilename3.Data());
5661e210 244 AliAnalysisDataContainer *coutput5 = mgr->CreateContainer("rejectedCutList",
245 TList::Class(),
246 AliAnalysisManager::kOutputContainer,
247 outputFilename3.Data());
248 AliAnalysisDataContainer *coutput6 = mgr->CreateContainer("acceptedDCAList",
1b309669 249 TList::Class(),
250 AliAnalysisManager::kOutputContainer,
251 outputFilename3.Data());
5661e210 252 AliAnalysisDataContainer *coutput7 = mgr->CreateContainer("efficiencyList",
1b309669 253 TList::Class(),
254 AliAnalysisManager::kOutputContainer,
255 outputFilename4.Data());
5661e210 256 AliAnalysisDataContainer *coutput8 = mgr->CreateContainer("vertexList",
75decd62 257 TList::Class(),
258 AliAnalysisManager::kOutputContainer,
259 outputFilename5.Data());
1b309669 260
261 //____________________________________________//
262 mgr->ConnectInput(taskProtonsQA,0,cinput1);
263 mgr->ConnectOutput(taskProtonsQA,0,coutput1);
264 mgr->ConnectOutput(taskProtonsQA,1,coutput2);
265 mgr->ConnectOutput(taskProtonsQA,2,coutput3);
266 mgr->ConnectOutput(taskProtonsQA,3,coutput4);
267 mgr->ConnectOutput(taskProtonsQA,4,coutput5);
268 mgr->ConnectOutput(taskProtonsQA,5,coutput6);
75decd62 269 mgr->ConnectOutput(taskProtonsQA,6,coutput7);
5661e210 270 mgr->ConnectOutput(taskProtonsQA,7,coutput8);
1b309669 271 if (!mgr->InitAnalysis()) return;
272 mgr->PrintStatus();
273 mgr->StartAnalysis("local",chain);
274}
275
276//_________________________________________________//
e7df5638 277void runBatch(const char* mode = "ESD",
278 const char* analysisType = 0x0,
279 const char* pidMode = 0x0,
280 const char *collectionfile = "wn.xml") {
9e2392b0 281 TString outputFilename1 = "Protons.QA."; outputFilename1 += analysisType;
282 outputFilename1 += ".root"; //main QA file
283 TString outputFilename2 = "Protons.MC.QA."; outputFilename2 += analysisType;
284 outputFilename2 += ".root"; //MC process QA
285 TString outputFilename3 = "Protons.QA.Histograms.";
286 outputFilename3 += analysisType;
287 outputFilename3 += ".root"; //Accepted cut distributions
288 TString outputFilename4 = "Protons.Efficiency.";
289 outputFilename4 += analysisType;
290 outputFilename4 += ".root"; //Reco and PID efficiency
75decd62 291 TString outputFilename5 = "Vertex.QA.root"; //vertex QA
e2f97a75 292
293 TGrid::Connect("alien://");
e7df5638 294 gSystem->Load("libProofPlayer.so");
e2f97a75 295
296 //Setup the par files
297 setupPar("STEERBase");
298 gSystem->Load("libSTEERBase.so");
299 setupPar("ESD");
300 gSystem->Load("libESD.so");
301 setupPar("AOD");
302 gSystem->Load("libAOD.so");
303 setupPar("ANALYSIS");
304 gSystem->Load("libANALYSIS.so");
305 setupPar("ANALYSISalice");
306 gSystem->Load("libANALYSISalice.so");
307 setupPar("CORRFW");
308 gSystem->Load("libCORRFW.so");
309 setupPar("PWG2spectra");
310 gSystem->Load("libPWG2spectra.so");
311
e2f97a75 312 //____________________________________________//
313 //Usage of event tags
e7df5638 314 AliTagAnalysis *tagAnalysis = new AliTagAnalysis();
e2f97a75 315 TChain *chain = 0x0;
e7df5638 316 chain = tagAnalysis->GetChainFromCollection(collectionfile,"esdTree");
317 chain->SetBranchStatus("*Calo*",0);
318
319 //____________________________________________//
320 gROOT->LoadMacro("configProtonAnalysis.C");
321 AliProtonQAAnalysis *analysis = GetProtonQAAnalysisObject(mode,
322 analysisType,
323 pidMode);
e2f97a75 324 //____________________________________________//
325 // Make the analysis manager
e7df5638 326 AliAnalysisManager *mgr = new AliAnalysisManager("protonAnalysisQAManager");
e2f97a75 327 AliVEventHandler* esdH = new AliESDInputHandler;
328 mgr->SetInputEventHandler(esdH);
329 AliMCEventHandler *mc = new AliMCEventHandler();
330 mgr->SetMCtruthEventHandler(mc);
7b59a00b 331
e2f97a75 332 //____________________________________________//
333 // 1st Proton task
334 AliAnalysisTaskProtonsQA *taskProtonsQA = new AliAnalysisTaskProtonsQA("TaskProtonsQA");
e7df5638 335 taskProtonsQA->SetAnalysisObject(analysis);
e2f97a75 336 mgr->AddTask(taskProtonsQA);
337
338 // Create containers for input/output
e7df5638 339 AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("dataChain",
340 TChain::Class(),
341 AliAnalysisManager::kInputContainer);
e2f97a75 342 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("globalQAList",
343 TList::Class(),
344 AliAnalysisManager::kOutputContainer,
345 outputFilename1.Data());
346 AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("pdgCodeList",
347 TList::Class(),
348 AliAnalysisManager::kOutputContainer,
349 outputFilename2.Data());
350 AliAnalysisDataContainer *coutput3 = mgr->CreateContainer("mcProcessList",
351 TList::Class(),
352 AliAnalysisManager::kOutputContainer,
353 outputFilename2.Data());
354 AliAnalysisDataContainer *coutput4 = mgr->CreateContainer("acceptedCutList",
355 TList::Class(),
356 AliAnalysisManager::kOutputContainer,
357 outputFilename3.Data());
5661e210 358 AliAnalysisDataContainer *coutput5 = mgr->CreateContainer("rejectedCutList",
e2f97a75 359 TList::Class(),
360 AliAnalysisManager::kOutputContainer,
361 outputFilename3.Data());
5661e210 362 AliAnalysisDataContainer *coutput6 = mgr->CreateContainer("acceptedDCAList",
363 TList::Class(),
364 AliAnalysisManager::kOutputContainer,
365 outputFilename3.Data());
366 AliAnalysisDataContainer *coutput7 = mgr->CreateContainer("efficiencyList",
e2f97a75 367 TList::Class(),
368 AliAnalysisManager::kOutputContainer,
369 outputFilename4.Data());
5661e210 370 AliAnalysisDataContainer *coutput8 = mgr->CreateContainer("vertexList",
75decd62 371 TList::Class(),
372 AliAnalysisManager::kOutputContainer,
373 outputFilename5.Data());
e2f97a75 374
375 //____________________________________________//
376 mgr->ConnectInput(taskProtonsQA,0,cinput1);
377 mgr->ConnectOutput(taskProtonsQA,0,coutput1);
378 mgr->ConnectOutput(taskProtonsQA,1,coutput2);
379 mgr->ConnectOutput(taskProtonsQA,2,coutput3);
380 mgr->ConnectOutput(taskProtonsQA,3,coutput4);
381 mgr->ConnectOutput(taskProtonsQA,4,coutput5);
382 mgr->ConnectOutput(taskProtonsQA,5,coutput6);
75decd62 383 mgr->ConnectOutput(taskProtonsQA,6,coutput7);
5661e210 384 mgr->ConnectOutput(taskProtonsQA,7,coutput8);
e2f97a75 385 if (!mgr->InitAnalysis()) return;
386 mgr->PrintStatus();
387 mgr->StartAnalysis("local",chain);
388}
389
390//_________________________________________________//
e7df5638 391void runProof(const char* mode = "ESD",
392 const char* analysisType = 0x0,
393 const char* pidMode = 0x0,
394 Int_t stats = 0,
395 const char* dataset = 0x0) {
9e2392b0 396 TString outputFilename1 = "Protons.QA."; outputFilename1 += analysisType;
397 outputFilename1 += ".root"; //main QA file
398 TString outputFilename2 = "Protons.MC.QA."; outputFilename2 += analysisType;
399 outputFilename2 += ".root"; //MC process QA
400 TString outputFilename3 = "Protons.QA.Histograms.";
401 outputFilename3 += analysisType;
402 outputFilename3 += ".root"; //Accepted cut distributions
403 TString outputFilename4 = "Protons.Efficiency.";
404 outputFilename4 += analysisType;
405 outputFilename4 += ".root"; //Reco and PID efficiency
75decd62 406 TString outputFilename5 = "Vertex.QA.root"; //vertex QA
7b59a00b 407
408 printf("****** Connect to PROOF *******\n");
96f84c25 409 TProof::Open("alicecaf.cern.ch");
7b59a00b 410 gProof->SetParallel();
411
412 // Enable the Analysis Package
413 gProof->UploadPackage("STEERBase.par");
414 gProof->EnablePackage("STEERBase");
415 gProof->UploadPackage("ESD.par");
416 gProof->EnablePackage("ESD");
417 gProof->UploadPackage("AOD.par");
418 gProof->EnablePackage("AOD");
419 gProof->UploadPackage("ANALYSIS.par");
420 gProof->EnablePackage("ANALYSIS");
421 gProof->UploadPackage("ANALYSISalice.par");
422 gProof->EnablePackage("ANALYSISalice");
f99662ca 423 gProof->UploadPackage("CORRFW.par");
424 gProof->EnablePackage("CORRFW");
7b59a00b 425 gProof->UploadPackage("PWG2spectra.par");
426 gProof->EnablePackage("PWG2spectra");
427
e7df5638 428 //____________________________________________//
429 gROOT->LoadMacro("configProtonAnalysis.C");
430 AliProtonQAAnalysis *analysis = GetProtonQAAnalysisObject(mode,
431 analysisType,
432 pidMode);
7b59a00b 433 //____________________________________________//
434 // Make the analysis manager
e7df5638 435 AliAnalysisManager *mgr = new AliAnalysisManager("protonAnalysisQAManager");
7b59a00b 436 AliVEventHandler* esdH = new AliESDInputHandler;
437 mgr->SetInputEventHandler(esdH);
438 AliMCEventHandler *mc = new AliMCEventHandler();
439 mgr->SetMCtruthEventHandler(mc);
440
441 //____________________________________________//
442 // 1st Proton task
443 AliAnalysisTaskProtonsQA *taskProtonsQA = new AliAnalysisTaskProtonsQA("TaskProtonsQA");
e7df5638 444 taskProtonsQA->SetAnalysisObject(analysis);
7b59a00b 445 mgr->AddTask(taskProtonsQA);
446
447 // Create containers for input/output
8a546c82 448 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
5b8133c7 449 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("globalQAList",
f99662ca 450 TList::Class(),
451 AliAnalysisManager::kOutputContainer,
d4733690 452 outputFilename1.Data());
5b8133c7 453 AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("pdgCodeList",
d4733690 454 TList::Class(),
455 AliAnalysisManager::kOutputContainer,
456 outputFilename2.Data());
5b8133c7 457 AliAnalysisDataContainer *coutput3 = mgr->CreateContainer("mcProcessList",
d4733690 458 TList::Class(),
459 AliAnalysisManager::kOutputContainer,
0008a5a6 460 outputFilename2.Data());
5b8133c7 461 AliAnalysisDataContainer *coutput4 = mgr->CreateContainer("acceptedCutList",
462 TList::Class(),
463 AliAnalysisManager::kOutputContainer,
464 outputFilename3.Data());
5661e210 465 AliAnalysisDataContainer *coutput5 = mgr->CreateContainer("rejectedCutList",
466 TList::Class(),
467 AliAnalysisManager::kOutputContainer,
468 outputFilename3.Data());
469 AliAnalysisDataContainer *coutput6 = mgr->CreateContainer("acceptedDCAList",
5b8133c7 470 TList::Class(),
471 AliAnalysisManager::kOutputContainer,
472 outputFilename3.Data());
5661e210 473 AliAnalysisDataContainer *coutput7 = mgr->CreateContainer("efficiencyList",
e2f97a75 474 TList::Class(),
475 AliAnalysisManager::kOutputContainer,
476 outputFilename4.Data());
5661e210 477 AliAnalysisDataContainer *coutput8 = mgr->CreateContainer("vertexList",
75decd62 478 TList::Class(),
479 AliAnalysisManager::kOutputContainer,
480 outputFilename5.Data());
7b59a00b 481
482 //____________________________________________//
483 mgr->ConnectInput(taskProtonsQA,0,cinput1);
484 mgr->ConnectOutput(taskProtonsQA,0,coutput1);
d4733690 485 mgr->ConnectOutput(taskProtonsQA,1,coutput2);
486 mgr->ConnectOutput(taskProtonsQA,2,coutput3);
5b8133c7 487 mgr->ConnectOutput(taskProtonsQA,3,coutput4);
488 mgr->ConnectOutput(taskProtonsQA,4,coutput5);
e2f97a75 489 mgr->ConnectOutput(taskProtonsQA,5,coutput6);
75decd62 490 mgr->ConnectOutput(taskProtonsQA,6,coutput7);
5661e210 491 mgr->ConnectOutput(taskProtonsQA,7,coutput8);
7b59a00b 492 if (!mgr->InitAnalysis()) return;
493 mgr->PrintStatus();
494
495 if(dataset)
496 mgr->StartAnalysis("proof",dataset,stats);
497 else {
498 // You should get this macro and the txt file from:
499 // http://aliceinfo.cern.ch/Offline/Analysis/CAF/
500 gROOT->LoadMacro("CreateESDChain.C");
501 TChain* chain = 0x0;
502 chain = CreateESDChain("ESD82XX_30K.txt",stats);
503 chain->SetBranchStatus("*Calo*",0);
504
505 mgr->StartAnalysis("proof",chain);
f99662ca 506 //mgr->StartAnalysis("local",chain);
7b59a00b 507 }
7b59a00b 508}
509
510//_________________________________________________//
511Int_t setupPar(const char* pararchivename) {
512 ///////////////////
513 // Setup PAR File//
514 ///////////////////
515 if (pararchivename) {
516 char processline[1024];
517 sprintf(processline,".! tar xvzf %s.par",pararchivename);
1b309669 518 gROOT->ProcessLine(processline);
7b59a00b 519 const char* ocwd = gSystem->WorkingDirectory();
520 gSystem->ChangeDirectory(pararchivename);
521
522 // check for BUILD.sh and execute
523 if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
524 printf("*******************************\n");
525 printf("*** Building PAR archive ***\n");
526 printf("*******************************\n");
527
528 if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
529 Error("runAnalysis","Cannot Build the PAR Archive! - Abort!");
530 return -1;
531 }
532 }
533 // check for SETUP.C and execute
534 if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
535 printf("*******************************\n");
536 printf("*** Setup PAR archive ***\n");
537 printf("*******************************\n");
538 gROOT->Macro("PROOF-INF/SETUP.C");
539 }
540
541 gSystem->ChangeDirectory("../");
542 }
543 return 1;
544}