Loading libEventMixing in macros
[u/mrichter/AliRoot.git] / PWGCF / EBYE / macros / runBalanceFunctionToyModel.C
1 //=========Total multiplicity=========//\r
2 Double_t nTotalMultiplicityMean = 1000.;\r
3 Double_t nTotalMultiplicitySigma = 10.;\r
4 \r
5 //=========Net charge=========//\r
6 Double_t nNetChargeMean = 50.0;\r
7 Double_t nNetChargeSigma = 3.0;\r
8 \r
9 //==============Particles and spectra==============//\r
10 Double_t gAllChargesTemperature = 0.11; //in GeV\r
11 Double_t gPionPercentage = 0.8;\r
12 Double_t gPionTemperature = 0.1; //in GeV\r
13 Double_t gKaonPercentage = 0.12;\r
14 Double_t gKaonTemperature = 0.12; //in GeV\r
15 Double_t gProtonPercentage = 0.08;\r
16 Double_t gProtonTemperature = 0.2; //in GeV\r
17 //==============Particles and spectra==============//\r
18 \r
19 //==============Flow values==============//\r
20 Double_t gDirectedFlow = 0.0;\r
21 Double_t gEllipticFlow = 0.07;\r
22 Double_t gTriangularFlow = 0.0;\r
23 Double_t gQuandrangularFlow = 0.0;\r
24 Double_t gPentangularFlow = 0.0;\r
25 //==============Flow values==============//\r
26 \r
27 //=========Acceptance definition=========//\r
28 Double_t gEtaMin = -1.0;\r
29 Double_t gEtaMax = 1.0;\r
30 Double_t gPtMin = 0.1;\r
31 Double_t gPtMax = 100.0;\r
32 //=========Acceptance definition=========//\r
33 \r
34 //=========Acceptance filter=========//\r
35 Bool_t kUseAcceptanceFilter = kFALSE;\r
36 const char *gAcceptanceFilterFile = "efficiencyALICE.root";\r
37 //=========Acceptance filter=========//\r
38 \r
39 //=========Dynamical Correlations=========//\r
40 Bool_t kUseDynamicalCorrelations = kFALSE;\r
41 Double_t gDynamicalCorrelationsPercentage = 0.1;\r
42 //=========Dynamical Correlations=========//\r
43 \r
44 Bool_t kUseDebug = kFALSE;\r
45 \r
46 // Run macro used for the toy model analysis\r
47 // Author: Panos.Christakoglou@nikhef.nl\r
48 \r
49 //______________________________________________________________________________\r
50 void runBalanceFunctionToyModel(Int_t nEvents = 10,\r
51                                 Bool_t kUseAllCharges = kTRUE) {\r
52   TStopwatch timer;\r
53   timer.Start();\r
54 \r
55   // load libraries\r
56   gSystem->Load("libCore.so");        \r
57   gSystem->Load("libGeom.so");\r
58   gSystem->Load("libVMC.so");\r
59   gSystem->Load("libPhysics.so");\r
60   gSystem->Load("libTree.so");\r
61   gSystem->Load("libSTEERBase.so");\r
62   gSystem->Load("libESD.so");\r
63   gSystem->Load("libAOD.so");\r
64   gSystem->Load("libANALYSIS.so");\r
65   gSystem->Load("libANALYSISalice.so");\r
66   gSystem->Load("libEventMixing.so");\r
67   gSystem->Load("libPWGCFebye.so");\r
68   \r
69   //configure the bf objects\r
70   gROOT->LoadMacro("configBalanceFunctionAnalysis.C");\r
71   AliBalance *bf  = GetBalanceFunctionObject("MC");\r
72   AliBalance *bfs = GetBalanceFunctionObject("MC",kTRUE);\r
73   \r
74   //Configure the toy model object\r
75   AliAnalysisTaskToyModel *toyModelAnalysis = new AliAnalysisTaskToyModel();\r
76   if(kUseDebug) toyModelAnalysis->SetDebugFlag();\r
77   toyModelAnalysis->SetAnalysisObject(bf);\r
78   toyModelAnalysis->SetShufflingObject(bfs);\r
79   toyModelAnalysis->SetTotalMultiplicity(nTotalMultiplicityMean,nTotalMultiplicitySigma);\r
80   toyModelAnalysis->SetNetCharge(nNetChargeMean,nNetChargeSigma);\r
81   toyModelAnalysis->SetKinematicsCutsMC(gPtMin,gPtMax,gEtaMin,gEtaMax);\r
82 \r
83   if(kUseAllCharges) {\r
84     toyModelAnalysis->SetSpectraTemperatureForAllCharges(gAllChargesTemperature);\r
85     toyModelAnalysis->SetDirectedFlowForAllCharges(gDirectedFlow);\r
86     toyModelAnalysis->SetEllipticFlowForAllCharges(gEllipticFlow);\r
87     toyModelAnalysis->SetTriangularFlowForAllCharges(gTriangularFlow);\r
88     toyModelAnalysis->SetQuandrangularFlowForAllCharges(gQuandrangularFlow);\r
89     toyModelAnalysis->SetPentangularFlowForAllCharges(gPentangularFlow);\r
90   }\r
91   else {\r
92     //Pions\r
93     toyModelAnalysis->SetPionPercentage(gPionPercentage);\r
94     toyModelAnalysis->SetSpectraTemperatureForPions(gPionTemperature);\r
95     toyModelAnalysis->SetDirectedFlowForPions(gDirectedFlow);\r
96     toyModelAnalysis->SetEllipticFlowForPions(gEllipticFlow);\r
97     toyModelAnalysis->SetTriangularFlowForPions(gTriangularFlow);\r
98     toyModelAnalysis->SetQuandrangularFlowForPions(gQuandrangularFlow);\r
99     toyModelAnalysis->SetPentangularFlowForPions(gPentangularFlow);\r
100 \r
101     //Kaons\r
102     toyModelAnalysis->SetKaonPercentage(gKaonPercentage);\r
103     toyModelAnalysis->SetSpectraTemperatureForKaons(gKaonTemperature);\r
104     toyModelAnalysis->SetDirectedFlowForKaons(gDirectedFlow);\r
105     toyModelAnalysis->SetEllipticFlowForKaons(gEllipticFlow);\r
106     toyModelAnalysis->SetTriangularFlowForKaons(gTriangularFlow);\r
107     toyModelAnalysis->SetQuandrangularFlowForKaons(gQuandrangularFlow);\r
108     toyModelAnalysis->SetPentangularFlowForKaons(gPentangularFlow);\r
109 \r
110     //Protons\r
111     toyModelAnalysis->SetProtonPercentage(gProtonPercentage);\r
112     toyModelAnalysis->SetSpectraTemperatureForProtons(gProtonTemperature);\r
113     toyModelAnalysis->SetDirectedFlowForProtons(gDirectedFlow);\r
114     toyModelAnalysis->SetEllipticFlowForProtons(gEllipticFlow);\r
115     toyModelAnalysis->SetTriangularFlowForProtons(gTriangularFlow);\r
116     toyModelAnalysis->SetQuandrangularFlowForProtons(gQuandrangularFlow);\r
117     toyModelAnalysis->SetPentangularFlowForProtons(gPentangularFlow);\r
118   }\r
119 \r
120   //Dynamical correlations\r
121   if(kUseDynamicalCorrelations) \r
122     toyModelAnalysis->SetCorrelationPercentage(gDynamicalCorrelationsPercentage);\r
123 \r
124   //Acceptance filter\r
125   if(kUseAcceptanceFilter) {\r
126     TFile *gParamFile = TFile::Open(gAcceptanceFilterFile);\r
127     if((!gParamFile) || (!gParamFile->IsOpen())) {\r
128       Printf("File %s not found!!!",acceptanceFilename);\r
129       return;\r
130     }\r
131 \r
132     TString gParamName;\r
133     for(Int_t iCentrality = 0; iCentrality < numberOfCentralityBins; iCentrality++) {\r
134       gParamName = "gParamCentrality0";//centrality 0-5%\r
135       TF1 *gParameterization = dynamic_cast<TF1 *>(gParamFile->Get(gParamName.Data()));\r
136     }\r
137     toyModelAnalysis->SetAcceptanceParameterization(gParameterization);\r
138   }\r
139 \r
140   toyModelAnalysis->Init();\r
141   toyModelAnalysis->CreateOutputObjects();\r
142   toyModelAnalysis->Run(nEvents);\r
143   toyModelAnalysis->FinishOutput();\r
144 \r
145   // Print real and CPU time used for analysis:  \r
146   timer.Stop();\r
147   timer.Print();\r
148 }\r
149 \r