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