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