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