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 += "_secondrun.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 =
599 mgr->CreateContainer("cchain1",TChain::Class(),AliAnalysisManager::kInputContainer);
602 AliAnalysisDataContainer *cinputWeights = mgr->CreateContainer("cobjWeights",TList::Class(),AliAnalysisManager::kInputContainer);
606 AliAnalysisDataContainer *cinputLYZ2 = mgr->CreateContainer("cobjLYZ2in",TList::Class(),AliAnalysisManager::kInputContainer); }
608 AliAnalysisDataContainer *cinputLYZEP = mgr->CreateContainer("cobjLYZEPin",TList::Class(),AliAnalysisManager::kInputContainer); }
611 TString outputSP = "outputSPanalysis";
614 AliAnalysisDataContainer *coutputSP = mgr->CreateContainer("cobjSP", TList::Class(),AliAnalysisManager::kOutputContainer,outputSP);
618 TString outputLYZ1 = "outputLYZ1analysis";
620 outputLYZ1+= "_firstrun.root";
621 AliAnalysisDataContainer *coutputLYZ1 = mgr->CreateContainer("cobjLYZ1", TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ1);
625 TString outputLYZ2 = "outputLYZ2analysis";
627 outputLYZ2+= "_secondrun.root";
628 AliAnalysisDataContainer *coutputLYZ2 = mgr->CreateContainer("cobjLYZ2", TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ2);
632 TString outputLYZEP = "outputLYZEPanalysis";
634 outputLYZEP+= ".root";
635 AliAnalysisDataContainer *coutputLYZEP = mgr->CreateContainer("cobjLYZEP", TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZEP);
639 TString outputGFC = "outputGFCanalysis";
642 AliAnalysisDataContainer *coutputGFC = mgr->CreateContainer("cobjGFC", TList::Class(),AliAnalysisManager::kOutputContainer,outputGFC);
646 TString outputQC = "outputQCanalysis";
649 AliAnalysisDataContainer *coutputQC = mgr->CreateContainer("cobjQC", TList::Class(),AliAnalysisManager::kOutputContainer,outputQC);
653 TString outputFQD = "outputFQDanalysis";
656 AliAnalysisDataContainer *coutputFQD = mgr->CreateContainer("cobjFQD", TList::Class(),AliAnalysisManager::kOutputContainer,outputFQD);
660 TString outputMCEP = "outputMCEPanalysis";
662 outputMCEP+= ".root";
663 AliAnalysisDataContainer *coutputMCEP = mgr->CreateContainer("cobjMCEP", TList::Class(),AliAnalysisManager::kOutputContainer,outputMCEP);
669 TString qaNameIntSP = "QAforInt_SP_";
671 qaNameIntSP += ".root";
672 AliAnalysisDataContainer *coutputQA1SP =
673 mgr->CreateContainer("QAintSP", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntSP);
675 TString qaNameDiffSP = "QAforDiff_SP_";
676 qaNameDiffSP += type;
677 qaNameDiffSP += ".root";
678 AliAnalysisDataContainer *coutputQA2SP =
679 mgr->CreateContainer("QAdiffSP", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffSP);
682 TString qaNameIntLYZ1 = "QAforInt_LYZ1_";
683 qaNameIntLYZ1 += type;
684 qaNameIntLYZ1 += ".root";
685 AliAnalysisDataContainer *coutputQA1LYZ1 =
686 mgr->CreateContainer("QAintLYZ1", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntLYZ1);
688 TString qaNameDiffLYZ1 = "QAforDiff_LYZ1_";
689 qaNameDiffLYZ1 += type;
690 qaNameDiffLYZ1 += ".root";
691 AliAnalysisDataContainer *coutputQA2LYZ1 =
692 mgr->CreateContainer("QAdiffLYZ1", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffLYZ1);
695 TString qaNameIntLYZ2 = "QAforInt_LYZ2_";
696 qaNameIntLYZ2 += type;
697 qaNameIntLYZ2 += ".root";
698 AliAnalysisDataContainer *coutputQA1LYZ2 =
699 mgr->CreateContainer("QAintLYZ2", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntLYZ2);
701 TString qaNameDiffLYZ2 = "QAforDiff_LYZ2_";
702 qaNameDiffLYZ2 += type;
703 qaNameDiffLYZ2 += ".root";
704 AliAnalysisDataContainer *coutputQA2LYZ2 =
705 mgr->CreateContainer("QAdiffLYZ2", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffLYZ2);
708 TString qaNameIntLYZEP = "QAforInt_LYZEP_";
709 qaNameIntLYZEP += type;
710 qaNameIntLYZEP += ".root";
711 AliAnalysisDataContainer *coutputQA1LYZEP =
712 mgr->CreateContainer("QAintLYZEP", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntLYZEP);
714 TString qaNameDiffLYZEP = "QAforDiff_LYZEP_";
715 qaNameDiffLYZEP += type;
716 qaNameDiffLYZEP += ".root";
717 AliAnalysisDataContainer *coutputQA2LYZEP =
718 mgr->CreateContainer("QAdiffLYZEP", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffLYZEP);
721 TString qaNameIntGFC = "QAforInt_GFC_";
722 qaNameIntGFC += type;
723 qaNameIntGFC += ".root";
724 AliAnalysisDataContainer *coutputQA1GFC =
725 mgr->CreateContainer("QAintGFC", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntGFC);
727 TString qaNameDiffGFC = "QAforDiff_GFC_";
728 qaNameDiffGFC += type;
729 qaNameDiffGFC += ".root";
730 AliAnalysisDataContainer *coutputQA2GFC =
731 mgr->CreateContainer("QAdiffGFC", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffGFC);
734 TString qaNameIntQC = "QAforInt_QC_";
736 qaNameIntQC += ".root";
737 AliAnalysisDataContainer *coutputQA1QC =
738 mgr->CreateContainer("QAintQC", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntQC);
740 TString qaNameDiffQC = "QAforDiff_QC_";
741 qaNameDiffQC += type;
742 qaNameDiffQC += ".root";
743 AliAnalysisDataContainer *coutputQA2QC =
744 mgr->CreateContainer("QAdiffQC", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffQC);
747 TString qaNameIntFQD = "QAforInt_FQD_";
748 qaNameIntFQD += type;
749 qaNameIntFQD += ".root";
750 AliAnalysisDataContainer *coutputQA1FQD =
751 mgr->CreateContainer("QAintFQD", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntFQD);
753 TString qaNameDiffFQD = "QAforDiff_FQD_";
754 qaNameDiffFQD += type;
755 qaNameDiffFQD += ".root";
756 AliAnalysisDataContainer *coutputQA2FQD =
757 mgr->CreateContainer("QAdiffFQD", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffFQD);
760 TString qaNameIntMCEP = "QAforInt_MCEP_";
761 qaNameIntMCEP += type;
762 qaNameIntMCEP += ".root";
763 AliAnalysisDataContainer *coutputQA1MCEP =
764 mgr->CreateContainer("QAintMCEP", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameIntMCEP);
766 TString qaNameDiffMCEP = "QAforDiff_MCEP_";
767 qaNameDiffMCEP += type;
768 qaNameDiffMCEP += ".root";
769 AliAnalysisDataContainer *coutputQA2MCEP =
770 mgr->CreateContainer("QAdiffMCEP", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameDiffMCEP);
775 //____________________________________________//
778 mgr->ConnectInput(taskSP,0,cinput1);
779 mgr->ConnectOutput(taskSP,0,coutputSP);
780 if (QA) { mgr->ConnectOutput(taskSP,1,coutputQA1SP);
781 mgr->ConnectOutput(taskSP,2,coutputQA2SP); }
784 mgr->ConnectInput(taskLYZ1,0,cinput1);
785 mgr->ConnectOutput(taskLYZ1,0,coutputLYZ1);
786 if (QA) { mgr->ConnectOutput(taskLYZ1,1,coutputQA1LYZ1);
787 mgr->ConnectOutput(taskLYZ1,2,coutputQA2LYZ1); }
790 mgr->ConnectInput(taskLYZ2,0,cinput1);
791 mgr->ConnectInput(taskLYZ2,1,cinputLYZ2);
792 mgr->ConnectOutput(taskLYZ2,0,coutputLYZ2);
793 if (QA) { mgr->ConnectOutput(taskLYZ2,1,coutputQA1LYZ2);
794 mgr->ConnectOutput(taskLYZ2,2,coutputQA2LYZ2); }
795 cinputLYZ2->SetData(fInputListLYZ2);
798 mgr->ConnectInput(taskLYZEP,0,cinput1);
799 mgr->ConnectInput(taskLYZEP,1,cinputLYZEP);
800 mgr->ConnectOutput(taskLYZEP,0,coutputLYZEP);
801 if (QA) { mgr->ConnectOutput(taskLYZEP,1,coutputQA1LYZEP);
802 mgr->ConnectOutput(taskLYZEP,2,coutputQA2LYZEP); }
803 cinputLYZEP->SetData(fInputListLYZEP);
806 mgr->ConnectInput(taskGFC,0,cinput1);
807 mgr->ConnectOutput(taskGFC,0,coutputGFC);
808 if (QA) { mgr->ConnectOutput(taskGFC,1,coutputQA1GFC);
809 mgr->ConnectOutput(taskGFC,2,coutputQA2GFC); }
812 mgr->ConnectInput(taskQC,0,cinput1);
813 mgr->ConnectOutput(taskQC,0,coutputQC);
814 if (QA) { mgr->ConnectOutput(taskQC,1,coutputQA1QC);
815 mgr->ConnectOutput(taskQC,2,coutputQA2QC); }
817 mgr->ConnectInput(taskQC,1,cinputWeights);
818 cinputWeights->SetData(weightsList);
822 mgr->ConnectInput(taskFQD,0,cinput1);
823 mgr->ConnectOutput(taskFQD,0,coutputFQD);
824 if (QA) { mgr->ConnectOutput(taskFQD,1,coutputQA1FQD);
825 mgr->ConnectOutput(taskFQD,2,coutputQA2FQD); }
827 mgr->ConnectInput(taskFQD,1,cinputWeights);
828 cinputWeights->SetData(weightsList);
832 mgr->ConnectInput(taskMCEP,0,cinput1);
833 mgr->ConnectOutput(taskMCEP,0,coutputMCEP);
834 if (QA) { mgr->ConnectOutput(taskMCEP,1,coutputQA1MCEP);
835 mgr->ConnectOutput(taskMCEP,2,coutputQA2MCEP); }
840 //----------------------------------------------------------
842 //----------------------------------------------------------
844 if (!mgr->InitAnalysis()) return;
847 if (mode==mLocal || mode == mLocalPAR) {
848 mgr->StartAnalysis("local",chain);
850 else if (mode==mPROOF) {
851 // mgr->StartAnalysis("proof",chain);
852 mgr->StartAnalysis("proof",data,nRuns,offset);
854 else if (mode==mGRID) {
855 mgr->StartAnalysis("local",chain);
863 void LoadLibraries(const anaModes mode) {
865 //--------------------------------------
866 // Load the needed libraries most of them already loaded by aliroot
867 //--------------------------------------
868 gSystem->Load("libTree.so");
869 gSystem->Load("libGeom.so");
870 gSystem->Load("libVMC.so");
871 gSystem->Load("libXMLIO.so");
872 gSystem->Load("libPhysics.so");
874 //----------------------------------------------------------
875 // >>>>>>>>>>> Local mode <<<<<<<<<<<<<<
876 //----------------------------------------------------------
878 //--------------------------------------------------------
879 // If you want to use already compiled libraries
880 // in the aliroot distribution
881 //--------------------------------------------------------
882 gSystem->Load("libSTEERBase");
883 gSystem->Load("libESD");
884 gSystem->Load("libAOD");
885 gSystem->Load("libANALYSIS");
886 gSystem->Load("libANALYSISalice");
887 gSystem->Load("libCORRFW.so");
888 cerr<<"libCORRFW.so loaded..."<<endl;
889 gSystem->Load("libPWG2flowCommon.so");
890 cerr<<"libPWG2flowCommon.so loaded..."<<endl;
891 gSystem->Load("libPWG2flowTasks.so");
892 cerr<<"libPWG2flowTasks.so loaded..."<<endl;
895 else if (mode == mLocalPAR || mode == mGRID) {
896 //--------------------------------------------------------
897 //If you want to use root and par files from aliroot
898 //--------------------------------------------------------
899 SetupPar("STEERBase");
902 SetupPar("ANALYSIS");
903 SetupPar("ANALYSISalice");
906 SetupPar("PWG2flowCommon");
907 cerr<<"PWG2flowCommon.par loaded..."<<endl;
908 SetupPar("PWG2flowTasks");
909 cerr<<"PWG2flowTasks.par loaded..."<<endl;
912 //---------------------------------------------------------
913 // <<<<<<<<<< PROOF mode >>>>>>>>>>>>
914 //---------------------------------------------------------
915 else if (mode==mPROOF) {
918 // set to debug root versus if needed
919 // TProof::Mgr("alicecaf")->SetROOTVersion("v5-21-01-alice_dbg");
920 // TProof::Mgr("alicecaf")->SetROOTVersion("v5-21-01-alice");
923 // Put appropriate username here
924 // TProof::Reset("proof://snelling@alicecaf.cern.ch");
925 printf("*** Connect to PROOF ***\n");
926 // TProof::Open("abilandz@alicecaf.cern.ch");
927 TProof::Open("snelling@localhost");
929 // Enable the STEERBase Package
930 gProof->ClearPackage("STEERBase.par");
931 gProof->UploadPackage("STEERBase.par");
932 gProof->EnablePackage("STEERBase");
933 // Enable the ESD Package
934 gProof->ClearPackage("ESD.par");
935 gProof->UploadPackage("ESD.par");
936 gProof->EnablePackage("ESD");
937 // Enable the AOD Package
938 gProof->ClearPackage("AOD.par");
939 gProof->UploadPackage("AOD.par");
940 gProof->EnablePackage("AOD");
941 // Enable the Analysis Package
942 gProof->ClearPackage("ANALYSIS.par");
943 gProof->UploadPackage("ANALYSIS.par");
944 gProof->EnablePackage("ANALYSIS");
945 // Enable the Analysis Package alice
946 gProof->ClearPackage("ANALYSISalice.par");
947 gProof->UploadPackage("ANALYSISalice.par");
948 gProof->EnablePackage("ANALYSISalice");
950 gProof->ClearPackage("PWG2AOD.par");
951 gProof->UploadPackage("PWG2AOD.par");
952 gProof->EnablePackage("PWG2AOD");
953 // Enable the Correction Framework
954 gProof->ClearPackage("CORRFW.par");
955 gProof->UploadPackage("CORRFW.par");
956 gProof->EnablePackage("CORRFW");
957 // Enable Flow Analysis
958 gProof->ClearPackage("PWG2flowCommon");
959 gProof->UploadPackage("PWG2flowCommon.par");
960 gProof->EnablePackage("PWG2flowCommon");
961 gProof->ClearPackage("PWG2flowTasks");
962 gProof->UploadPackage("PWG2flowTasks.par");
963 gProof->EnablePackage("PWG2flowTasks");
965 gProof->ShowEnabledPackages();
970 void SetupPar(char* pararchivename) {
971 //Load par files, create analysis libraries
972 //For testing, if par file already decompressed and modified
973 //classes then do not decompress.
975 TString cdir(Form("%s", gSystem->WorkingDirectory() )) ;
976 TString parpar(Form("%s.par", pararchivename)) ;
977 if ( gSystem->AccessPathName(parpar.Data()) ) {
978 gSystem->ChangeDirectory(gSystem->Getenv("ALICE_ROOT")) ;
979 TString processline(Form(".! make %s", parpar.Data())) ;
980 gROOT->ProcessLine(processline.Data()) ;
981 gSystem->ChangeDirectory(cdir) ;
982 processline = Form(".! mv /tmp/%s .", parpar.Data()) ;
983 gROOT->ProcessLine(processline.Data()) ;
985 if ( gSystem->AccessPathName(pararchivename) ) {
986 TString processline = Form(".! tar xvzf %s",parpar.Data()) ;
987 gROOT->ProcessLine(processline.Data());
990 TString ocwd = gSystem->WorkingDirectory();
991 gSystem->ChangeDirectory(pararchivename);
993 // check for BUILD.sh and execute
994 if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
995 printf("*******************************\n");
996 printf("*** Building PAR archive ***\n");
997 cout<<pararchivename<<endl;
998 printf("*******************************\n");
1000 if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
1001 Error("runProcess","Cannot Build the PAR Archive! - Abort!");
1005 // check for SETUP.C and execute
1006 if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
1007 printf("*******************************\n");
1008 printf("*** Setup PAR archive ***\n");
1009 cout<<pararchivename<<endl;
1010 printf("*******************************\n");
1011 gROOT->Macro("PROOF-INF/SETUP.C");
1014 gSystem->ChangeDirectory(ocwd.Data());
1015 printf("Current dir: %s\n", ocwd.Data());
1019 // Helper macros for creating chains
1020 // from: CreateESDChain.C,v 1.10 jgrosseo Exp
1022 TChain* CreateESDChain(const char* aDataDir, Int_t aRuns, Int_t offset)
1024 // creates chain of files in a given directory or file containing a list.
1025 // In case of directory the structure is expected as:
1026 // <aDataDir>/<dir0>/AliESDs.root
1027 // <aDataDir>/<dir1>/AliESDs.root
1033 Long_t id, size, flags, modtime;
1034 if (gSystem->GetPathInfo(aDataDir, &id, &size, &flags, &modtime))
1036 printf("%s not found.\n", aDataDir);
1040 TChain* chain = new TChain("esdTree");
1041 TChain* chaingAlice = 0;
1045 TString execDir(gSystem->pwd());
1046 TSystemDirectory* baseDir = new TSystemDirectory(".", aDataDir);
1047 TList* dirList = baseDir->GetListOfFiles();
1048 Int_t nDirs = dirList->GetEntries();
1049 gSystem->cd(execDir);
1053 for (Int_t iDir=0; iDir<nDirs; ++iDir)
1055 TSystemFile* presentDir = (TSystemFile*) dirList->At(iDir);
1056 if (!presentDir || !presentDir->IsDirectory() || strcmp(presentDir->GetName(), ".") == 0 || strcmp(presentDir->GetName(), "..") == 0)
1065 if (count++ == aRuns)
1068 TString presentDirName(aDataDir);
1069 presentDirName += "/";
1070 presentDirName += presentDir->GetName();
1071 chain->Add(presentDirName + "/AliESDs.root/esdTree");
1072 // cerr<<presentDirName<<endl;
1078 // Open the input stream
1084 // Read the input list of files and add them to the chain
1088 if (!esdfile.Contains("root")) continue; // protection
1096 if (count++ == aRuns)
1100 chain->Add(esdfile);
1109 // Helper macros for creating chains
1110 // from: CreateESDChain.C,v 1.10 jgrosseo Exp
1112 TChain* CreateAODChain(const char* aDataDir, Int_t aRuns, Int_t offset)
1114 // creates chain of files in a given directory or file containing a list.
1115 // In case of directory the structure is expected as:
1116 // <aDataDir>/<dir0>/AliAOD.root
1117 // <aDataDir>/<dir1>/AliAOD.root
1123 Long_t id, size, flags, modtime;
1124 if (gSystem->GetPathInfo(aDataDir, &id, &size, &flags, &modtime))
1126 printf("%s not found.\n", aDataDir);
1130 TChain* chain = new TChain("aodTree");
1131 TChain* chaingAlice = 0;
1135 TString execDir(gSystem->pwd());
1136 TSystemDirectory* baseDir = new TSystemDirectory(".", aDataDir);
1137 TList* dirList = baseDir->GetListOfFiles();
1138 Int_t nDirs = dirList->GetEntries();
1139 gSystem->cd(execDir);
1143 for (Int_t iDir=0; iDir<nDirs; ++iDir)
1145 TSystemFile* presentDir = (TSystemFile*) dirList->At(iDir);
1146 if (!presentDir || !presentDir->IsDirectory() || strcmp(presentDir->GetName(), ".") == 0 || strcmp(presentDir->GetName(), "..") == 0)
1155 if (count++ == aRuns)
1158 TString presentDirName(aDataDir);
1159 presentDirName += "/";
1160 presentDirName += presentDir->GetName();
1161 chain->Add(presentDirName + "/AliAOD.root/aodTree");
1162 // cerr<<presentDirName<<endl;
1168 // Open the input stream
1174 // Read the input list of files and add them to the chain
1178 if (!aodfile.Contains("root")) continue; // protection
1186 if (count++ == aRuns)
1190 chain->Add(aodfile);