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
40 // Flow analysis method can be:(set to kTRUE or kFALSE)
44 Bool_t LYZEP = kFALSE;
50 // Analysis type can be ESD, AOD, MC, ESDMC0, ESDMC1
51 const TString type = "ESD";
53 // Boolean to fill/not fill the QA histograms
57 //Use weights for Q vector
58 Bool_t usePhiWeights = kFALSE; //Phi
59 Bool_t usePtWeights = kFALSE; //v'(pt)
60 Bool_t useEtaWeights = kFALSE; //v'(eta)
61 Bool_t useWeights = usePhiWeights||usePtWeights||useEtaWeights;
66 // For integrated flow
67 const Double_t ptmin1 = 0.0;
68 const Double_t ptmax1 = 10.0;
69 const Double_t ymin1 = -1.;
70 const Double_t ymax1 = 1.;
71 const Int_t mintrackrefsTPC1 = 2;
72 const Int_t mintrackrefsITS1 = 3;
73 const Int_t charge1 = 1;
74 Bool_t UsePIDIntegratedFlow = kFALSE;
75 const Int_t PDG1 = 211;
76 const Int_t minclustersTPC1 = 50;
77 const Int_t maxnsigmatovertex1 = 3;
79 // For differential flow
80 const Double_t ptmin2 = 0.0;
81 const Double_t ptmax2 = 10.0;
82 const Double_t ymin2 = -1.;
83 const Double_t ymax2 = 1.;
84 const Int_t mintrackrefsTPC2 = 2;
85 const Int_t mintrackrefsITS2 = 3;
86 const Int_t charge2 = 1;
87 Bool_t UsePIDDifferentialFlow = kFALSE;
88 const Int_t PDG2 = 211;
89 const Int_t minclustersTPC2 = 50;
90 const Int_t maxnsigmatovertex2 = 3;
92 // ESD data on PROOF cluster
93 //void runAliAnalysisTaskFlow(Int_t mode=mPROOF, const Char_t* data="/PWG2/akisiel/Therminator_c2030", Int_t nRuns=-1, Int_t offset=0)
95 // AOD data on PROOF cluster
96 //void runAliAnalysisTaskFlow(Int_t mode=mPROOF, const Char_t* data="/PWG2/nkolk/myDataSet", Int_t nRuns=-1, Int_t offset=0)
97 //void runAliAnalysisTaskFlow(Int_t mode=mPROOF, const Char_t* data="/PWG2/akisiel/Therminator_midcentral_AOD", Int_t nRuns=44, Int_t offset=0)
100 void runAliAnalysisTaskFlow(Int_t mode=mLocal, Int_t nRuns = 55, const Char_t* dataDir="/data/alice2/kolk/Therminator_midcentral", Int_t offset = 0)
101 //void runAliAnalysisTaskFlow(Int_t mode=mLocalPAR, Int_t nRuns = 55, const Char_t* dataDir="/data/alice2/kolk/Therminator_midcentral", Int_t offset = 0)
104 //void runAliAnalysisTaskFlow(Int_t mode=mLocal, Int_t nRuns = -1, const Char_t* dataDir="/Users/snelling/alice_data/Therminator_midcentral", Int_t offset = 0)
105 //void runAliAnalysisTaskFlow(Int_t mode=mLocalPAR, Int_t nRuns = 55, const Char_t* dataDir="/Users/snelling/alice_data/Therminator_midcentral", Int_t offset = 0)
112 if (LYZ1 && LYZ2) {cout<<"WARNING: you cannot run LYZ1 and LYZ2 at the same time! LYZ2 needs the output from LYZ1."<<endl; exit(); }
113 if (LYZ2 && LYZEP) {cout<<"WARNING: you cannot run LYZ2 and LYZEP at the same time! LYZEP needs the output from LYZ2."<<endl; exit(); }
114 if (LYZ1 && LYZEP) {cout<<"WARNING: you cannot run LYZ1 and LYZEP at the same time! LYZEP needs the output from LYZ2."<<endl; exit(); }
118 if (mode==mLocal || mode == mLocalPAR || mode == mGRID) {
119 if (type!="AOD") { TChain* chain = CreateESDChain(dataDir, nRuns, offset);}
120 else { TChain* chain = CreateAODChain(dataDir, nRuns, offset);}
123 //Create cuts using correction framework
125 //Set TList for the QA histograms
127 if (SP){ TList* qaIntSP = new TList(); TList* qaDiffSP = new TList(); }
128 if (LYZ1) { TList* qaIntLYZ1 = new TList(); TList* qaDiffLYZ1 = new TList(); }
129 if (LYZ2) { TList* qaIntLYZ2 = new TList(); TList* qaDiffLYZ2 = new TList(); }
130 if (LYZEP) { TList* qaIntLYZEP = new TList(); TList* qaDiffLYZEP = new TList(); }
131 if (GFC) { TList* qaIntGFC = new TList(); TList* qaDiffGFC = new TList(); }
132 if (QC) { TList* qaIntQC = new TList(); TList* qaDiffQC = new TList(); }
133 if (FQD) { TList* qaIntFQD = new TList(); TList* qaDiffFQD = new TList(); }
134 if (MCEP) { TList* qaIntMCEP = new TList(); TList* qaDiffMCEP = new TList(); }
137 //############# cuts on MC
138 AliCFTrackKineCuts* mcKineCuts1 = new AliCFTrackKineCuts("mcKineCuts1","MC-level kinematic cuts");
139 mcKineCuts1->SetPtRange(ptmin1,ptmax1);
140 mcKineCuts1->SetRapidityRange(ymin1,ymax1);
141 mcKineCuts1->SetChargeMC(charge1);
143 if (SP) { mcKineCuts1->SetQAOn(qaIntSP); }
144 if (LYZ1) { mcKineCuts1->SetQAOn(qaIntLYZ1); }
145 if (LYZ2) { mcKineCuts1->SetQAOn(qaIntLYZ2); }
146 if (LYZEP){ mcKineCuts1->SetQAOn(qaIntLYZEP); }
147 if (GFC) { mcKineCuts1->SetQAOn(qaIntGFC); }
148 if (QC) { mcKineCuts1->SetQAOn(qaIntQC); }
149 if (FQD) { mcKineCuts1->SetQAOn(qaIntFQD); }
150 if (MCEP) { mcKineCuts1->SetQAOn(qaIntMCEP); }
153 AliCFTrackKineCuts* mcKineCuts2 = new AliCFTrackKineCuts("mcKineCuts2","MC-level kinematic cuts");
154 mcKineCuts2->SetPtRange(ptmin2,ptmax2);
155 mcKineCuts2->SetRapidityRange(ymin2,ymax2);
156 mcKineCuts2->SetChargeMC(charge2);
158 if (SP) { mcKineCuts2->SetQAOn(qaDiffSP); }
159 if (LYZ1) { mcKineCuts2->SetQAOn(qaDiffLYZ1); }
160 if (LYZ2) { mcKineCuts2->SetQAOn(qaDiffLYZ2); }
161 if (LYZEP){ mcKineCuts2->SetQAOn(qaDiffLYZEP); }
162 if (GFC) { mcKineCuts2->SetQAOn(qaDiffGFC); }
163 if (QC) { mcKineCuts2->SetQAOn(qaDiffQC); }
164 if (FQD) { mcKineCuts2->SetQAOn(qaDiffFQD); }
165 if (MCEP) { mcKineCuts2->SetQAOn(qaDiffMCEP); }
168 AliCFParticleGenCuts* mcGenCuts1 = new AliCFParticleGenCuts("mcGenCuts1","MC particle generation cuts for integrated flow");
169 mcGenCuts1->SetRequireIsPrimary();
170 if (UsePIDIntegratedFlow) {mcGenCuts1->SetRequirePdgCode(PDG1);}
172 if (SP) { mcGenCuts1->SetQAOn(qaIntSP); }
173 if (LYZ1) { mcGenCuts1->SetQAOn(qaIntLYZ1); }
174 if (LYZ2) { mcGenCuts1->SetQAOn(qaIntLYZ2); }
175 if (LYZEP){ mcGenCuts1->SetQAOn(qaIntLYZEP); }
176 if (GFC) { mcGenCuts1->SetQAOn(qaIntGFC); }
177 if (QC) { mcGenCuts1->SetQAOn(qaIntQC); }
178 if (FQD) { mcGenCuts1->SetQAOn(qaIntFQD); }
179 if (MCEP) { mcGenCuts1->SetQAOn(qaIntMCEP); }
182 AliCFParticleGenCuts* mcGenCuts2 = new AliCFParticleGenCuts("mcGenCuts2","MC particle generation cuts for differential flow");
183 mcGenCuts2->SetRequireIsPrimary();
184 if (UsePIDDifferentialFlow) {mcGenCuts2->SetRequirePdgCode(PDG2);}
186 if (SP) { mcGenCuts2->SetQAOn(qaDiffSP); }
187 if (LYZ1) { mcGenCuts2->SetQAOn(qaDiffLYZ1); }
188 if (LYZ2) { mcGenCuts2->SetQAOn(qaDiffLYZ2); }
189 if (LYZEP){ mcGenCuts2->SetQAOn(qaDiffLYZEP); }
190 if (GFC) { mcGenCuts2->SetQAOn(qaDiffGFC); }
191 if (QC) { mcGenCuts2->SetQAOn(qaDiffQC); }
192 if (FQD) { mcGenCuts2->SetQAOn(qaDiffFQD); }
193 if (MCEP) { mcGenCuts2->SetQAOn(qaDiffMCEP); }
196 //############# Acceptance Cuts
197 AliCFAcceptanceCuts *mcAccCuts1 = new AliCFAcceptanceCuts("mcAccCuts1","MC acceptance cuts");
198 mcAccCuts1->SetMinNHitITS(mintrackrefsITS1);
199 mcAccCuts1->SetMinNHitTPC(mintrackrefsTPC1);
201 if (SP) { mcAccCuts1->SetQAOn(qaIntSP); }
202 if (LYZ1) { mcAccCuts1->SetQAOn(qaIntLYZ1); }
203 if (LYZ2) { mcAccCuts1->SetQAOn(qaIntLYZ2); }
204 if (LYZEP){ mcAccCuts1->SetQAOn(qaIntLYZEP); }
205 if (GFC) { mcAccCuts1->SetQAOn(qaIntGFC); }
206 if (QC) { mcAccCuts1->SetQAOn(qaIntQC); }
207 if (FQD) { mcAccCuts1->SetQAOn(qaIntFQD); }
208 if (MCEP) { mcAccCuts1->SetQAOn(qaIntMCEP); }
211 AliCFAcceptanceCuts *mcAccCuts2 = new AliCFAcceptanceCuts("mcAccCuts2","MC acceptance cuts");
212 mcAccCuts2->SetMinNHitITS(mintrackrefsITS2);
213 mcAccCuts2->SetMinNHitTPC(mintrackrefsTPC2);
215 if (SP) { mcAccCuts2->SetQAOn(qaDiffSP); }
216 if (LYZ1) { mcAccCuts2->SetQAOn(qaDiffLYZ1); }
217 if (LYZ2) { mcAccCuts2->SetQAOn(qaDiffLYZ2); }
218 if (LYZEP){ mcAccCuts2->SetQAOn(qaDiffLYZEP); }
219 if (GFC) { mcAccCuts2->SetQAOn(qaDiffGFC); }
220 if (QC) { mcAccCuts2->SetQAOn(qaDiffQC); }
221 if (FQD) { mcAccCuts2->SetQAOn(qaDiffFQD); }
222 if (MCEP) { mcAccCuts2->SetQAOn(qaDiffMCEP); }
225 //############# Rec-Level kinematic cuts
226 AliCFTrackKineCuts *recKineCuts1 = new AliCFTrackKineCuts("recKineCuts1","rec-level kine cuts");
227 recKineCuts1->SetPtRange(ptmin1,ptmax1);
228 recKineCuts1->SetRapidityRange(ymin1,ymax1);
229 recKineCuts1->SetChargeRec(charge1);
231 if (SP) { recKineCuts1->SetQAOn(qaIntSP); }
232 if (LYZ1) { recKineCuts1->SetQAOn(qaIntLYZ1); }
233 if (LYZ2) { recKineCuts1->SetQAOn(qaIntLYZ2); }
234 if (LYZEP){ recKineCuts1->SetQAOn(qaIntLYZEP); }
235 if (GFC) { recKineCuts1->SetQAOn(qaIntGFC); }
236 if (QC) { recKineCuts1->SetQAOn(qaIntQC); }
237 if (FQD) { recKineCuts1->SetQAOn(qaIntFQD); }
238 if (MCEP) { recKineCuts1->SetQAOn(qaIntMCEP); }
241 AliCFTrackKineCuts *recKineCuts2 = new AliCFTrackKineCuts("recKineCuts2","rec-level kine cuts");
242 recKineCuts2->SetPtRange(ptmin2,ptmax2);
243 recKineCuts2->SetRapidityRange(ymin2,ymax2);
244 recKineCuts2->SetChargeRec(charge2);
246 if (SP) { recKineCuts2->SetQAOn(qaDiffSP); }
247 if (LYZ1) { recKineCuts2->SetQAOn(qaDiffLYZ1); }
248 if (LYZ2) { recKineCuts2->SetQAOn(qaDiffLYZ2); }
249 if (LYZEP){ recKineCuts2->SetQAOn(qaDiffLYZEP); }
250 if (GFC) { recKineCuts2->SetQAOn(qaDiffGFC); }
251 if (QC) { recKineCuts2->SetQAOn(qaDiffQC); }
252 if (FQD) { recKineCuts2->SetQAOn(qaDiffFQD); }
253 if (MCEP) { recKineCuts2->SetQAOn(qaDiffMCEP); }
256 AliCFTrackQualityCuts *recQualityCuts1 = new AliCFTrackQualityCuts("recQualityCuts1","rec-level quality cuts");
257 recQualityCuts1->SetMinNClusterTPC(minclustersTPC1);
258 recQualityCuts1->SetStatus(AliESDtrack::kITSrefit);
260 if (SP) { recQualityCuts1->SetQAOn(qaIntSP); }
261 if (LYZ1) { recQualityCuts1->SetQAOn(qaIntLYZ1); }
262 if (LYZ2) { recQualityCuts1->SetQAOn(qaIntLYZ2); }
263 if (LYZEP){ recQualityCuts1->SetQAOn(qaIntLYZEP); }
264 if (GFC) { recQualityCuts1->SetQAOn(qaIntGFC); }
265 if (QC) { recQualityCuts1->SetQAOn(qaIntQC); }
266 if (FQD) { recQualityCuts1->SetQAOn(qaIntFQD); }
267 if (MCEP) { recQualityCuts1->SetQAOn(qaIntMCEP); }
270 AliCFTrackQualityCuts *recQualityCuts2 = new AliCFTrackQualityCuts("recQualityCuts2","rec-level quality cuts");
271 recQualityCuts2->SetMinNClusterTPC(minclustersTPC2);
272 recQualityCuts2->SetStatus(AliESDtrack::kITSrefit);
274 if (SP) { recQualityCuts2->SetQAOn(qaDiffSP); }
275 if (LYZ1) { recQualityCuts2->SetQAOn(qaDiffLYZ1); }
276 if (LYZ2) { recQualityCuts2->SetQAOn(qaDiffLYZ2); }
277 if (LYZEP){ recQualityCuts2->SetQAOn(qaDiffLYZEP); }
278 if (GFC) { recQualityCuts2->SetQAOn(qaDiffGFC); }
279 if (QC) { recQualityCuts2->SetQAOn(qaDiffQC); }
280 if (FQD) { recQualityCuts2->SetQAOn(qaDiffFQD); }
281 if (MCEP) { recQualityCuts2->SetQAOn(qaDiffMCEP); }
284 AliCFTrackIsPrimaryCuts *recIsPrimaryCuts1 = new AliCFTrackIsPrimaryCuts("recIsPrimaryCuts1","rec-level isPrimary cuts");
285 recIsPrimaryCuts1->SetMaxNSigmaToVertex(maxnsigmatovertex1);
287 if (SP) { recIsPrimaryCuts1->SetQAOn(qaIntSP); }
288 if (LYZ1) { recIsPrimaryCuts1->SetQAOn(qaIntLYZ1); }
289 if (LYZ2) { recIsPrimaryCuts1->SetQAOn(qaIntLYZ2); }
290 if (LYZEP){ recIsPrimaryCuts1->SetQAOn(qaIntLYZEP); }
291 if (GFC) { recIsPrimaryCuts1->SetQAOn(qaIntGFC); }
292 if (QC) { recIsPrimaryCuts1->SetQAOn(qaIntQC); }
293 if (FQD) { recIsPrimaryCuts1->SetQAOn(qaIntFQD); }
294 if (MCEP) { recIsPrimaryCuts1->SetQAOn(qaIntMCEP); }
297 AliCFTrackIsPrimaryCuts *recIsPrimaryCuts2 = new AliCFTrackIsPrimaryCuts("recIsPrimaryCuts2","rec-level isPrimary cuts");
298 recIsPrimaryCuts2->SetMaxNSigmaToVertex(maxnsigmatovertex2);
300 if (SP) { recIsPrimaryCuts2->SetQAOn(qaDiffSP); }
301 if (LYZ1) { recIsPrimaryCuts2->SetQAOn(qaDiffLYZ1); }
302 if (LYZ2) { recIsPrimaryCuts2->SetQAOn(qaDiffLYZ2); }
303 if (LYZEP){ recIsPrimaryCuts2->SetQAOn(qaDiffLYZEP); }
304 if (GFC) { recIsPrimaryCuts2->SetQAOn(qaDiffGFC); }
305 if (QC) { recIsPrimaryCuts2->SetQAOn(qaDiffQC); }
306 if (FQD) { recIsPrimaryCuts2->SetQAOn(qaDiffFQD); }
307 if (MCEP) { recIsPrimaryCuts2->SetQAOn(qaDiffMCEP); }
310 int n_species = AliPID::kSPECIES ;
311 Double_t* prior = new Double_t[n_species];
313 prior[0] = 0.0244519 ;
314 prior[1] = 0.0143988 ;
315 prior[2] = 0.805747 ;
316 prior[3] = 0.0928785 ;
317 prior[4] = 0.0625243 ;
319 AliCFTrackCutPid* cutPID1 = NULL;
320 if(UsePIDIntegratedFlow) {
321 AliCFTrackCutPid* cutPID1 = new AliCFTrackCutPid("cutPID1","ESD_PID for integrated flow") ;
322 cutPID1->SetPriors(prior);
323 cutPID1->SetProbabilityCut(0.0);
324 cutPID1->SetDetectors("TPC TOF");
325 switch(TMath::Abs(PDG1)) {
326 case 11 : cutPID1->SetParticleType(AliPID::kElectron, kTRUE); break;
327 case 13 : cutPID1->SetParticleType(AliPID::kMuon , kTRUE); break;
328 case 211 : cutPID1->SetParticleType(AliPID::kPion , kTRUE); break;
329 case 321 : cutPID1->SetParticleType(AliPID::kKaon , kTRUE); break;
330 case 2212 : cutPID1->SetParticleType(AliPID::kProton , kTRUE); break;
331 default : printf("UNDEFINED PID\n"); break;
334 if (SP) {cutPID1->SetQAOn(qaIntSP);}
335 if (LYZ1) {cutPID1->SetQAOn(qaIntLYZ1);}
336 if (LYZ2) {cutPID1->SetQAOn(qaIntLYZ2);}
337 if (LYZEP){cutPID1->SetQAOn(qaIntLYZEP);}
338 if (GFC) {cutPID1->SetQAOn(qaIntGFC);}
339 if (QC) {cutPID1->SetQAOn(qaIntQC);}
340 if (FQD) {cutPID1->SetQAOn(qaIntFQD);}
341 if (MCEP) {cutPID1->SetQAOn(qaIntMCEP);}
345 AliCFTrackCutPid* cutPID2 = NULL;
346 if (UsePIDDifferentialFlow) {
347 AliCFTrackCutPid* cutPID2 = new AliCFTrackCutPid("cutPID2","ESD_PID for differential flow") ;
348 cutPID2->SetPriors(prior);
349 cutPID2->SetProbabilityCut(0.0);
350 cutPID2->SetDetectors("TPC TOF");
351 switch(TMath::Abs(PDG2)) {
352 case 11 : cutPID2->SetParticleType(AliPID::kElectron, kTRUE); break;
353 case 13 : cutPID2->SetParticleType(AliPID::kMuon , kTRUE); break;
354 case 211 : cutPID2->SetParticleType(AliPID::kPion , kTRUE); break;
355 case 321 : cutPID2->SetParticleType(AliPID::kKaon , kTRUE); break;
356 case 2212 : cutPID2->SetParticleType(AliPID::kProton , kTRUE); break;
357 default : printf("UNDEFINED PID\n"); break;
360 if (SP) {cutPID2->SetQAOn(qaIntSP);}
361 if (LYZ1) {cutPID2->SetQAOn(qaIntLYZ1);}
362 if (LYZ2) {cutPID2->SetQAOn(qaIntLYZ2);}
363 if (LYZEP){cutPID2->SetQAOn(qaIntLYZEP);}
364 if (GFC) {cutPID2->SetQAOn(qaIntGFC);}
365 if (QC) {cutPID2->SetQAOn(qaIntQC);}
366 if (FQD) {cutPID2->SetQAOn(qaIntFQD);}
367 if (MCEP) {cutPID2->SetQAOn(qaIntMCEP);}
371 printf("CREATE MC KINE CUTS\n");
372 TObjArray* mcList1 = new TObjArray(0);
373 mcList1->AddLast(mcKineCuts1);
374 mcList1->AddLast(mcGenCuts1);
376 TObjArray* mcList2 = new TObjArray(0);
377 mcList2->AddLast(mcKineCuts2);
378 mcList2->AddLast(mcGenCuts2);
380 printf("CREATE ACCEPTANCE CUTS\n");
381 TObjArray* accList1 = new TObjArray(0) ;
382 accList1->AddLast(mcAccCuts1);
384 TObjArray* accList2 = new TObjArray(0) ;
385 accList2->AddLast(mcAccCuts2);
387 printf("CREATE RECONSTRUCTION CUTS\n");
388 TObjArray* recList1 = new TObjArray(0) ;
389 recList1->AddLast(recKineCuts1);
390 recList1->AddLast(recQualityCuts1);
391 recList1->AddLast(recIsPrimaryCuts1);
393 TObjArray* recList2 = new TObjArray(0) ;
394 recList2->AddLast(recKineCuts2);
395 recList2->AddLast(recQualityCuts2);
396 recList2->AddLast(recIsPrimaryCuts2);
398 printf("CREATE PID CUTS\n");
399 TObjArray* fPIDCutList1 = new TObjArray(0) ;
400 if(UsePIDIntegratedFlow) {fPIDCutList1->AddLast(cutPID1);}
402 TObjArray* fPIDCutList2 = new TObjArray(0) ;
403 if (UsePIDDifferentialFlow) {fPIDCutList2->AddLast(cutPID2);}
405 printf("CREATE INTERFACE AND CUTS\n");
406 AliCFManager* cfmgr1 = new AliCFManager();
407 cfmgr1->SetNStepParticle(4); //05nov08
408 cfmgr1->SetParticleCutsList(AliCFManager::kPartGenCuts,mcList1);
409 cfmgr1->SetParticleCutsList(AliCFManager::kPartAccCuts,accList1);
410 cfmgr1->SetParticleCutsList(AliCFManager::kPartRecCuts,recList1);
411 cfmgr1->SetParticleCutsList(AliCFManager::kPartSelCuts,fPIDCutList1);
413 AliCFManager* cfmgr2 = new AliCFManager();
414 cfmgr2->SetNStepParticle(4); //05nov08
415 cfmgr2->SetParticleCutsList(AliCFManager::kPartGenCuts,mcList2);
416 cfmgr2->SetParticleCutsList(AliCFManager::kPartAccCuts,accList2);
417 cfmgr2->SetParticleCutsList(AliCFManager::kPartRecCuts,recList2);
418 cfmgr2->SetParticleCutsList(AliCFManager::kPartSelCuts,fPIDCutList2);
421 TFile *weightsFile = NULL;
422 TList *weightsList = NULL;
425 //open the file with the weights:
426 weightsFile = TFile::Open("weights.root","READ");
428 //access the list which holds the histos with weigths:
429 weightsList = (TList*)weightsFile->Get("weights");
432 cout<<" WARNING: the file <weights.root> with weights from the previous run was not available."<<endl;
439 // read the input file from the first run
440 TString inputFileNameLYZ2 = "outputLYZ1analysis" ;
441 inputFileNameLYZ2 += type;
442 inputFileNameLYZ2 += ".root";
443 cout<<"The input file is "<<inputFileNameLYZ2.Data()<<endl;
444 TFile* fInputFileLYZ2 = new TFile(inputFileNameLYZ2.Data(),"READ");
445 if(!fInputFileLYZ2 || fInputFileLYZ2->IsZombie()) {
446 cerr << " ERROR: NO First Run file... " << endl ; }
448 TList* fInputListLYZ2 = (TList*)fInputFileLYZ2->Get("cobjLYZ1");
449 if (!fInputListLYZ2) {cout<<"list is NULL pointer!"<<endl;}
451 cout<<"LYZ2 input file/list read..."<<endl;
455 // read the input file from the second LYZ run
456 TString inputFileNameLYZEP = "outputLYZ2analysis" ;
457 inputFileNameLYZEP += type;
458 inputFileNameLYZEP += ".root";
459 cout<<"The input file is "<<inputFileNameLYZEP.Data()<<endl;
460 TFile* fInputFileLYZEP = new TFile(inputFileNameLYZEP.Data(),"READ");
461 if(!fInputFileLYZEP || fInputFileLYZEP->IsZombie()) {
462 cerr << " ERROR: NO First Run file... " << endl ; }
464 TList* fInputListLYZEP = (TList*)fInputFileLYZEP->Get("cobjLYZ2");
465 if (!fInputListLYZEP) {cout<<"list is NULL pointer!"<<endl;}
467 cout<<"LYZEP input file/list read..."<<endl;
470 //____________________________________________//
471 // Make the analysis manager
472 AliAnalysisManager *mgr = new AliAnalysisManager("FlowAnalysisManager");
475 AliVEventHandler* esdH = new AliESDInputHandler;
476 mgr->SetInputEventHandler(esdH);
478 AliMCEventHandler *mc = new AliMCEventHandler();
479 mgr->SetMCtruthEventHandler(mc);} }
482 AliVEventHandler* aodH = new AliAODInputHandler;
483 mgr->SetInputEventHandler(aodH);
485 AliMCEventHandler *mc = new AliMCEventHandler();
486 mgr->SetMCtruthEventHandler(mc);} }
488 if (type == "MC" || type == "ESDMC0" || type == "ESDMC1"){
489 AliVEventHandler* esdH = new AliESDInputHandler;
490 mgr->SetInputEventHandler(esdH);
492 AliMCEventHandler *mc = new AliMCEventHandler();
493 mgr->SetMCtruthEventHandler(mc); }
495 //____________________________________________//
498 if (QA) { AliAnalysisTaskScalarProduct *taskSP = new AliAnalysisTaskScalarProduct("TaskScalarProduct",kTRUE); }
499 else { AliAnalysisTaskScalarProduct *taskSP = new AliAnalysisTaskScalarProduct("TaskScalarProduct",kFALSE); }
500 taskSP->SetAnalysisType(type);
501 taskSP->SetCFManager1(cfmgr1);
502 taskSP->SetCFManager2(cfmgr2);
504 taskSP->SetQAList1(qaIntSP);
505 taskSP->SetQAList2(qaDiffSP); }
506 mgr->AddTask(taskSP);
509 if (QA) { AliAnalysisTaskLeeYangZeros *taskLYZ1 = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZeros",kTRUE,kTRUE);}
510 else { AliAnalysisTaskLeeYangZeros *taskLYZ1 = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZeros",kTRUE,kFALSE);}
511 taskLYZ1->SetAnalysisType(type);
512 taskLYZ1->SetFirstRunLYZ(kTRUE);
513 taskLYZ1->SetUseSumLYZ(kTRUE);
514 taskLYZ1->SetCFManager1(cfmgr1);
515 taskLYZ1->SetCFManager2(cfmgr2);
517 taskLYZ1->SetQAList1(qaIntLYZ1);
518 taskLYZ1->SetQAList2(qaDiffLYZ1);}
519 mgr->AddTask(taskLYZ1);
522 if (QA) { AliAnalysisTaskLeeYangZeros *taskLYZ2 = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZeros",kFALSE,kTRUE);}
523 else { AliAnalysisTaskLeeYangZeros *taskLYZ2 = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZeros",kFALSE,kFALSE); }
524 taskLYZ2->SetAnalysisType(type);
525 taskLYZ2->SetFirstRunLYZ(kFALSE);
526 taskLYZ2->SetUseSumLYZ(kTRUE);
527 taskLYZ2->SetCFManager1(cfmgr1);
528 taskLYZ2->SetCFManager2(cfmgr2);
530 taskLYZ2->SetQAList1(qaIntLYZ2);
531 taskLYZ2->SetQAList2(qaDiffLYZ2); }
532 mgr->AddTask(taskLYZ2);
535 if (QA) { AliAnalysisTaskLYZEventPlane *taskLYZEP = new AliAnalysisTaskLYZEventPlane("TaskLYZEventPlane",kTRUE); }
536 else { AliAnalysisTaskLYZEventPlane *taskLYZEP = new AliAnalysisTaskLYZEventPlane("TaskLYZEventPlane",kFALSE); }
537 taskLYZEP->SetAnalysisType(type);
538 taskLYZEP->SetCFManager1(cfmgr1);
539 taskLYZEP->SetCFManager2(cfmgr2);
541 taskLYZEP->SetQAList1(qaIntLYZEP);
542 taskLYZEP->SetQAList2(qaDiffLYZEP); }
543 mgr->AddTask(taskLYZEP);
546 if (QA) { AliAnalysisTaskCumulants *taskGFC = new AliAnalysisTaskCumulants("TaskCumulants",kTRUE);}
547 else { AliAnalysisTaskCumulants *taskGFC = new AliAnalysisTaskCumulants("TaskCumulants",kFALSE);}
548 taskGFC->SetAnalysisType(type);
549 taskGFC->SetCFManager1(cfmgr1);
550 taskGFC->SetCFManager2(cfmgr2);
552 taskGFC->SetQAList1(qaIntGFC);
553 taskGFC->SetQAList2(qaDiffGFC); }
554 mgr->AddTask(taskGFC);
557 if (QA) { AliAnalysisTaskQCumulants *taskQC = new AliAnalysisTaskQCumulants("TaskQCumulants",kTRUE,useWeights);}
558 else { AliAnalysisTaskQCumulants *taskQC = new AliAnalysisTaskQCumulants("TaskQCumulants",kFALSE,useWeights);}
559 taskQC->SetAnalysisType(type);
560 taskQC->SetUsePhiWeights(usePhiWeights);
561 taskQC->SetUsePtWeights(usePtWeights);
562 taskQC->SetUseEtaWeights(useEtaWeights);
563 taskQC->SetCFManager1(cfmgr1);
564 taskQC->SetCFManager2(cfmgr2);
566 taskQC->SetQAList1(qaIntQC);
567 taskQC->SetQAList2(qaDiffQC); }
568 mgr->AddTask(taskQC);
571 if (QA) { AliAnalysisTaskFittingQDistribution *taskFQD = new AliAnalysisTaskFittingQDistribution("TaskFittingQDistribution",kTRUE,useWeights);}
572 else { AliAnalysisTaskFittingQDistribution *taskFQD = new AliAnalysisTaskFittingQDistribution("TaskFittingQDistribution",kFALSE,useWeights);}
573 taskFQD->SetAnalysisType(type);
574 taskFQD->SetUsePhiWeights(usePhiWeights);
575 taskFQD->SetUsePtWeights(usePtWeights);
576 taskFQD->SetUseEtaWeights(useEtaWeights);
577 taskFQD->SetCFManager1(cfmgr1);
578 taskFQD->SetCFManager2(cfmgr2);
580 taskFQD->SetQAList1(qaIntFQD);
581 taskFQD->SetQAList2(qaDiffFQD); }
582 mgr->AddTask(taskFQD);
585 if (QA) { AliAnalysisTaskMCEventPlane *taskMCEP = new AliAnalysisTaskMCEventPlane("TaskMCEventPlane",kTRUE);}
586 else { AliAnalysisTaskMCEventPlane *taskMCEP = new AliAnalysisTaskMCEventPlane("TaskMCEventPlane",kFALSE);}
587 taskMCEP->SetAnalysisType(type);
588 taskMCEP->SetCFManager1(cfmgr1);
589 taskMCEP->SetCFManager2(cfmgr2);
591 taskMCEP->SetQAList1(qaIntMCEP);
592 taskMCEP->SetQAList2(qaDiffMCEP); }
593 mgr->AddTask(taskMCEP);
597 // Create containers for input/output
598 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
601 AliAnalysisDataContainer *cinputWeights = mgr->CreateContainer("cobjWeights",TList::Class(),AliAnalysisManager::kInputContainer);
605 AliAnalysisDataContainer *cinputLYZ2 = mgr->CreateContainer("cobjLYZ2in",TList::Class(),AliAnalysisManager::kInputContainer); }
607 AliAnalysisDataContainer *cinputLYZEP = mgr->CreateContainer("cobjLYZEPin",TList::Class(),AliAnalysisManager::kInputContainer); }
610 TString outputSP = "outputSPanalysis";
613 AliAnalysisDataContainer *coutputSP = mgr->CreateContainer("cobjSP", TList::Class(),AliAnalysisManager::kOutputContainer,outputSP);
617 TString outputLYZ1 = "outputLYZ1analysis";
619 outputLYZ1+= ".root";
620 AliAnalysisDataContainer *coutputLYZ1 = mgr->CreateContainer("cobjLYZ1", TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ1);
624 TString outputLYZ2 = "outputLYZ2analysis";
626 outputLYZ2+= ".root";
627 AliAnalysisDataContainer *coutputLYZ2 = mgr->CreateContainer("cobjLYZ2", TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ2);
631 TString outputLYZEP = "outputLYZEPanalysis";
633 outputLYZEP+= ".root";
634 AliAnalysisDataContainer *coutputLYZEP = mgr->CreateContainer("cobjLYZEP", TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZEP);
638 TString outputGFC = "outputGFCanalysis";
641 AliAnalysisDataContainer *coutputGFC = mgr->CreateContainer("cobjGFC", TList::Class(),AliAnalysisManager::kOutputContainer,outputGFC);
645 TString outputQC = "outputQCanalysis";
648 AliAnalysisDataContainer *coutputQC = mgr->CreateContainer("cobjQC", TList::Class(),AliAnalysisManager::kOutputContainer,outputQC);
652 TString outputFQD = "outputFQDanalysis";
655 AliAnalysisDataContainer *coutputFQD = mgr->CreateContainer("cobjFQD", TList::Class(),AliAnalysisManager::kOutputContainer,outputFQD);
659 TString outputMCEP = "outputMCEPanalysis";
661 outputMCEP+= ".root";
662 AliAnalysisDataContainer *coutputMCEP = mgr->CreateContainer("cobjMCEP", TList::Class(),AliAnalysisManager::kOutputContainer,outputMCEP);
668 TString qaNameIntSP = "QAforInt_SP_";
670 qaNameIntSP += ".root";
671 AliAnalysisDataContainer *coutputQA1SP =
672 mgr->CreateContainer("QAintSP", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntSP);
674 TString qaNameDiffSP = "QAforDiff_SP_";
675 qaNameDiffSP += type;
676 qaNameDiffSP += ".root";
677 AliAnalysisDataContainer *coutputQA2SP =
678 mgr->CreateContainer("QAdiffSP", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffSP);
681 TString qaNameIntLYZ1 = "QAforInt_LYZ1_";
682 qaNameIntLYZ1 += type;
683 qaNameIntLYZ1 += ".root";
684 AliAnalysisDataContainer *coutputQA1LYZ1 =
685 mgr->CreateContainer("QAintLYZ1", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntLYZ1);
687 TString qaNameDiffLYZ1 = "QAforDiff_LYZ1_";
688 qaNameDiffLYZ1 += type;
689 qaNameDiffLYZ1 += ".root";
690 AliAnalysisDataContainer *coutputQA2LYZ1 =
691 mgr->CreateContainer("QAdiffLYZ1", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffLYZ1);
694 TString qaNameIntLYZ2 = "QAforInt_LYZ2_";
695 qaNameIntLYZ2 += type;
696 qaNameIntLYZ2 += ".root";
697 AliAnalysisDataContainer *coutputQA1LYZ2 =
698 mgr->CreateContainer("QAintLYZ2", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntLYZ2);
700 TString qaNameDiffLYZ2 = "QAforDiff_LYZ2_";
701 qaNameDiffLYZ2 += type;
702 qaNameDiffLYZ2 += ".root";
703 AliAnalysisDataContainer *coutputQA2LYZ2 =
704 mgr->CreateContainer("QAdiffLYZ2", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffLYZ2);
707 TString qaNameIntLYZEP = "QAforInt_LYZEP_";
708 qaNameIntLYZEP += type;
709 qaNameIntLYZEP += ".root";
710 AliAnalysisDataContainer *coutputQA1LYZEP =
711 mgr->CreateContainer("QAintLYZEP", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntLYZEP);
713 TString qaNameDiffLYZEP = "QAforDiff_LYZEP_";
714 qaNameDiffLYZEP += type;
715 qaNameDiffLYZEP += ".root";
716 AliAnalysisDataContainer *coutputQA2LYZEP =
717 mgr->CreateContainer("QAdiffLYZEP", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffLYZEP);
720 TString qaNameIntGFC = "QAforInt_GFC_";
721 qaNameIntGFC += type;
722 qaNameIntGFC += ".root";
723 AliAnalysisDataContainer *coutputQA1GFC =
724 mgr->CreateContainer("QAintGFC", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntGFC);
726 TString qaNameDiffGFC = "QAforDiff_GFC_";
727 qaNameDiffGFC += type;
728 qaNameDiffGFC += ".root";
729 AliAnalysisDataContainer *coutputQA2GFC =
730 mgr->CreateContainer("QAdiffGFC", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffGFC);
733 TString qaNameIntQC = "QAforInt_QC_";
735 qaNameIntQC += ".root";
736 AliAnalysisDataContainer *coutputQA1QC =
737 mgr->CreateContainer("QAintQC", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntQC);
739 TString qaNameDiffQC = "QAforDiff_QC_";
740 qaNameDiffQC += type;
741 qaNameDiffQC += ".root";
742 AliAnalysisDataContainer *coutputQA2QC =
743 mgr->CreateContainer("QAdiffQC", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffQC);
746 TString qaNameIntFQD = "QAforInt_FQD_";
747 qaNameIntFQD += type;
748 qaNameIntFQD += ".root";
749 AliAnalysisDataContainer *coutputQA1FQD =
750 mgr->CreateContainer("QAintFQD", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntFQD);
752 TString qaNameDiffFQD = "QAforDiff_FQD_";
753 qaNameDiffFQD += type;
754 qaNameDiffFQD += ".root";
755 AliAnalysisDataContainer *coutputQA2FQD =
756 mgr->CreateContainer("QAdiffFQD", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffFQD);
759 TString qaNameIntMCEP = "QAforInt_MCEP_";
760 qaNameIntMCEP += type;
761 qaNameIntMCEP += ".root";
762 AliAnalysisDataContainer *coutputQA1MCEP =
763 mgr->CreateContainer("QAintMCEP", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntMCEP);
765 TString qaNameDiffMCEP = "QAforDiff_MCEP_";
766 qaNameDiffMCEP += type;
767 qaNameDiffMCEP += ".root";
768 AliAnalysisDataContainer *coutputQA2MCEP =
769 mgr->CreateContainer("QAdiffMCEP", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffMCEP);
774 //____________________________________________//
777 mgr->ConnectInput(taskSP,0,cinput1);
778 mgr->ConnectOutput(taskSP,0,coutputSP);
779 if (QA) { mgr->ConnectOutput(taskSP,1,coutputQA1SP);
780 mgr->ConnectOutput(taskSP,2,coutputQA2SP); }
783 mgr->ConnectInput(taskLYZ1,0,cinput1);
784 mgr->ConnectOutput(taskLYZ1,0,coutputLYZ1);
785 if (QA) { mgr->ConnectOutput(taskLYZ1,1,coutputQA1LYZ1);
786 mgr->ConnectOutput(taskLYZ1,2,coutputQA2LYZ1); }
789 mgr->ConnectInput(taskLYZ2,0,cinput1);
790 mgr->ConnectInput(taskLYZ2,1,cinputLYZ2);
791 mgr->ConnectOutput(taskLYZ2,0,coutputLYZ2);
792 if (QA) { mgr->ConnectOutput(taskLYZ2,1,coutputQA1LYZ2);
793 mgr->ConnectOutput(taskLYZ2,2,coutputQA2LYZ2); }
794 cinputLYZ2->SetData(fInputListLYZ2);
797 mgr->ConnectInput(taskLYZEP,0,cinput1);
798 mgr->ConnectInput(taskLYZEP,1,cinputLYZEP);
799 mgr->ConnectOutput(taskLYZEP,0,coutputLYZEP);
800 if (QA) { mgr->ConnectOutput(taskLYZEP,1,coutputQA1LYZEP);
801 mgr->ConnectOutput(taskLYZEP,2,coutputQA2LYZEP); }
802 cinputLYZEP->SetData(fInputListLYZEP);
805 mgr->ConnectInput(taskGFC,0,cinput1);
806 mgr->ConnectOutput(taskGFC,0,coutputGFC);
807 if (QA) { mgr->ConnectOutput(taskGFC,1,coutputQA1GFC);
808 mgr->ConnectOutput(taskGFC,2,coutputQA2GFC); }
811 mgr->ConnectInput(taskQC,0,cinput1);
812 mgr->ConnectOutput(taskQC,0,coutputQC);
813 if (QA) { mgr->ConnectOutput(taskQC,1,coutputQA1QC);
814 mgr->ConnectOutput(taskQC,2,coutputQA2QC); }
816 mgr->ConnectInput(taskQC,1,cinputWeights);
817 cinputWeights->SetData(weightsList);
821 mgr->ConnectInput(taskFQD,0,cinput1);
822 mgr->ConnectOutput(taskFQD,0,coutputFQD);
823 if (QA) { mgr->ConnectOutput(taskFQD,1,coutputQA1FQD);
824 mgr->ConnectOutput(taskFQD,2,coutputQA2FQD); }
826 mgr->ConnectInput(taskFQD,1,cinputWeights);
827 cinputWeights->SetData(weightsList);
831 mgr->ConnectInput(taskMCEP,0,cinput1);
832 mgr->ConnectOutput(taskMCEP,0,coutputMCEP);
833 if (QA) { mgr->ConnectOutput(taskMCEP,1,coutputQA1MCEP);
834 mgr->ConnectOutput(taskMCEP,2,coutputQA2MCEP); }
839 //----------------------------------------------------------
841 //----------------------------------------------------------
843 if (!mgr->InitAnalysis()) return;
846 if (mode==mLocal || mode == mLocalPAR) {
847 mgr->StartAnalysis("local",chain);
849 else if (mode==mPROOF) {
850 // mgr->StartAnalysis("proof",chain);
851 mgr->StartAnalysis("proof",data,nRuns,offset);
853 else if (mode==mGRID) {
854 mgr->StartAnalysis("local",chain);
862 void LoadLibraries(const anaModes mode) {
864 //--------------------------------------
865 // Load the needed libraries most of them already loaded by aliroot
866 //--------------------------------------
867 gSystem->Load("libTree.so");
868 gSystem->Load("libGeom.so");
869 gSystem->Load("libVMC.so");
870 gSystem->Load("libXMLIO.so");
871 gSystem->Load("libPhysics.so");
873 //----------------------------------------------------------
874 // >>>>>>>>>>> Local mode <<<<<<<<<<<<<<
875 //----------------------------------------------------------
877 //--------------------------------------------------------
878 // If you want to use already compiled libraries
879 // in the aliroot distribution
880 //--------------------------------------------------------
881 gSystem->Load("libSTEERBase");
882 gSystem->Load("libESD");
883 gSystem->Load("libAOD");
884 gSystem->Load("libANALYSIS");
885 gSystem->Load("libANALYSISalice");
886 gSystem->Load("libCORRFW.so");
887 cerr<<"libCORRFW.so loaded..."<<endl;
888 gSystem->Load("libPWG2flowCommon.so");
889 cerr<<"libPWG2flowCommon.so loaded..."<<endl;
890 gSystem->Load("libPWG2flowTasks.so");
891 cerr<<"libPWG2flowTasks.so loaded..."<<endl;
894 else if (mode == mLocalPAR || mode == mGRID) {
895 //--------------------------------------------------------
896 //If you want to use root and par files from aliroot
897 //--------------------------------------------------------
898 SetupPar("STEERBase");
901 SetupPar("ANALYSIS");
902 SetupPar("ANALYSISalice");
905 SetupPar("PWG2flowCommon");
906 cerr<<"PWG2flowCommon.par loaded..."<<endl;
907 SetupPar("PWG2flowTasks");
908 cerr<<"PWG2flowTasks.par loaded..."<<endl;
911 //---------------------------------------------------------
912 // <<<<<<<<<< PROOF mode >>>>>>>>>>>>
913 //---------------------------------------------------------
914 else if (mode==mPROOF) {
917 // set to debug root versus if needed
918 // TProof::Mgr("alicecaf")->SetROOTVersion("v5-21-01-alice_dbg");
919 // TProof::Mgr("alicecaf")->SetROOTVersion("v5-21-01-alice");
922 // Put appropriate username here
923 // TProof::Reset("proof://snelling@alicecaf.cern.ch");
924 printf("*** Connect to PROOF ***\n");
925 // TProof::Open("abilandz@alicecaf.cern.ch");
926 TProof::Open("snelling@localhost");
928 // Enable the STEERBase Package
929 gProof->ClearPackage("STEERBase.par");
930 gProof->UploadPackage("STEERBase.par");
931 gProof->EnablePackage("STEERBase");
932 // Enable the ESD Package
933 gProof->ClearPackage("ESD.par");
934 gProof->UploadPackage("ESD.par");
935 gProof->EnablePackage("ESD");
936 // Enable the AOD Package
937 gProof->ClearPackage("AOD.par");
938 gProof->UploadPackage("AOD.par");
939 gProof->EnablePackage("AOD");
940 // Enable the Analysis Package
941 gProof->ClearPackage("ANALYSIS.par");
942 gProof->UploadPackage("ANALYSIS.par");
943 gProof->EnablePackage("ANALYSIS");
944 // Enable the Analysis Package alice
945 gProof->ClearPackage("ANALYSISalice.par");
946 gProof->UploadPackage("ANALYSISalice.par");
947 gProof->EnablePackage("ANALYSISalice");
949 gProof->ClearPackage("PWG2AOD.par");
950 gProof->UploadPackage("PWG2AOD.par");
951 gProof->EnablePackage("PWG2AOD");
952 // Enable the Correction Framework
953 gProof->ClearPackage("CORRFW.par");
954 gProof->UploadPackage("CORRFW.par");
955 gProof->EnablePackage("CORRFW");
956 // Enable Flow Analysis
957 gProof->ClearPackage("PWG2flowCommon");
958 gProof->UploadPackage("PWG2flowCommon.par");
959 gProof->EnablePackage("PWG2flowCommon");
960 gProof->ClearPackage("PWG2flowTasks");
961 gProof->UploadPackage("PWG2flowTasks.par");
962 gProof->EnablePackage("PWG2flowTasks");
964 gProof->ShowEnabledPackages();
969 void SetupPar(char* pararchivename) {
970 //Load par files, create analysis libraries
971 //For testing, if par file already decompressed and modified
972 //classes then do not decompress.
974 TString cdir(Form("%s", gSystem->WorkingDirectory() )) ;
975 TString parpar(Form("%s.par", pararchivename)) ;
976 if ( gSystem->AccessPathName(parpar.Data()) ) {
977 gSystem->ChangeDirectory(gSystem->Getenv("ALICE_ROOT")) ;
978 TString processline(Form(".! make %s", parpar.Data())) ;
979 gROOT->ProcessLine(processline.Data()) ;
980 gSystem->ChangeDirectory(cdir) ;
981 processline = Form(".! mv /tmp/%s .", parpar.Data()) ;
982 gROOT->ProcessLine(processline.Data()) ;
984 if ( gSystem->AccessPathName(pararchivename) ) {
985 TString processline = Form(".! tar xvzf %s",parpar.Data()) ;
986 gROOT->ProcessLine(processline.Data());
989 TString ocwd = gSystem->WorkingDirectory();
990 gSystem->ChangeDirectory(pararchivename);
992 // check for BUILD.sh and execute
993 if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
994 printf("*******************************\n");
995 printf("*** Building PAR archive ***\n");
996 cout<<pararchivename<<endl;
997 printf("*******************************\n");
999 if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
1000 Error("runProcess","Cannot Build the PAR Archive! - Abort!");
1004 // check for SETUP.C and execute
1005 if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
1006 printf("*******************************\n");
1007 printf("*** Setup PAR archive ***\n");
1008 cout<<pararchivename<<endl;
1009 printf("*******************************\n");
1010 gROOT->Macro("PROOF-INF/SETUP.C");
1013 gSystem->ChangeDirectory(ocwd.Data());
1014 printf("Current dir: %s\n", ocwd.Data());
1018 // Helper macros for creating chains
1019 // from: CreateESDChain.C,v 1.10 jgrosseo Exp
1021 TChain* CreateESDChain(const char* aDataDir, Int_t aRuns, Int_t offset)
1023 // creates chain of files in a given directory or file containing a list.
1024 // In case of directory the structure is expected as:
1025 // <aDataDir>/<dir0>/AliESDs.root
1026 // <aDataDir>/<dir1>/AliESDs.root
1032 Long_t id, size, flags, modtime;
1033 if (gSystem->GetPathInfo(aDataDir, &id, &size, &flags, &modtime))
1035 printf("%s not found.\n", aDataDir);
1039 TChain* chain = new TChain("esdTree");
1040 TChain* chaingAlice = 0;
1044 TString execDir(gSystem->pwd());
1045 TSystemDirectory* baseDir = new TSystemDirectory(".", aDataDir);
1046 TList* dirList = baseDir->GetListOfFiles();
1047 Int_t nDirs = dirList->GetEntries();
1048 gSystem->cd(execDir);
1052 for (Int_t iDir=0; iDir<nDirs; ++iDir)
1054 TSystemFile* presentDir = (TSystemFile*) dirList->At(iDir);
1055 if (!presentDir || !presentDir->IsDirectory() || strcmp(presentDir->GetName(), ".") == 0 || strcmp(presentDir->GetName(), "..") == 0)
1064 if (count++ == aRuns)
1067 TString presentDirName(aDataDir);
1068 presentDirName += "/";
1069 presentDirName += presentDir->GetName();
1070 chain->Add(presentDirName + "/AliESDs.root/esdTree");
1071 // cerr<<presentDirName<<endl;
1077 // Open the input stream
1083 // Read the input list of files and add them to the chain
1087 if (!esdfile.Contains("root")) continue; // protection
1095 if (count++ == aRuns)
1099 chain->Add(esdfile);
1108 // Helper macros for creating chains
1109 // from: CreateESDChain.C,v 1.10 jgrosseo Exp
1111 TChain* CreateAODChain(const char* aDataDir, Int_t aRuns, Int_t offset)
1113 // creates chain of files in a given directory or file containing a list.
1114 // In case of directory the structure is expected as:
1115 // <aDataDir>/<dir0>/AliAOD.root
1116 // <aDataDir>/<dir1>/AliAOD.root
1122 Long_t id, size, flags, modtime;
1123 if (gSystem->GetPathInfo(aDataDir, &id, &size, &flags, &modtime))
1125 printf("%s not found.\n", aDataDir);
1129 TChain* chain = new TChain("aodTree");
1130 TChain* chaingAlice = 0;
1134 TString execDir(gSystem->pwd());
1135 TSystemDirectory* baseDir = new TSystemDirectory(".", aDataDir);
1136 TList* dirList = baseDir->GetListOfFiles();
1137 Int_t nDirs = dirList->GetEntries();
1138 gSystem->cd(execDir);
1142 for (Int_t iDir=0; iDir<nDirs; ++iDir)
1144 TSystemFile* presentDir = (TSystemFile*) dirList->At(iDir);
1145 if (!presentDir || !presentDir->IsDirectory() || strcmp(presentDir->GetName(), ".") == 0 || strcmp(presentDir->GetName(), "..") == 0)
1154 if (count++ == aRuns)
1157 TString presentDirName(aDataDir);
1158 presentDirName += "/";
1159 presentDirName += presentDir->GetName();
1160 chain->Add(presentDirName + "/AliAOD.root/aodTree");
1161 // cerr<<presentDirName<<endl;
1167 // Open the input stream
1173 // Read the input list of files and add them to the chain
1177 if (!aodfile.Contains("root")) continue; // protection
1185 if (count++ == aRuns)
1189 chain->Add(aodfile);