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