1 /////////////////////////////////////////////////////////////////////////////////
3 // HOW TO USE THIS MACRO:
5 // With this macro several flow analysis can be run.
6 // SP = Scalar Product (for PbPb or pp)
7 // LYZ1 = Lee Yang Zeroes first run (for PbPb)
8 // LYZ2 = Lee Yang Zeroes second run (for PbPb)
9 // LYZEP = Lee Yang Zeroes Event Plane (for PbPb)
10 // GFC = Cumulants (for PbPb)
11 // QC = Q-cumulants (for PbPb or pp)
12 // FQD = Fitting q-distribution (for PbPb)
13 // MCEP = Flow calculated from the real MC event plane (for PbPb only)
15 // The LYZ analysis should be done in the following order;
16 // LYZ1 -> LYZ2 -> LYZEP,
17 // because LYZ2 depends on the outputfile of LYZ1 and LYZEP on the outputfile
20 // The MCEP method is a reference method.
21 // It can only be run when MC information (kinematics.root & galice.root file)
22 // is available in which the reaction plane is stored.
24 // One can run on ESD, AOD or MC.
25 // Additional options are ESDMC0, ESDMC1. In these options the ESD and MC
26 // information is combined. Tracks are selected in the ESD, the PID information
27 // is taken from the MC (perfect PID). For ESDMC0 the track kinematics is taken
28 // from the ESD and for ESDMC1 it is taken from the MC information.
30 // the macro can be used to run local in aliroot or root, on the grid and on caf
31 ///////////////////////////////////////////////////////////////////////////////////
33 enum anaModes {mLocal,mLocalPAR,mPROOF,mGRID};
34 //mLocal: Analyze locally files in your computer using aliroot
35 //mLocalPAR: Analyze locally files in your computer using root + PAR files
36 //mPROOF: Analyze CAF files with PROOF
38 // Analysis type can be ESD, AOD, MC, ESDMC0, ESDMC1
39 const TString type = "ESD";
42 // Flow analysis method can be:(set to kTRUE or kFALSE)
46 Bool_t LYZEP = kFALSE;
52 // Boolean to fill/not fill the QA histograms
56 //Use weights for Q vector
57 Bool_t usePhiWeights = kFALSE; //Phi
58 Bool_t usePtWeights = kFALSE; //v'(pt)
59 Bool_t useEtaWeights = kFALSE; //v'(eta)
60 Bool_t useWeights = usePhiWeights||usePtWeights||useEtaWeights;
63 void runFlowTask(Int_t mode=mLocal, Int_t nRuns = -1, const Char_t* dataDir="/Users/snelling/alice_data/Therminator_midcentral", Int_t offset=0)
69 if (LYZ1 && LYZ2) {cout<<"WARNING: you cannot run LYZ1 and LYZ2 at the same time! LYZ2 needs the output from LYZ1."<<endl; exit(); }
70 if (LYZ2 && LYZEP) {cout<<"WARNING: you cannot run LYZ2 and LYZEP at the same time! LYZEP needs the output from LYZ2."<<endl; exit(); }
71 if (LYZ1 && LYZEP) {cout<<"WARNING: you cannot run LYZ1 and LYZEP at the same time! LYZEP needs the output from LYZ2."<<endl; exit(); }
75 if (mode==mLocal || mode == mLocalPAR || mode == mGRID) {
76 if (type!="AOD") {TChain* chain = CreateESDChain(dataDir, nRuns, offset);}
77 else { TChain* chain = CreateAODChain(dataDir, nRuns, offset);}
80 //____________________________________________//
81 //external input files
83 TFile *weightsFile = NULL;
84 TList *weightsList = NULL;
87 //open the file with the weights:
88 weightsFile = TFile::Open("weights.root","READ");
90 //access the list which holds the histos with weigths:
91 weightsList = (TList*)weightsFile->Get("weights");
94 cout<<" WARNING: the file <weights.root> with weights from the previous run was not available."<<endl;
100 // read the input file from the first run
101 TString inputFileNameLYZ2 = "outputLYZ1analysis" ;
102 inputFileNameLYZ2 += type;
103 inputFileNameLYZ2 += ".root";
104 cout<<"The input file is "<<inputFileNameLYZ2.Data()<<endl;
105 TFile* fInputFileLYZ2 = new TFile(inputFileNameLYZ2.Data(),"READ");
106 if(!fInputFileLYZ2 || fInputFileLYZ2->IsZombie()) {
107 cerr << " ERROR: NO First Run file... " << endl ;
111 TList* fInputListLYZ2 = (TList*)fInputFileLYZ2->Get("cobjLYZ1");
112 if (!fInputListLYZ2) {cout<<"list is NULL pointer!"<<endl;}
114 cout<<"LYZ2 input file/list read..."<<endl;
118 // read the input file from the second LYZ run
119 TString inputFileNameLYZEP = "outputLYZ2analysis" ;
120 inputFileNameLYZEP += type;
121 inputFileNameLYZEP += ".root";
122 cout<<"The input file is "<<inputFileNameLYZEP.Data()<<endl;
123 TFile* fInputFileLYZEP = new TFile(inputFileNameLYZEP.Data(),"READ");
124 if(!fInputFileLYZEP || fInputFileLYZEP->IsZombie()) {
125 cerr << " ERROR: NO First Run file... " << endl ;
129 TList* fInputListLYZEP = (TList*)fInputFileLYZEP->Get("cobjLYZ2");
130 if (!fInputListLYZEP) {cout<<"list is NULL pointer!"<<endl;}
132 cout<<"LYZEP input file/list read..."<<endl;
136 //____________________________________________//
137 // Make the analysis manager
138 AliAnalysisManager *mgr = new AliAnalysisManager("FlowAnalysisManager");
141 AliVEventHandler* esdH = new AliESDInputHandler;
142 mgr->SetInputEventHandler(esdH);
144 AliMCEventHandler *mc = new AliMCEventHandler();
145 mgr->SetMCtruthEventHandler(mc);} }
148 AliVEventHandler* aodH = new AliAODInputHandler;
149 mgr->SetInputEventHandler(aodH);
151 AliMCEventHandler *mc = new AliMCEventHandler();
152 mgr->SetMCtruthEventHandler(mc);} }
154 if (type == "MC" || type == "ESDMC0" || type == "ESDMC1"){
155 AliVEventHandler* esdH = new AliESDInputHandler;
156 mgr->SetInputEventHandler(esdH);
158 AliMCEventHandler *mc = new AliMCEventHandler();
159 mgr->SetMCtruthEventHandler(mc); }
161 //____________________________________________//
163 AliAnalysisTaskFlowEvent *taskFE = NULL;
165 taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent",kTRUE);
166 taskFE->SetAnalysisType(type);
167 mgr->AddTask(taskFE);
170 taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent",kFALSE);
171 taskFE->SetAnalysisType(type);
172 mgr->AddTask(taskFE);
175 AliAnalysisTaskFittingQDistribution *taskFQD = new AliAnalysisTaskFittingQDistribution("TaskFittingQDistribution",kFALSE);
176 taskFQD->SetUsePhiWeights(usePhiWeights);
177 mgr->AddTask(taskFQD);
180 AliAnalysisTaskScalarProduct *taskSP = new AliAnalysisTaskScalarProduct("TaskScalarProduct");
181 mgr->AddTask(taskSP);
184 AliAnalysisTaskLeeYangZeros *taskLYZ1 = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZeros",kTRUE);
185 taskLYZ1->SetFirstRunLYZ(kTRUE);
186 taskLYZ1->SetUseSumLYZ(kTRUE);
187 mgr->AddTask(taskLYZ1);
190 AliAnalysisTaskLeeYangZeros *taskLYZ2 = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZeros",kFALSE);
191 taskLYZ2->SetFirstRunLYZ(kFALSE);
192 taskLYZ2->SetUseSumLYZ(kTRUE);
193 mgr->AddTask(taskLYZ2);
196 AliAnalysisTaskLYZEventPlane *taskLYZEP = new AliAnalysisTaskLYZEventPlane("TaskLYZEventPlane");
197 mgr->AddTask(taskLYZEP);
200 AliAnalysisTaskCumulants *taskGFC = new AliAnalysisTaskCumulants("TaskCumulants",useWeights);
201 taskGFC->SetUsePhiWeights(usePhiWeights);
202 taskGFC->SetUsePtWeights(usePtWeights);
203 taskGFC->SetUseEtaWeights(useEtaWeights);
204 mgr->AddTask(taskGFC);
207 AliAnalysisTaskQCumulants *taskQC = new AliAnalysisTaskQCumulants("TaskQCumulants",kFALSE);
208 taskQC->SetUsePhiWeights(usePhiWeights);
209 taskQC->SetUsePtWeights(usePtWeights);
210 taskQC->SetUseEtaWeights(useEtaWeights);
211 mgr->AddTask(taskQC);
214 AliAnalysisTaskMCEventPlane *taskMCEP = new AliAnalysisTaskMCEventPlane("TaskMCEventPlane");
215 mgr->AddTask(taskMCEP);
219 // Create containers for input/output
220 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
221 // TString outputFE = "outputFlowEvent";
223 // outputFE+= ".root";
224 AliAnalysisDataContainer *coutputFE = mgr->CreateContainer("cobjFlowEventSimple", AliFlowEventSimple::Class(),AliAnalysisManager::kExchangeContainer);
227 AliAnalysisDataContainer *cinputWeights = mgr->CreateContainer("cobjWeights",TList::Class(),AliAnalysisManager::kInputContainer);
231 AliAnalysisDataContainer *cinputLYZ2 = mgr->CreateContainer("cobjLYZ2in",TList::Class(),AliAnalysisManager::kInputContainer); }
233 AliAnalysisDataContainer *cinputLYZEP = mgr->CreateContainer("cobjLYZEPin",TList::Class(),AliAnalysisManager::kInputContainer); }
236 TString outputSP = "outputSPanalysis";
239 AliAnalysisDataContainer *coutputSP = mgr->CreateContainer("cobjSP", TList::Class(),AliAnalysisManager::kOutputContainer,outputSP);
243 TString outputLYZ1 = "outputLYZ1analysis";
245 outputLYZ1+= ".root";
246 AliAnalysisDataContainer *coutputLYZ1 = mgr->CreateContainer("cobjLYZ1", TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ1);
250 TString outputLYZ2 = "outputLYZ2analysis";
252 outputLYZ2+= ".root";
253 AliAnalysisDataContainer *coutputLYZ2 = mgr->CreateContainer("cobjLYZ2", TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ2);
257 TString outputLYZEP = "outputLYZEPanalysis";
259 outputLYZEP+= ".root";
260 AliAnalysisDataContainer *coutputLYZEP = mgr->CreateContainer("cobjLYZEP", TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZEP);
264 TString outputGFC = "outputGFCanalysis";
267 AliAnalysisDataContainer *coutputGFC = mgr->CreateContainer("cobjGFC", TList::Class(),AliAnalysisManager::kOutputContainer,outputGFC);
271 TString outputQC = "outputQCanalysis";
274 AliAnalysisDataContainer *coutputQC = mgr->CreateContainer("cobjQC", TList::Class(),AliAnalysisManager::kOutputContainer,outputQC);
278 TString outputFQD = "outputFQDanalysis";
281 AliAnalysisDataContainer *coutputFQD = mgr->CreateContainer("cobjFQD", TList::Class(),AliAnalysisManager::kOutputContainer,outputFQD);
285 TString outputMCEP = "outputMCEPanalysis";
287 outputMCEP+= ".root";
288 AliAnalysisDataContainer *coutputMCEP = mgr->CreateContainer("cobjMCEP", TList::Class(),AliAnalysisManager::kOutputContainer,outputMCEP);
292 TString qaNameIntFE = "QAforInt_FE_";
294 qaNameIntFE += ".root";
295 AliAnalysisDataContainer *coutputQA1FE =
296 mgr->CreateContainer("QAintFE", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntFE);
298 TString qaNameDiffFE = "QAforDiff_FE_";
299 qaNameDiffFE += type;
300 qaNameDiffFE += ".root";
301 AliAnalysisDataContainer *coutputQA2FE =
302 mgr->CreateContainer("QAdiffFE", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffFE);
304 //____________________________________________//
307 // the flow event simple is produced here
308 mgr->ConnectInput(taskFE,0,cinput1);
309 mgr->ConnectOutput(taskFE,0,coutputFE);
311 mgr->ConnectOutput(taskFE,1,coutputQA1FE);
312 mgr->ConnectOutput(taskFE,2,coutputQA2FE);
316 mgr->ConnectInput(taskFQD,0,coutputFE);
317 mgr->ConnectOutput(taskFQD,0,coutputFQD);
319 mgr->ConnectInput(taskFQD,1,cinputWeights);
320 cinputWeights->SetData(weightsList);
324 mgr->ConnectInput(taskSP,0,coutputFE);
325 mgr->ConnectOutput(taskSP,0,coutputSP);
328 mgr->ConnectInput(taskLYZ1,0,coutputFE);
329 mgr->ConnectOutput(taskLYZ1,0,coutputLYZ1);
332 mgr->ConnectInput(taskLYZ2,0,coutputFE);
333 mgr->ConnectInput(taskLYZ2,1,cinputLYZ2);
334 mgr->ConnectOutput(taskLYZ2,0,coutputLYZ2);
335 cinputLYZ2->SetData(fInputListLYZ2);
338 mgr->ConnectInput(taskLYZEP,0,coutputFE);
339 mgr->ConnectInput(taskLYZEP,1,cinputLYZEP);
340 mgr->ConnectOutput(taskLYZEP,0,coutputLYZEP);
341 cinputLYZEP->SetData(fInputListLYZEP);
344 mgr->ConnectInput(taskGFC,0,coutputFE);
345 mgr->ConnectOutput(taskGFC,0,coutputGFC);
347 mgr->ConnectInput(taskGFC,1,cinputWeights);
348 cinputWeights->SetData(weightsList);
352 mgr->ConnectInput(taskQC,0,coutputFE);
353 mgr->ConnectOutput(taskQC,0,coutputQC);
355 mgr->ConnectInput(taskQC,1,cinputWeights);
356 cinputWeights->SetData(weightsList);
360 mgr->ConnectInput(taskMCEP,0,coutputFE);
361 mgr->ConnectOutput(taskMCEP,0,coutputMCEP);
364 //----------------------------------------------------------
366 //----------------------------------------------------------
368 if (!mgr->InitAnalysis()) return;
371 if (mode==mLocal || mode == mLocalPAR) {
372 mgr->StartAnalysis("local",chain);
374 else if (mode==mPROOF) {
375 // mgr->StartAnalysis("proof",chain);
376 mgr->StartAnalysis("proof",dataDir,nRuns,offset);
378 else if (mode==mGRID) {
379 mgr->StartAnalysis("local",chain);
386 void LoadLibraries(const anaModes mode) {
388 //--------------------------------------
389 // Load the needed libraries most of them already loaded by aliroot
390 //--------------------------------------
391 gSystem->Load("libTree.so");
392 gSystem->Load("libGeom.so");
393 gSystem->Load("libVMC.so");
394 gSystem->Load("libXMLIO.so");
395 gSystem->Load("libPhysics.so");
397 //----------------------------------------------------------
398 // >>>>>>>>>>> Local mode <<<<<<<<<<<<<<
399 //----------------------------------------------------------
401 //--------------------------------------------------------
402 // If you want to use already compiled libraries
403 // in the aliroot distribution
404 //--------------------------------------------------------
405 gSystem->Load("libSTEERBase");
406 gSystem->Load("libESD");
407 gSystem->Load("libAOD");
408 gSystem->Load("libANALYSIS");
409 gSystem->Load("libANALYSISalice");
410 gSystem->Load("libCORRFW.so");
411 cerr<<"libCORRFW.so loaded..."<<endl;
412 gSystem->Load("libPWG2flowCommon.so");
413 cerr<<"libPWG2flowCommon.so loaded..."<<endl;
414 gSystem->Load("libPWG2flowTasks.so");
415 cerr<<"libPWG2flowTasks.so loaded..."<<endl;
417 gSystem->AddIncludePath("-I$ALICE_ROOT/include -I$ALICE_ROOT/CORRFW -I$ALICE_ROOT/PWG2/FLOW/AliFlowTasks");
418 gROOT->LoadMacro("ConfigFlowAnalysis.C++");
423 else if (mode == mLocalPAR || mode == mGRID) {
424 //--------------------------------------------------------
425 //If you want to use root and par files from aliroot
426 //--------------------------------------------------------
427 SetupPar("STEERBase");
430 SetupPar("ANALYSIS");
431 SetupPar("ANALYSISalice");
434 SetupPar("PWG2flowCommon");
435 cerr<<"PWG2flowCommon.par loaded..."<<endl;
436 SetupPar("PWG2flowTasks");
437 cerr<<"PWG2flowTasks.par loaded..."<<endl;
439 gSystem->AddIncludePath("-I./PWG2FlowTasks -I./CORRFW");
440 gROOT->LoadMacro("ConfigFlowAnalysis.C++");
444 //---------------------------------------------------------
445 // <<<<<<<<<< PROOF mode >>>>>>>>>>>>
446 //---------------------------------------------------------
447 else if (mode==mPROOF) {
450 // set to debug root versus if needed
451 // TProof::Mgr("alicecaf")->SetROOTVersion("v5-21-01-alice_dbg");
452 // TProof::Mgr("alicecaf")->SetROOTVersion("v5-21-01-alice");
455 // Put appropriate username here
456 // TProof::Reset("proof://snelling@alicecaf.cern.ch");
457 printf("*** Connect to PROOF ***\n");
458 //TProof::Open("abilandz@alicecaf.cern.ch");
459 //TProof::Open("nkolk@alicecaf.cern.ch");
460 TProof::Open("snelling@localhost");
462 // Enable the STEERBase Package
463 gProof->ClearPackage("STEERBase.par");
464 gProof->UploadPackage("STEERBase.par");
465 gProof->EnablePackage("STEERBase");
466 // Enable the ESD Package
467 gProof->ClearPackage("ESD.par");
468 gProof->UploadPackage("ESD.par");
469 gProof->EnablePackage("ESD");
470 // Enable the AOD Package
471 gProof->ClearPackage("AOD.par");
472 gProof->UploadPackage("AOD.par");
473 gProof->EnablePackage("AOD");
474 // Enable the Analysis Package
475 gProof->ClearPackage("ANALYSIS.par");
476 gProof->UploadPackage("ANALYSIS.par");
477 gProof->EnablePackage("ANALYSIS");
478 // Enable the Analysis Package alice
479 gProof->ClearPackage("ANALYSISalice.par");
480 gProof->UploadPackage("ANALYSISalice.par");
481 gProof->EnablePackage("ANALYSISalice");
483 gProof->ClearPackage("PWG2AOD.par");
484 gProof->UploadPackage("PWG2AOD.par");
485 gProof->EnablePackage("PWG2AOD");
486 // Enable the Correction Framework
487 gProof->ClearPackage("CORRFW.par");
488 gProof->UploadPackage("CORRFW.par");
489 gProof->EnablePackage("CORRFW");
490 // Enable Flow Analysis
491 gProof->ClearPackage("PWG2flowCommon");
492 gProof->UploadPackage("PWG2flowCommon.par");
493 gProof->EnablePackage("PWG2flowCommon");
494 gProof->ClearPackage("PWG2flowTasks");
495 gProof->UploadPackage("PWG2flowTasks.par");
496 gProof->EnablePackage("PWG2flowTasks");
498 gProof->ShowEnabledPackages();
500 gSystem->AddIncludePath("-I./PWG2flowTasks -I./CORRFW");
501 gProof->Load("ConfigFlowAnalysis.C++");
506 void SetupPar(char* pararchivename) {
507 //Load par files, create analysis libraries
508 //For testing, if par file already decompressed and modified
509 //classes then do not decompress.
511 TString cdir(Form("%s", gSystem->WorkingDirectory() )) ;
512 TString parpar(Form("%s.par", pararchivename)) ;
513 if ( gSystem->AccessPathName(parpar.Data()) ) {
514 gSystem->ChangeDirectory(gSystem->Getenv("ALICE_ROOT")) ;
515 TString processline(Form(".! make %s", parpar.Data())) ;
516 gROOT->ProcessLine(processline.Data()) ;
517 gSystem->ChangeDirectory(cdir) ;
518 processline = Form(".! mv /tmp/%s .", parpar.Data()) ;
519 gROOT->ProcessLine(processline.Data()) ;
521 if ( gSystem->AccessPathName(pararchivename) ) {
522 TString processline = Form(".! tar xvzf %s",parpar.Data()) ;
523 gROOT->ProcessLine(processline.Data());
526 TString ocwd = gSystem->WorkingDirectory();
527 gSystem->ChangeDirectory(pararchivename);
529 // check for BUILD.sh and execute
530 if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
531 printf("*******************************\n");
532 printf("*** Building PAR archive ***\n");
533 cout<<pararchivename<<endl;
534 printf("*******************************\n");
536 if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
537 Error("runProcess","Cannot Build the PAR Archive! - Abort!");
541 // check for SETUP.C and execute
542 if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
543 printf("*******************************\n");
544 printf("*** Setup PAR archive ***\n");
545 cout<<pararchivename<<endl;
546 printf("*******************************\n");
547 gROOT->Macro("PROOF-INF/SETUP.C");
550 gSystem->ChangeDirectory(ocwd.Data());
551 printf("Current dir: %s\n", ocwd.Data());
555 // Helper macros for creating chains
556 // from: CreateESDChain.C,v 1.10 jgrosseo Exp
558 TChain* CreateESDChain(const char* aDataDir, Int_t aRuns, Int_t offset)
560 // creates chain of files in a given directory or file containing a list.
561 // In case of directory the structure is expected as:
562 // <aDataDir>/<dir0>/AliESDs.root
563 // <aDataDir>/<dir1>/AliESDs.root
569 Long_t id, size, flags, modtime;
570 if (gSystem->GetPathInfo(aDataDir, &id, &size, &flags, &modtime))
572 printf("%s not found.\n", aDataDir);
576 TChain* chain = new TChain("esdTree");
577 TChain* chaingAlice = 0;
581 TString execDir(gSystem->pwd());
582 TSystemDirectory* baseDir = new TSystemDirectory(".", aDataDir);
583 TList* dirList = baseDir->GetListOfFiles();
584 Int_t nDirs = dirList->GetEntries();
585 gSystem->cd(execDir);
589 for (Int_t iDir=0; iDir<nDirs; ++iDir)
591 TSystemFile* presentDir = (TSystemFile*) dirList->At(iDir);
592 if (!presentDir || !presentDir->IsDirectory() || strcmp(presentDir->GetName(), ".") == 0 || strcmp(presentDir->GetName(), "..") == 0)
601 if (count++ == aRuns)
604 TString presentDirName(aDataDir);
605 presentDirName += "/";
606 presentDirName += presentDir->GetName();
607 chain->Add(presentDirName + "/AliESDs.root/esdTree");
608 // cerr<<presentDirName<<endl;
614 // Open the input stream
620 // Read the input list of files and add them to the chain
624 if (!esdfile.Contains("root")) continue; // protection
632 if (count++ == aRuns)
645 // Helper macros for creating chains
646 // from: CreateESDChain.C,v 1.10 jgrosseo Exp
648 TChain* CreateAODChain(const char* aDataDir, Int_t aRuns, Int_t offset)
650 // creates chain of files in a given directory or file containing a list.
651 // In case of directory the structure is expected as:
652 // <aDataDir>/<dir0>/AliAOD.root
653 // <aDataDir>/<dir1>/AliAOD.root
659 Long_t id, size, flags, modtime;
660 if (gSystem->GetPathInfo(aDataDir, &id, &size, &flags, &modtime))
662 printf("%s not found.\n", aDataDir);
666 TChain* chain = new TChain("aodTree");
667 TChain* chaingAlice = 0;
671 TString execDir(gSystem->pwd());
672 TSystemDirectory* baseDir = new TSystemDirectory(".", aDataDir);
673 TList* dirList = baseDir->GetListOfFiles();
674 Int_t nDirs = dirList->GetEntries();
675 gSystem->cd(execDir);
679 for (Int_t iDir=0; iDir<nDirs; ++iDir)
681 TSystemFile* presentDir = (TSystemFile*) dirList->At(iDir);
682 if (!presentDir || !presentDir->IsDirectory() || strcmp(presentDir->GetName(), ".") == 0 || strcmp(presentDir->GetName(), "..") == 0)
691 if (count++ == aRuns)
694 TString presentDirName(aDataDir);
695 presentDirName += "/";
696 presentDirName += presentDir->GetName();
697 chain->Add(presentDirName + "/AliAOD.root/aodTree");
698 // cerr<<presentDirName<<endl;
704 // Open the input stream
710 // Read the input list of files and add them to the chain
714 if (!aodfile.Contains("root")) continue; // protection
722 if (count++ == aRuns)