]>
Commit | Line | Data |
---|---|---|
daf66719 | 1 | ///////////////////////////////////////////////////////////////////////////////////////////// |
2 | // | |
3 | // AddTask* macro for flow analysis | |
4 | // Creates a Flow Event task and adds it to the analysis manager. | |
5 | // Sets the cuts using the correction framework (CORRFW) classes. | |
6 | // Also creates Flow Analysis tasks and connects them to the output of the flow event task. | |
7 | // | |
8 | ///////////////////////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | // Define the range for eta subevents (for SP method) | |
daf66719 | 11 | Double_t minA = -0.9; |
12 | Double_t maxA = -0.5; | |
13 | Double_t minB = 0.5; | |
14 | Double_t maxB = 0.9; | |
15 | ||
16 | // AFTERBURNER | |
17 | Bool_t useAfterBurner=kFALSE; | |
18 | Double_t v1=0.0; | |
19 | Double_t v2=0.0; | |
20 | Double_t v3=0.0; | |
21 | Double_t v4=0.0; | |
22 | Int_t numberOfTrackClones=0; //non-flow | |
23 | ||
24 | // Define a range of the detector to exclude | |
25 | Bool_t ExcludeRegion = kFALSE; | |
26 | Double_t excludeEtaMin = -0.; | |
27 | Double_t excludeEtaMax = 0.; | |
28 | Double_t excludePhiMin = 0.; | |
29 | Double_t excludePhiMax = 0.; | |
30 | ||
31 | // use physics selection class | |
32 | Bool_t UsePhysicsSelection = kTRUE; | |
33 | ||
076df7bf | 34 | // generate the control ntuple |
35 | Bool_t FillQAntuple=kFALSE; | |
32b846cd | 36 | Bool_t DoQAcorrelations=kFALSE; |
daf66719 | 37 | |
d178bd1f | 38 | // RUN SETTINGS |
39 | // Flow analysis method can be:(set to kTRUE or kFALSE) | |
40 | Bool_t MCEP = kTRUE; // correlation with Monte Carlo reaction plane | |
41 | Bool_t SP = kTRUE; // scalar product method (similar to eventplane method) | |
42 | Bool_t GFC = kTRUE; // cumulants based on generating function | |
43 | Bool_t QC = kTRUE; // cumulants using Q vectors | |
44 | Bool_t FQD = kTRUE; // fit of the distribution of the Q vector (only integrated v) | |
45 | Bool_t LYZ1SUM = kTRUE; // Lee Yang Zeroes using sum generating function (integrated v) | |
219286ba | 46 | Bool_t LYZ1PROD = kFALSE; // Lee Yang Zeroes using product generating function (integrated v) |
d178bd1f | 47 | Bool_t LYZ2SUM = kFALSE; // Lee Yang Zeroes using sum generating function (second pass differential v) |
48 | Bool_t LYZ2PROD = kFALSE; // Lee Yang Zeroes using product generating function (second pass differential v) | |
49 | Bool_t LYZEP = kFALSE; // Lee Yang Zeroes Event plane using sum generating function (gives eventplane + weight) | |
219286ba | 50 | Bool_t MH = kFALSE; // azimuthal correlators in mixed harmonics |
d178bd1f | 51 | Bool_t NL = kFALSE; // nested loops (for instance distribution of phi1-phi2 for all distinct pairs) |
52 | ||
53 | Bool_t METHODS[] = {SP,LYZ1SUM,LYZ1PROD,LYZ2SUM,LYZ2PROD,LYZEP,GFC,QC,FQD,MCEP,MH,NL}; | |
54 | ||
55 | // Boolean to use/not use weights for the Q vector | |
56 | Bool_t WEIGHTS[] = {kFALSE,kFALSE,kFALSE}; //Phi, v'(pt), v'(eta) | |
daf66719 | 57 | |
d178bd1f | 58 | // SETTING THE CUTS |
daf66719 | 59 | |
03d364db | 60 | //---------Data selection---------- |
12b2b8bc | 61 | //kMC, kGlobal, kESD_TPConly, kESD_SPDtracklet |
dc8887a1 | 62 | AliFlowTrackCuts::trackParameterType rptype = AliFlowTrackCuts::kGlobal; |
63 | AliFlowTrackCuts::trackParameterType poitype = AliFlowTrackCuts::kGlobal; | |
daf66719 | 64 | |
03d364db | 65 | //---------Parameter mixing-------- |
66 | //kPure - no mixing, kTrackWithMCkine, kTrackWithMCPID, kTrackWithMCpt | |
67 | AliFlowTrackCuts::trackParameterMix rpmix = AliFlowTrackCuts::kPure; | |
68 | AliFlowTrackCuts::trackParameterMix poimix = AliFlowTrackCuts::kPure; | |
69 | ||
70 | ||
27b5ccf2 | 71 | const char* rptypestr = AliFlowTrackCuts::GetParamTypeName(rptype); |
72 | const char* poitypestr = AliFlowTrackCuts::GetParamTypeName(poitype); | |
d178bd1f | 73 | |
7d9ab4fb | 74 | void AddTaskFlowCentrality( Float_t centrMin=0., |
75 | Float_t centrMax=100., | |
b0e1585b | 76 | TString fileNameBase="AnalysisResults", |
77 | Int_t binnumber=0 ) | |
daf66719 | 78 | { |
b0e1585b | 79 | TString fileName(fileNameBase); |
80 | fileName+=binnumber; | |
81 | fileName.Append(".root"); | |
d178bd1f | 82 | //=========================================================================== |
83 | printf("CREATE CUTS\n"); | |
0a91110b | 84 | cout << "Used for RP: "<< rptypestr << endl; |
85 | cout << "Used for POI: "<< poitypestr << endl; | |
d178bd1f | 86 | // EVENTS CUTS: |
87 | AliFlowEventCuts* cutsEvent = new AliFlowEventCuts(); | |
7d9ab4fb | 88 | cutsEvent->SetCentralityPercentileRange(centrMin,centrMax); |
89 | //cutsEvent->SetCentralityPercentileMethod(AliFlowEventCuts::kTPConly); | |
90 | cutsEvent->SetCentralityPercentileMethod(AliFlowEventCuts::kV0); | |
91 | //cutsEvent->SetCentralityPercentileMethod(AliFlowEventCuts::kSPDtracklets); | |
dc8887a1 | 92 | cutsEvent->SetNContributorsRange(2); |
b0e1585b | 93 | cutsEvent->SetPrimaryVertexZrange(-10.,10.); |
7d9ab4fb | 94 | cutsEvent->SetCutSPDvertexerAnomaly(kTRUE); //"Francesco's cut" |
d178bd1f | 95 | |
96 | // RP TRACK CUTS: | |
97 | AliFlowTrackCuts* cutsRP = new AliFlowTrackCuts(); | |
0a91110b | 98 | cutsRP->SetParamType(rptype); |
03d364db | 99 | cutsRP->SetParamMix(rpmix); |
dc8887a1 | 100 | cutsRP->SetPtRange(0.2,5.); |
101 | cutsRP->SetEtaRange(-0.7,0.7); | |
102 | //cutsRP->SetRequireCharge(kTRUE); | |
d178bd1f | 103 | //cutsRP->SetCharge(chargeRP); |
104 | //cutsRP->SetPID(PdgRP); | |
dc8887a1 | 105 | cutsRP->SetMinNClustersTPC(70); |
f33c7420 | 106 | cutsRP->SetMinChi2PerClusterTPC(0.2); |
7305f70f | 107 | cutsRP->SetMaxChi2PerClusterTPC(4.0); |
dc8887a1 | 108 | cutsRP->SetMinNClustersITS(2); |
f33c7420 | 109 | cutsRP->SetRequireITSRefit(kTRUE); |
110 | cutsRP->SetRequireTPCRefit(kTRUE); | |
d178bd1f | 111 | //cutsRP->SetMaxChi2PerClusterITS(1.e+09); |
f33c7420 | 112 | cutsRP->SetMaxDCAToVertexXY(0.3); |
113 | cutsRP->SetMaxDCAToVertexZ(0.3); | |
219286ba | 114 | //cutsRP->SetDCAToVertex2D(kTRUE); |
115 | //cutsRP->SetMaxNsigmaToVertex(1.e+10); | |
116 | //cutsRP->SetRequireSigmaToVertex(kFALSE); | |
dc8887a1 | 117 | cutsRP->SetAcceptKinkDaughters(kFALSE); |
d178bd1f | 118 | |
119 | // POI TRACK CUTS: | |
120 | AliFlowTrackCuts* cutsPOI = new AliFlowTrackCuts(); | |
0a91110b | 121 | cutsPOI->SetParamType(poitype); |
03d364db | 122 | cutsPOI->SetParamMix(poimix); |
dc8887a1 | 123 | cutsPOI->SetPtRange(0.0,10.); |
124 | cutsPOI->SetEtaRange(-1.2,1.2); | |
125 | //cutsPOI->SetRequireCharge(kTRUE); | |
d178bd1f | 126 | //cutsPOI->SetCharge(chargeRP); |
127 | //cutsPOI->SetPID(PdgRP); | |
dc8887a1 | 128 | cutsPOI->SetMinNClustersTPC(80); |
f33c7420 | 129 | cutsPOI->SetMinChi2PerClusterTPC(0.2); |
dc8887a1 | 130 | cutsPOI->SetMaxChi2PerClusterTPC(4.0); |
f33c7420 | 131 | cutsPOI->SetRequireITSRefit(kTRUE); |
132 | cutsPOI->SetRequireTPCRefit(kTRUE); | |
133 | cutsPOI->SetMinNClustersITS(2); | |
d178bd1f | 134 | //cutsPOI->SetMaxChi2PerClusterITS(1.e+09); |
f33c7420 | 135 | cutsPOI->SetMaxDCAToVertexXY(0.3); |
136 | cutsPOI->SetMaxDCAToVertexZ(0.3); | |
219286ba | 137 | //cutsPOI->SetDCAToVertex2D(kTRUE); |
138 | //cutsPOI->SetMaxNsigmaToVertex(1.e+10); | |
139 | //cutsPOI->SetRequireSigmaToVertex(kFALSE); | |
f33c7420 | 140 | cutsPOI->SetAcceptKinkDaughters(kFALSE); |
32b846cd | 141 | //cutsPOI->SetPID(AliPID::kProton, AliFlowTrackCuts::kTOFpid); |
142 | //cutsPOI->SetPID(AliPID::kPion, AliFlowTrackCuts::kTPCpid); | |
143 | //cutsPOI->SetPID(AliPID::kProton, AliFlowTrackCuts::kTPCTOFpid); | |
144 | //cutsPOI->SetTPCTOFpidCrossOverPt(0.4); | |
145 | ||
daf66719 | 146 | Bool_t useWeights = WEIGHTS[0] || WEIGHTS[1] || WEIGHTS[2]; |
147 | if (useWeights) cout<<"Weights are used"<<endl; | |
148 | else cout<<"Weights are not used"<<endl; | |
d178bd1f | 149 | |
daf66719 | 150 | // Get the pointer to the existing analysis manager via the static access method. |
151 | //============================================================================== | |
152 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
153 | if (!mgr) { | |
154 | Error("AddTaskFlowEvent", "No analysis manager to connect to."); | |
155 | return NULL; | |
d178bd1f | 156 | } |
daf66719 | 157 | |
158 | // Check the analysis type using the event handlers connected to the analysis | |
59dab33a | 159 | // manager. The availability of MC handler can also be checked here. |
daf66719 | 160 | //============================================================================== |
161 | if (!mgr->GetInputEventHandler()) { | |
162 | ::Error("AddTaskFlowEvent", "This task requires an input event handler"); | |
163 | return NULL; | |
164 | } | |
d178bd1f | 165 | |
daf66719 | 166 | // Open external input files |
167 | //=========================================================================== | |
168 | //weights: | |
169 | TFile *weightsFile = NULL; | |
170 | TList *weightsList = NULL; | |
171 | ||
172 | if(useWeights) { | |
173 | //open the file with the weights: | |
174 | weightsFile = TFile::Open("weights.root","READ"); | |
175 | if(weightsFile) { | |
176 | //access the list which holds the histos with weigths: | |
177 | weightsList = (TList*)weightsFile->Get("weights"); | |
178 | } | |
179 | else { | |
180 | cout<<" WARNING: the file <weights.root> with weights from the previous run was not available."<<endl; | |
181 | break; | |
182 | } | |
183 | } | |
d178bd1f | 184 | |
daf66719 | 185 | //LYZ2 |
186 | if (LYZ2SUM || LYZ2PROD) { | |
187 | //read the outputfile of the first run | |
188 | TString outputFileName = "AnalysisResults1.root"; | |
189 | TString pwd(gSystem->pwd()); | |
190 | pwd+="/"; | |
191 | pwd+=outputFileName.Data(); | |
192 | TFile *outputFile = NULL; | |
193 | if(gSystem->AccessPathName(pwd.Data(),kFileExists)) { | |
194 | cout<<"WARNING: You do not have an output file:"<<endl; | |
195 | cout<<" "<<pwd.Data()<<endl; | |
196 | exit(0); | |
d178bd1f | 197 | } else { outputFile = TFile::Open(pwd.Data(),"READ");} |
daf66719 | 198 | |
199 | if (LYZ2SUM){ | |
200 | // read the output directory from LYZ1SUM | |
201 | TString inputFileNameLYZ2SUM = "outputLYZ1SUManalysis" ; | |
12b2b8bc | 202 | inputFileNameLYZ2SUM += rptypestr; |
daf66719 | 203 | cout<<"The input directory is "<<inputFileNameLYZ2SUM.Data()<<endl; |
204 | TFile* fInputFileLYZ2SUM = (TFile*)outputFile->FindObjectAny(inputFileNameLYZ2SUM.Data()); | |
205 | if(!fInputFileLYZ2SUM || fInputFileLYZ2SUM->IsZombie()) { | |
206 | cerr << " ERROR: To run LYZ2SUM you need the output file from LYZ1SUM. This file is not there! Please run LYZ1SUM first." << endl ; | |
207 | break; | |
208 | } | |
209 | else { | |
210 | TList* fInputListLYZ2SUM = (TList*)fInputFileLYZ2SUM->Get("cobjLYZ1SUM"); | |
211 | if (!fInputListLYZ2SUM) {cout<<"list is NULL pointer!"<<endl;} | |
212 | } | |
213 | cout<<"LYZ2SUM input file/list read..."<<endl; | |
214 | } | |
215 | ||
216 | if (LYZ2PROD){ | |
217 | // read the output directory from LYZ1PROD | |
218 | TString inputFileNameLYZ2PROD = "outputLYZ1PRODanalysis" ; | |
12b2b8bc | 219 | inputFileNameLYZ2PROD += rptypestr; |
daf66719 | 220 | cout<<"The input directory is "<<inputFileNameLYZ2PROD.Data()<<endl; |
221 | TFile* fInputFileLYZ2PROD = (TFile*)outputFile->FindObjectAny(inputFileNameLYZ2PROD.Data()); | |
222 | if(!fInputFileLYZ2PROD || fInputFileLYZ2PROD->IsZombie()) { | |
223 | cerr << " ERROR: To run LYZ2PROD you need the output file from LYZ1PROD. This file is not there! Please run LYZ1PROD first." << endl ; | |
224 | break; | |
225 | } | |
226 | else { | |
227 | TList* fInputListLYZ2PROD = (TList*)fInputFileLYZ2PROD->Get("cobjLYZ1PROD"); | |
228 | if (!fInputListLYZ2PROD) {cout<<"list is NULL pointer!"<<endl;} | |
229 | } | |
230 | cout<<"LYZ2PROD input file/list read..."<<endl; | |
231 | } | |
232 | } | |
233 | ||
daf66719 | 234 | if (LYZEP) { |
235 | //read the outputfile of the second run | |
236 | TString outputFileName = "AnalysisResults2.root"; | |
237 | TString pwd(gSystem->pwd()); | |
238 | pwd+="/"; | |
239 | pwd+=outputFileName.Data(); | |
240 | TFile *outputFile = NULL; | |
241 | if(gSystem->AccessPathName(pwd.Data(),kFileExists)) { | |
242 | cout<<"WARNING: You do not have an output file:"<<endl; | |
243 | cout<<" "<<pwd.Data()<<endl; | |
244 | exit(0); | |
245 | } else { | |
246 | outputFile = TFile::Open(pwd.Data(),"READ"); | |
247 | } | |
d178bd1f | 248 | |
daf66719 | 249 | // read the output file from LYZ2SUM |
250 | TString inputFileNameLYZEP = "outputLYZ2SUManalysis" ; | |
12b2b8bc | 251 | inputFileNameLYZEP += rptypestr; |
daf66719 | 252 | cout<<"The input file is "<<inputFileNameLYZEP.Data()<<endl; |
253 | TFile* fInputFileLYZEP = (TFile*)outputFile->FindObjectAny(inputFileNameLYZEP.Data()); | |
254 | if(!fInputFileLYZEP || fInputFileLYZEP->IsZombie()) { | |
255 | cerr << " ERROR: To run LYZEP you need the output file from LYZ2SUM. This file is not there! Please run LYZ2SUM first." << endl ; | |
256 | break; | |
257 | } | |
258 | else { | |
259 | TList* fInputListLYZEP = (TList*)fInputFileLYZEP->Get("cobjLYZ2SUM"); | |
260 | if (!fInputListLYZEP) {cout<<"list is NULL pointer!"<<endl;} | |
261 | } | |
262 | cout<<"LYZEP input file/list read..."<<endl; | |
263 | } | |
264 | ||
265 | ||
266 | // Create the FMD task and add it to the manager | |
267 | //=========================================================================== | |
12b2b8bc | 268 | if (rptypestr == "FMD") { |
daf66719 | 269 | AliFMDAnalysisTaskSE *taskfmd = NULL; |
12b2b8bc | 270 | if (rptypestr == "FMD") { |
daf66719 | 271 | taskfmd = new AliFMDAnalysisTaskSE("TaskFMD"); |
272 | mgr->AddTask(taskfmd); | |
d178bd1f | 273 | |
daf66719 | 274 | AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance(); |
275 | pars->Init(); | |
276 | pars->SetProcessPrimary(kTRUE); //for MC only | |
277 | pars->SetProcessHits(kFALSE); | |
d178bd1f | 278 | |
daf66719 | 279 | //pars->SetRealData(kTRUE); //for real data |
280 | //pars->SetProcessPrimary(kFALSE); //for real data | |
daf66719 | 281 | } |
282 | } | |
283 | ||
daf66719 | 284 | // Create the task, add it to the manager. |
285 | //=========================================================================== | |
286 | AliAnalysisTaskFlowEvent *taskFE = NULL; | |
daf66719 | 287 | |
d178bd1f | 288 | if(useAfterBurner) |
daf66719 | 289 | { |
12b2b8bc | 290 | taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent","",kFALSE,1); |
daf66719 | 291 | taskFE->SetFlow(v1,v2,v3,v4); |
292 | taskFE->SetNonFlowNumberOfTrackClones(numberOfTrackClones); | |
293 | taskFE->SetAfterburnerOn(); | |
294 | } | |
12b2b8bc | 295 | else {taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent","",kFALSE); } |
d178bd1f | 296 | if (ExcludeRegion) { |
297 | taskFE->DefineDeadZone(excludeEtaMin, excludeEtaMax, excludePhiMin, excludePhiMax); | |
59dab33a | 298 | } |
d178bd1f | 299 | taskFE->SetSubeventEtaRange(minA, maxA, minB, maxB); |
300 | if (UsePhysicsSelection) { | |
dc8887a1 | 301 | //taskFE->SelectCollisionCandidates(AliVEvent::kUserDefined); |
a43776f2 | 302 | taskFE->SelectCollisionCandidates(AliVEvent::kMB); |
d178bd1f | 303 | cout<<"Using Physics Selection"<<endl; |
daf66719 | 304 | } |
d178bd1f | 305 | mgr->AddTask(taskFE); |
59dab33a | 306 | |
d178bd1f | 307 | // Pass cuts for RPs and POIs to the task: |
308 | taskFE->SetCutsEvent(cutsEvent); | |
309 | ||
59dab33a | 310 | // Pass cuts for RPs and POIs to the task: |
311 | taskFE->SetCutsRP(cutsRP); | |
312 | taskFE->SetCutsPOI(cutsPOI); | |
32b846cd | 313 | taskFE->SetTOFresolution(80); |
3958eee6 | 314 | |
7d9ab4fb | 315 | |
316 | ||
daf66719 | 317 | // Create the analysis tasks, add them to the manager. |
318 | //=========================================================================== | |
319 | if (SP){ | |
320 | AliAnalysisTaskScalarProduct *taskSP = new AliAnalysisTaskScalarProduct("TaskScalarProduct",WEIGHTS[0]); | |
321 | taskSP->SetRelDiffMsub(1.0); | |
219286ba | 322 | taskSP->SetApplyCorrectionForNUA(kTRUE); |
daf66719 | 323 | mgr->AddTask(taskSP); |
324 | } | |
325 | if (LYZ1SUM){ | |
326 | AliAnalysisTaskLeeYangZeros *taskLYZ1SUM = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZerosSUM",kTRUE); | |
327 | taskLYZ1SUM->SetFirstRunLYZ(kTRUE); | |
328 | taskLYZ1SUM->SetUseSumLYZ(kTRUE); | |
329 | mgr->AddTask(taskLYZ1SUM); | |
330 | } | |
331 | if (LYZ1PROD){ | |
332 | AliAnalysisTaskLeeYangZeros *taskLYZ1PROD = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZerosPROD",kTRUE); | |
333 | taskLYZ1PROD->SetFirstRunLYZ(kTRUE); | |
334 | taskLYZ1PROD->SetUseSumLYZ(kFALSE); | |
335 | mgr->AddTask(taskLYZ1PROD); | |
336 | } | |
337 | if (LYZ2SUM){ | |
338 | AliAnalysisTaskLeeYangZeros *taskLYZ2SUM = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZerosSUM",kFALSE); | |
339 | taskLYZ2SUM->SetFirstRunLYZ(kFALSE); | |
340 | taskLYZ2SUM->SetUseSumLYZ(kTRUE); | |
341 | mgr->AddTask(taskLYZ2SUM); | |
342 | } | |
343 | if (LYZ2PROD){ | |
344 | AliAnalysisTaskLeeYangZeros *taskLYZ2PROD = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZerosPROD",kFALSE); | |
345 | taskLYZ2PROD->SetFirstRunLYZ(kFALSE); | |
346 | taskLYZ2PROD->SetUseSumLYZ(kFALSE); | |
347 | mgr->AddTask(taskLYZ2PROD); | |
348 | } | |
349 | if (LYZEP){ | |
350 | AliAnalysisTaskLYZEventPlane *taskLYZEP = new AliAnalysisTaskLYZEventPlane("TaskLYZEventPlane"); | |
351 | mgr->AddTask(taskLYZEP); | |
352 | } | |
353 | if (GFC){ | |
354 | AliAnalysisTaskCumulants *taskGFC = new AliAnalysisTaskCumulants("TaskCumulants",useWeights); | |
355 | taskGFC->SetUsePhiWeights(WEIGHTS[0]); | |
356 | taskGFC->SetUsePtWeights(WEIGHTS[1]); | |
357 | taskGFC->SetUseEtaWeights(WEIGHTS[2]); | |
358 | mgr->AddTask(taskGFC); | |
359 | } | |
360 | if (QC){ | |
361 | AliAnalysisTaskQCumulants *taskQC = new AliAnalysisTaskQCumulants("TaskQCumulants",useWeights); | |
362 | taskQC->SetUsePhiWeights(WEIGHTS[0]); | |
363 | taskQC->SetUsePtWeights(WEIGHTS[1]); | |
364 | taskQC->SetUseEtaWeights(WEIGHTS[2]); | |
365 | taskQC->SetnBinsMult(10000); | |
366 | taskQC->SetMinMult(0.); | |
367 | taskQC->SetMaxMult(10000.); | |
219286ba | 368 | taskQC->SetApplyCorrectionForNUA(kTRUE); |
daf66719 | 369 | mgr->AddTask(taskQC); |
370 | } | |
371 | if (FQD){ | |
372 | AliAnalysisTaskFittingQDistribution *taskFQD = new AliAnalysisTaskFittingQDistribution("TaskFittingQDistribution",kFALSE); | |
373 | taskFQD->SetUsePhiWeights(WEIGHTS[0]); | |
374 | taskFQD->SetqMin(0.); | |
375 | taskFQD->SetqMax(1000.); | |
376 | taskFQD->SetqNbins(10000); | |
377 | mgr->AddTask(taskFQD); | |
378 | } | |
379 | if (MCEP){ | |
380 | AliAnalysisTaskMCEventPlane *taskMCEP = new AliAnalysisTaskMCEventPlane("TaskMCEventPlane"); | |
381 | mgr->AddTask(taskMCEP); | |
382 | } | |
383 | if (MH){ | |
384 | AliAnalysisTaskMixedHarmonics *taskMH = new AliAnalysisTaskMixedHarmonics("TaskMixedHarmonics",useWeights); | |
385 | taskMH->SetHarmonic(1); // n in cos[n(phi1+phi2-2phi3)] and cos[n(psi1+psi2-2phi3)] | |
dc8887a1 | 386 | taskMH->SetNoOfMultipicityBins(10000); |
387 | taskMH->SetMultipicityBinWidth(1.); | |
388 | taskMH->SetMinMultiplicity(1.); | |
daf66719 | 389 | taskMH->SetCorrectForDetectorEffects(kTRUE); |
390 | taskMH->SetEvaluateDifferential3pCorrelator(kFALSE); // evaluate <<cos[n(psi1+psi2-2phi3)]>> (Remark: two nested loops) | |
391 | taskMH->SetOppositeChargesPOI(kFALSE); // POIs psi1 and psi2 in cos[n(psi1+psi2-2phi3)] will have opposite charges | |
392 | mgr->AddTask(taskMH); | |
393 | } | |
394 | if (NL){ | |
395 | AliAnalysisTaskNestedLoops *taskNL = new AliAnalysisTaskNestedLoops("TaskNestedLoops",useWeights); | |
396 | taskNL->SetHarmonic(1); // n in cos[n(phi1+phi2-2phi3)] and cos[n(psi1+psi2-2phi3)] | |
397 | taskNL->SetEvaluateNestedLoopsForRAD(kTRUE); // RAD = Relative Angle Distribution | |
398 | taskNL->SetEvaluateNestedLoopsForMH(kTRUE); // evalaute <<cos[n(phi1+phi2-2phi3)]>> (Remark: three nested loops) | |
399 | taskNL->SetEvaluateDifferential3pCorrelator(kFALSE); // evaluate <<cos[n(psi1+psi2-2phi3)]>> (Remark: three nested loops) | |
400 | taskNL->SetOppositeChargesPOI(kFALSE); // POIs psi1 and psi2 in cos[n(psi1+psi2-2phi3)] will have opposite charges | |
401 | mgr->AddTask(taskNL); | |
402 | } | |
b0e1585b | 403 | |
404 | AliAnalysisTaskQAflow* taskQAflow = new AliAnalysisTaskQAflow("TaskQAflow"); | |
405 | taskQAflow->SetEventCuts(cutsEvent); | |
406 | taskQAflow->SetTrackCuts(cutsRP); | |
076df7bf | 407 | taskQAflow->SetFillNTuple(FillQAntuple); |
32b846cd | 408 | taskQAflow->SetDoCorrelations(DoQAcorrelations); |
b0e1585b | 409 | mgr->AddTask(taskQAflow); |
daf66719 | 410 | |
411 | // Create the output container for the data produced by the task | |
412 | // Connect to the input and output containers | |
413 | //=========================================================================== | |
414 | AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer(); | |
415 | ||
12b2b8bc | 416 | if (rptypestr == "FMD") { |
daf66719 | 417 | AliAnalysisDataContainer *coutputFMD = |
d178bd1f | 418 | mgr->CreateContainer(Form("BackgroundCorrected_%s",fileName.Data()), TList::Class(), AliAnalysisManager::kExchangeContainer); |
daf66719 | 419 | //input and output taskFMD |
420 | mgr->ConnectInput(taskfmd, 0, cinput1); | |
421 | mgr->ConnectOutput(taskfmd, 1, coutputFMD); | |
422 | //input into taskFE | |
423 | mgr->ConnectInput(taskFE,1,coutputFMD); | |
424 | } | |
425 | ||
426 | AliAnalysisDataContainer *coutputFE = | |
427 | mgr->CreateContainer(Form("cobjFlowEventSimple_%s",fileName.Data()), AliFlowEventSimple::Class(),AliAnalysisManager::kExchangeContainer); | |
428 | mgr->ConnectInput(taskFE,0,cinput1); | |
429 | mgr->ConnectOutput(taskFE,1,coutputFE); | |
d178bd1f | 430 | |
daf66719 | 431 | |
432 | // Create the output containers for the data produced by the analysis tasks | |
433 | // Connect to the input and output containers | |
434 | //=========================================================================== | |
435 | if (useWeights) { | |
d178bd1f | 436 | AliAnalysisDataContainer *cinputWeights = mgr->CreateContainer(Form("cobjWeights_%s",fileName.Data()), |
437 | TList::Class(),AliAnalysisManager::kInputContainer); | |
daf66719 | 438 | } |
439 | ||
440 | if(SP) { | |
441 | TString outputSP = fileName; | |
442 | outputSP += ":outputSPanalysis"; | |
12b2b8bc | 443 | outputSP+= rptypestr; |
d178bd1f | 444 | AliAnalysisDataContainer *coutputSP = mgr->CreateContainer(Form("cobjSP_%s",fileName.Data()), |
445 | TList::Class(),AliAnalysisManager::kOutputContainer,outputSP); | |
daf66719 | 446 | mgr->ConnectInput(taskSP,0,coutputFE); |
447 | mgr->ConnectOutput(taskSP,1,coutputSP); | |
448 | if (WEIGHTS[0]) { | |
449 | mgr->ConnectInput(taskSP,1,cinputWeights); | |
450 | cinputWeights->SetData(weightsList); | |
d178bd1f | 451 | } |
daf66719 | 452 | } |
453 | if(LYZ1SUM) { | |
454 | TString outputLYZ1SUM = fileName; | |
455 | outputLYZ1SUM += ":outputLYZ1SUManalysis"; | |
12b2b8bc | 456 | outputLYZ1SUM+= rptypestr; |
d178bd1f | 457 | AliAnalysisDataContainer *coutputLYZ1SUM = mgr->CreateContainer(Form("cobjLYZ1SUM_%s",fileName.Data()), |
458 | TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ1SUM); | |
459 | mgr->ConnectInput(taskLYZ1SUM,0,coutputFE); | |
460 | mgr->ConnectOutput(taskLYZ1SUM,1,coutputLYZ1SUM); | |
daf66719 | 461 | } |
462 | if(LYZ1PROD) { | |
463 | TString outputLYZ1PROD = fileName; | |
464 | outputLYZ1PROD += ":outputLYZ1PRODanalysis"; | |
12b2b8bc | 465 | outputLYZ1PROD+= rptypestr; |
d178bd1f | 466 | AliAnalysisDataContainer *coutputLYZ1PROD = mgr->CreateContainer(Form("cobjLYZ1PROD_%s",fileName.Data()), |
467 | TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ1PROD); | |
daf66719 | 468 | mgr->ConnectInput(taskLYZ1PROD,0,coutputFE); |
469 | mgr->ConnectOutput(taskLYZ1PROD,1,coutputLYZ1PROD); | |
470 | } | |
471 | if(LYZ2SUM) { | |
d178bd1f | 472 | AliAnalysisDataContainer *cinputLYZ2SUM = mgr->CreateContainer(Form("cobjLYZ2SUMin_%s",fileName.Data()), |
473 | TList::Class(),AliAnalysisManager::kInputContainer); | |
daf66719 | 474 | TString outputLYZ2SUM = fileName; |
475 | outputLYZ2SUM += ":outputLYZ2SUManalysis"; | |
12b2b8bc | 476 | outputLYZ2SUM+= rptypestr; |
daf66719 | 477 | |
d178bd1f | 478 | AliAnalysisDataContainer *coutputLYZ2SUM = mgr->CreateContainer(Form("cobjLYZ2SUM_%s",fileName.Data()), |
479 | TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ2SUM); | |
daf66719 | 480 | mgr->ConnectInput(taskLYZ2SUM,0,coutputFE); |
481 | mgr->ConnectInput(taskLYZ2SUM,1,cinputLYZ2SUM); | |
482 | mgr->ConnectOutput(taskLYZ2SUM,1,coutputLYZ2SUM); | |
483 | cinputLYZ2SUM->SetData(fInputListLYZ2SUM); | |
484 | } | |
485 | if(LYZ2PROD) { | |
d178bd1f | 486 | AliAnalysisDataContainer *cinputLYZ2PROD = mgr->CreateContainer(Form("cobjLYZ2PRODin_%s",fileName.Data()), |
487 | TList::Class(),AliAnalysisManager::kInputContainer); | |
daf66719 | 488 | TString outputLYZ2PROD = fileName; |
489 | outputLYZ2PROD += ":outputLYZ2PRODanalysis"; | |
12b2b8bc | 490 | outputLYZ2PROD+= rptypestr; |
daf66719 | 491 | |
d178bd1f | 492 | AliAnalysisDataContainer *coutputLYZ2PROD = mgr->CreateContainer(Form("cobjLYZ2PROD_%s",fileName.Data()), |
493 | TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ2PROD); | |
daf66719 | 494 | mgr->ConnectInput(taskLYZ2PROD,0,coutputFE); |
495 | mgr->ConnectInput(taskLYZ2PROD,1,cinputLYZ2PROD); | |
496 | mgr->ConnectOutput(taskLYZ2PROD,1,coutputLYZ2PROD); | |
497 | cinputLYZ2PROD->SetData(fInputListLYZ2PROD); | |
498 | } | |
499 | if(LYZEP) { | |
d178bd1f | 500 | AliAnalysisDataContainer *cinputLYZEP = mgr->CreateContainer(Form("cobjLYZEPin_%s",fileName.Data()), |
501 | TList::Class(),AliAnalysisManager::kInputContainer); | |
daf66719 | 502 | TString outputLYZEP = fileName; |
503 | outputLYZEP += ":outputLYZEPanalysis"; | |
12b2b8bc | 504 | outputLYZEP+= rptypestr; |
daf66719 | 505 | |
d178bd1f | 506 | AliAnalysisDataContainer *coutputLYZEP = mgr->CreateContainer(Form("cobjLYZEP_%s",fileName.Data()), |
507 | TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZEP); | |
daf66719 | 508 | mgr->ConnectInput(taskLYZEP,0,coutputFE); |
509 | mgr->ConnectInput(taskLYZEP,1,cinputLYZEP); | |
510 | mgr->ConnectOutput(taskLYZEP,1,coutputLYZEP); | |
511 | cinputLYZEP->SetData(fInputListLYZEP); | |
512 | } | |
513 | if(GFC) { | |
514 | TString outputGFC = fileName; | |
515 | outputGFC += ":outputGFCanalysis"; | |
12b2b8bc | 516 | outputGFC+= rptypestr; |
daf66719 | 517 | |
d178bd1f | 518 | AliAnalysisDataContainer *coutputGFC = mgr->CreateContainer(Form("cobjGFC_%s",fileName.Data()), |
519 | TList::Class(),AliAnalysisManager::kOutputContainer,outputGFC); | |
daf66719 | 520 | mgr->ConnectInput(taskGFC,0,coutputFE); |
521 | mgr->ConnectOutput(taskGFC,1,coutputGFC); | |
522 | if (useWeights) { | |
523 | mgr->ConnectInput(taskGFC,1,cinputWeights); | |
524 | cinputWeights->SetData(weightsList); | |
525 | } | |
526 | } | |
527 | if(QC) { | |
528 | TString outputQC = fileName; | |
529 | outputQC += ":outputQCanalysis"; | |
12b2b8bc | 530 | outputQC+= rptypestr; |
daf66719 | 531 | |
d178bd1f | 532 | AliAnalysisDataContainer *coutputQC = mgr->CreateContainer(Form("cobjQC_%s",fileName.Data()), |
533 | TList::Class(),AliAnalysisManager::kOutputContainer,outputQC); | |
daf66719 | 534 | mgr->ConnectInput(taskQC,0,coutputFE); |
535 | mgr->ConnectOutput(taskQC,1,coutputQC); | |
536 | if (useWeights) { | |
537 | mgr->ConnectInput(taskQC,1,cinputWeights); | |
538 | cinputWeights->SetData(weightsList); | |
d178bd1f | 539 | } |
daf66719 | 540 | } |
541 | if(FQD) { | |
542 | TString outputFQD = fileName; | |
543 | outputFQD += ":outputFQDanalysis"; | |
12b2b8bc | 544 | outputFQD+= rptypestr; |
daf66719 | 545 | |
d178bd1f | 546 | AliAnalysisDataContainer *coutputFQD = mgr->CreateContainer(Form("cobjFQD_%s",fileName.Data()), |
547 | TList::Class(),AliAnalysisManager::kOutputContainer,outputFQD); | |
daf66719 | 548 | mgr->ConnectInput(taskFQD,0,coutputFE); |
549 | mgr->ConnectOutput(taskFQD,1,coutputFQD); | |
550 | if(useWeights) { | |
551 | mgr->ConnectInput(taskFQD,1,cinputWeights); | |
552 | cinputWeights->SetData(weightsList); | |
553 | } | |
554 | } | |
555 | if(MCEP) { | |
556 | TString outputMCEP = fileName; | |
557 | outputMCEP += ":outputMCEPanalysis"; | |
12b2b8bc | 558 | outputMCEP+= rptypestr; |
daf66719 | 559 | |
d178bd1f | 560 | AliAnalysisDataContainer *coutputMCEP = mgr->CreateContainer(Form("cobjMCEP_%s",fileName.Data()), |
561 | TList::Class(),AliAnalysisManager::kOutputContainer,outputMCEP); | |
562 | mgr->ConnectInput(taskMCEP,0,coutputFE); | |
daf66719 | 563 | mgr->ConnectOutput(taskMCEP,1,coutputMCEP); |
564 | } | |
565 | if(MH) { | |
566 | TString outputMH = fileName; | |
567 | outputMH += ":outputMHanalysis"; | |
12b2b8bc | 568 | outputMH += rptypestr; |
daf66719 | 569 | |
d178bd1f | 570 | AliAnalysisDataContainer *coutputMH = mgr->CreateContainer(Form("cobjMH_%s",fileName.Data()), |
571 | TList::Class(),AliAnalysisManager::kOutputContainer,outputMH); | |
daf66719 | 572 | mgr->ConnectInput(taskMH,0,coutputFE); |
573 | mgr->ConnectOutput(taskMH,1,coutputMH); | |
574 | //if (useWeights) { | |
575 | // mgr->ConnectInput(taskMH,1,cinputWeights); | |
576 | // cinputWeights->SetData(weightsList); | |
577 | //} | |
578 | } | |
579 | if(NL) { | |
580 | TString outputNL = fileName; | |
581 | outputNL += ":outputNLanalysis"; | |
12b2b8bc | 582 | outputNL += rptypestr; |
d178bd1f | 583 | |
584 | AliAnalysisDataContainer *coutputNL = mgr->CreateContainer(Form("cobjNL_%s",fileName.Data()), | |
585 | TList::Class(),AliAnalysisManager::kOutputContainer,outputNL); | |
586 | mgr->ConnectInput(taskNL,0,coutputFE); | |
587 | mgr->ConnectOutput(taskNL,1,coutputNL); | |
daf66719 | 588 | //if (useWeights) { |
589 | // mgr->ConnectInput(taskNL,1,cinputWeights); | |
590 | // cinputWeights->SetData(weightsList); | |
591 | //} | |
592 | } | |
b0e1585b | 593 | |
594 | TString taskQAoutputFileName(fileNameBase); | |
595 | taskQAoutputFileName+=binnumber; | |
596 | taskQAoutputFileName.Append("_QA.root"); | |
0532e062 | 597 | AliAnalysisDataContainer* coutputQAtask = mgr->CreateContainer(Form("flowQA_%i",binnumber), |
b0e1585b | 598 | TObjArray::Class(), |
599 | AliAnalysisManager::kOutputContainer, | |
6f59a2c4 | 600 | taskQAoutputFileName); |
076df7bf | 601 | AliAnalysisDataContainer* coutputQAtaskTree = mgr->CreateContainer(Form("flowQAntuple_%i",binnumber), |
62384e34 | 602 | TNtuple::Class(), |
076df7bf | 603 | AliAnalysisManager::kOutputContainer, |
6f59a2c4 | 604 | taskQAoutputFileName); |
b0e1585b | 605 | mgr->ConnectInput(taskQAflow,0,mgr->GetCommonInputContainer()); |
076df7bf | 606 | mgr->ConnectInput(taskQAflow,1,coutputFE); |
b0e1585b | 607 | mgr->ConnectOutput(taskQAflow,1,coutputQAtask); |
32b846cd | 608 | if (FillQAntuple) mgr->ConnectOutput(taskQAflow,2,coutputQAtaskTree); |
daf66719 | 609 | } |
610 | ||
611 | ||
612 | ||
613 | ||
614 |