]>
Commit | Line | Data |
---|---|---|
62ae620e | 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 | AliAnalysisTaskFlowEvent *AddTaskFlowCentralityBayesian(Float_t centrMin=0., | |
11 | Float_t centrMax=100., | |
12 | TString fileNameBase="output", | |
13 | Int_t specie=2, | |
14 | Int_t charge=0, | |
15 | Int_t harmonic=2, | |
16 | Bool_t doQA=kFALSE, | |
17 | TString uniqueStr="" ) | |
18 | { | |
19 | // Define the range for eta subevents (for SP method) | |
20 | Double_t minA = -0.9; | |
21 | Double_t maxA = -0.5; | |
22 | Double_t minB = 0.5; | |
23 | Double_t maxB = 0.9; | |
24 | ||
25 | // AFTERBURNER | |
26 | Bool_t useAfterBurner=kFALSE; | |
27 | Double_t v1=0.0; | |
28 | Double_t v2=0.0; | |
29 | Double_t v3=0.0; | |
30 | Double_t v4=0.0; | |
31 | Int_t numberOfTrackClones=0; //non-flow | |
32 | ||
33 | // Define a range of the detector to exclude | |
34 | Bool_t ExcludeRegion = kFALSE; | |
35 | Double_t excludeEtaMin = -0.; | |
36 | Double_t excludeEtaMax = 0.; | |
37 | Double_t excludePhiMin = 0.; | |
38 | Double_t excludePhiMax = 0.; | |
39 | ||
40 | // use physics selection class | |
41 | Bool_t UsePhysicsSelection = kTRUE; | |
42 | ||
43 | // QA | |
44 | Bool_t runQAtask=kFALSE; | |
45 | Bool_t FillQAntuple=kFALSE; | |
46 | Bool_t DoQAcorrelations=kFALSE; | |
47 | ||
48 | // RUN SETTINGS | |
49 | // Flow analysis method can be:(set to kTRUE or kFALSE) | |
50 | Bool_t MCEP = kFALSE; // correlation with Monte Carlo reaction plane | |
51 | Bool_t SP = kTRUE; // scalar product method (similar to eventplane method) | |
52 | Bool_t GFC = kTRUE; // cumulants based on generating function | |
53 | Bool_t QC = kTRUE; // cumulants using Q vectors | |
54 | Bool_t FQD = kTRUE; // fit of the distribution of the Q vector (only integrated v) | |
55 | Bool_t LYZ1SUM = kTRUE; // Lee Yang Zeroes using sum generating function (integrated v) | |
56 | Bool_t LYZ1PROD = kFALSE; // Lee Yang Zeroes using product generating function (integrated v) | |
57 | Bool_t LYZ2SUM = kFALSE; // Lee Yang Zeroes using sum generating function (second pass differential v) | |
58 | Bool_t LYZ2PROD = kFALSE; // Lee Yang Zeroes using product generating function (second pass differential v) | |
59 | Bool_t LYZEP = kFALSE; // Lee Yang Zeroes Event plane using sum generating function (gives eventplane + weight) | |
60 | Bool_t MH = kFALSE; // azimuthal correlators in mixed harmonics | |
61 | Bool_t NL = kFALSE; // nested loops (for instance distribution of phi1-phi2 for all distinct pairs) | |
62 | ||
63 | Bool_t METHODS[] = {SP,LYZ1SUM,LYZ1PROD,LYZ2SUM,LYZ2PROD,LYZEP,GFC,QC,FQD,MCEP,MH,NL}; | |
64 | ||
65 | // Boolean to use/not use weights for the Q vector | |
66 | Bool_t WEIGHTS[] = {kFALSE,kFALSE,kFALSE}; //Phi, v'(pt), v'(eta) | |
67 | ||
68 | // SETTING THE CUTS | |
69 | ||
70 | //---------Data selection---------- | |
71 | //kMC, kGlobal, kESD_TPConly, kESD_SPDtracklet, kPMD | |
72 | AliFlowTrackCuts::trackParameterType rptype = AliFlowTrackCuts::kGlobal; | |
73 | AliFlowTrackCuts::trackParameterType poitype = AliFlowTrackCuts::kGlobal; | |
74 | ||
75 | //---------Parameter mixing-------- | |
76 | //kPure - no mixing, kTrackWithMCkine, kTrackWithMCPID, kTrackWithMCpt | |
77 | AliFlowTrackCuts::trackParameterMix rpmix = AliFlowTrackCuts::kPure; | |
78 | AliFlowTrackCuts::trackParameterMix poimix = AliFlowTrackCuts::kPure; | |
79 | ||
80 | ||
81 | const char* rptypestr = AliFlowTrackCuts::GetParamTypeName(rptype); | |
82 | const char* poitypestr = AliFlowTrackCuts::GetParamTypeName(poitype); | |
83 | ||
84 | TString fileName(fileNameBase); | |
85 | fileName.Append(".root"); | |
86 | //=========================================================================== | |
87 | printf("CREATE CUTS\n"); | |
88 | cout << "Used for RP: "<< rptypestr << endl; | |
89 | cout << "Used for POI: "<< poitypestr << endl; | |
90 | ||
91 | // EVENTS CUTS: | |
92 | AliFlowEventCuts* cutsEvent = new AliFlowEventCuts("event cuts"); | |
93 | cutsEvent->SetCentralityPercentileRange(centrMin,centrMax); | |
94 | cutsEvent->SetCentralityPercentileMethod(AliFlowEventCuts::kV0); | |
95 | cutsEvent->SetRefMultMethod(AliFlowEventCuts::kV0); | |
96 | //cutsEvent->SetCentralityPercentileMethod(AliFlowEventCuts::kSPD1tracklets); | |
97 | cutsEvent->SetNContributorsRange(2); | |
98 | cutsEvent->SetPrimaryVertexZrange(-7.,7.); | |
99 | cutsEvent->SetCutSPDvertexerAnomaly(); //"Francesco's cut" | |
100 | cutsEvent->SetCutZDCtiming(); | |
101 | cutsEvent->SetCutTPCmultiplicityOutliers(); | |
102 | //cutsEvent->SetUseCentralityUnchecked(); | |
103 | //cutsEvent->SetQA(doQA); | |
104 | ||
105 | // RP TRACK CUTS: | |
106 | AliFlowTrackCuts* cutsRP = new AliFlowTrackCuts("TPConlyRP"); | |
107 | cutsRP->SetParamType(rptype); | |
108 | cutsRP->SetParamMix(rpmix); | |
109 | cutsRP->SetPtRange(0.2,5.); | |
110 | cutsRP->SetEtaRange(-0.8,0.8); | |
111 | cutsRP->SetMinNClustersTPC(70); | |
112 | cutsRP->SetMinChi2PerClusterTPC(0.1); | |
113 | cutsRP->SetMaxChi2PerClusterTPC(4.0); | |
114 | cutsRP->SetMinNClustersITS(2); | |
115 | cutsRP->SetRequireITSRefit(kTRUE); | |
116 | cutsRP->SetRequireTPCRefit(kTRUE); | |
117 | cutsRP->SetMaxDCAToVertexXY(0.3); | |
118 | cutsRP->SetMaxDCAToVertexZ(0.3); | |
119 | cutsRP->SetAcceptKinkDaughters(kFALSE); | |
120 | // cutsRP->SetMinimalTPCdedx(10.); | |
121 | // cutsRP->SetQA(doQA); | |
122 | ||
123 | // POI TRACK CUTS: | |
124 | AliFlowTrackCuts* cutsPOI = new AliFlowTrackCuts("GlobalPOI"); | |
125 | ||
126 | // Set priors as a function of centrality | |
127 | Float_t centr = (centrMin+centrMax)*0.5; | |
128 | cutsPOI->SetPriors(centr); | |
129 | ||
130 | cutsPOI->SetParamType(poitype); | |
131 | cutsPOI->SetParamMix(poimix); | |
132 | cutsPOI->SetPtRange(0.0,10.); | |
133 | cutsPOI->SetEtaRange(-0.8,0.8); | |
134 | //cutsPOI->SetRequireCharge(kTRUE); | |
135 | //cutsPOI->SetPID(PdgRP); | |
136 | ||
137 | // track cuts for PID | |
138 | cutsPOI->SetMinNClustersTPC(70); | |
139 | cutsPOI->SetMinChi2PerClusterTPC(0.1); | |
140 | cutsPOI->SetMaxChi2PerClusterTPC(4.0); | |
141 | cutsPOI->SetRequireITSRefit(kTRUE); | |
142 | cutsPOI->SetRequireTPCRefit(kTRUE); | |
143 | cutsPOI->SetMinNClustersITS(2); | |
144 | //cutsPOI->SetMaxChi2PerClusterITS(1.e+09); | |
145 | cutsPOI->SetMaxDCAToVertexXY(0.3); | |
146 | cutsPOI->SetMaxDCAToVertexZ(0.3); | |
147 | //cutsPOI->SetDCAToVertex2D(kTRUE); | |
148 | //cutsPOI->SetMaxNsigmaToVertex(1.e+10); | |
149 | //cutsPOI->SetRequireSigmaToVertex(kFALSE); | |
150 | cutsPOI->SetAcceptKinkDaughters(kFALSE); | |
151 | //cutsPOI->SetPID(AliPID::kProton, AliFlowTrackCuts::kTOFpid); | |
152 | //cutsPOI->SetPID(AliPID::kPion, AliFlowTrackCuts::kTPCpid); | |
153 | //cutsPOI->SetPID(AliPID::kProton, AliFlowTrackCuts::kTPCdedx); | |
154 | //cutsPOI->SetPID(AliPID::kProton, AliFlowTrackCuts::kTOFbeta); | |
155 | cutsPOI->SetRequireStrictTOFTPCagreement(); | |
156 | ||
157 | // Bayesian PID | |
158 | if(specie==0) | |
159 | cutsPOI->SetPID(AliPID::kElectron, AliFlowTrackCuts::kTOFbayesian,0.8); | |
160 | else if(specie==1) | |
161 | cutsPOI->SetPID(AliPID::kMuon, AliFlowTrackCuts::kTOFbayesian,0.8); | |
162 | else if(specie==2) | |
163 | cutsPOI->SetPID(AliPID::kPion, AliFlowTrackCuts::kTOFbayesian,0.8); | |
164 | else if(specie==3) | |
165 | cutsPOI->SetPID(AliPID::kKaon, AliFlowTrackCuts::kTOFbayesian,0.8); | |
166 | else if(specie==4) | |
167 | cutsPOI->SetPID(AliPID::kProton, AliFlowTrackCuts::kTOFbayesian,0.8); | |
168 | ||
169 | //not implemented yet | |
170 | // else if(specie==10) | |
171 | // cutsPOI->SetPID(AliPID::kDeuteron, AliFlowTrackCuts::kTOFbayesian,0.8); | |
172 | ||
173 | if(charge !=0) cutsPOI->SetCharge(charge); | |
174 | ||
175 | //iexample: francesco's tunig TPC Bethe Bloch for data (for TOF+TPC analysis): | |
176 | Float_t centrCur = (centrMax + centrMin) * 0.5; | |
177 | Float_t AlephParameters[5]; | |
178 | Float_t mip=51; | |
179 | ||
180 | if(centrCur < 10){ | |
181 | AlephParameters[0] = 7.68595e-02; | |
182 | AlephParameters[1] = 1.01781e+01; | |
183 | AlephParameters[2] = 9.34864e-06; | |
184 | AlephParameters[3] = 2.38588e+00; | |
185 | AlephParameters[4] = 2.13599e+00; | |
186 | } | |
187 | else if(centrCur < 20){ | |
188 | AlephParameters[0] = 7.79393e-02; | |
189 | AlephParameters[1] = 1.00337e+01; | |
190 | AlephParameters[2] = 9.34864e-06; | |
191 | AlephParameters[3] = 2.40323e+00; | |
192 | AlephParameters[4] = 2.13072e+00; | |
193 | } | |
194 | else if(centrCur < 30){ | |
195 | AlephParameters[0] = 7.87563e-02; | |
196 | AlephParameters[1] = 9.91265e+00; | |
197 | AlephParameters[2] = 9.34864e-06; | |
198 | AlephParameters[3] = 2.42280e+00; | |
199 | AlephParameters[4] = 2.13296e+00; | |
200 | } | |
201 | else if(centrCur < 40){ | |
202 | AlephParameters[0] = 8.23869e-02; | |
203 | AlephParameters[1] = 9.50211e+00; | |
204 | AlephParameters[2] = 1.40230e-05; | |
205 | AlephParameters[3] = 2.42899e+00; | |
206 | AlephParameters[4] = 2.05572e+00; | |
207 | } | |
208 | else if(centrCur < 50){ | |
209 | AlephParameters[0] = 8.25626e-02; | |
210 | AlephParameters[1] = 9.47698e+00; | |
211 | AlephParameters[2] = 1.40230e-05; | |
212 | AlephParameters[3] = 2.43731e+00; | |
213 | AlephParameters[4] = 2.06060e+00; | |
214 | } | |
215 | else if(centrCur < 60){ | |
216 | AlephParameters[0] = 8.27528e-02; | |
217 | AlephParameters[1] = 9.44676e+00; | |
218 | AlephParameters[2] = 1.40230e-05; | |
219 | AlephParameters[3] = 2.44433e+00; | |
220 | AlephParameters[4] = 2.06498e+00; | |
221 | } | |
222 | else if(centrCur < 70){ | |
223 | AlephParameters[0] = 8.29615e-02; | |
224 | AlephParameters[1] = 9.41909e+00; | |
225 | AlephParameters[2] = 1.40230e-05; | |
226 | AlephParameters[3] = 2.44894e+00; | |
227 | AlephParameters[4] = 2.06676e+00; | |
228 | } | |
229 | else if(centrCur < 80){ | |
230 | AlephParameters[0] = 8.31397e-02; | |
231 | AlephParameters[1] = 9.41126e+00; | |
232 | AlephParameters[2] = 1.40230e-05; | |
233 | AlephParameters[3] = 2.44848e+00; | |
234 | AlephParameters[4] = 2.06326e+00; | |
235 | } | |
236 | else{ | |
237 | AlephParameters[0] = 8.38910e-02; | |
238 | AlephParameters[1] = 9.30736e+00; | |
239 | AlephParameters[2] = 1.40230e-05; | |
240 | AlephParameters[3] = 2.45844e+00; | |
241 | AlephParameters[4] = 2.07334e+00; | |
242 | } | |
243 | ||
244 | cutsPOI->GetESDpid().GetTPCResponse().SetBetheBlochParameters(AlephParameters[0],AlephParameters[1],AlephParameters[2],AlephParameters[3],AlephParameters[4]); | |
245 | cutsPOI->GetESDpid().GetTPCResponse().SetMip(mip); | |
246 | ||
247 | TString outputSlotName(""); | |
248 | outputSlotName+=uniqueStr; | |
249 | outputSlotName+=Form("V%i ",harmonic); | |
250 | outputSlotName+=cutsRP->GetName(); | |
251 | outputSlotName+=" "; | |
252 | outputSlotName+=cutsPOI->GetName(); | |
253 | outputSlotName+=Form(" %.0f-",centrMin); | |
254 | outputSlotName+=Form("%.0f ",centrMax); | |
255 | outputSlotName+=AliFlowTrackCuts::PIDsourceName(sourcePID); | |
256 | outputSlotName+=" "; | |
257 | outputSlotName+=AliPID::ParticleName(particleType); | |
258 | if (charge<0) outputSlotName+="-"; | |
259 | if (charge>0) outputSlotName+="+"; | |
260 | ||
261 | Bool_t useWeights = WEIGHTS[0] || WEIGHTS[1] || WEIGHTS[2]; | |
262 | if (useWeights) cout<<"Weights are used"<<endl; | |
263 | else cout<<"Weights are not used"<<endl; | |
264 | ||
265 | // Get the pointer to the existing analysis manager via the static access method. | |
266 | //============================================================================== | |
267 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
268 | if (!mgr) { | |
269 | Error("AddTaskFlowEvent", "No analysis manager to connect to."); | |
270 | return NULL; | |
271 | } | |
272 | ||
273 | // Check the analysis type using the event handlers connected to the analysis | |
274 | // manager. The availability of MC handler can also be checked here. | |
275 | //============================================================================== | |
276 | if (!mgr->GetInputEventHandler()) { | |
277 | ::Error("AddTaskFlowEvent", "This task requires an input event handler"); | |
278 | return NULL; | |
279 | } | |
280 | ||
281 | // Open external input files | |
282 | //=========================================================================== | |
283 | //weights: | |
284 | TFile *weightsFile = NULL; | |
285 | TList *weightsList = NULL; | |
286 | ||
287 | if(useWeights) { | |
288 | //open the file with the weights: | |
289 | weightsFile = TFile::Open("weights.root","READ"); | |
290 | if(weightsFile) { | |
291 | //access the list which holds the histos with weigths: | |
292 | weightsList = (TList*)weightsFile->Get("weights"); | |
293 | } | |
294 | else { | |
295 | cout<<" WARNING: the file <weights.root> with weights from the previous run was not available."<<endl; | |
296 | break; | |
297 | } | |
298 | } | |
299 | ||
300 | //LYZ2 | |
301 | if (LYZ2SUM || LYZ2PROD) { | |
302 | //read the outputfile of the first run | |
303 | TString outputFileName = "AnalysisResults1.root"; | |
304 | TString pwd(gSystem->pwd()); | |
305 | pwd+="/"; | |
306 | pwd+=outputFileName.Data(); | |
307 | TFile *outputFile = NULL; | |
308 | if(gSystem->AccessPathName(pwd.Data(),kFileExists)) { | |
309 | cout<<"WARNING: You do not have an output file:"<<endl; | |
310 | cout<<" "<<pwd.Data()<<endl; | |
311 | exit(0); | |
312 | } else { outputFile = TFile::Open(pwd.Data(),"READ");} | |
313 | ||
314 | if (LYZ2SUM){ | |
315 | // read the output directory from LYZ1SUM | |
316 | TString inputFileNameLYZ2SUM = "outputLYZ1SUManalysis" ; | |
317 | inputFileNameLYZ2SUM += rptypestr; | |
318 | cout<<"The input directory is "<<inputFileNameLYZ2SUM.Data()<<endl; | |
319 | TFile* fInputFileLYZ2SUM = (TFile*)outputFile->FindObjectAny(inputFileNameLYZ2SUM.Data()); | |
320 | if(!fInputFileLYZ2SUM || fInputFileLYZ2SUM->IsZombie()) { | |
321 | cerr << " ERROR: To run LYZ2SUM you need the output file from LYZ1SUM. This file is not there! Please run LYZ1SUM first." << endl ; | |
322 | break; | |
323 | } | |
324 | else { | |
325 | TList* fInputListLYZ2SUM = (TList*)fInputFileLYZ2SUM->Get("cobjLYZ1SUM"); | |
326 | if (!fInputListLYZ2SUM) {cout<<"list is NULL pointer!"<<endl;} | |
327 | } | |
328 | cout<<"LYZ2SUM input file/list read..."<<endl; | |
329 | } | |
330 | ||
331 | if (LYZ2PROD){ | |
332 | // read the output directory from LYZ1PROD | |
333 | TString inputFileNameLYZ2PROD = "outputLYZ1PRODanalysis" ; | |
334 | inputFileNameLYZ2PROD += rptypestr; | |
335 | cout<<"The input directory is "<<inputFileNameLYZ2PROD.Data()<<endl; | |
336 | TFile* fInputFileLYZ2PROD = (TFile*)outputFile->FindObjectAny(inputFileNameLYZ2PROD.Data()); | |
337 | if(!fInputFileLYZ2PROD || fInputFileLYZ2PROD->IsZombie()) { | |
338 | cerr << " ERROR: To run LYZ2PROD you need the output file from LYZ1PROD. This file is not there! Please run LYZ1PROD first." << endl ; | |
339 | break; | |
340 | } | |
341 | else { | |
342 | TList* fInputListLYZ2PROD = (TList*)fInputFileLYZ2PROD->Get("cobjLYZ1PROD"); | |
343 | if (!fInputListLYZ2PROD) {cout<<"list is NULL pointer!"<<endl;} | |
344 | } | |
345 | cout<<"LYZ2PROD input file/list read..."<<endl; | |
346 | } | |
347 | } | |
348 | ||
349 | if (LYZEP) { | |
350 | //read the outputfile of the second run | |
351 | TString outputFileName = "AnalysisResults2.root"; | |
352 | TString pwd(gSystem->pwd()); | |
353 | pwd+="/"; | |
354 | pwd+=outputFileName.Data(); | |
355 | TFile *outputFile = NULL; | |
356 | if(gSystem->AccessPathName(pwd.Data(),kFileExists)) { | |
357 | cout<<"WARNING: You do not have an output file:"<<endl; | |
358 | cout<<" "<<pwd.Data()<<endl; | |
359 | exit(0); | |
360 | } else { | |
361 | outputFile = TFile::Open(pwd.Data(),"READ"); | |
362 | } | |
363 | ||
364 | // read the output file from LYZ2SUM | |
365 | TString inputFileNameLYZEP = "outputLYZ2SUManalysis" ; | |
366 | inputFileNameLYZEP += rptypestr; | |
367 | cout<<"The input file is "<<inputFileNameLYZEP.Data()<<endl; | |
368 | TFile* fInputFileLYZEP = (TFile*)outputFile->FindObjectAny(inputFileNameLYZEP.Data()); | |
369 | if(!fInputFileLYZEP || fInputFileLYZEP->IsZombie()) { | |
370 | cerr << " ERROR: To run LYZEP you need the output file from LYZ2SUM. This file is not there! Please run LYZ2SUM first." << endl ; | |
371 | break; | |
372 | } | |
373 | else { | |
374 | TList* fInputListLYZEP = (TList*)fInputFileLYZEP->Get("cobjLYZ2SUM"); | |
375 | if (!fInputListLYZEP) {cout<<"list is NULL pointer!"<<endl;} | |
376 | } | |
377 | cout<<"LYZEP input file/list read..."<<endl; | |
378 | } | |
379 | ||
380 | ||
381 | // Create the FMD task and add it to the manager | |
382 | //=========================================================================== | |
383 | if (rptypestr == "FMD") { | |
384 | AliFMDAnalysisTaskSE *taskfmd = NULL; | |
385 | if (rptypestr == "FMD") { | |
386 | taskfmd = new AliFMDAnalysisTaskSE("TaskFMD"); | |
387 | mgr->AddTask(taskfmd); | |
388 | ||
389 | AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance(); | |
390 | pars->Init(); | |
391 | pars->SetProcessPrimary(kTRUE); //for MC only | |
392 | pars->SetProcessHits(kFALSE); | |
393 | ||
394 | //pars->SetRealData(kTRUE); //for real data | |
395 | //pars->SetProcessPrimary(kFALSE); //for real data | |
396 | } | |
397 | } | |
398 | ||
399 | // Create the task, add it to the manager. | |
400 | //=========================================================================== | |
401 | AliAnalysisTaskFlowEvent *taskFE = NULL; | |
402 | ||
403 | if(useAfterBurner) | |
404 | { | |
405 | taskFE = new AliAnalysisTaskFlowEvent(Form("TaskFlowEvent %s",outputSlotName.Data()),"",doQA,1); | |
406 | taskFE->SetFlow(v1,v2,v3,v4); | |
407 | taskFE->SetNonFlowNumberOfTrackClones(numberOfTrackClones); | |
408 | taskFE->SetAfterburnerOn(); | |
409 | } | |
410 | else {taskFE = new AliAnalysisTaskFlowEvent(Form("TaskFlowEvent %s",outputSlotName.Data()),"",doQA); } | |
411 | if (ExcludeRegion) { | |
412 | taskFE->DefineDeadZone(excludeEtaMin, excludeEtaMax, excludePhiMin, excludePhiMax); | |
413 | } | |
414 | taskFE->SetSubeventEtaRange(minA, maxA, minB, maxB); | |
415 | if (UsePhysicsSelection) { | |
416 | //taskFE->SelectCollisionCandidates(AliVEvent::kUserDefined); | |
417 | taskFE->SelectCollisionCandidates(AliVEvent::kMB); | |
418 | cout<<"Using Physics Selection"<<endl; | |
419 | } | |
420 | mgr->AddTask(taskFE); | |
421 | ||
422 | // Pass cuts for RPs and POIs to the task: | |
423 | taskFE->SetCutsEvent(cutsEvent); | |
424 | ||
425 | // Pass cuts for RPs and POIs to the task: | |
426 | taskFE->SetCutsRP(cutsRP); | |
427 | taskFE->SetCutsPOI(cutsPOI); | |
644f1368 | 428 | if (cutsRP->GetParamType()==AliFlowTrackCuts::kV0) |
429 | { | |
430 | //TODO: since this is set in a static object all analyses in an analysis train | |
431 | //will be affected. | |
432 | taskFE->SetHistWeightvsPhiMin(0.); | |
433 | taskFE->SetHistWeightvsPhiMax(200.); | |
434 | } | |
62ae620e | 435 | |
436 | // Create the analysis tasks, add them to the manager. | |
437 | //=========================================================================== | |
438 | if (SP){ | |
439 | AliAnalysisTaskScalarProduct *taskSP = new AliAnalysisTaskScalarProduct("TaskScalarProduct",WEIGHTS[0]); | |
440 | taskSP->SetRelDiffMsub(1.0); | |
441 | taskSP->SetApplyCorrectionForNUA(kFALSE); | |
442 | taskSP->SetHarmonic(harmonic); // default is v2 | |
443 | mgr->AddTask(taskSP); | |
444 | } | |
445 | if (LYZ1SUM){ | |
446 | AliAnalysisTaskLeeYangZeros *taskLYZ1SUM = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZerosSUM",kTRUE); | |
447 | taskLYZ1SUM->SetFirstRunLYZ(kTRUE); | |
448 | taskLYZ1SUM->SetUseSumLYZ(kTRUE); | |
449 | mgr->AddTask(taskLYZ1SUM); | |
450 | } | |
451 | if (LYZ1PROD){ | |
452 | AliAnalysisTaskLeeYangZeros *taskLYZ1PROD = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZerosPROD",kTRUE); | |
453 | taskLYZ1PROD->SetFirstRunLYZ(kTRUE); | |
454 | taskLYZ1PROD->SetUseSumLYZ(kFALSE); | |
455 | mgr->AddTask(taskLYZ1PROD); | |
456 | } | |
457 | if (LYZ2SUM){ | |
458 | AliAnalysisTaskLeeYangZeros *taskLYZ2SUM = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZerosSUM",kFALSE); | |
459 | taskLYZ2SUM->SetFirstRunLYZ(kFALSE); | |
460 | taskLYZ2SUM->SetUseSumLYZ(kTRUE); | |
461 | mgr->AddTask(taskLYZ2SUM); | |
462 | } | |
463 | if (LYZ2PROD){ | |
464 | AliAnalysisTaskLeeYangZeros *taskLYZ2PROD = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZerosPROD",kFALSE); | |
465 | taskLYZ2PROD->SetFirstRunLYZ(kFALSE); | |
466 | taskLYZ2PROD->SetUseSumLYZ(kFALSE); | |
467 | mgr->AddTask(taskLYZ2PROD); | |
468 | } | |
469 | if (LYZEP){ | |
470 | AliAnalysisTaskLYZEventPlane *taskLYZEP = new AliAnalysisTaskLYZEventPlane("TaskLYZEventPlane"); | |
471 | mgr->AddTask(taskLYZEP); | |
472 | } | |
473 | if (GFC){ | |
474 | AliAnalysisTaskCumulants *taskGFC = new AliAnalysisTaskCumulants("TaskCumulants",useWeights); | |
475 | taskGFC->SetUsePhiWeights(WEIGHTS[0]); | |
476 | taskGFC->SetUsePtWeights(WEIGHTS[1]); | |
477 | taskGFC->SetUseEtaWeights(WEIGHTS[2]); | |
478 | taskGFC->SetHarmonic(harmonic); | |
479 | mgr->AddTask(taskGFC); | |
480 | } | |
481 | if (QC){ | |
482 | AliAnalysisTaskQCumulants *taskQC = new AliAnalysisTaskQCumulants("TaskQCumulants",useWeights); | |
483 | taskQC->SetUsePhiWeights(WEIGHTS[0]); | |
484 | taskQC->SetUsePtWeights(WEIGHTS[1]); | |
485 | taskQC->SetUseEtaWeights(WEIGHTS[2]); | |
486 | taskQC->SetCalculateCumulantsVsM(kFALSE); | |
487 | taskQC->SetnBinsMult(10000); | |
488 | taskQC->SetMinMult(0.); | |
489 | taskQC->SetMaxMult(10000.); | |
490 | taskQC->SetHarmonic(harmonic); // default is v2 | |
491 | taskQC->SetApplyCorrectionForNUA(kFALSE); | |
492 | taskQC->SetFillMultipleControlHistograms(kFALSE); | |
493 | mgr->AddTask(taskQC); | |
494 | } | |
495 | if (FQD){ | |
496 | AliAnalysisTaskFittingQDistribution *taskFQD = new AliAnalysisTaskFittingQDistribution("TaskFittingQDistribution",kFALSE); | |
497 | taskFQD->SetUsePhiWeights(WEIGHTS[0]); | |
498 | taskFQD->SetqMin(0.); | |
499 | taskFQD->SetqMax(1000.); | |
500 | taskFQD->SetqNbins(10000); | |
501 | mgr->AddTask(taskFQD); | |
502 | } | |
503 | if (MCEP){ | |
504 | AliAnalysisTaskMCEventPlane *taskMCEP = new AliAnalysisTaskMCEventPlane("TaskMCEventPlane"); | |
505 | taskMCEP->SetHarmonic(harmonic); | |
506 | mgr->AddTask(taskMCEP); | |
507 | } | |
508 | if (MH){ | |
509 | AliAnalysisTaskMixedHarmonics *taskMH = new AliAnalysisTaskMixedHarmonics("TaskMixedHarmonics",useWeights); | |
510 | taskMH->SetHarmonic(harmonic); // n in cos[n(phi1+phi2-2phi3)] and cos[n(psi1+psi2-2phi3)] | |
511 | taskMH->SetNoOfMultipicityBins(10000); | |
512 | taskMH->SetMultipicityBinWidth(1.); | |
513 | taskMH->SetMinMultiplicity(1.); | |
514 | taskMH->SetCorrectForDetectorEffects(kTRUE); | |
515 | taskMH->SetEvaluateDifferential3pCorrelator(kFALSE); // evaluate <<cos[n(psi1+psi2-2phi3)]>> (Remark: two nested loops) | |
516 | taskMH->SetOppositeChargesPOI(kFALSE); // POIs psi1 and psi2 in cos[n(psi1+psi2-2phi3)] will have opposite charges | |
517 | mgr->AddTask(taskMH); | |
518 | } | |
519 | if (NL){ | |
520 | AliAnalysisTaskNestedLoops *taskNL = new AliAnalysisTaskNestedLoops("TaskNestedLoops",useWeights); | |
521 | taskNL->SetHarmonic(harmonic); // n in cos[n(phi1+phi2-2phi3)] and cos[n(psi1+psi2-2phi3)] | |
522 | taskNL->SetEvaluateNestedLoopsForRAD(kTRUE); // RAD = Relative Angle Distribution | |
523 | taskNL->SetEvaluateNestedLoopsForMH(kTRUE); // evalaute <<cos[n(phi1+phi2-2phi3)]>> (Remark: three nested loops) | |
524 | taskNL->SetEvaluateDifferential3pCorrelator(kFALSE); // evaluate <<cos[n(psi1+psi2-2phi3)]>> (Remark: three nested loops) | |
525 | taskNL->SetOppositeChargesPOI(kFALSE); // POIs psi1 and psi2 in cos[n(psi1+psi2-2phi3)] will have opposite charges | |
526 | mgr->AddTask(taskNL); | |
527 | } | |
528 | ||
529 | // Create the output container for the data produced by the task | |
530 | // Connect to the input and output containers | |
531 | //=========================================================================== | |
532 | AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer(); | |
533 | ||
534 | if (rptypestr == "FMD") { | |
535 | AliAnalysisDataContainer *coutputFMD = | |
536 | mgr->CreateContainer(Form("BackgroundCorrected_%s",centralityName.Data()), TList::Class(), AliAnalysisManager::kExchangeContainer); | |
537 | //input and output taskFMD | |
538 | mgr->ConnectInput(taskfmd, 0, cinput1); | |
539 | mgr->ConnectOutput(taskfmd, 1, coutputFMD); | |
540 | //input into taskFE | |
541 | mgr->ConnectInput(taskFE,1,coutputFMD); | |
542 | } | |
543 | ||
544 | AliAnalysisDataContainer *coutputFE = | |
545 | mgr->CreateContainer(Form("cobjFlowEventSimple_%s",centralityName.Data()),AliFlowEventSimple::Class(),AliAnalysisManager::kExchangeContainer); | |
546 | mgr->ConnectInput(taskFE,0,cinput1); | |
547 | mgr->ConnectOutput(taskFE,1,coutputFE); | |
548 | ||
549 | if (taskFE->GetQAOn()) | |
550 | { | |
551 | TString outputQA = fileName; | |
552 | outputQA += ":QA"; | |
553 | AliAnalysisDataContainer* coutputFEQA = | |
554 | mgr->CreateContainer(Form("QA %s",outputSlotName.Data()), TList::Class(),AliAnalysisManager::kOutputContainer,outputQA); | |
555 | mgr->ConnectOutput(taskFE,2,coutputFEQA); | |
556 | } | |
557 | ||
558 | // Create the output containers for the data produced by the analysis tasks | |
559 | // Connect to the input and output containers | |
560 | //=========================================================================== | |
561 | if (useWeights) { | |
562 | AliAnalysisDataContainer *cinputWeights = mgr->CreateContainer(Form("cobjWeights_%s",centralityName.Data()), | |
563 | TList::Class(),AliAnalysisManager::kInputContainer); | |
564 | } | |
565 | ||
566 | if(SP) { | |
567 | TString outputSP = fileName; | |
568 | outputSP += ":outputSPanalysis"; | |
569 | outputSP+= rptypestr; | |
570 | AliAnalysisDataContainer *coutputSP = mgr->CreateContainer(Form("cobjSP_%s",centralityName.Data()), | |
571 | TList::Class(),AliAnalysisManager::kOutputContainer,outputSP); | |
572 | mgr->ConnectInput(taskSP,0,coutputFE); | |
573 | mgr->ConnectOutput(taskSP,1,coutputSP); | |
574 | if (WEIGHTS[0]) { | |
575 | mgr->ConnectInput(taskSP,1,cinputWeights); | |
576 | cinputWeights->SetData(weightsList); | |
577 | } | |
578 | } | |
579 | if(LYZ1SUM) { | |
580 | TString outputLYZ1SUM = fileName; | |
581 | outputLYZ1SUM += ":outputLYZ1SUManalysis"; | |
582 | outputLYZ1SUM+= rptypestr; | |
583 | AliAnalysisDataContainer *coutputLYZ1SUM = mgr->CreateContainer(Form("cobjLYZ1SUM_%s",centralityName.Data()), | |
584 | TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ1SUM); | |
585 | mgr->ConnectInput(taskLYZ1SUM,0,coutputFE); | |
586 | mgr->ConnectOutput(taskLYZ1SUM,1,coutputLYZ1SUM); | |
587 | } | |
588 | if(LYZ1PROD) { | |
589 | TString outputLYZ1PROD = fileName; | |
590 | outputLYZ1PROD += ":outputLYZ1PRODanalysis"; | |
591 | outputLYZ1PROD+= rptypestr; | |
592 | AliAnalysisDataContainer *coutputLYZ1PROD = mgr->CreateContainer(Form("cobjLYZ1PROD_%s",centralityName.Data()), | |
593 | TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ1PROD); | |
594 | mgr->ConnectInput(taskLYZ1PROD,0,coutputFE); | |
595 | mgr->ConnectOutput(taskLYZ1PROD,1,coutputLYZ1PROD); | |
596 | } | |
597 | if(LYZ2SUM) { | |
598 | AliAnalysisDataContainer *cinputLYZ2SUM = mgr->CreateContainer(Form("cobjLYZ2SUMin_%s",centralityName.Data()), | |
599 | TList::Class(),AliAnalysisManager::kInputContainer); | |
600 | TString outputLYZ2SUM = fileName; | |
601 | outputLYZ2SUM += ":outputLYZ2SUManalysis"; | |
602 | outputLYZ2SUM+= rptypestr; | |
603 | ||
604 | AliAnalysisDataContainer *coutputLYZ2SUM = mgr->CreateContainer(Form("cobjLYZ2SUM_%s",centralityName.Data()), | |
605 | TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ2SUM); | |
606 | mgr->ConnectInput(taskLYZ2SUM,0,coutputFE); | |
607 | mgr->ConnectInput(taskLYZ2SUM,1,cinputLYZ2SUM); | |
608 | mgr->ConnectOutput(taskLYZ2SUM,1,coutputLYZ2SUM); | |
609 | cinputLYZ2SUM->SetData(fInputListLYZ2SUM); | |
610 | } | |
611 | if(LYZ2PROD) { | |
612 | AliAnalysisDataContainer *cinputLYZ2PROD = mgr->CreateContainer(Form("cobjLYZ2PRODin_%s",centralityName.Data()), | |
613 | TList::Class(),AliAnalysisManager::kInputContainer); | |
614 | TString outputLYZ2PROD = fileName; | |
615 | outputLYZ2PROD += ":outputLYZ2PRODanalysis"; | |
616 | outputLYZ2PROD+= rptypestr; | |
617 | ||
618 | AliAnalysisDataContainer *coutputLYZ2PROD = mgr->CreateContainer(Form("cobjLYZ2PROD_%s",centralityName.Data()), | |
619 | TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ2PROD); | |
620 | mgr->ConnectInput(taskLYZ2PROD,0,coutputFE); | |
621 | mgr->ConnectInput(taskLYZ2PROD,1,cinputLYZ2PROD); | |
622 | mgr->ConnectOutput(taskLYZ2PROD,1,coutputLYZ2PROD); | |
623 | cinputLYZ2PROD->SetData(fInputListLYZ2PROD); | |
624 | } | |
625 | if(LYZEP) { | |
626 | AliAnalysisDataContainer *cinputLYZEP = mgr->CreateContainer(Form("cobjLYZEPin_%s",centralityName.Data()), | |
627 | TList::Class(),AliAnalysisManager::kInputContainer); | |
628 | TString outputLYZEP = fileName; | |
629 | outputLYZEP += ":outputLYZEPanalysis"; | |
630 | outputLYZEP+= rptypestr; | |
631 | ||
632 | AliAnalysisDataContainer *coutputLYZEP = mgr->CreateContainer(Form("cobjLYZEP_%s",centralityName.Data()), | |
633 | TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZEP); | |
634 | mgr->ConnectInput(taskLYZEP,0,coutputFE); | |
635 | mgr->ConnectInput(taskLYZEP,1,cinputLYZEP); | |
636 | mgr->ConnectOutput(taskLYZEP,1,coutputLYZEP); | |
637 | cinputLYZEP->SetData(fInputListLYZEP); | |
638 | } | |
639 | if(GFC) { | |
640 | TString outputGFC = fileName; | |
641 | outputGFC += ":outputGFCanalysis"; | |
642 | outputGFC+= rptypestr; | |
643 | ||
644 | AliAnalysisDataContainer *coutputGFC = mgr->CreateContainer(Form("cobjGFC_%s",centralityName.Data()), | |
645 | TList::Class(),AliAnalysisManager::kOutputContainer,outputGFC); | |
646 | mgr->ConnectInput(taskGFC,0,coutputFE); | |
647 | mgr->ConnectOutput(taskGFC,1,coutputGFC); | |
648 | if (useWeights) { | |
649 | mgr->ConnectInput(taskGFC,1,cinputWeights); | |
650 | cinputWeights->SetData(weightsList); | |
651 | } | |
652 | } | |
653 | if(QC) { | |
654 | TString outputQC = fileName; | |
655 | outputQC += ":outputQCanalysis"; | |
656 | outputQC+= rptypestr; | |
657 | ||
658 | AliAnalysisDataContainer *coutputQC = mgr->CreateContainer(Form("cobjQC_%s",centralityName.Data()), | |
659 | TList::Class(),AliAnalysisManager::kOutputContainer,outputQC); | |
660 | mgr->ConnectInput(taskQC,0,coutputFE); | |
661 | mgr->ConnectOutput(taskQC,1,coutputQC); | |
662 | if (useWeights) { | |
663 | mgr->ConnectInput(taskQC,1,cinputWeights); | |
664 | cinputWeights->SetData(weightsList); | |
665 | } | |
666 | } | |
667 | if(FQD) { | |
668 | TString outputFQD = fileName; | |
669 | outputFQD += ":outputFQDanalysis"; | |
670 | outputFQD+= rptypestr; | |
671 | ||
672 | AliAnalysisDataContainer *coutputFQD = mgr->CreateContainer(Form("cobjFQD_%s",centralityName.Data()), | |
673 | TList::Class(),AliAnalysisManager::kOutputContainer,outputFQD); | |
674 | mgr->ConnectInput(taskFQD,0,coutputFE); | |
675 | mgr->ConnectOutput(taskFQD,1,coutputFQD); | |
676 | if(useWeights) { | |
677 | mgr->ConnectInput(taskFQD,1,cinputWeights); | |
678 | cinputWeights->SetData(weightsList); | |
679 | } | |
680 | } | |
681 | if(MCEP) { | |
682 | TString outputMCEP = fileName; | |
683 | outputMCEP += ":outputMCEPanalysis"; | |
684 | outputMCEP+= rptypestr; | |
685 | ||
686 | AliAnalysisDataContainer *coutputMCEP = mgr->CreateContainer(Form("cobjMCEP_%s",centralityName.Data()), | |
687 | TList::Class(),AliAnalysisManager::kOutputContainer,outputMCEP); | |
688 | mgr->ConnectInput(taskMCEP,0,coutputFE); | |
689 | mgr->ConnectOutput(taskMCEP,1,coutputMCEP); | |
690 | } | |
691 | if(MH) { | |
692 | TString outputMH = fileName; | |
693 | outputMH += ":outputMHanalysis"; | |
694 | outputMH += rptypestr; | |
695 | ||
696 | AliAnalysisDataContainer *coutputMH = mgr->CreateContainer(Form("cobjMH_%s",centralityName.Data()), | |
697 | TList::Class(),AliAnalysisManager::kOutputContainer,outputMH); | |
698 | mgr->ConnectInput(taskMH,0,coutputFE); | |
699 | mgr->ConnectOutput(taskMH,1,coutputMH); | |
700 | //if (useWeights) { | |
701 | // mgr->ConnectInput(taskMH,1,cinputWeights); | |
702 | // cinputWeights->SetData(weightsList); | |
703 | //} | |
704 | } | |
705 | if(NL) { | |
706 | TString outputNL = fileName; | |
707 | outputNL += ":outputNLanalysis"; | |
708 | outputNL += rptypestr; | |
709 | ||
710 | AliAnalysisDataContainer *coutputNL = mgr->CreateContainer(Form("cobjNL_%s",centralityName.Data()), | |
711 | TList::Class(),AliAnalysisManager::kOutputContainer,outputNL); | |
712 | mgr->ConnectInput(taskNL,0,coutputFE); | |
713 | mgr->ConnectOutput(taskNL,1,coutputNL); | |
714 | //if (useWeights) { | |
715 | // mgr->ConnectInput(taskNL,1,cinputWeights); | |
716 | // cinputWeights->SetData(weightsList); | |
717 | //} | |
718 | } | |
719 | ||
720 | /////////////////////////////////////////////////////////////////////////////////////////// | |
721 | if (runQAtask) | |
722 | { | |
723 | AliAnalysisTaskQAflow* taskQAflow = new AliAnalysisTaskQAflow("TaskQAflow"); | |
724 | taskQAflow->SetEventCuts(cutsEvent); | |
725 | taskQAflow->SetTrackCuts(cutsRP); | |
726 | taskQAflow->SetFillNTuple(FillQAntuple); | |
727 | taskQAflow->SetDoCorrelations(DoQAcorrelations); | |
728 | mgr->AddTask(taskQAflow); | |
729 | ||
730 | Printf("centralityName %s",centralityName.Data()); | |
731 | TString taskQAoutputFileName(fileNameBase); | |
732 | taskQAoutputFileName.Append("_QA.root"); | |
733 | AliAnalysisDataContainer* coutputQAtask = mgr->CreateContainer(Form("flowQA_%s",centralityName.Data()), | |
734 | TObjArray::Class(), | |
735 | AliAnalysisManager::kOutputContainer, | |
736 | taskQAoutputFileName); | |
737 | AliAnalysisDataContainer* coutputQAtaskTree = mgr->CreateContainer(Form("flowQAntuple_%s",centralityName.Data()), | |
738 | TNtuple::Class(), | |
739 | AliAnalysisManager::kOutputContainer, | |
740 | taskQAoutputFileName); | |
741 | mgr->ConnectInput(taskQAflow,0,mgr->GetCommonInputContainer()); | |
742 | mgr->ConnectInput(taskQAflow,1,coutputFE); | |
743 | mgr->ConnectOutput(taskQAflow,1,coutputQAtask); | |
744 | if (FillQAntuple) mgr->ConnectOutput(taskQAflow,2,coutputQAtaskTree); | |
745 | } | |
746 | ||
747 | return taskFE; | |
748 | } | |
749 | ||
750 | ||
751 | ||
752 | ||
753 |