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