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