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