]>
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 AddTaskFlowCentralityKinkQaMunu( Float_t centrMin=0., | |
11 | Float_t centrMax=100., | |
12 | TString fileNameBase="output", | |
13 | AliPID::EParticleType particleType=AliPID::kUnknown, | |
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 | { | |
21 | // Define the range for eta subevents (for SP method) | |
22 | Double_t minA = -0.9; | |
23 | Double_t maxA = -0.4; | |
24 | Double_t minB = 0.4; | |
25 | Double_t maxB = 0.9; | |
26 | TString totalQvectorSP="Qa"; //["Qa"|"Qb"|"QaQb"] | |
27 | Double_t poiMinEta=0.4; | |
28 | Double_t poiMaxEta=0.9; | |
29 | ||
30 | ||
31 | // AFTERBURNER | |
32 | Bool_t useAfterBurner=kFALSE; | |
33 | Double_t v1=0.0; | |
34 | Double_t v2=0.0; | |
35 | Double_t v3=0.0; | |
36 | Double_t v4=0.0; | |
37 | Int_t numberOfTrackClones=0; //non-flow | |
38 | ||
39 | // Define a range of the detector to exclude | |
40 | Bool_t ExcludeRegion = kFALSE; | |
41 | Double_t excludeEtaMin = -0.; | |
42 | Double_t excludeEtaMax = 0.; | |
43 | Double_t excludePhiMin = 0.; | |
44 | Double_t excludePhiMax = 0.; | |
45 | ||
46 | // use physics selection class | |
47 | Bool_t UsePhysicsSelection = kTRUE; | |
48 | ||
49 | // QA | |
50 | Bool_t runQAtask=kFALSE; | |
51 | Bool_t FillQAntuple=kFALSE; | |
52 | Bool_t DoQAcorrelations=kFALSE; | |
53 | ||
54 | // RUN SETTINGS | |
55 | // Flow analysis method can be:(set to kTRUE or kFALSE) | |
56 | Bool_t SP = kTRUE; // scalar product method (similar to eventplane method) | |
57 | Bool_t QC = kTRUE; // cumulants using Q vectors | |
58 | ||
59 | //these are OBSOLETE, use at own peril | |
60 | Bool_t GFC = kFALSE; // cumulants based on generating function | |
61 | Bool_t MCEP = kFALSE; // correlation with Monte Carlo reaction plane | |
62 | Bool_t FQD = kFALSE; // fit of the distribution of the Q vector (only integrated v) | |
63 | Bool_t LYZ1SUM = kFALSE; // Lee Yang Zeroes using sum generating function (integrated v) | |
64 | Bool_t LYZ1PROD = kFALSE; // Lee Yang Zeroes using product generating function (integrated v) | |
65 | Bool_t LYZ2SUM = kFALSE; // Lee Yang Zeroes using sum generating function (second pass differential v) | |
66 | Bool_t LYZ2PROD = kFALSE; // Lee Yang Zeroes using product generating function (second pass differential v) | |
67 | Bool_t LYZEP = kFALSE; // Lee Yang Zeroes Event plane using sum generating function (gives eventplane + weight) | |
68 | Bool_t MH = kFALSE; // azimuthal correlators in mixed harmonics | |
69 | Bool_t NL = kFALSE; // nested loops (for instance distribution of phi1-phi2 for all distinct pairs) | |
70 | ||
71 | //Bool_t METHODS[] = {SP,LYZ1SUM,LYZ1PROD,LYZ2SUM,LYZ2PROD,LYZEP,GFC,QC,FQD,MCEP,MH,NL}; | |
72 | Bool_t METHODS[] = {SP}; | |
73 | ||
74 | // Boolean to use/not use weights for the Q vector | |
75 | Bool_t WEIGHTS[] = {kFALSE,kFALSE,kFALSE}; //Phi, v'(pt), v'(eta) | |
76 | ||
77 | // SETTING THE CUTS | |
78 | ||
79 | //---------Data selection---------- | |
80 | //kMC, kGlobal, kESD_TPConly, kESD_SPDtracklet | |
81 | AliFlowTrackCuts::trackParameterType rptype = AliFlowTrackCuts::kGlobal; | |
82 | AliFlowTrackCuts::trackParameterType poitype = AliFlowTrackCuts::kKink; | |
83 | ||
84 | //---------Parameter mixing-------- | |
85 | //kPure - no mixing, kTrackWithMCkine, kTrackWithMCPID, kTrackWithMCpt | |
86 | AliFlowTrackCuts::trackParameterMix rpmix = AliFlowTrackCuts::kPure; | |
87 | AliFlowTrackCuts::trackParameterMix poimix = AliFlowTrackCuts::kPure; | |
88 | ||
89 | ||
90 | const char* rptypestr = AliFlowTrackCuts::GetParamTypeName(rptype); | |
91 | const char* poitypestr = AliFlowTrackCuts::GetParamTypeName(poitype); | |
92 | ||
93 | //=========================================================================== | |
94 | // EVENTS CUTS: | |
95 | AliFlowEventCuts* cutsEvent = new AliFlowEventCuts("event cuts"); | |
96 | cutsEvent->SetCentralityPercentileRange(centrMin,centrMax); | |
97 | cutsEvent->SetCentralityPercentileMethod(AliFlowEventCuts::kV0); | |
98 | cutsEvent->SetRefMultMethod(AliFlowEventCuts::kV0); | |
99 | //cutsEvent->SetCentralityPercentileMethod(AliFlowEventCuts::kSPD1tracklets); | |
100 | cutsEvent->SetNContributorsRange(2); | |
101 | cutsEvent->SetPrimaryVertexZrange(-7.,7.); | |
102 | cutsEvent->SetQA(doQA); | |
103 | ||
104 | // RP TRACK CUTS: | |
105 | AliFlowTrackCuts* cutsRP = new AliFlowTrackCuts("TPConlyRP"); | |
106 | cutsRP->SetParamType(rptype); | |
107 | cutsRP->SetParamMix(rpmix); | |
108 | cutsRP->SetPtRange(0.2,5.); | |
109 | cutsRP->SetEtaRange(-0.8,0.8); | |
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->SetQA(doQA); | |
118 | ||
119 | // POI TRACK CUTS: | |
120 | AliFlowTrackCuts* cutsPOI = new AliFlowTrackCuts("GlobalPOI"); | |
121 | cutsPOI->SetParamType(poitype); | |
122 | cutsPOI->SetParamMix(poimix); | |
123 | cutsPOI->SetPtRange(0.0,10.); | |
124 | cutsPOI->SetEtaRange(poiMinEta,poiMaxEta); | |
125 | //cutsPOI->SetRequireCharge(kTRUE); | |
126 | //cutsPOI->SetPID(PdgRP); | |
127 | cutsPOI->SetMinNClustersTPC(30); | |
128 | cutsPOI->SetMinChi2PerClusterTPC(0.1); | |
129 | cutsPOI->SetMaxChi2PerClusterTPC(4.0); | |
130 | //cutsPOI->SetRequireITSRefit(kTRUE); | |
131 | cutsPOI->SetRequireTPCRefit(kTRUE); | |
132 | cutsPOI->SetMinNClustersITS(2); | |
133 | //cutsPOI->SetMaxChi2PerClusterITS(1.e+09); | |
134 | cutsPOI->SetMaxDCAToVertexXY(3.); | |
135 | cutsPOI->SetMaxDCAToVertexZ(3.); | |
136 | //cutsPOI->SetDCAToVertex2D(kTRUE); | |
137 | //cutsPOI->SetMaxNsigmaToVertex(1.e+10); | |
138 | //cutsPOI->SetRequireSigmaToVertex(kFALSE); | |
139 | cutsPOI->SetAcceptKinkDaughters(kTRUE); | |
140 | cutsPOI->SetPID(particleType, sourcePID); | |
141 | if (charge!=0) cutsPOI->SetCharge(charge); | |
142 | //cutsPOI->SetAllowTOFmismatch(kFALSE); | |
143 | cutsPOI->SetRequireStrictTOFTPCagreement(kTRUE); | |
144 | //iexample: francesco's tunig TPC Bethe Bloch for data: | |
145 | //cutsPOI->GetESDpid().GetTPCResponse().SetBetheBlochParameters(4.36414e-02,1.75977e+01,1.14385e-08,2.27907e+00,3.36699e+00); | |
146 | //cutsPOI->GetESDpid().GetTPCResponse().SetMip(49); | |
147 | cutsPOI->SetMinimalTPCdedx(10.); | |
148 | cutsPOI->SetQA(doQA); | |
149 | cutsPOI->SetMinKinkInvMassKmu(0.46); | |
150 | ||
151 | TString outputSlotName(""); | |
152 | outputSlotName+=uniqueStr; | |
153 | outputSlotName+=" "; | |
154 | outputSlotName+=totalQvectorSP; | |
155 | outputSlotName+=" "; | |
156 | outputSlotName+=Form("V%i ",harmonic); | |
157 | outputSlotName+=cutsRP->GetName(); | |
158 | outputSlotName+=" "; | |
159 | outputSlotName+=cutsPOI->GetName(); | |
160 | outputSlotName+=Form(" %.0f-",centrMin); | |
161 | outputSlotName+=Form("%.0f ",centrMax); | |
162 | outputSlotName+=Form("POI:%s ", AliFlowTrackCuts::GetParamTypeName(cutsPOI->GetParamType()) ); | |
163 | outputSlotName+=Form("RP:%s ", AliFlowTrackCuts::GetParamTypeName(cutsRP->GetParamType()) ); | |
164 | if (particleType!=AliPID::kUnknown) | |
165 | { | |
166 | outputSlotName+=AliFlowTrackCuts::PIDsourceName(sourcePID); | |
167 | outputSlotName+=" "; | |
168 | outputSlotName+=AliPID::ParticleName(particleType); | |
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 | mgr->AddTask(taskfmd); | |
303 | ||
304 | AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance(); | |
305 | pars->Init(); | |
306 | pars->SetProcessPrimary(kTRUE); //for MC only | |
307 | pars->SetProcessHits(kFALSE); | |
308 | ||
309 | //pars->SetRealData(kTRUE); //for real data | |
310 | //pars->SetProcessPrimary(kFALSE); //for real data | |
311 | } | |
312 | } | |
313 | ||
314 | // Create the flow event task, add it to the manager. | |
315 | //=========================================================================== | |
316 | AliAnalysisTaskFlowEvent *taskFE = NULL; | |
317 | ||
318 | if(useAfterBurner) | |
319 | { | |
320 | taskFE = new AliAnalysisTaskFlowEvent(Form("TaskFlowEvent %s",outputSlotName.Data()),"",doQA,1); | |
321 | taskFE->SetFlow(v1,v2,v3,v4); | |
322 | taskFE->SetNonFlowNumberOfTrackClones(numberOfTrackClones); | |
323 | taskFE->SetAfterburnerOn(); | |
324 | } | |
325 | else {taskFE = new AliAnalysisTaskFlowEvent(Form("TaskFlowEvent %s",outputSlotName.Data()),"",doQA); } | |
326 | if (ExcludeRegion) { | |
327 | taskFE->DefineDeadZone(excludeEtaMin, excludeEtaMax, excludePhiMin, excludePhiMax); | |
328 | } | |
329 | taskFE->SetSubeventEtaRange(minA, maxA, minB, maxB); | |
330 | if (UsePhysicsSelection) { | |
331 | taskFE->SelectCollisionCandidates(AliVEvent::kMB); | |
332 | cout<<"Using Physics Selection"<<endl; | |
333 | } | |
334 | mgr->AddTask(taskFE); | |
335 | ||
336 | // Pass cuts for RPs and POIs to the task: | |
337 | taskFE->SetCutsEvent(cutsEvent); | |
338 | taskFE->SetCutsRP(cutsRP); | |
339 | taskFE->SetCutsPOI(cutsPOI); | |
340 | if (cutsRP->GetParamType()==AliFlowTrackCuts::kV0) | |
341 | { | |
342 | //TODO: since this is set in a static object all analyses in an analysis train | |
343 | //will be affected. | |
344 | taskFE->SetHistWeightvsPhiMin(0.); | |
345 | taskFE->SetHistWeightvsPhiMax(200.); | |
346 | } | |
347 | ||
348 | // Create the analysis tasks, add them to the manager. | |
349 | //=========================================================================== | |
350 | if (SP){ | |
351 | AliAnalysisTaskScalarProduct *taskSP = new AliAnalysisTaskScalarProduct(Form("TaskScalarProduct %s",outputSlotName.Data()),WEIGHTS[0]); | |
352 | taskSP->SetRelDiffMsub(1.0); | |
353 | taskSP->SetApplyCorrectionForNUA(kTRUE); | |
354 | taskSP->SetTotalQvector(totalQvectorSP.Data()); | |
355 | mgr->AddTask(taskSP); | |
356 | } | |
357 | if (LYZ1SUM){ | |
358 | AliAnalysisTaskLeeYangZeros *taskLYZ1SUM = new AliAnalysisTaskLeeYangZeros(Form("TaskLeeYangZerosSUM %s",outputSlotName.Data()),kTRUE); | |
359 | taskLYZ1SUM->SetFirstRunLYZ(kTRUE); | |
360 | taskLYZ1SUM->SetUseSumLYZ(kTRUE); | |
361 | mgr->AddTask(taskLYZ1SUM); | |
362 | } | |
363 | if (LYZ1PROD){ | |
364 | AliAnalysisTaskLeeYangZeros *taskLYZ1PROD = new AliAnalysisTaskLeeYangZeros(Form("TaskLeeYangZerosPROD %s",outputSlotName.Data()),kTRUE); | |
365 | taskLYZ1PROD->SetFirstRunLYZ(kTRUE); | |
366 | taskLYZ1PROD->SetUseSumLYZ(kFALSE); | |
367 | mgr->AddTask(taskLYZ1PROD); | |
368 | } | |
369 | if (LYZ2SUM){ | |
370 | AliAnalysisTaskLeeYangZeros *taskLYZ2SUM = new AliAnalysisTaskLeeYangZeros(Form("TaskLeeYangZerosSUM %s",outputSlotName.Data()),kFALSE); | |
371 | taskLYZ2SUM->SetFirstRunLYZ(kFALSE); | |
372 | taskLYZ2SUM->SetUseSumLYZ(kTRUE); | |
373 | mgr->AddTask(taskLYZ2SUM); | |
374 | } | |
375 | if (LYZ2PROD){ | |
376 | AliAnalysisTaskLeeYangZeros *taskLYZ2PROD = new AliAnalysisTaskLeeYangZeros(Form("TaskLeeYangZerosPROD %s",outputSlotName.Data()),kFALSE); | |
377 | taskLYZ2PROD->SetFirstRunLYZ(kFALSE); | |
378 | taskLYZ2PROD->SetUseSumLYZ(kFALSE); | |
379 | mgr->AddTask(taskLYZ2PROD); | |
380 | } | |
381 | if (LYZEP){ | |
382 | AliAnalysisTaskLYZEventPlane *taskLYZEP = new AliAnalysisTaskLYZEventPlane(Form("TaskLYZEventPlane %s",outputSlotName.Data())); | |
383 | mgr->AddTask(taskLYZEP); | |
384 | } | |
385 | if (GFC){ | |
386 | AliAnalysisTaskCumulants *taskGFC = new AliAnalysisTaskCumulants(Form("TaskCumulants %s",outputSlotName.Data()),useWeights); | |
387 | taskGFC->SetUsePhiWeights(WEIGHTS[0]); | |
388 | taskGFC->SetUsePtWeights(WEIGHTS[1]); | |
389 | taskGFC->SetUseEtaWeights(WEIGHTS[2]); | |
390 | mgr->AddTask(taskGFC); | |
391 | } | |
392 | if (QC){ | |
393 | AliAnalysisTaskQCumulants *taskQC = new AliAnalysisTaskQCumulants(Form("TaskQCumulants %s",outputSlotName.Data()),useWeights); | |
394 | taskQC->SetUsePhiWeights(WEIGHTS[0]); | |
395 | taskQC->SetUsePtWeights(WEIGHTS[1]); | |
396 | taskQC->SetUseEtaWeights(WEIGHTS[2]); | |
397 | taskQC->SetCalculateCumulantsVsM(kFALSE); | |
398 | taskQC->SetnBinsMult(10000); | |
399 | taskQC->SetMinMult(0.); | |
400 | taskQC->SetMaxMult(10000.); | |
401 | taskQC->SetHarmonic(harmonic); | |
402 | taskQC->SetApplyCorrectionForNUA(kFALSE); | |
403 | taskQC->SetFillMultipleControlHistograms(kFALSE); | |
404 | mgr->AddTask(taskQC); | |
405 | } | |
406 | if (FQD){ | |
407 | AliAnalysisTaskFittingQDistribution *taskFQD = new AliAnalysisTaskFittingQDistribution(Form("TaskFittingQDistribution %s",outputSlotName.Data()),kFALSE); | |
408 | taskFQD->SetUsePhiWeights(WEIGHTS[0]); | |
409 | taskFQD->SetqMin(0.); | |
410 | taskFQD->SetqMax(1000.); | |
411 | taskFQD->SetqNbins(10000); | |
412 | mgr->AddTask(taskFQD); | |
413 | } | |
414 | if (MCEP){ | |
415 | AliAnalysisTaskMCEventPlane *taskMCEP = new AliAnalysisTaskMCEventPlane(Form("TaskMCEventPlane %s",outputSlotName.Data())); | |
416 | mgr->AddTask(taskMCEP); | |
417 | } | |
418 | if (MH){ | |
419 | AliAnalysisTaskMixedHarmonics *taskMH = new AliAnalysisTaskMixedHarmonics(Form("TaskMixedHarmonics %s",outputSlotName.Data()),useWeights); | |
420 | taskMH->SetHarmonic(1); // n in cos[n(phi1+phi2-2phi3)] and cos[n(psi1+psi2-2phi3)] | |
421 | taskMH->SetNoOfMultipicityBins(10000); | |
422 | taskMH->SetMultipicityBinWidth(1.); | |
423 | taskMH->SetMinMultiplicity(1.); | |
424 | taskMH->SetCorrectForDetectorEffects(kTRUE); | |
425 | taskMH->SetEvaluateDifferential3pCorrelator(kFALSE); // evaluate <<cos[n(psi1+psi2-2phi3)]>> (Remark: two nested loops) | |
426 | taskMH->SetOppositeChargesPOI(kFALSE); // POIs psi1 and psi2 in cos[n(psi1+psi2-2phi3)] will have opposite charges | |
427 | mgr->AddTask(taskMH); | |
428 | } | |
429 | if (NL){ | |
430 | AliAnalysisTaskNestedLoops *taskNL = new AliAnalysisTaskNestedLoops(Form("TaskNestedLoops %s",outputSlotName.Data()),useWeights); | |
431 | taskNL->SetHarmonic(1); // n in cos[n(phi1+phi2-2phi3)] and cos[n(psi1+psi2-2phi3)] | |
432 | taskNL->SetEvaluateNestedLoopsForRAD(kTRUE); // RAD = Relative Angle Distribution | |
433 | taskNL->SetEvaluateNestedLoopsForMH(kTRUE); // evalaute <<cos[n(phi1+phi2-2phi3)]>> (Remark: three nested loops) | |
434 | taskNL->SetEvaluateDifferential3pCorrelator(kFALSE); // evaluate <<cos[n(psi1+psi2-2phi3)]>> (Remark: three nested loops) | |
435 | taskNL->SetOppositeChargesPOI(kFALSE); // POIs psi1 and psi2 in cos[n(psi1+psi2-2phi3)] will have opposite charges | |
436 | mgr->AddTask(taskNL); | |
437 | } | |
438 | ||
439 | // Create the output container for the data produced by the task | |
440 | // Connect to the input and output containers | |
441 | //=========================================================================== | |
442 | AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer(); | |
443 | ||
444 | if (rptypestr == "FMD") { | |
445 | AliAnalysisDataContainer *coutputFMD = | |
446 | mgr->CreateContainer(Form("BackgroundCorrected %s",outputSlotName.Data()), TList::Class(), AliAnalysisManager::kExchangeContainer); | |
447 | //input and output taskFMD | |
448 | mgr->ConnectInput(taskfmd, 0, cinput1); | |
449 | mgr->ConnectOutput(taskfmd, 1, coutputFMD); | |
450 | //input into taskFE | |
451 | mgr->ConnectInput(taskFE,1,coutputFMD); | |
452 | } | |
453 | ||
454 | AliAnalysisDataContainer *coutputFE = | |
455 | mgr->CreateContainer(Form("FlowEventSimple %s",outputSlotName.Data()),AliFlowEventSimple::Class(),AliAnalysisManager::kExchangeContainer); | |
456 | mgr->ConnectInput(taskFE,0,cinput1); | |
457 | mgr->ConnectOutput(taskFE,1,coutputFE); | |
458 | ||
459 | if (taskFE->GetQAOn()) | |
460 | { | |
461 | TString outputQA = fileName; | |
462 | outputQA += ":QA"; | |
463 | AliAnalysisDataContainer* coutputFEQA = | |
464 | mgr->CreateContainer(Form("QA %s",outputSlotName.Data()), TList::Class(),AliAnalysisManager::kOutputContainer,outputQA); | |
465 | mgr->ConnectOutput(taskFE,2,coutputFEQA); | |
466 | } | |
467 | ||
468 | // Create the output containers for the data produced by the analysis tasks | |
469 | // Connect to the input and output containers | |
470 | //=========================================================================== | |
471 | if (useWeights) { | |
472 | AliAnalysisDataContainer *cinputWeights = mgr->CreateContainer(Form("Weights %s",outputSlotName.Data()), | |
473 | TList::Class(),AliAnalysisManager::kInputContainer); | |
474 | } | |
475 | ||
476 | if(SP) { | |
477 | TString outputSP = fileName; | |
478 | outputSP += ":outputSPanalysis"; | |
479 | outputSP+= rptypestr; | |
480 | AliAnalysisDataContainer *coutputSP = mgr->CreateContainer(Form("SP %s",outputSlotName.Data()), | |
481 | TList::Class(),AliAnalysisManager::kOutputContainer,outputSP); | |
482 | mgr->ConnectInput(taskSP,0,coutputFE); | |
483 | mgr->ConnectOutput(taskSP,1,coutputSP); | |
484 | if (WEIGHTS[0]) { | |
485 | mgr->ConnectInput(taskSP,1,cinputWeights); | |
486 | cinputWeights->SetData(weightsList); | |
487 | } | |
488 | } | |
489 | if(LYZ1SUM) { | |
490 | TString outputLYZ1SUM = fileName; | |
491 | outputLYZ1SUM += ":outputLYZ1SUManalysis"; | |
492 | outputLYZ1SUM+= rptypestr; | |
493 | AliAnalysisDataContainer *coutputLYZ1SUM = mgr->CreateContainer(Form("LYZ1SUM %s",outputSlotName.Data()), | |
494 | TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ1SUM); | |
495 | mgr->ConnectInput(taskLYZ1SUM,0,coutputFE); | |
496 | mgr->ConnectOutput(taskLYZ1SUM,1,coutputLYZ1SUM); | |
497 | } | |
498 | if(LYZ1PROD) { | |
499 | TString outputLYZ1PROD = fileName; | |
500 | outputLYZ1PROD += ":outputLYZ1PRODanalysis"; | |
501 | outputLYZ1PROD+= rptypestr; | |
502 | AliAnalysisDataContainer *coutputLYZ1PROD = mgr->CreateContainer(Form("LYZ1PROD %s",outputSlotName.Data()), | |
503 | TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ1PROD); | |
504 | mgr->ConnectInput(taskLYZ1PROD,0,coutputFE); | |
505 | mgr->ConnectOutput(taskLYZ1PROD,1,coutputLYZ1PROD); | |
506 | } | |
507 | if(LYZ2SUM) { | |
508 | AliAnalysisDataContainer *cinputLYZ2SUM = mgr->CreateContainer(Form("LYZ2SUMin %s",outputSlotName.Data()), | |
509 | TList::Class(),AliAnalysisManager::kInputContainer); | |
510 | TString outputLYZ2SUM = fileName; | |
511 | outputLYZ2SUM += ":outputLYZ2SUManalysis"; | |
512 | outputLYZ2SUM+= rptypestr; | |
513 | ||
514 | AliAnalysisDataContainer *coutputLYZ2SUM = mgr->CreateContainer(Form("LYZ2SUM %s",outputSlotName.Data()), | |
515 | TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ2SUM); | |
516 | mgr->ConnectInput(taskLYZ2SUM,0,coutputFE); | |
517 | mgr->ConnectInput(taskLYZ2SUM,1,cinputLYZ2SUM); | |
518 | mgr->ConnectOutput(taskLYZ2SUM,1,coutputLYZ2SUM); | |
519 | cinputLYZ2SUM->SetData(fInputListLYZ2SUM); | |
520 | } | |
521 | if(LYZ2PROD) { | |
522 | AliAnalysisDataContainer *cinputLYZ2PROD = mgr->CreateContainer(Form("LYZ2PRODin %s",outputSlotName.Data()), | |
523 | TList::Class(),AliAnalysisManager::kInputContainer); | |
524 | TString outputLYZ2PROD = fileName; | |
525 | outputLYZ2PROD += ":outputLYZ2PRODanalysis"; | |
526 | outputLYZ2PROD+= rptypestr; | |
527 | ||
528 | AliAnalysisDataContainer *coutputLYZ2PROD = mgr->CreateContainer(Form("LYZ2PROD %s",outputSlotName.Data()), | |
529 | TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ2PROD); | |
530 | mgr->ConnectInput(taskLYZ2PROD,0,coutputFE); | |
531 | mgr->ConnectInput(taskLYZ2PROD,1,cinputLYZ2PROD); | |
532 | mgr->ConnectOutput(taskLYZ2PROD,1,coutputLYZ2PROD); | |
533 | cinputLYZ2PROD->SetData(fInputListLYZ2PROD); | |
534 | } | |
535 | if(LYZEP) { | |
536 | AliAnalysisDataContainer *cinputLYZEP = mgr->CreateContainer(Form("LYZEPin %s",outputSlotName.Data()), | |
537 | TList::Class(),AliAnalysisManager::kInputContainer); | |
538 | TString outputLYZEP = fileName; | |
539 | outputLYZEP += ":outputLYZEPanalysis"; | |
540 | outputLYZEP+= rptypestr; | |
541 | ||
542 | AliAnalysisDataContainer *coutputLYZEP = mgr->CreateContainer(Form("LYZEP %s",outputSlotName.Data()), | |
543 | TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZEP); | |
544 | mgr->ConnectInput(taskLYZEP,0,coutputFE); | |
545 | mgr->ConnectInput(taskLYZEP,1,cinputLYZEP); | |
546 | mgr->ConnectOutput(taskLYZEP,1,coutputLYZEP); | |
547 | cinputLYZEP->SetData(fInputListLYZEP); | |
548 | } | |
549 | if(GFC) { | |
550 | TString outputGFC = fileName; | |
551 | outputGFC += ":outputGFCanalysis"; | |
552 | outputGFC+= rptypestr; | |
553 | ||
554 | AliAnalysisDataContainer *coutputGFC = mgr->CreateContainer(Form("GFC %s",outputSlotName.Data()), | |
555 | TList::Class(),AliAnalysisManager::kOutputContainer,outputGFC); | |
556 | mgr->ConnectInput(taskGFC,0,coutputFE); | |
557 | mgr->ConnectOutput(taskGFC,1,coutputGFC); | |
558 | if (useWeights) { | |
559 | mgr->ConnectInput(taskGFC,1,cinputWeights); | |
560 | cinputWeights->SetData(weightsList); | |
561 | } | |
562 | } | |
563 | if(QC) { | |
564 | TString outputQC = fileName; | |
565 | outputQC += ":outputQCanalysis"; | |
566 | outputQC+= rptypestr; | |
567 | ||
568 | AliAnalysisDataContainer *coutputQC = mgr->CreateContainer(Form("QC %s",outputSlotName.Data()), | |
569 | TList::Class(),AliAnalysisManager::kOutputContainer,outputQC); | |
570 | mgr->ConnectInput(taskQC,0,coutputFE); | |
571 | mgr->ConnectOutput(taskQC,1,coutputQC); | |
572 | if (useWeights) { | |
573 | mgr->ConnectInput(taskQC,1,cinputWeights); | |
574 | cinputWeights->SetData(weightsList); | |
575 | } | |
576 | } | |
577 | if(FQD) { | |
578 | TString outputFQD = fileName; | |
579 | outputFQD += ":outputFQDanalysis"; | |
580 | outputFQD+= rptypestr; | |
581 | ||
582 | AliAnalysisDataContainer *coutputFQD = mgr->CreateContainer(Form("FQD %s",outputSlotName.Data()), | |
583 | TList::Class(),AliAnalysisManager::kOutputContainer,outputFQD); | |
584 | mgr->ConnectInput(taskFQD,0,coutputFE); | |
585 | mgr->ConnectOutput(taskFQD,1,coutputFQD); | |
586 | if(useWeights) { | |
587 | mgr->ConnectInput(taskFQD,1,cinputWeights); | |
588 | cinputWeights->SetData(weightsList); | |
589 | } | |
590 | } | |
591 | if(MCEP) { | |
592 | TString outputMCEP = fileName; | |
593 | outputMCEP += ":outputMCEPanalysis"; | |
594 | outputMCEP+= rptypestr; | |
595 | ||
596 | AliAnalysisDataContainer *coutputMCEP = mgr->CreateContainer(Form("MCEP %s",outputSlotName.Data()), | |
597 | TList::Class(),AliAnalysisManager::kOutputContainer,outputMCEP); | |
598 | mgr->ConnectInput(taskMCEP,0,coutputFE); | |
599 | mgr->ConnectOutput(taskMCEP,1,coutputMCEP); | |
600 | } | |
601 | if(MH) { | |
602 | TString outputMH = fileName; | |
603 | outputMH += ":outputMHanalysis"; | |
604 | outputMH += rptypestr; | |
605 | ||
606 | AliAnalysisDataContainer *coutputMH = mgr->CreateContainer(Form("MH %s",outputSlotName.Data()), | |
607 | TList::Class(),AliAnalysisManager::kOutputContainer,outputMH); | |
608 | mgr->ConnectInput(taskMH,0,coutputFE); | |
609 | mgr->ConnectOutput(taskMH,1,coutputMH); | |
610 | //if (useWeights) { | |
611 | // mgr->ConnectInput(taskMH,1,cinputWeights); | |
612 | // cinputWeights->SetData(weightsList); | |
613 | //} | |
614 | } | |
615 | if(NL) { | |
616 | TString outputNL = fileName; | |
617 | outputNL += ":outputNLanalysis"; | |
618 | outputNL += rptypestr; | |
619 | ||
620 | AliAnalysisDataContainer *coutputNL = mgr->CreateContainer(Form("NL %s",outputSlotName.Data()), | |
621 | TList::Class(),AliAnalysisManager::kOutputContainer,outputNL); | |
622 | mgr->ConnectInput(taskNL,0,coutputFE); | |
623 | mgr->ConnectOutput(taskNL,1,coutputNL); | |
624 | //if (useWeights) { | |
625 | // mgr->ConnectInput(taskNL,1,cinputWeights); | |
626 | // cinputWeights->SetData(weightsList); | |
627 | //} | |
628 | } | |
629 | ||
630 | /////////////////////////////////////////////////////////////////////////////////////////// | |
631 | if (runQAtask) | |
632 | { | |
633 | AliAnalysisTaskQAflow* taskQAflow = new AliAnalysisTaskQAflow(Form("TaskQAflow %s",outputSlotName.Data())); | |
634 | taskQAflow->SetEventCuts(cutsEvent); | |
635 | taskQAflow->SetTrackCuts(cutsRP); | |
636 | taskQAflow->SetFillNTuple(FillQAntuple); | |
637 | taskQAflow->SetDoCorrelations(DoQAcorrelations); | |
638 | mgr->AddTask(taskQAflow); | |
639 | ||
640 | Printf("outputSlotName %s",outputSlotName.Data()); | |
641 | TString taskQAoutputFileName(fileNameBase); | |
642 | taskQAoutputFileName.Append("_QA.root"); | |
643 | AliAnalysisDataContainer* coutputQAtask = mgr->CreateContainer(Form("flowQA %s",outputSlotName.Data()), | |
644 | TObjArray::Class(), | |
645 | AliAnalysisManager::kOutputContainer, | |
646 | taskQAoutputFileName); | |
647 | AliAnalysisDataContainer* coutputQAtaskTree = mgr->CreateContainer(Form("flowQAntuple %s",outputSlotName.Data()), | |
648 | TNtuple::Class(), | |
649 | AliAnalysisManager::kOutputContainer, | |
650 | taskQAoutputFileName); | |
651 | mgr->ConnectInput(taskQAflow,0,mgr->GetCommonInputContainer()); | |
652 | mgr->ConnectInput(taskQAflow,1,coutputFE); | |
653 | mgr->ConnectOutput(taskQAflow,1,coutputQAtask); | |
654 | if (FillQAntuple) mgr->ConnectOutput(taskQAflow,2,coutputQAtaskTree); | |
655 | } | |
656 | } | |
657 | ||
658 | ||
659 | ||
660 | ||
661 |