1 #include "TStopwatch.h"
6 //--------------------------------------------------------------------------------------
8 // flow analysis method can be: (set to kTRUE or kFALSE)
10 Bool_t LYZ1SUM = kTRUE;
11 Bool_t LYZ1PROD = kTRUE;
12 Bool_t LYZ2SUM = kFALSE;
13 Bool_t LYZ2PROD = kFALSE;
14 Bool_t LYZEP = kFALSE;
19 //--------------------------------------------------------------------------------------
22 // use weights for Q-vector:
23 Bool_t usePhiWeights = kFALSE; // phi weights (correction for non-uniform azimuthal acceptance)
24 Bool_t usePtWeights = kFALSE; // pt weights
25 Bool_t useEtaWeights = kFALSE; // eta weights
27 // Run same flow analysis method but with different settings/aims
28 // You will have to label each setting/aim with your own label (see examples bellow):
29 Bool_t GFC_Additional_Analysis = kFALSE;
30 Bool_t QC_Additional_Analysis = kFALSE;
31 Bool_t FQD_Additional_Analysis = kFALSE;
33 // Parameters for the simulation of events 'on the fly':
34 Bool_t bSameSeed = kFALSE; // use always the same seed for random generators.
35 // usage of same seed (kTRUE) is relevant in two cases:
36 // 1.) If you want to use LYZ method to calcualte differential flow;
37 // 2.) If you want to use phi weights for GFC, QC and FQD
39 Bool_t bConstantHarmonics = kTRUE; // harmonics V1, V2, V4... are constant (kTRUE) or functions of pt and eta (kFALSE)
41 Int_t iLoops = 1; // number of times to use each track (to simulate nonflow)
43 Bool_t bMultDistrOfRPsIsGauss = kTRUE; // 1.) if kTRUE = multiplicitiy of RPs is sampled e-b-e from Gaussian distribution with
44 // mean = iMultiplicityOfRP and spread = dMultiplicitySpreadOfRP
45 // 2.) if kFALSE = multiplicitiy of RPs is sampled e-b-e uniformly from
46 // interval [iMinMultOfRP,iMaxMultOfRP]
47 // 3.) for a fixed multiplicity use Gaussian with zero spread or use uniform with iMinMult=iMaxMult
49 Bool_t bV2DistrOfRPsIsGauss = kTRUE; // 1.) if kTRUE = elliptic flow of RPs is sampled e-b-e from Gaussian distribution with
50 // mean = dV2RP and spread = dV2SpreadRP
51 // 2.) if kFALSE = elliptic flow of RPs is sampled e-b-e uniformly from
52 // interval [dMinV2RP,dMaxV2RP]
53 // 3.) for a fixed elliptic flow use Gaussian with zero spread or use uniform with dMinV2RP=dMaxV2RP
55 Bool_t uniformAcceptance = kTRUE; // 1.) if kTRUE = detectors has uniform azimuthal acceptance
56 // 2.) if kFALSE = you will simulate detector with non-uniform acceptance in one or two sectors.
57 // For each of two sectors you specify phi_min, phi_max and probability p. Then all particles
58 // going in direction phi_min < phi < phi_max will be taken with probability p. If p = 0, that
59 // sector is blocked. Set bellow phimin1, phimax1, p1 for the first sector and phimin2, phimax2, p2
60 // for the second sector. If you set phimin2 = phimax2 = p2 = 0, only first non-uniform sector is
63 Int_t iMultiplicityOfRP = 500; // mean multiplicity of RPs (if sampled from Gaussian)
64 Double_t dMultiplicitySpreadOfRP = 0; // multiplicity spread of RPs (if sampled from Gaussian)
65 Int_t iMinMultOfRP = 400; // minimal multiplicity of RPs (if sampled uniformly)
66 Int_t iMaxMultOfRP = 600; // maximal multiplicity of RPs (if sampled uniformly)
68 Double_t dTemperatureOfRP = 0.44; // 'temperature' of RPs in GeV/c (increase this parameter to get more high pt RPs)
70 //......................................................................................
71 // if you use (pt,eta) dependent harmonics (bConstantHarmonics = kFALSE):
72 Double_t dPtCutOff = 2.0; // V2(pt) is linear up to pt = 2 GeV and for pt > 2 GeV it is constant: V2(pt) = dVRPMax
73 Double_t dV2RPMax = 0.20; // maximum value of V2(pt) for pt >= 2GeV
74 //......................................................................................
76 //......................................................................................
77 // if you use constant harmonics (bConstantHarmonics = kTRUE) (i.e. no pt dependence):
78 Double_t dV2RP = 0.05; // elliptic flow of RPs (if sampled from Gaussian)
79 Double_t dV2SpreadRP = 0.0; // elliptic flow spread of RPs (if sampled from Gaussian)
80 Double_t dMinV2RP = 0.04; // minimal elliptic flow of RPs (if sampled uniformly)
81 Double_t dMaxV2RP = 0.06; // maximal elliptic flow of RPs (if sampled uniformly)
83 Double_t dV1RP = 0.0; // directed flow of RPs
84 Double_t dV1SpreadRP = 0.0; // directed flow spread of RPs
86 Double_t dV4RP = 0.0; // harmonic V4 of RPs (to be improved: name needed)
87 Double_t dV4SpreadRP = 0.0; // harmonic V4's spread of RPs (to be improved: name needed)
88 //......................................................................................
90 //......................................................................................
91 // settings for non-uniform acceptance:
92 // Remark: set the angles in degrees from interval [0,360] and probability from interval [0,1]
94 // 1st non-uniform sector:
95 Double_t phimin1 = 60; // first non-uniform sector starts at this azimuth
96 Double_t phimax1 = 120; // first non-uniform sector ends at this azimuth
97 Double_t p1 = 0.33; // e.g. if p1 = 0 all particles emitted in phimin1 < phi < phimax1 are blocked
98 // e.g. if p1 = 0.5 half of the particles emitted in phimin1 < phi < phimax1 are blocked
100 // 2nd non-uniform sector (Remark: if you do NOT want to simulate this sector, set phimin2 = phimax2 = p2 = 0):
101 Double_t phimin2 = 0.0; // second non-uniform sector starts at this azimuth (make sure phimin2 > phimax1 !!!!)
102 Double_t phimax2 = 0.0; // second non-uniform sector ends at this azimuth
104 //......................................................................................
106 enum anaModes {mLocal,mLocalSource,mLocalPAR};
107 // mLocal: Analyze data on your computer using aliroot
108 // mLocalPAR: Analyze data on your computer using root + PAR files
109 // mLocalSource: Analyze data on your computer using root + source files
111 int runFlowAnalysisOnTheFly(Int_t mode=mLocal, Int_t nEvts=440)
116 if (LYZ1SUM && LYZ2SUM) {cout<<"WARNING: you cannot run LYZ1 and LYZ2 at the same time! LYZ2 needs the output from LYZ1. "<<endl; exit(); }
117 if (LYZ1PROD && LYZ2PROD) {cout<<"WARNING: you cannot run LYZ1 and LYZ2 at the same time! LYZ2 needs the output from LYZ1. "<<endl; exit(); }
118 if (LYZ2SUM && LYZEP) {cout<<"WARNING: you cannot run LYZ2 and LYZEP at the same time! LYZEP needs the output from LYZ2."<<endl; exit(); }
119 if (LYZ1SUM && LYZEP) {cout<<"WARNING: you cannot run LYZ1 and LYZEP at the same time! LYZEP needs the output from LYZ2."<<endl; exit(); }
121 if(!uniformAcceptance && phimin1 > phimax1)
123 cout<<"WARNING: you must have phimin1 < phimax1 !!!!"<<endl;
127 if (!uniformAcceptance && !((phimin2 == 0.) && (phimax2 == 0.) && (p2 == 0.)) && (phimin2 < phimax1 || phimin2 > phimax2))
129 cout<<"WARNING: you must have phimin2 > phimax1 and phimin2 < phimax2 !!!!"<<endl;
133 if((phimin1 < 0 || phimin1 > 360) || (phimax1 < 0 || phimax1 > 360) ||
134 (phimin2 < 0 || phimin2 > 360) || (phimax2 < 0 || phimax2 > 360) )
136 cout<<"WARNING: you must take azimuthal angles from interval [0,360] !!!!"<<endl;
140 if((p1 < 0 || p1 > 1) || (p2 < 0 || p2 > 1))
142 cout<<"WARNING: you must take p1 and p2 from interval [0,1] !!!!"<<endl;
148 cout<<" ---- ARE YOU READY TO FLY ? ---- "<<endl;
152 cout<<" ---- BEGIN FLOW ANALYSIS 'ON THE FLY' ---- "<<endl;
158 // Initialize the seed for random generator
163 sseed = 44; // the default constant value for seed for random generators
169 sseed = dt.GetNanoSec()/1000;
173 cout<<"Seed for the random generators is "<<sseed<<endl;
176 //---------------------------------------------------------------------------------------
177 // If the weights are used:
178 TFile *fileWithWeights = NULL;
179 TList *listWithWeights = NULL;
181 if(usePhiWeights||usePtWeights||useEtaWeights) {
182 fileWithWeights = TFile::Open("weights.root","READ");
183 if(fileWithWeights) {
184 listWithWeights = (TList*)fileWithWeights->Get("weights");
187 {cout << " WARNING: the file <weights.root> with weights from the previous run was not found."<<endl;
192 //---------------------------------------------------------------------------------------
193 // Initialize the flowevent maker
194 AliFlowEventSimpleMakerOnTheFly* eventMakerOnTheFly = new AliFlowEventSimpleMakerOnTheFly(sseed);
195 eventMakerOnTheFly->Init();
197 //---------------------------------------------------------------------------------------
198 // Initialize all the flow methods for default analysis:
199 AliFlowAnalysisWithQCumulants *qc = NULL;
200 AliFlowAnalysisWithCumulants *gfc = NULL;
201 AliFlowAnalysisWithFittingQDistribution *fqd = NULL;
202 AliFlowAnalysisWithLeeYangZeros *lyz1sum = NULL;
203 AliFlowAnalysisWithLeeYangZeros *lyz1prod = NULL;
204 AliFlowAnalysisWithLeeYangZeros *lyz2sum = NULL;
205 AliFlowAnalysisWithLeeYangZeros *lyz2prod = NULL;
206 AliFlowAnalysisWithLYZEventPlane *lyzep = NULL;
207 AliFlowAnalysisWithScalarProduct *sp = NULL;
208 AliFlowAnalysisWithMCEventPlane *mcep = NULL;
210 // MCEP = monte carlo event plane
212 AliFlowAnalysisWithMCEventPlane *mcep = new AliFlowAnalysisWithMCEventPlane();
218 AliFlowAnalysisWithQCumulants* qc = new AliFlowAnalysisWithQCumulants();
219 if(listWithWeights) qc->SetWeightsList(listWithWeights);
220 if(usePhiWeights) qc->SetUsePhiWeights(usePhiWeights);
221 if(usePtWeights) qc->SetUsePtWeights(usePtWeights);
222 if(useEtaWeights) qc->SetUseEtaWeights(useEtaWeights);
223 qc->SetCalculate2DFlow(kTRUE);
224 qc->SetEvaluateNestedLoopsForIntFlow(kFALSE);
225 qc->SetEvaluateNestedLoopsForDiffFlow(kFALSE);
229 // GFC = Generating Function Cumulants
231 AliFlowAnalysisWithCumulants* gfc = new AliFlowAnalysisWithCumulants();
232 if(listWithWeights) gfc->SetWeightsList(listWithWeights);
233 if(usePhiWeights) gfc->SetUsePhiWeights(usePhiWeights);
234 if(usePtWeights) gfc->SetUsePtWeights(usePtWeights);
235 if(useEtaWeights) gfc->SetUseEtaWeights(useEtaWeights);
239 // FQD = Fitting q-distribution
241 AliFlowAnalysisWithFittingQDistribution* fqd = new AliFlowAnalysisWithFittingQDistribution();
242 if(listWithWeights) fqd->SetWeightsList(listWithWeights);
243 if(usePhiWeights) fqd->SetUsePhiWeights(usePhiWeights);
247 // SP = Scalar Product
249 AliFlowAnalysisWithScalarProduct* sp = new AliFlowAnalysisWithScalarProduct();
253 // LYZ1 = Lee-Yang Zeroes first run
255 AliFlowAnalysisWithLeeYangZeros* lyz1sum = new AliFlowAnalysisWithLeeYangZeros();
256 lyz1sum->SetFirstRun(kTRUE);
257 lyz1sum->SetUseSum(kTRUE);
261 AliFlowAnalysisWithLeeYangZeros* lyz1prod = new AliFlowAnalysisWithLeeYangZeros();
262 lyz1prod->SetFirstRun(kTRUE);
263 lyz1prod->SetUseSum(kFALSE);
266 // LYZ2 = Lee-Yang Zeroes second run
268 AliFlowAnalysisWithLeeYangZeros* lyz2sum = new AliFlowAnalysisWithLeeYangZeros();
269 // read the input file from the first run
270 TString inputFileNameLYZ2SUM = "outputLYZ1SUManalysis.root" ;
271 TFile* inputFileLYZ2SUM = new TFile(inputFileNameLYZ2SUM.Data(),"READ");
272 if(!inputFileLYZ2SUM || inputFileLYZ2SUM->IsZombie()) {
273 cerr << " ERROR: To run LYZ2SUM you need the output file from LYZ1SUM. This file is not there! Please run LYZ1SUM first." << endl ;
277 TList* inputListLYZ2SUM = (TList*)inputFileLYZ2SUM->Get("cobjLYZ1SUM");
278 if (!inputListLYZ2SUM) {cout<<"Input list LYZ2SUM is NULL pointer!"<<endl; break;}
280 cout<<"LYZ2SUM input file/list read..."<<endl;
281 lyz2sum->SetFirstRunList(inputListLYZ2SUM);
282 lyz2sum->SetFirstRun(kFALSE);
283 lyz2sum->SetUseSum(kTRUE);
289 AliFlowAnalysisWithLeeYangZeros* lyz2prod = new AliFlowAnalysisWithLeeYangZeros();
290 // read the input file from the first run
291 TString inputFileNameLYZ2PROD = "outputLYZ1PRODanalysis.root" ;
292 TFile* inputFileLYZ2PROD = new TFile(inputFileNameLYZ2PROD.Data(),"READ");
293 if(!inputFileLYZ2PROD || inputFileLYZ2PROD->IsZombie()) {
294 cerr << " ERROR: To run LYZ2PROD you need the output file from LYZ1PROD. This file is not there! Please run LYZ1PROD first." << endl ;
298 TList* inputListLYZ2PROD = (TList*)inputFileLYZ2PROD->Get("cobjLYZ1PROD");
299 if (!inputListLYZ2PROD) {cout<<"Input list LYZ2PROD is NULL pointer!"<<endl; break;}
301 cout<<"LYZ2PROD input file/list read..."<<endl;
302 lyz2prod->SetFirstRunList(inputListLYZ2PROD);
303 lyz2prod->SetFirstRun(kFALSE);
304 lyz2prod->SetUseSum(kFALSE);
310 // LYZEP = Lee-Yang Zeroes event plane
312 AliFlowLYZEventPlane* ep = new AliFlowLYZEventPlane() ;
313 AliFlowAnalysisWithLYZEventPlane* lyzep = new AliFlowAnalysisWithLYZEventPlane();
314 // read the input file from the second lyz run
315 TString inputFileNameLYZEP = "outputLYZ2SUManalysis.root" ;
316 TFile* inputFileLYZEP = new TFile(inputFileNameLYZEP.Data(),"READ");
317 if(!inputFileLYZEP || inputFileLYZEP->IsZombie()) {
318 cerr << " ERROR: To run LYZEP you need the output file from LYZ2SUM. This file is not there! Please run LYZ2SUM first." << endl ;
322 TList* inputListLYZEP = (TList*)inputFileLYZEP->Get("cobjLYZ2SUM");
323 if (!inputListLYZEP) {cout<<"Input list LYZEP is NULL pointer!"<<endl; break;}
325 cout<<"LYZEP input file/list read..."<<endl;
326 ep ->SetSecondRunList(inputListLYZEP);
327 lyzep->SetSecondRunList(inputListLYZEP);
333 //---------------------------------------------------------------------------------------
335 //---------------------------------------------------------------------------------------
336 // Initialize all the flow methods for additional analysis with different settings/aims
337 // Label each setting/aim with different label !!!!
340 TString gfcDefaultName = "outputGFCanalysis";
341 // 1.) GFC analysis for elliptic flow with r0 = 1.5:
342 AliFlowAnalysisWithCumulants *gfc_1;
343 TString gfcAnalysisLabels_1 = "_r0_1.5"; // all histograms and output file name will have this label
344 TString gfcOutputFileName_1;
345 gfcOutputFileName_1 = gfcDefaultName.Data();
346 gfcOutputFileName_1 += gfcAnalysisLabels_1.Data();
347 gfcOutputFileName_1 += ".root";
348 if(GFC_Additional_Analysis)
350 gfc_1 = new AliFlowAnalysisWithCumulants();
351 //gfc_1->SetAnalysisLabel(gfcAnalysisLabels_1.Data());
352 if(listWithWeights) gfc_1->SetWeightsList(listWithWeights);
353 if(usePhiWeights) gfc_1->SetUsePhiWeights(usePhiWeights);
354 if(usePtWeights) gfc_1->SetUsePtWeights(usePtWeights);
355 if(useEtaWeights) gfc_1->SetUseEtaWeights(useEtaWeights);
360 TString qcDefaultName = "outputQCanalysis";
361 // 1.) QC analysis for directed flow:
362 AliFlowAnalysisWithQCumulants *qc_1;
363 TString qcAnalysisLabels_1 = "_v1"; // all histograms and output file name will have this label
364 TString qcOutputFileName_1;
365 qcOutputFileName_1 = qcDefaultName.Data();
366 qcOutputFileName_1 += qcAnalysisLabels_1.Data();
367 qcOutputFileName_1 += ".root";
368 if(QC_Additional_Analysis)
370 qc_1 = new AliFlowAnalysisWithQCumulants();
371 //qc_1->SetAnalysisLabel(qcAnalysisLabels_1->Data());
372 if(listWithWeights) qc_1->SetWeightsList(listWithWeights);
373 if(usePhiWeights) qc_1->SetUsePhiWeights(usePhiWeights);
378 TString fqdDefaultName = "outputFQDanalysis";
379 // 1.) FQD fitting with fixed sigma:
380 AliFlowAnalysisWithFittingQDistribution *fqd_1;
381 TString fqdAnalysisLabels_1 = "_fixedSigma"; // all histograms and output file name will have this label
382 TString fqdOutputFileName_1;
383 fqdOutputFileName_1 = fqdDefaultName.Data();
384 fqdOutputFileName_1 += fqdAnalysisLabels_1.Data();
385 fqdOutputFileName_1 += ".root";
386 if(FQD_Additional_Analysis)
388 fqd_1 = new AliFlowAnalysisWithFittingQDistribution();
389 //fqd_1->SetAnalysisLabel(fqdAnalysisLabels_1->Data());
390 if(listWithWeights) fqd_1->SetWeightsList(listWithWeights);
391 if(usePhiWeights) fqd_1->SetUsePhiWeights(usePhiWeights);
394 //---------------------------------------------------------------------------------------
396 // set the global event parameters:
397 eventMakerOnTheFly->SetNoOfLoops(iLoops);
399 if(bMultDistrOfRPsIsGauss)
401 eventMakerOnTheFly->SetMultDistrOfRPsIsGauss(bMultDistrOfRPsIsGauss);
402 eventMakerOnTheFly->SetMultiplicityOfRP(iMultiplicityOfRP);
403 eventMakerOnTheFly->SetMultiplicitySpreadOfRP(dMultiplicitySpreadOfRP);
406 eventMakerOnTheFly->SetMultDistrOfRPsIsGauss(bMultDistrOfRPsIsGauss);
407 eventMakerOnTheFly->SetMinMultOfRP(iMinMultOfRP);
408 eventMakerOnTheFly->SetMaxMultOfRP(iMaxMultOfRP);
411 eventMakerOnTheFly->SetTemperatureOfRP(dTemperatureOfRP);
413 eventMakerOnTheFly->SetV1RP(dV1RP);
414 eventMakerOnTheFly->SetV1SpreadRP(dV1SpreadRP);
415 eventMakerOnTheFly->SetV4RP(dV4RP);
416 eventMakerOnTheFly->SetV4SpreadRP(dV4SpreadRP);
418 // constant harmonic V2:
419 if(bConstantHarmonics)
421 eventMakerOnTheFly->SetUseConstantHarmonics(bConstantHarmonics);
422 if(bV2DistrOfRPsIsGauss)
424 eventMakerOnTheFly->SetV2DistrOfRPsIsGauss(bV2DistrOfRPsIsGauss);
425 eventMakerOnTheFly->SetV2RP(dV2RP);
426 eventMakerOnTheFly->SetV2SpreadRP(dV2SpreadRP);
429 eventMakerOnTheFly->SetV2DistrOfRPsIsGauss(bV2DistrOfRPsIsGauss);
430 eventMakerOnTheFly->SetMinV2RP(dMinV2RP);
431 eventMakerOnTheFly->SetMaxV2RP(dMaxV2RP);
435 // (pt,eta) dependent harmonic V2:
436 if(!bConstantHarmonics)
438 eventMakerOnTheFly->SetUseConstantHarmonics(bConstantHarmonics);
439 eventMakerOnTheFly->SetV2RPMax(dV2RPMax);
440 eventMakerOnTheFly->SetPtCutOff(dPtCutOff);
443 // non-uniform acceptance:
444 if(!uniformAcceptance)
446 eventMakerOnTheFly->SetFirstSectorPhiMin(phimin1);
447 eventMakerOnTheFly->SetFirstSectorPhiMax(phimax1);
448 eventMakerOnTheFly->SetFirstSectorProbability(p1);
449 eventMakerOnTheFly->SetSecondSectorPhiMin(phimin2);
450 eventMakerOnTheFly->SetSecondSectorPhiMax(phimax2);
451 eventMakerOnTheFly->SetSecondSectorProbability(p2);
454 //---------------------------------------------------------------------------------------
455 // create and analyze events 'on the fly':
457 for(Int_t i=0;i<nEvts;i++) {
458 // creating the event with above settings:
459 AliFlowEventSimple *event = eventMakerOnTheFly->CreateEventOnTheFly();
461 // analyzing the created event 'on the fly':
462 // do flow analysis for various methods:
463 if(MCEP) mcep->Make(event);
464 if(QC) qc->Make(event);
465 if(GFC) gfc->Make(event);
466 if(FQD) fqd->Make(event);
467 if(LYZ1SUM) lyz1sum->Make(event);
468 if(LYZ1PROD)lyz1prod->Make(event);
469 if(LYZ2SUM) lyz2sum->Make(event);
470 if(LYZ2PROD)lyz2prod->Make(event);
471 if(LYZEP) lyzep->Make(event,ep);
472 if(SP) sp->Make(event);
474 if(GFC_Additional_Analysis)
479 if(QC_Additional_Analysis)
484 if(FQD_Additional_Analysis)
491 } // end of for(Int_t i=0;i<nEvts;i++)
492 //---------------------------------------------------------------------------------------
496 //---------------------------------------------------------------------------------------
497 // calculating and storing the final results of default flow analysis:
498 if(MCEP) {mcep->Finish(); mcep->WriteHistograms("outputMCEPanalysis.root");}
499 if(SP) {sp->Finish(); sp->WriteHistograms("outputSPanalysis.root");}
500 if(QC) {qc->Finish(); qc->WriteHistograms("outputQCanalysis.root");}
501 if(GFC) {gfc->Finish(); gfc->WriteHistograms("outputGFCanalysis.root");}
502 if(FQD) {fqd->Finish(); fqd->WriteHistograms("outputFQDanalysis.root");}
503 if(LYZ1SUM) {lyz1sum->Finish(); lyz1sum->WriteHistograms("outputLYZ1SUManalysis.root");}
504 if(LYZ1PROD){lyz1prod->Finish();lyz1prod->WriteHistograms("outputLYZ1PRODanalysis.root");}
505 if(LYZ2SUM) {lyz2sum->Finish(); lyz2sum->WriteHistograms("outputLYZ2SUManalysis.root");}
506 if(LYZ2PROD){lyz2prod->Finish();lyz2prod->WriteHistograms("outputLYZ2PRODanalysis.root");}
507 if(LYZEP) {lyzep->Finish(); lyzep->WriteHistograms("outputLYZEPanalysis.root");}
508 //---------------------------------------------------------------------------------------
510 //---------------------------------------------------------------------------------------
511 // calculating and storing the final results of flow analysis with different settings/aims:
512 if(GFC_Additional_Analysis)
516 gfc_1->WriteHistograms(gfcOutputFileName_1.Data());
518 if(QC_Additional_Analysis)
522 qc_1->WriteHistograms(qcOutputFileName_1.Data());
524 if(FQD_Additional_Analysis)
528 fqd_1->WriteHistograms(fqdOutputFileName_1.Data());
530 //---------------------------------------------------------------------------------------
534 cout<<" ---- LANDED SUCCESSFULLY ---- "<<endl;
542 void SetupPar(char* pararchivename)
544 //Load par files, create analysis libraries
545 //For testing, if par file already decompressed and modified
546 //classes then do not decompress.
548 TString cdir(Form("%s", gSystem->WorkingDirectory() )) ;
549 TString parpar(Form("%s.par", pararchivename)) ;
550 if ( gSystem->AccessPathName(parpar.Data()) ) {
551 gSystem->ChangeDirectory(gSystem->Getenv("ALICE_ROOT")) ;
552 TString processline(Form(".! make %s", parpar.Data())) ;
553 gROOT->ProcessLine(processline.Data()) ;
554 gSystem->ChangeDirectory(cdir) ;
555 processline = Form(".! mv /tmp/%s .", parpar.Data()) ;
556 gROOT->ProcessLine(processline.Data()) ;
558 if ( gSystem->AccessPathName(pararchivename) ) {
559 TString processline = Form(".! tar xvzf %s",parpar.Data()) ;
560 gROOT->ProcessLine(processline.Data());
563 TString ocwd = gSystem->WorkingDirectory();
564 gSystem->ChangeDirectory(pararchivename);
566 // check for BUILD.sh and execute
567 if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
568 printf("*******************************\n");
569 printf("*** Building PAR archive ***\n");
570 cout<<pararchivename<<endl;
571 printf("*******************************\n");
573 if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
574 Error("runProcess","Cannot Build the PAR Archive! - Abort!");
578 // check for SETUP.C and execute
579 if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
580 printf("*******************************\n");
581 printf("*** Setup PAR archive ***\n");
582 cout<<pararchivename<<endl;
583 printf("*******************************\n");
584 gROOT->Macro("PROOF-INF/SETUP.C");
587 gSystem->ChangeDirectory(ocwd.Data());
588 printf("Current dir: %s\n", ocwd.Data());
591 void LoadLibraries(const anaModes mode) {
593 //--------------------------------------
594 // Load the needed libraries most of them already loaded by aliroot
595 //--------------------------------------
596 gSystem->Load("libTree.so");
597 gSystem->Load("libGeom.so");
598 gSystem->Load("libVMC.so");
599 gSystem->Load("libXMLIO.so");
600 gSystem->Load("libPhysics.so");
602 //----------------------------------------------------------
603 // >>>>>>>>>>> Local mode <<<<<<<<<<<<<<
604 //----------------------------------------------------------
606 //--------------------------------------------------------
607 // If you want to use already compiled libraries
608 // in the aliroot distribution
609 //--------------------------------------------------------
610 gSystem->Load("libSTEERBase");
611 gSystem->Load("libESD");
612 gSystem->Load("libAOD");
613 gSystem->Load("libANALYSIS");
614 gSystem->Load("libANALYSISalice");
615 gSystem->Load("libCORRFW.so");
616 cerr<<"libCORRFW.so loaded..."<<endl;
617 gSystem->Load("libPWG2flowCommon.so");
618 cerr<<"libPWG2flowCommon.so loaded..."<<endl;
619 gSystem->Load("libPWG2flowTasks.so");
620 cerr<<"libPWG2flowTasks.so loaded..."<<endl;
623 else if (mode == mLocalPAR) {
624 //--------------------------------------------------------
625 //If you want to use root and par files from aliroot
626 //--------------------------------------------------------
627 //If you want to use root and par files from aliroot
628 //--------------------------------------------------------
629 SetupPar("STEERBase");
632 SetupPar("ANALYSIS");
633 SetupPar("ANALYSISalice");
636 SetupPar("PWG2flowCommon");
637 cerr<<"PWG2flowCommon.par loaded..."<<endl;
638 SetupPar("PWG2flowTasks");
639 cerr<<"PWG2flowTasks.par loaded..."<<endl;
642 //---------------------------------------------------------
643 // <<<<<<<<<< Source mode >>>>>>>>>>>>
644 //---------------------------------------------------------
645 else if (mode==mLocalSource) {
647 // In root inline compile
651 gROOT->LoadMacro("AliFlowCommon/AliFlowCommonConstants.cxx+");
652 gROOT->LoadMacro("AliFlowCommon/AliFlowLYZConstants.cxx+");
653 gROOT->LoadMacro("AliFlowCommon/AliFlowCumuConstants.cxx+");
656 gROOT->LoadMacro("AliFlowCommon/AliFlowVector.cxx+");
657 gROOT->LoadMacro("AliFlowCommon/AliFlowTrackSimple.cxx+");
658 gROOT->LoadMacro("AliFlowCommon/AliFlowEventSimple.cxx+");
661 gROOT->LoadMacro("AliFlowCommon/AliFlowTrackSimpleCuts.cxx+");
663 // Output histosgrams
664 gROOT->LoadMacro("AliFlowCommon/AliFlowCommonHist.cxx+");
665 gROOT->LoadMacro("AliFlowCommon/AliFlowCommonHistResults.cxx+");
666 gROOT->LoadMacro("AliFlowCommon/AliFlowLYZHist1.cxx+");
667 gROOT->LoadMacro("AliFlowCommon/AliFlowLYZHist2.cxx+");
669 // Functions needed for various methods
670 gROOT->LoadMacro("AliFlowCommon/AliCumulantsFunctions.cxx+");
671 gROOT->LoadMacro("AliFlowCommon/AliFlowLYZEventPlane.cxx+");
673 // Flow Analysis code for various methods
674 gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithMCEventPlane.cxx+");
675 gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithScalarProduct.cxx+");
676 gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithLYZEventPlane.cxx+");
677 gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithLeeYangZeros.cxx+");
678 gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithCumulants.cxx+");
679 gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithQCumulants.cxx+");
680 gROOT->LoadMacro("AliFlowCommon/AliFlowAnalysisWithFittingQDistribution.cxx+");
682 // Class to fill the FlowEvent on the fly (generate Monte Carlo events)
683 gROOT->LoadMacro("AliFlowCommon/AliFlowEventSimpleMakerOnTheFly.cxx+");
685 cout << "finished loading macros!" << endl;