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