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 = Generating Function Cumulants (for PbPb)
11 // QC = Q-cumulants (for PbPb)
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) is available
22 // 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 ///////////////////////////////////////////////////////////////////////////////////
33 // SETTING THE ANALYSIS
35 // Flow analysis methods can be: (set to kTRUE or kFALSE)
39 Bool_t LYZEP = kFALSE;
46 // Type of analysis can be:
47 // ESD, AOD, MC, ESDMC0, ESDMC1
48 const TString type = "ESD";
50 // Boolean to fill/not fill the QA histograms
55 // to use weigths for the Q vector
56 Bool_t usePhiWeights = kFALSE; //Phi
57 Bool_t usePtWeights = kFALSE; //v'(pt)
58 Bool_t useEtaWeights = kFALSE; //v'(eta)
59 Bool_t useWeights = usePhiWeights||usePtWeights||usePtWeights;
63 // For integrated flow
64 const Double_t ptmin1 = 0.0;
65 const Double_t ptmax1 = 10.0;
66 const Double_t ymin1 = -1.;
67 const Double_t ymax1 = 1.;
68 const Int_t mintrackrefsTPC1 = 2;
69 const Int_t mintrackrefsITS1 = 3;
70 const Int_t charge1 = 1;
71 Bool_t UsePIDIntegratedFlow = kFALSE;
72 const Int_t PDG1 = 211;
73 const Int_t minclustersTPC1 = 50;
74 const Int_t maxnsigmatovertex1 = 3;
76 // For differential flow
77 const Double_t ptmin2 = 0.0;
78 const Double_t ptmax2 = 10.0;
79 const Double_t ymin2 = -1.;
80 const Double_t ymax2 = 1.;
81 const Int_t mintrackrefsTPC2 = 2;
82 const Int_t mintrackrefsITS2 = 3;
83 const Int_t charge2 = 1;
84 Bool_t UsePIDDifferentialFlow = kFALSE;
85 const Int_t PDG2 = 211;
86 const Int_t minclustersTPC2 = 50;
87 const Int_t maxnsigmatovertex2 = 3;
89 //void runAliAnalysisTaskFlow(Int_t nRuns = 50, const Char_t* dataDir="/data/alice2/kolk/Therminator_midcentral", Int_t offset = 0)
90 void runAliAnalysisTaskFlow(Int_t nRuns = -1, const Char_t* dataDir="/Users/snelling/alice_data/Therminator_midcentral", Int_t offset = 0)
96 if (LYZ1 && LYZ2) {cout<<"WARNING: you cannot run LYZ1 and LYZ2 at the same time! LYZ2 needs the output from LYZ1."<<endl; exit(); }
97 if (LYZ2 && LYZEP) {cout<<"WARNING: you cannot run LYZ2 and LYZEP at the same time! LYZEP needs the output from LYZ2."<<endl; exit(); }
98 if (LYZ1 && LYZEP) {cout<<"WARNING: you cannot run LYZ1 and LYZEP at the same time! LYZEP needs the output from LYZ2."<<endl; exit(); }
100 // Include path (to find the .h files when compiling)
101 gSystem->AddIncludePath("-I$ROOTSYS/include") ;
103 // Load needed root libraries
104 gSystem->Load("libTree.so");
105 gSystem->Load("libGeom.so");
106 gSystem->Load("libVMC.so");
107 gSystem->Load("libPhysics.so");
109 // For using root and par files
110 SetupPar("PWG2flowCommon");
111 cerr<<"PWG2flowCommon.par loaded..."<<endl;
113 // Alice specific stuff
114 SetupPar("STEERBase");
118 SetupPar("ANALYSIS");
119 SetupPar("ANALYSISalice");
124 SetupPar("PWG2flowTasks");
125 cerr<<"PWG2flowTasks.par loaded..."<<endl;
129 // gSystem->AddIncludePath("-I$ALICE_ROOT/include") ;
131 gSystem->Load("libESD.so");
132 cerr<<"libESD loaded..."<<endl;
133 gSystem->Load("libANALYSIS.so");
134 cerr<<"libANALYSIS.so loaded..."<<endl;
135 gSystem->Load("libANALYSISRL.so");
136 cerr<<"libANALYSISRL.so loaded..."<<endl;
137 gSystem->Load("libCORRFW.so");
138 cerr<<"libCORRFW.so loaded..."<<endl;
139 gSystem->Load("libPWG2flowCommon.so");
140 cerr<<"libPWG2flowCommon.so loaded..."<<endl;
141 gSystem->Load("libPWG2flowTasks.so");
142 cerr<<"libPWG2flowTasks.so loaded..."<<endl;
145 // Create the TChain. CreateESDChain() is defined in CreateESDChain.C
146 if (type!="AOD") { TChain* chain = CreateESDChain(dataDir, nRuns, offset);}
147 // cout<<"chain ("<<chain<<")"<<endl; }
148 else { TChain* chain = CreateAODChain(dataDir, nRuns, offset);}
149 // cout<<"chain ("<<chain<<")"<<endl; }
151 //____________________________________________//
152 // Create cuts using correction framework
154 // Set TList for the QA histograms
157 TList* qaIntSP = new TList();
158 TList* qaDiffSP = new TList(); }
160 TList* qaIntLYZ1 = new TList();
161 TList* qaDiffLYZ1 = new TList(); }
163 TList* qaIntLYZ2 = new TList();
164 TList* qaDiffLYZ2 = new TList(); }
166 TList* qaIntLYZEP = new TList();
167 TList* qaDiffLYZEP = new TList(); }
169 TList* qaIntGFC = new TList();
170 TList* qaDiffGFC = new TList(); }
172 TList* qaIntQC = new TList();
173 TList* qaDiffQC = new TList(); }
175 TList* qaIntFQD = new TList();
176 TList* qaDiffFQD = new TList(); }
178 TList* qaIntMCEP = new TList();
179 TList* qaDiffMCEP = new TList(); }
182 //############# cuts on MC
183 AliCFTrackKineCuts* mcKineCuts1 = new AliCFTrackKineCuts("mcKineCuts1","MC-level kinematic cuts");
184 mcKineCuts1->SetPtRange(ptmin1,ptmax1);
185 mcKineCuts1->SetRapidityRange(ymin1,ymax1);
186 mcKineCuts1->SetChargeMC(charge1);
188 if (SP) { mcKineCuts1->SetQAOn(qaIntSP); }
189 if (LYZ1) { mcKineCuts1->SetQAOn(qaIntLYZ1); }
190 if (LYZ2) { mcKineCuts1->SetQAOn(qaIntLYZ2); }
191 if (LYZEP){ mcKineCuts1->SetQAOn(qaIntLYZEP); }
192 if (GFC) { mcKineCuts1->SetQAOn(qaIntGFC); }
193 if (QC) { mcKineCuts1->SetQAOn(qaIntQC); }
194 if (FQD) { mcKineCuts1->SetQAOn(qaIntFQD); }
195 if (MCEP) { mcKineCuts1->SetQAOn(qaIntMCEP); }
198 AliCFTrackKineCuts* mcKineCuts2 = new AliCFTrackKineCuts("mcKineCuts2","MC-level kinematic cuts");
199 mcKineCuts2->SetPtRange(ptmin2,ptmax2);
200 mcKineCuts2->SetRapidityRange(ymin2,ymax2);
201 mcKineCuts2->SetChargeMC(charge2);
203 if (SP) { mcKineCuts2->SetQAOn(qaDiffSP); }
204 if (LYZ1) { mcKineCuts2->SetQAOn(qaDiffLYZ1); }
205 if (LYZ2) { mcKineCuts2->SetQAOn(qaDiffLYZ2); }
206 if (LYZEP){ mcKineCuts2->SetQAOn(qaDiffLYZEP); }
207 if (GFC) { mcKineCuts2->SetQAOn(qaDiffGFC); }
208 if (QC) { mcKineCuts2->SetQAOn(qaDiffQC); }
209 if (FQD) { mcKineCuts2->SetQAOn(qaDiffFQD); }
210 if (MCEP) { mcKineCuts2->SetQAOn(qaDiffMCEP); }
213 AliCFParticleGenCuts* mcGenCuts1 = new AliCFParticleGenCuts("mcGenCuts1","MC particle generation cuts for integrated flow");
214 mcGenCuts1->SetRequireIsPrimary();
215 if (UsePIDIntegratedFlow) {mcGenCuts1->SetRequirePdgCode(PDG1);}
217 if (SP) { mcGenCuts1->SetQAOn(qaIntSP); }
218 if (LYZ1) { mcGenCuts1->SetQAOn(qaIntLYZ1); }
219 if (LYZ2) { mcGenCuts1->SetQAOn(qaIntLYZ2); }
220 if (LYZEP){ mcGenCuts1->SetQAOn(qaIntLYZEP); }
221 if (GFC) { mcGenCuts1->SetQAOn(qaIntGFC); }
222 if (QC) { mcGenCuts1->SetQAOn(qaIntQC); }
223 if (FQD) { mcGenCuts1->SetQAOn(qaIntFQD); }
224 if (MCEP) { mcGenCuts1->SetQAOn(qaIntMCEP); }
227 AliCFParticleGenCuts* mcGenCuts2 = new AliCFParticleGenCuts("mcGenCuts2","MC particle generation cuts for differential flow");
228 mcGenCuts2->SetRequireIsPrimary();
229 if (UsePIDDifferentialFlow) {mcGenCuts2->SetRequirePdgCode(PDG2);}
231 if (SP) { mcGenCuts2->SetQAOn(qaDiffSP); }
232 if (LYZ1) { mcGenCuts2->SetQAOn(qaDiffLYZ1); }
233 if (LYZ2) { mcGenCuts2->SetQAOn(qaDiffLYZ2); }
234 if (LYZEP){ mcGenCuts2->SetQAOn(qaDiffLYZEP); }
235 if (GFC) { mcGenCuts2->SetQAOn(qaDiffGFC); }
236 if (QC) { mcGenCuts2->SetQAOn(qaDiffQC); }
237 if (FQD) { mcGenCuts2->SetQAOn(qaDiffFQD); }
238 if (MCEP) { mcGenCuts2->SetQAOn(qaDiffMCEP); }
241 //############# Acceptance Cuts
242 AliCFAcceptanceCuts *mcAccCuts1 = new AliCFAcceptanceCuts("mcAccCuts1","MC acceptance cuts");
243 mcAccCuts1->SetMinNHitITS(mintrackrefsITS1);
244 mcAccCuts1->SetMinNHitTPC(mintrackrefsTPC1);
246 if (SP) { mcAccCuts1->SetQAOn(qaIntSP); }
247 if (LYZ1) { mcAccCuts1->SetQAOn(qaIntLYZ1); }
248 if (LYZ2) { mcAccCuts1->SetQAOn(qaIntLYZ2); }
249 if (LYZEP){ mcAccCuts1->SetQAOn(qaIntLYZEP); }
250 if (GFC) { mcAccCuts1->SetQAOn(qaIntGFC); }
251 if (QC) { mcAccCuts1->SetQAOn(qaIntQC); }
252 if (FQD) { mcAccCuts1->SetQAOn(qaIntFQD); }
253 if (MCEP) { mcAccCuts1->SetQAOn(qaIntMCEP); }
256 AliCFAcceptanceCuts *mcAccCuts2 = new AliCFAcceptanceCuts("mcAccCuts2","MC acceptance cuts");
257 mcAccCuts2->SetMinNHitITS(mintrackrefsITS2);
258 mcAccCuts2->SetMinNHitTPC(mintrackrefsTPC2);
260 if (SP) { mcAccCuts2->SetQAOn(qaDiffSP); }
261 if (LYZ1) { mcAccCuts2->SetQAOn(qaDiffLYZ1); }
262 if (LYZ2) { mcAccCuts2->SetQAOn(qaDiffLYZ2); }
263 if (LYZEP){ mcAccCuts2->SetQAOn(qaDiffLYZEP); }
264 if (GFC) { mcAccCuts2->SetQAOn(qaDiffGFC); }
265 if (QC) { mcAccCuts2->SetQAOn(qaDiffQC); }
266 if (FQD) { mcAccCuts2->SetQAOn(qaDiffFQD); }
267 if (MCEP) { mcAccCuts2->SetQAOn(qaDiffMCEP); }
270 //############# Rec-Level kinematic cuts
271 AliCFTrackKineCuts *recKineCuts1 = new AliCFTrackKineCuts("recKineCuts1","rec-level kine cuts");
272 recKineCuts1->SetPtRange(ptmin1,ptmax1);
273 recKineCuts1->SetRapidityRange(ymin1,ymax1);
274 recKineCuts1->SetChargeRec(charge1);
276 if (SP) { recKineCuts1->SetQAOn(qaIntSP); }
277 if (LYZ1) { recKineCuts1->SetQAOn(qaIntLYZ1); }
278 if (LYZ2) { recKineCuts1->SetQAOn(qaIntLYZ2); }
279 if (LYZEP){ recKineCuts1->SetQAOn(qaIntLYZEP); }
280 if (GFC) { recKineCuts1->SetQAOn(qaIntGFC); }
281 if (QC) { recKineCuts1->SetQAOn(qaIntQC); }
282 if (FQD) { recKineCuts1->SetQAOn(qaIntFQD); }
283 if (MCEP) { recKineCuts1->SetQAOn(qaIntMCEP); }
286 AliCFTrackKineCuts *recKineCuts2 = new AliCFTrackKineCuts("recKineCuts2","rec-level kine cuts");
287 recKineCuts2->SetPtRange(ptmin2,ptmax2);
288 recKineCuts2->SetRapidityRange(ymin2,ymax2);
289 recKineCuts2->SetChargeRec(charge2);
291 if (SP) { recKineCuts2->SetQAOn(qaDiffSP); }
292 if (LYZ1) { recKineCuts2->SetQAOn(qaDiffLYZ1); }
293 if (LYZ2) { recKineCuts2->SetQAOn(qaDiffLYZ2); }
294 if (LYZEP){ recKineCuts2->SetQAOn(qaDiffLYZEP); }
295 if (GFC) { recKineCuts2->SetQAOn(qaDiffGFC); }
296 if (QC) { recKineCuts2->SetQAOn(qaDiffQC); }
297 if (FQD) { recKineCuts2->SetQAOn(qaDiffFQD); }
298 if (MCEP) { recKineCuts2->SetQAOn(qaDiffMCEP); }
301 AliCFTrackQualityCuts *recQualityCuts1 = new AliCFTrackQualityCuts("recQualityCuts1","rec-level quality cuts");
302 recQualityCuts1->SetMinNClusterTPC(minclustersTPC1);
303 recQualityCuts1->SetStatus(AliESDtrack::kITSrefit);
305 if (SP) { recQualityCuts1->SetQAOn(qaIntSP); }
306 if (LYZ1) { recQualityCuts1->SetQAOn(qaIntLYZ1); }
307 if (LYZ2) { recQualityCuts1->SetQAOn(qaIntLYZ2); }
308 if (LYZEP){ recQualityCuts1->SetQAOn(qaIntLYZEP); }
309 if (GFC) { recQualityCuts1->SetQAOn(qaIntGFC); }
310 if (QC) { recQualityCuts1->SetQAOn(qaIntQC); }
311 if (FQD) { recQualityCuts1->SetQAOn(qaIntFQD); }
312 if (MCEP) { recQualityCuts1->SetQAOn(qaIntMCEP); }
315 AliCFTrackQualityCuts *recQualityCuts2 = new AliCFTrackQualityCuts("recQualityCuts2","rec-level quality cuts");
316 recQualityCuts2->SetMinNClusterTPC(minclustersTPC2);
317 recQualityCuts2->SetStatus(AliESDtrack::kITSrefit);
319 if (SP) { recQualityCuts2->SetQAOn(qaDiffSP); }
320 if (LYZ1) { recQualityCuts2->SetQAOn(qaDiffLYZ1); }
321 if (LYZ2) { recQualityCuts2->SetQAOn(qaDiffLYZ2); }
322 if (LYZEP){ recQualityCuts2->SetQAOn(qaDiffLYZEP); }
323 if (GFC) { recQualityCuts2->SetQAOn(qaDiffGFC); }
324 if (QC) { recQualityCuts2->SetQAOn(qaDiffQC); }
325 if (FQD) { recQualityCuts2->SetQAOn(qaDiffFQD); }
326 if (MCEP) { recQualityCuts2->SetQAOn(qaDiffMCEP); }
329 AliCFTrackIsPrimaryCuts *recIsPrimaryCuts1 = new AliCFTrackIsPrimaryCuts("recIsPrimaryCuts1","rec-level isPrimary cuts");
330 recIsPrimaryCuts1->SetMaxNSigmaToVertex(maxnsigmatovertex1);
332 if (SP) { recIsPrimaryCuts1->SetQAOn(qaIntSP); }
333 if (LYZ1) { recIsPrimaryCuts1->SetQAOn(qaIntLYZ1); }
334 if (LYZ2) { recIsPrimaryCuts1->SetQAOn(qaIntLYZ2); }
335 if (LYZEP){ recIsPrimaryCuts1->SetQAOn(qaIntLYZEP); }
336 if (GFC) { recIsPrimaryCuts1->SetQAOn(qaIntGFC); }
337 if (QC) { recIsPrimaryCuts1->SetQAOn(qaIntQC); }
338 if (FQD) { recIsPrimaryCuts1->SetQAOn(qaIntFQD); }
339 if (MCEP) { recIsPrimaryCuts1->SetQAOn(qaIntMCEP); }
342 AliCFTrackIsPrimaryCuts *recIsPrimaryCuts2 = new AliCFTrackIsPrimaryCuts("recIsPrimaryCuts2","rec-level isPrimary cuts");
343 recIsPrimaryCuts2->SetMaxNSigmaToVertex(maxnsigmatovertex2);
345 if (SP) { recIsPrimaryCuts2->SetQAOn(qaDiffSP); }
346 if (LYZ1) { recIsPrimaryCuts2->SetQAOn(qaDiffLYZ1); }
347 if (LYZ2) { recIsPrimaryCuts2->SetQAOn(qaDiffLYZ2); }
348 if (LYZEP){ recIsPrimaryCuts2->SetQAOn(qaDiffLYZEP); }
349 if (GFC) { recIsPrimaryCuts2->SetQAOn(qaDiffGFC); }
350 if (QC) { recIsPrimaryCuts2->SetQAOn(qaDiffQC); }
351 if (FQD) { recIsPrimaryCuts2->SetQAOn(qaDiffFQD); }
352 if (MCEP) { recIsPrimaryCuts2->SetQAOn(qaDiffMCEP); }
357 int n_species = AliPID::kSPECIES ;
358 Double_t* prior = new Double_t[n_species];
360 prior[0] = 0.0244519 ;
361 prior[1] = 0.0143988 ;
362 prior[2] = 0.805747 ;
363 prior[3] = 0.0928785 ;
364 prior[4] = 0.0625243 ;
366 AliCFTrackCutPid* cutPID1 = NULL;
367 if(UsePIDIntegratedFlow) {
368 AliCFTrackCutPid* cutPID1 = new AliCFTrackCutPid("cutPID1","ESD_PID for integrated flow") ;
369 cutPID1->SetPriors(prior);
370 cutPID1->SetProbabilityCut(0.0);
371 cutPID1->SetDetectors("TPC TOF");
372 switch(TMath::Abs(PDG1)) {
373 case 11 : cutPID1->SetParticleType(AliPID::kElectron, kTRUE); break;
374 case 13 : cutPID1->SetParticleType(AliPID::kMuon , kTRUE); break;
375 case 211 : cutPID1->SetParticleType(AliPID::kPion , kTRUE); break;
376 case 321 : cutPID1->SetParticleType(AliPID::kKaon , kTRUE); break;
377 case 2212 : cutPID1->SetParticleType(AliPID::kProton , kTRUE); break;
378 default : printf("UNDEFINED PID\n"); break;
381 if (SP) {cutPID1->SetQAOn(qaIntSP);}
382 if (LYZ1) {cutPID1->SetQAOn(qaIntLYZ1);}
383 if (LYZ2) {cutPID1->SetQAOn(qaIntLYZ2);}
384 if (LYZEP){cutPID1->SetQAOn(qaIntLYZEP);}
385 if (GFC) {cutPID1->SetQAOn(qaIntGFC);}
386 if (QC) {cutPID1->SetQAOn(qaIntQC);}
387 if (FQD) {cutPID1->SetQAOn(qaIntFQD);}
388 if (MCEP) {cutPID1->SetQAOn(qaIntMCEP);}
392 AliCFTrackCutPid* cutPID2 = NULL;
393 if (UsePIDDifferentialFlow) {
394 AliCFTrackCutPid* cutPID2 = new AliCFTrackCutPid("cutPID2","ESD_PID for differential flow") ;
395 cutPID2->SetPriors(prior);
396 cutPID2->SetProbabilityCut(0.0);
397 cutPID2->SetDetectors("TPC TOF");
398 switch(TMath::Abs(PDG2)) {
399 case 11 : cutPID2->SetParticleType(AliPID::kElectron, kTRUE); break;
400 case 13 : cutPID2->SetParticleType(AliPID::kMuon , kTRUE); break;
401 case 211 : cutPID2->SetParticleType(AliPID::kPion , kTRUE); break;
402 case 321 : cutPID2->SetParticleType(AliPID::kKaon , kTRUE); break;
403 case 2212 : cutPID2->SetParticleType(AliPID::kProton , kTRUE); break;
404 default : printf("UNDEFINED PID\n"); break;
407 if (SP) {cutPID2->SetQAOn(qaIntSP);}
408 if (LYZ1) {cutPID2->SetQAOn(qaIntLYZ1);}
409 if (LYZ2) {cutPID2->SetQAOn(qaIntLYZ2);}
410 if (LYZEP){cutPID2->SetQAOn(qaIntLYZEP);}
411 if (GFC) {cutPID2->SetQAOn(qaIntGFC);}
412 if (QC) {cutPID2->SetQAOn(qaIntQC);}
413 if (FQD) {cutPID2->SetQAOn(qaIntFQD);}
414 if (MCEP) {cutPID2->SetQAOn(qaIntMCEP);}
418 printf("CREATE MC KINE CUTS\n");
419 TObjArray* mcList1 = new TObjArray(0);
420 mcList1->AddLast(mcKineCuts1);
421 mcList1->AddLast(mcGenCuts1);
423 TObjArray* mcList2 = new TObjArray(0);
424 mcList2->AddLast(mcKineCuts2);
425 mcList2->AddLast(mcGenCuts2);
427 printf("CREATE ACCEPTANCE CUTS\n");
428 TObjArray* accList1 = new TObjArray(0) ;
429 accList1->AddLast(mcAccCuts1);
431 TObjArray* accList2 = new TObjArray(0) ;
432 accList2->AddLast(mcAccCuts2);
434 printf("CREATE RECONSTRUCTION CUTS\n");
435 TObjArray* recList1 = new TObjArray(0) ;
436 recList1->AddLast(recKineCuts1);
437 recList1->AddLast(recQualityCuts1);
438 recList1->AddLast(recIsPrimaryCuts1);
440 TObjArray* recList2 = new TObjArray(0) ;
441 recList2->AddLast(recKineCuts2);
442 recList2->AddLast(recQualityCuts2);
443 recList2->AddLast(recIsPrimaryCuts2);
445 printf("CREATE PID CUTS\n");
446 TObjArray* fPIDCutList1 = new TObjArray(0) ;
447 if(UsePIDIntegratedFlow) {fPIDCutList1->AddLast(cutPID1);}
449 TObjArray* fPIDCutList2 = new TObjArray(0) ;
450 if (UsePIDDifferentialFlow) {fPIDCutList2->AddLast(cutPID2);}
452 printf("CREATE INTERFACE AND CUTS FOR INTEGRATED FLOW\n");
453 AliCFManager* cfmgr1 = new AliCFManager();
454 // cfmgr1->SetNStepParticle(4); // needed for trunk not in 4.16
455 cfmgr1->SetParticleCutsList(AliCFManager::kPartGenCuts,mcList1); //on MC
456 cfmgr1->SetParticleCutsList(AliCFManager::kPartAccCuts,accList1); //on MC
457 cfmgr1->SetParticleCutsList(AliCFManager::kPartRecCuts,recList1); //on ESD
458 cfmgr1->SetParticleCutsList(AliCFManager::kPartSelCuts,fPIDCutList1); //on ESD
460 printf("CREATE INTERFACE AND CUTS FOR DIFFERENTIAL FLOW\n");
461 AliCFManager* cfmgr2 = new AliCFManager();
462 // cfmgr2->SetNStepParticle(4); // needed for trunk not in 4.16
463 cfmgr2->SetParticleCutsList(AliCFManager::kPartGenCuts,mcList2);
464 cfmgr2->SetParticleCutsList(AliCFManager::kPartAccCuts,accList2);
465 cfmgr2->SetParticleCutsList(AliCFManager::kPartRecCuts,recList2);
466 cfmgr2->SetParticleCutsList(AliCFManager::kPartSelCuts,fPIDCutList2);
469 TFile *weightsFile = NULL;
470 TList *weightsList = NULL;
474 //open the file with the weights:
475 weightsFile = TFile::Open("weights.root","READ");
477 //access the list which holds the histos with weigths:
478 weightsList = (TList*)weightsFile->Get("weights");
481 cout<<" WARNING: the file <weights.root> with weights from the previous run was not available."<<endl;
484 }//end of if(useWeights)
487 // read the input file from the first run
488 TString inputFileNameLYZ2 = "outputLYZ1analysis" ;
489 inputFileNameLYZ2 += type;
490 inputFileNameLYZ2 += ".root";
491 cout<<"The input file is "<<inputFileNameLYZ2.Data()<<endl;
492 TFile* fInputFileLYZ2 = new TFile(inputFileNameLYZ2.Data(),"READ");
493 if(!fInputFileLYZ2 || fInputFileLYZ2->IsZombie()) {
494 cerr << " ERROR: NO First Run file... " << endl ; }
496 TList* fInputListLYZ2 = (TList*)fInputFileLYZ2->Get("cobjLYZ1");
497 if (!fInputListLYZ2) {cout<<"list is NULL pointer!"<<endl;}
499 cout<<"LYZ2 input file/list read..."<<endl;
503 // read the input file from the second LYZ run
504 TString inputFileNameLYZEP = "outputLYZ2analysis" ;
505 inputFileNameLYZEP += type;
506 inputFileNameLYZEP += ".root";
507 cout<<"The input file is "<<inputFileNameLYZEP.Data()<<endl;
508 TFile* fInputFileLYZEP = new TFile(inputFileNameLYZEP.Data(),"READ");
509 if(!fInputFileLYZEP || fInputFileLYZEP->IsZombie()) { cerr << " ERROR: NO First Run file... " << endl ; }
511 TList* fInputListLYZEP = (TList*)fInputFileLYZEP->Get("cobjLYZ2");
512 if (!fInputListLYZEP) {cout<<"list is NULL pointer!"<<endl;}
514 cout<<"LYZEP input file/list read..."<<endl;
518 //____________________________________________//
519 // Make the analysis manager
520 AliAnalysisManager *mgr = new AliAnalysisManager("FlowAnalysisManager");
523 AliVEventHandler* esdH = new AliESDInputHandler;
524 mgr->SetInputEventHandler(esdH);
526 AliMCEventHandler *mc = new AliMCEventHandler();
527 mgr->SetMCtruthEventHandler(mc);} }
530 AliVEventHandler* aodH = new AliAODInputHandler;
531 mgr->SetInputEventHandler(aodH);
533 AliMCEventHandler *mc = new AliMCEventHandler();
534 mgr->SetMCtruthEventHandler(mc);} }
536 if (type == "MC" || type == "ESDMC0" || type == "ESDMC1"){
537 AliVEventHandler* esdH = new AliESDInputHandler;
538 mgr->SetInputEventHandler(esdH);
540 AliMCEventHandler *mc = new AliMCEventHandler();
541 mgr->SetMCtruthEventHandler(mc); }
543 //____________________________________________//
547 if (QA) { AliAnalysisTaskScalarProduct *taskSP = new AliAnalysisTaskScalarProduct("TaskScalarProduct",kTRUE); }
548 else { AliAnalysisTaskScalarProduct *taskSP = new AliAnalysisTaskScalarProduct("TaskScalarProduct",kFALSE); }
549 taskSP->SetAnalysisType(type);
550 taskSP->SetCFManager1(cfmgr1);
551 taskSP->SetCFManager2(cfmgr2);
553 taskSP->SetQAList1(qaIntSP);
554 taskSP->SetQAList2(qaDiffSP); }
555 mgr->AddTask(taskSP);
558 if (QA) { AliAnalysisTaskLeeYangZeros *taskLYZ1 = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZeros",kTRUE,kTRUE);}
559 else { AliAnalysisTaskLeeYangZeros *taskLYZ1 = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZeros",kTRUE,kFALSE);}
560 taskLYZ1->SetAnalysisType(type);
561 taskLYZ1->SetFirstRunLYZ(kTRUE);
562 taskLYZ1->SetUseSumLYZ(kTRUE);
563 taskLYZ1->SetCFManager1(cfmgr1);
564 taskLYZ1->SetCFManager2(cfmgr2);
566 taskLYZ1->SetQAList1(qaIntLYZ1);
567 taskLYZ1->SetQAList2(qaDiffLYZ1);}
568 mgr->AddTask(taskLYZ1);
571 if (QA) { AliAnalysisTaskLeeYangZeros *taskLYZ2 = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZeros",kFALSE,kTRUE);}
572 else { AliAnalysisTaskLeeYangZeros *taskLYZ2 = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZeros",kFALSE,kFALSE); }
573 taskLYZ2->SetAnalysisType(type);
574 taskLYZ2->SetFirstRunLYZ(kFALSE);
575 taskLYZ2->SetUseSumLYZ(kTRUE);
576 taskLYZ2->SetCFManager1(cfmgr1);
577 taskLYZ2->SetCFManager2(cfmgr2);
579 taskLYZ2->SetQAList1(qaIntLYZ2);
580 taskLYZ2->SetQAList2(qaDiffLYZ2); }
581 mgr->AddTask(taskLYZ2);
584 if (QA) { AliAnalysisTaskLYZEventPlane *taskLYZEP = new AliAnalysisTaskLYZEventPlane("TaskLYZEventPlane",kTRUE); }
585 else { AliAnalysisTaskLYZEventPlane *taskLYZEP = new AliAnalysisTaskLYZEventPlane("TaskLYZEventPlane",kFALSE); }
586 taskLYZEP->SetAnalysisType(type);
587 taskLYZEP->SetCFManager1(cfmgr1);
588 taskLYZEP->SetCFManager2(cfmgr2);
590 taskLYZEP->SetQAList1(qaIntLYZEP);
591 taskLYZEP->SetQAList2(qaDiffLYZEP); }
592 mgr->AddTask(taskLYZEP);
595 if (QA) { AliAnalysisTaskCumulants *taskGFC = new AliAnalysisTaskCumulants("TaskCumulants",kTRUE);}
596 else { AliAnalysisTaskCumulants *taskGFC = new AliAnalysisTaskCumulants("TaskCumulants",kFALSE);}
597 taskGFC->SetAnalysisType(type);
598 taskGFC->SetCFManager1(cfmgr1);
599 taskGFC->SetCFManager2(cfmgr2);
601 taskGFC->SetQAList1(qaIntGFC);
602 taskGFC->SetQAList2(qaDiffGFC); }
603 mgr->AddTask(taskGFC);
606 if (QA) { AliAnalysisTaskQCumulants *taskQC = new AliAnalysisTaskQCumulants("TaskQCumulants",kTRUE,useWeights);}
607 else { AliAnalysisTaskQCumulants *taskQC = new AliAnalysisTaskQCumulants("TaskQCumulants",kFALSE,useWeights);}
608 taskQC->SetAnalysisType(type);
609 taskQC->SetUsePhiWeights(usePhiWeights);
610 taskQC->SetUsePtWeights(usePtWeights);
611 taskQC->SetUseEtaWeights(useEtaWeights);
612 taskQC->SetCFManager1(cfmgr1);
613 taskQC->SetCFManager2(cfmgr2);
615 taskQC->SetQAList1(qaIntQC);
616 taskQC->SetQAList2(qaDiffQC); }
617 mgr->AddTask(taskQC);
620 if (QA) { AliAnalysisTaskFittingQDistribution *taskFQD = new AliAnalysisTaskFittingQDistribution("TaskFittingQDistribution",kTRUE);}
621 else { AliAnalysisTaskFittingQDistribution *taskFQD = new AliAnalysisTaskFittingQDistribution("TaskFittingQDistribution",kFALSE);}
622 taskFQD->SetAnalysisType(type);
623 taskFQD->SetCFManager1(cfmgr1);
624 taskFQD->SetCFManager2(cfmgr2);
626 taskFQD->SetQAList1(qaIntFQD);
627 taskFQD->SetQAList2(qaDiffFQD); }
628 mgr->AddTask(taskFQD);
631 if (QA) { AliAnalysisTaskMCEventPlane *taskMCEP = new AliAnalysisTaskMCEventPlane("TaskMCEventPlane",kTRUE);}
632 else { AliAnalysisTaskMCEventPlane *taskMCEP = new AliAnalysisTaskMCEventPlane("TaskMCEventPlane",kFALSE);}
633 taskMCEP->SetAnalysisType(type);
634 taskMCEP->SetCFManager1(cfmgr1);
635 taskMCEP->SetCFManager2(cfmgr2);
637 taskMCEP->SetQAList1(qaIntMCEP);
638 taskMCEP->SetQAList2(qaDiffMCEP); }
639 mgr->AddTask(taskMCEP);
643 // Create containers for input/output
644 AliAnalysisDataContainer *cinput1 =
645 mgr->CreateContainer("cchain1",TChain::Class(),AliAnalysisManager::kInputContainer);
647 //AliAnalysisDataContainer *cinputWeights = NULL;
650 cinputWeights = mgr->CreateContainer("cobjWeights",TList::Class(),AliAnalysisManager::kInputContainer);
654 AliAnalysisDataContainer *cinputLYZ2 =
655 mgr->CreateContainer("cobjLYZ2in",TList::Class(),AliAnalysisManager::kInputContainer); }
657 AliAnalysisDataContainer *cinputLYZEP =
658 mgr->CreateContainer("cobjLYZEPin",TList::Class(),AliAnalysisManager::kInputContainer); }
661 TString outputSP = "outputSPanalysis";
664 AliAnalysisDataContainer *coutputSP =
665 mgr->CreateContainer("cobjSP", TList::Class(),AliAnalysisManager::kOutputContainer,outputSP);
669 TString outputLYZ1 = "outputLYZ1analysis";
671 outputLYZ1+= ".root";
672 AliAnalysisDataContainer *coutputLYZ1 =
673 mgr->CreateContainer("cobjLYZ1", TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ1);
677 TString outputLYZ2 = "outputLYZ2analysis";
679 outputLYZ2+= ".root";
680 AliAnalysisDataContainer *coutputLYZ2 =
681 mgr->CreateContainer("cobjLYZ2", TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ2);
685 TString outputLYZEP = "outputLYZEPanalysis";
687 outputLYZEP+= ".root";
688 AliAnalysisDataContainer *coutputLYZEP =
689 mgr->CreateContainer("cobjLYZEP", TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZEP);
693 TString outputGFC = "outputGFCanalysis";
696 AliAnalysisDataContainer *coutputGFC =
697 mgr->CreateContainer("cobjGFC", TList::Class(),AliAnalysisManager::kOutputContainer,outputGFC);
701 TString outputQC = "outputQCanalysis";
704 AliAnalysisDataContainer *coutputQC =
705 mgr->CreateContainer("cobjQC", TList::Class(),AliAnalysisManager::kOutputContainer,outputQC);
709 TString outputFQD = "outputFQDanalysis";
712 AliAnalysisDataContainer *coutputFQD =
713 mgr->CreateContainer("cobjFQD", TList::Class(),AliAnalysisManager::kOutputContainer,outputFQD);
717 TString outputMCEP = "outputMCEPanalysis";
719 outputMCEP+= ".root";
720 AliAnalysisDataContainer *coutputMCEP =
721 mgr->CreateContainer("cobjMCEP", TList::Class(),AliAnalysisManager::kOutputContainer,outputMCEP);
726 TString qaNameIntSP = "QAforInt_SP_";
728 qaNameIntSP += ".root";
729 AliAnalysisDataContainer *coutputQA1SP =
730 mgr->CreateContainer("QAintSP", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntSP);
732 TString qaNameDiffSP = "QAforDiff_SP_";
733 qaNameDiffSP += type;
734 qaNameDiffSP += ".root";
735 AliAnalysisDataContainer *coutputQA2SP =
736 mgr->CreateContainer("QAdiffSP", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffSP);
739 TString qaNameIntLYZ1 = "QAforInt_LYZ1_";
740 qaNameIntLYZ1 += type;
741 qaNameIntLYZ1 += ".root";
742 AliAnalysisDataContainer *coutputQA1LYZ1 =
743 mgr->CreateContainer("QAintLYZ1", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntLYZ1);
745 TString qaNameDiffLYZ1 = "QAforDiff_LYZ1_";
746 qaNameDiffLYZ1 += type;
747 qaNameDiffLYZ1 += ".root";
748 AliAnalysisDataContainer *coutputQA2LYZ1 =
749 mgr->CreateContainer("QAdiffLYZ1", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffLYZ1);
752 TString qaNameIntLYZ2 = "QAforInt_LYZ2_";
753 qaNameIntLYZ2 += type;
754 qaNameIntLYZ2 += ".root";
755 AliAnalysisDataContainer *coutputQA1LYZ2 =
756 mgr->CreateContainer("QAintLYZ2", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntLYZ2);
758 TString qaNameDiffLYZ2 = "QAforDiff_LYZ2_";
759 qaNameDiffLYZ2 += type;
760 qaNameDiffLYZ2 += ".root";
761 AliAnalysisDataContainer *coutputQA2LYZ2 =
762 mgr->CreateContainer("QAdiffLYZ2", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffLYZ2);
765 TString qaNameIntLYZEP = "QAforInt_LYZEP_";
766 qaNameIntLYZEP += type;
767 qaNameIntLYZEP += ".root";
768 AliAnalysisDataContainer *coutputQA1LYZEP =
769 mgr->CreateContainer("QAintLYZEP", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntLYZEP);
771 TString qaNameDiffLYZEP = "QAforDiff_LYZEP_";
772 qaNameDiffLYZEP += type;
773 qaNameDiffLYZEP += ".root";
774 AliAnalysisDataContainer *coutputQA2LYZEP =
775 mgr->CreateContainer("QAdiffLYZEP", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffLYZEP);
778 TString qaNameIntGFC = "QAforInt_GFC_";
779 qaNameIntGFC += type;
780 qaNameIntGFC += ".root";
781 AliAnalysisDataContainer *coutputQA1GFC =
782 mgr->CreateContainer("QAintGFC", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntGFC);
784 TString qaNameDiffGFC = "QAforDiff_GFC_";
785 qaNameDiffGFC += type;
786 qaNameDiffGFC += ".root";
787 AliAnalysisDataContainer *coutputQA2GFC =
788 mgr->CreateContainer("QAdiffGFC", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffGFC);
791 TString qaNameIntQC = "QAforInt_QC_";
793 qaNameIntQC += ".root";
794 AliAnalysisDataContainer *coutputQA1QC =
795 mgr->CreateContainer("QAintQC", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntQC);
797 TString qaNameDiffQC = "QAforDiff_QC_";
798 qaNameDiffQC += type;
799 qaNameDiffQC += ".root";
800 AliAnalysisDataContainer *coutputQA2QC =
801 mgr->CreateContainer("QAdiffQC", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffQC);
804 TString qaNameIntFQD = "QAforInt_FQD_";
805 qaNameIntFQD += type;
806 qaNameIntFQD += ".root";
807 AliAnalysisDataContainer *coutputQA1FQD =
808 mgr->CreateContainer("QAintFQD", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntFQD);
810 TString qaNameDiffFQD = "QAforDiff_FQD_";
811 qaNameDiffFQD += type;
812 qaNameDiffFQD += ".root";
813 AliAnalysisDataContainer *coutputQA2FQD =
814 mgr->CreateContainer("QAdiffFQD", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffFQD);
817 TString qaNameIntMCEP = "QAforInt_MCEP_";
818 qaNameIntMCEP += type;
819 qaNameIntMCEP += ".root";
820 AliAnalysisDataContainer *coutputQA1MCEP =
821 mgr->CreateContainer("QAintMCEP", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntMCEP);
823 TString qaNameDiffMCEP = "QAforDiff_MCEP_";
824 qaNameDiffMCEP += type;
825 qaNameDiffMCEP += ".root";
826 AliAnalysisDataContainer *coutputQA2MCEP =
827 mgr->CreateContainer("QAdiffMCEP", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffMCEP);
831 //____________________________________________//
834 mgr->ConnectInput(taskSP,0,cinput1);
835 mgr->ConnectOutput(taskSP,0,coutputSP);
836 if (QA) { mgr->ConnectOutput(taskSP,1,coutputQA1SP);
837 mgr->ConnectOutput(taskSP,2,coutputQA2SP); }
840 mgr->ConnectInput(taskLYZ1,0,cinput1);
841 mgr->ConnectOutput(taskLYZ1,0,coutputLYZ1);
842 if (QA) { mgr->ConnectOutput(taskLYZ1,1,coutputQA1LYZ1);
843 mgr->ConnectOutput(taskLYZ1,2,coutputQA2LYZ1); }
846 mgr->ConnectInput(taskLYZ2,0,cinput1);
847 mgr->ConnectInput(taskLYZ2,1,cinputLYZ2);
848 mgr->ConnectOutput(taskLYZ2,0,coutputLYZ2);
849 if (QA) { mgr->ConnectOutput(taskLYZ2,1,coutputQA1LYZ2);
850 mgr->ConnectOutput(taskLYZ2,2,coutputQA2LYZ2); }
851 cinputLYZ2->SetData(fInputListLYZ2);
854 mgr->ConnectInput(taskLYZEP,0,cinput1);
855 mgr->ConnectInput(taskLYZEP,1,cinputLYZEP);
856 mgr->ConnectOutput(taskLYZEP,0,coutputLYZEP);
857 if (QA) { mgr->ConnectOutput(taskLYZEP,1,coutputQA1LYZEP);
858 mgr->ConnectOutput(taskLYZEP,2,coutputQA2LYZEP); }
859 cinputLYZEP->SetData(fInputListLYZEP);
862 mgr->ConnectInput(taskGFC,0,cinput1);
863 mgr->ConnectOutput(taskGFC,0,coutputGFC);
864 if (QA) { mgr->ConnectOutput(taskGFC,1,coutputQA1GFC);
865 mgr->ConnectOutput(taskGFC,2,coutputQA2GFC); }
868 mgr->ConnectInput(taskQC,0,cinput1);
869 mgr->ConnectOutput(taskQC,0,coutputQC);
870 if (QA) { mgr->ConnectOutput(taskQC,1,coutputQA1QC);
871 mgr->ConnectOutput(taskQC,2,coutputQA2QC); }
874 mgr->ConnectInput(taskQC,1,cinputWeights);
875 cinputWeights->SetData(weightsList);
879 mgr->ConnectInput(taskFQD,0,cinput1);
880 mgr->ConnectOutput(taskFQD,0,coutputFQD);
881 if (QA) { mgr->ConnectOutput(taskFQD,1,coutputQA1FQD);
882 mgr->ConnectOutput(taskFQD,2,coutputQA2FQD); }
885 mgr->ConnectInput(taskMCEP,0,cinput1);
886 mgr->ConnectOutput(taskMCEP,0,coutputMCEP);
887 if (QA) { mgr->ConnectOutput(taskMCEP,1,coutputQA1MCEP);
888 mgr->ConnectOutput(taskMCEP,2,coutputQA2MCEP); }
891 if (!mgr->InitAnalysis()) return;
893 mgr->StartAnalysis("local",chain);
900 // Helper macros for creating chains
901 // from: CreateESDChain.C,v 1.10 jgrosseo Exp
903 TChain* CreateESDChain(const char* aDataDir, Int_t aRuns, Int_t offset)
905 // creates chain of files in a given directory or file containing a list.
906 // In case of directory the structure is expected as:
907 // <aDataDir>/<dir0>/AliESDs.root
908 // <aDataDir>/<dir1>/AliESDs.root
914 Long_t id, size, flags, modtime;
915 if (gSystem->GetPathInfo(aDataDir, &id, &size, &flags, &modtime))
917 printf("%s not found.\n", aDataDir);
921 TChain* chain = new TChain("esdTree");
922 TChain* chaingAlice = 0;
926 TString execDir(gSystem->pwd());
927 TSystemDirectory* baseDir = new TSystemDirectory(".", aDataDir);
928 TList* dirList = baseDir->GetListOfFiles();
929 Int_t nDirs = dirList->GetEntries();
930 gSystem->cd(execDir);
934 for (Int_t iDir=0; iDir<nDirs; ++iDir)
936 TSystemFile* presentDir = (TSystemFile*) dirList->At(iDir);
937 if (!presentDir || !presentDir->IsDirectory() || strcmp(presentDir->GetName(), ".") == 0 || strcmp(presentDir->GetName(), "..") == 0)
946 if (count++ == aRuns)
949 TString presentDirName(aDataDir);
950 presentDirName += "/";
951 presentDirName += presentDir->GetName();
952 chain->Add(presentDirName + "/AliESDs.root/esdTree");
953 // cerr<<presentDirName<<endl;
959 // Open the input stream
965 // Read the input list of files and add them to the chain
969 if (!esdfile.Contains("root")) continue; // protection
977 if (count++ == aRuns)
990 // Helper macros for creating chains
991 // from: CreateESDChain.C,v 1.10 jgrosseo Exp
993 TChain* CreateAODChain(const char* aDataDir, Int_t aRuns, Int_t offset)
995 // creates chain of files in a given directory or file containing a list.
996 // In case of directory the structure is expected as:
997 // <aDataDir>/<dir0>/AliAOD.root
998 // <aDataDir>/<dir1>/AliAOD.root
1004 Long_t id, size, flags, modtime;
1005 if (gSystem->GetPathInfo(aDataDir, &id, &size, &flags, &modtime))
1007 printf("%s not found.\n", aDataDir);
1011 TChain* chain = new TChain("aodTree");
1012 TChain* chaingAlice = 0;
1016 TString execDir(gSystem->pwd());
1017 TSystemDirectory* baseDir = new TSystemDirectory(".", aDataDir);
1018 TList* dirList = baseDir->GetListOfFiles();
1019 Int_t nDirs = dirList->GetEntries();
1020 gSystem->cd(execDir);
1024 for (Int_t iDir=0; iDir<nDirs; ++iDir)
1026 TSystemFile* presentDir = (TSystemFile*) dirList->At(iDir);
1027 if (!presentDir || !presentDir->IsDirectory() || strcmp(presentDir->GetName(), ".") == 0 || strcmp(presentDir->GetName(), "..") == 0)
1036 if (count++ == aRuns)
1039 TString presentDirName(aDataDir);
1040 presentDirName += "/";
1041 presentDirName += presentDir->GetName();
1042 chain->Add(presentDirName + "/AliAOD.root/aodTree");
1043 // cerr<<presentDirName<<endl;
1049 // Open the input stream
1055 // Read the input list of files and add them to the chain
1059 if (!aodfile.Contains("root")) continue; // protection
1067 if (count++ == aRuns)
1071 chain->Add(aodfile);
1080 void SetupPar(char* pararchivename)
1082 //Load par files, create analysis libraries
1083 //For testing, if par file already decompressed and modified
1084 //classes then do not decompress.
1086 TString cdir(Form("%s", gSystem->WorkingDirectory() )) ;
1087 TString parpar(Form("%s.par", pararchivename)) ;
1088 if ( gSystem->AccessPathName(parpar.Data()) ) {
1089 gSystem->ChangeDirectory(gSystem->Getenv("ALICE_ROOT")) ;
1090 TString processline(Form(".! make %s", parpar.Data())) ;
1091 gROOT->ProcessLine(processline.Data()) ;
1092 gSystem->ChangeDirectory(cdir) ;
1093 processline = Form(".! mv /tmp/%s .", parpar.Data()) ;
1094 gROOT->ProcessLine(processline.Data()) ;
1096 if ( gSystem->AccessPathName(pararchivename) ) {
1097 TString processline = Form(".! tar xvzf %s",parpar.Data()) ;
1098 gROOT->ProcessLine(processline.Data());
1101 TString ocwd = gSystem->WorkingDirectory();
1102 gSystem->ChangeDirectory(pararchivename);
1104 // check for BUILD.sh and execute
1105 if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
1106 printf("*******************************\n");
1107 printf("*** Building PAR archive ***\n");
1108 cout<<pararchivename<<endl;
1109 printf("*******************************\n");
1111 if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
1112 Error("runProcess","Cannot Build the PAR Archive! - Abort!");
1116 // check for SETUP.C and execute
1117 if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
1118 printf("*******************************\n");
1119 printf("*** Setup PAR archive ***\n");
1120 cout<<pararchivename<<endl;
1121 printf("*******************************\n");
1122 gROOT->Macro("PROOF-INF/SETUP.C");
1125 gSystem->ChangeDirectory(ocwd.Data());
1126 printf("Current dir: %s\n", ocwd.Data());