]>
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 | ||
7a01f4a7 | 10 | // Define the range for eta subevents (for SP method) |
a02a1889 | 11 | //-----(FMD 1.7 - 5.0)----- |
44e060e0 | 12 | //Double_t minA = -5.0; |
13 | //Double_t maxA = -1.7; | |
14 | //Double_t minB = 1.7; | |
15 | //Double_t maxB = 5.0; | |
a02a1889 | 16 | //-----(Tracklets 0.9 - 2.0)----- |
17 | //Double_t minA = -2.0; | |
18 | //Double_t maxA = -0.9; | |
19 | //Double_t minB = 0.9; | |
20 | //Double_t maxB = 2.0; | |
21 | //-----(Global 0.5 - 0.9)----- | |
22 | Double_t minA = -0.9; | |
23 | Double_t maxA = -0.5; | |
24 | Double_t minB = 0.5; | |
25 | Double_t maxB = 0.9; | |
26 | ||
54089829 | 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 | |
93329510 | 34 | |
1f37d995 | 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 | ||
f6cf97c1 | 42 | // use physics selection class |
40c24aa8 | 43 | Bool_t UsePhysicsSelection = kTRUE; |
f6cf97c1 | 44 | |
93329510 | 45 | // SETTING THE CUTS |
46 | ||
c0ed6325 | 47 | //----------Event selection---------- |
48 | Bool_t UseMultCutforESD = kTRUE; | |
49 | //Bool_t UseMultCutforESD = kFALSE; | |
50 | const Int_t multminESD = 1; //used for CORRFW cuts | |
3828db44 | 51 | const Int_t multmaxESD = 1000000; //used for CORRFW cuts |
f01e9bfe | 52 | |
40ca990b | 53 | Bool_t requireVtxCuts = kTRUE; |
21f8d9b1 | 54 | const Double_t vertexXmin = -1.e99; |
55 | const Double_t vertexXmax = 1.e99; | |
56 | const Double_t vertexYmin = -1.e99; | |
57 | const Double_t vertexYmax = 1.e99; | |
1f37d995 | 58 | const Double_t vertexZmin = -10.; |
59 | const Double_t vertexZmax = 10.; | |
21f8d9b1 | 60 | const Int_t vertexNContributorsmin = 1; |
61 | const Int_t vertexNContributorsmax = 10000; | |
40ca990b | 62 | |
ea456d37 | 63 | //Bool_t UseMultCut = kFALSE; |
f6cf97c1 | 64 | Bool_t UseMultCut = kTRUE; |
22063257 | 65 | const Int_t multmin = 1; //used for AliFlowEventSimple (to set the centrality) |
29195b69 | 66 | const Int_t multmax = 10000; //used for AliFlowEventSimple (to set the centrality) |
c0ed6325 | 67 | //const Int_t multmin = 10; //used for AliFlowEventSimple (to set the centrality) |
68 | //const Int_t multmax = 1000000; //used for AliFlowEventSimple (to set the centrality) | |
47d5b28f | 69 | |
94cd9888 | 70 | |
c0ed6325 | 71 | //----------For RP selection---------- |
44e060e0 | 72 | // Use Global tracks ("Global"), or SPD tracklets ("Tracklet") |
73 | // or FMD hits ("FMD") for the RP selection | |
ef4799a7 | 74 | const TString rptype = "Global"; |
75 | //const TString rptype = "Tracklet"; | |
44e060e0 | 76 | //const TString rptype = "FMD"; |
333ce021 | 77 | //const TString rptype = "PMD"; |
ef4799a7 | 78 | |
c0ed6325 | 79 | //KINEMATICS (on generated and reconstructed tracks) |
1f37d995 | 80 | Bool_t UseKineforRP = kFALSE; |
c0ed6325 | 81 | const Double_t ptminRP = 0.0; |
82 | const Double_t ptmaxRP = 10.0; | |
83 | const Double_t etaminRP = -0.9; | |
84 | const Double_t etamaxRP = 0.9; | |
85 | const Int_t chargeRP = 1; //not used | |
21f8d9b1 | 86 | const Bool_t isChargedRP = kTRUE; |
c0ed6325 | 87 | |
88 | //PID (on generated and reconstructed tracks) | |
93329510 | 89 | Bool_t UsePIDforRP = kFALSE; |
c0ed6325 | 90 | const Int_t PdgRP = 211; |
91 | ||
92 | //TRACK QUALITY (on reconstructed tracks only) | |
93 | //see /CORRFW/AliCFTrackQualityCuts class | |
1f37d995 | 94 | Bool_t UseTrackQualityforRP = kFALSE; |
c0ed6325 | 95 | const Int_t minClustersTpcRP = 80; //default = -1; |
21f8d9b1 | 96 | const Double_t maxChi2PerClusterTpcRP = 4.0; //default = 1.e+09; |
c0ed6325 | 97 | const UShort_t minDedxClusterTpcRP = 0; |
98 | const Int_t minClustersItsRP = 2; //panos | |
99 | const Double_t maxChi2PerClusterItsRP = 1.e+09; | |
100 | const Int_t minClustersTrdRP = -1; | |
101 | const Int_t minTrackletTrdRP = -1; | |
102 | const Int_t minTrackletTrdPidRP = -1; | |
103 | const Double_t maxChi2PerClusterTrdRP = 1.e+09; | |
104 | const ULong_t statusRP = AliESDtrack::kTPCrefit; //AliESDtrack::kTPCrefit & AliESDtrack::kITSrefit | |
105 | ||
106 | //PRIMARY (on reconstructed tracks only) | |
107 | //see /CORRFW/AliCFTrackIsPrimaryCuts class | |
1f37d995 | 108 | Bool_t UsePrimariesforRP = kFALSE; |
c0ed6325 | 109 | const Bool_t spdVertexRP = kFALSE; |
110 | const Bool_t tpcVertexRP = kFALSE; | |
111 | const Float_t minDcaToVertexXyRP = 0.; | |
112 | const Float_t minDcaToVertexZRP = 0.; | |
113 | const Float_t maxDcaToVertexXyRP = 2.4; //default = 1.e+10; //2.4; | |
114 | const Float_t maxDcaToVertexZRP = 3.2; //default = 1.e+10; //3.2; | |
115 | const Bool_t dcaToVertex2dRP = kFALSE; //default = kFALSE; | |
116 | const Bool_t absDcaToVertexRP = kTRUE; //default = kTRUE; | |
117 | const Double_t minNSigmaToVertexRP = 0.; | |
118 | const Double_t maxNSigmaToVertexRP = 1.e+10; //3.; //1.e+10 | |
119 | const Double_t maxSigmaDcaXySP = 1.e+10; | |
120 | const Double_t maxSigmaDcaZSP = 1.e+10; | |
121 | const Bool_t requireSigmaToVertexSP = kFALSE; | |
122 | const Bool_t acceptKinkDaughtersSP = kFALSE; //default = kTRUE; | |
123 | ||
124 | //ACCEPTANCE (on generated tracks only : AliMCParticle) | |
125 | //see /CORRFW/AliCFAcceptanceCuts class | |
126 | Bool_t UseAcceptanceforRP = kFALSE; | |
127 | const Int_t minTrackrefsItsRP = 0;//3; | |
128 | const Int_t minTrackrefsTpcRP = 0;//2; | |
129 | const Int_t minTrackrefsTrdRP = 0; | |
130 | const Int_t minTrackrefsTofRP = 0; | |
131 | const Int_t minTrackrefsMuonRP = 0; | |
132 | //default for all is 0 | |
133 | ||
134 | //----------For POI selection---------- | |
135 | //KINEMATICS (on generated and reconstructed tracks) | |
136 | Bool_t UseKineforPOI = kTRUE; | |
137 | const Double_t ptminPOI = 0.0; | |
138 | const Double_t ptmaxPOI = 10.0; | |
ef4799a7 | 139 | const Double_t etaminPOI = -0.5; |
140 | const Double_t etamaxPOI = 0.5; | |
c0ed6325 | 141 | const Int_t chargePOI = 1; //not used |
21f8d9b1 | 142 | const Bool_t isChargedPOI = kTRUE; |
c0ed6325 | 143 | |
144 | //PID (on generated and reconstructed tracks) | |
93329510 | 145 | Bool_t UsePIDforPOI = kFALSE; |
c0ed6325 | 146 | const Int_t PdgPOI = 321; |
93329510 | 147 | |
c0ed6325 | 148 | //TRACK QUALITY (on reconstructed tracks only) |
149 | //see /CORRFW/AliCFTrackQualityCuts class | |
150 | Bool_t UseTrackQualityforPOI = kTRUE; | |
151 | const Int_t minClustersTpcPOI = 80; | |
21f8d9b1 | 152 | const Double_t maxChi2PerClusterTpcPOI = 4.0; |
c0ed6325 | 153 | const UShort_t minDedxClusterTpcPOI = 0; |
154 | const Int_t minClustersItsPOI = 2; | |
155 | const Double_t maxChi2PerClusterItsPOI = 1.e+09; | |
156 | const Int_t minClustersTrdPOI = -1; | |
157 | const Int_t minTrackletTrdPOI = -1; | |
158 | const Int_t minTrackletTrdPidPOI = -1; | |
159 | const Double_t maxChi2PerClusterTrdPOI = 1.e+09; | |
160 | const ULong_t statusPOI = AliESDtrack::kTPCrefit; | |
161 | ||
162 | //PRIMARY (on reconstructed tracks only) | |
163 | //see /CORRFW/AliCFTrackIsPrimaryCuts class | |
164 | Bool_t UsePrimariesforPOI = kTRUE; | |
165 | const Bool_t spdVertexPOI = kFALSE; | |
166 | const Bool_t tpcVertexPOI = kFALSE; | |
167 | const Float_t minDcaToVertexXyPOI = 0.; | |
168 | const Float_t minDcaToVertexZPOI = 0.; | |
169 | const Float_t maxDcaToVertexXyPOI = 2.4; | |
170 | const Float_t maxDcaToVertexZPOI = 3.2; | |
171 | const Bool_t dcaToVertex2dPOI = kFALSE; | |
172 | const Bool_t absDcaToVertexPOI = kTRUE; | |
173 | const Double_t minNSigmaToVertexPOI = 0.; | |
174 | const Double_t maxNSigmaToVertexPOI = 1.e+10; | |
175 | const Double_t maxSigmaDcaXyPOI = 1.e+10; | |
176 | const Double_t maxSigmaDcaZPOI = 1.e+10; | |
177 | const Bool_t requireSigmaToVertexPOI = kFALSE; | |
178 | const Bool_t acceptKinkDaughtersPOI = kFALSE; | |
179 | ||
180 | //ACCEPTANCE (on generated tracks only : AliMCParticle) | |
181 | //see /CORRFW/AliCFAcceptanceCuts class | |
182 | Bool_t UseAcceptanceforPOI = kFALSE; | |
183 | const Int_t minTrackrefsItsPOI = 3; | |
184 | const Int_t minTrackrefsTpcPOI = 2; | |
185 | const Int_t minTrackrefsTrdPOI = 0; | |
186 | const Int_t minTrackrefsTofPOI = 0; | |
187 | const Int_t minTrackrefsMuonPOI = 0; | |
188 | ||
93329510 | 189 | AliAnalysisTaskFlowEvent* AddTaskFlow(TString type, Bool_t* METHODS, Bool_t QA, Bool_t* WEIGHTS) |
190 | { | |
191 | //boleans for the methods | |
c741f5d0 | 192 | Bool_t SP = METHODS[0]; |
193 | Bool_t LYZ1SUM = METHODS[1]; | |
194 | Bool_t LYZ1PROD = METHODS[2]; | |
195 | Bool_t LYZ2SUM = METHODS[3]; | |
196 | Bool_t LYZ2PROD = METHODS[4]; | |
197 | Bool_t LYZEP = METHODS[5]; | |
198 | Bool_t GFC = METHODS[6]; | |
199 | Bool_t QC = METHODS[7]; | |
200 | Bool_t FQD = METHODS[8]; | |
67a6b178 | 201 | Bool_t MCEP = METHODS[9]; |
202 | Bool_t MH = METHODS[10]; | |
203 | Bool_t NL = METHODS[11]; | |
93329510 | 204 | //for using weights |
205 | Bool_t useWeights = WEIGHTS[0] || WEIGHTS[1] || WEIGHTS[2]; | |
206 | if (useWeights) cout<<"Weights are used"<<endl; | |
207 | else cout<<"Weights are not used"<<endl; | |
208 | ||
209 | ||
210 | // Get the pointer to the existing analysis manager via the static access method. | |
211 | //============================================================================== | |
212 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
213 | if (!mgr) { | |
214 | Error("AddTaskFlowEvent", "No analysis manager to connect to."); | |
215 | return NULL; | |
216 | } | |
217 | ||
218 | // Check the analysis type using the event handlers connected to the analysis | |
219 | // manager. The availability of MC handler cann also be checked here. | |
220 | //============================================================================== | |
221 | if (!mgr->GetInputEventHandler()) { | |
222 | ::Error("AddTaskFlowEvent", "This task requires an input event handler"); | |
223 | return NULL; | |
224 | } | |
225 | ||
226 | // Open external input files | |
227 | //=========================================================================== | |
228 | //weights: | |
229 | TFile *weightsFile = NULL; | |
230 | TList *weightsList = NULL; | |
231 | ||
232 | if(useWeights) { | |
233 | //open the file with the weights: | |
234 | weightsFile = TFile::Open("weights.root","READ"); | |
235 | if(weightsFile) { | |
236 | //access the list which holds the histos with weigths: | |
237 | weightsList = (TList*)weightsFile->Get("weights"); | |
238 | } | |
239 | else { | |
240 | cout<<" WARNING: the file <weights.root> with weights from the previous run was not available."<<endl; | |
241 | break; | |
242 | } | |
243 | } | |
244 | ||
40ca990b | 245 | //LYZ2 |
246 | if (LYZ2SUM || LYZ2PROD) { | |
247 | //read the outputfile of the first run | |
248 | TString outputFileName = "AnalysisResults1.root"; | |
249 | TString pwd(gSystem->pwd()); | |
250 | pwd+="/"; | |
251 | pwd+=outputFileName.Data(); | |
252 | TFile *outputFile = NULL; | |
253 | if(gSystem->AccessPathName(pwd.Data(),kFileExists)) { | |
254 | cout<<"WARNING: You do not have an output file:"<<endl; | |
255 | cout<<" "<<pwd.Data()<<endl; | |
256 | exit(0); | |
257 | } else { | |
258 | outputFile = TFile::Open(pwd.Data(),"READ"); | |
c741f5d0 | 259 | } |
40ca990b | 260 | |
261 | if (LYZ2SUM){ | |
262 | // read the output directory from LYZ1SUM | |
263 | TString inputFileNameLYZ2SUM = "outputLYZ1SUManalysis" ; | |
264 | inputFileNameLYZ2SUM += type; | |
265 | cout<<"The input directory is "<<inputFileNameLYZ2SUM.Data()<<endl; | |
266 | TFile* fInputFileLYZ2SUM = (TFile*)outputFile->FindObjectAny(inputFileNameLYZ2SUM.Data()); | |
267 | if(!fInputFileLYZ2SUM || fInputFileLYZ2SUM->IsZombie()) { | |
268 | cerr << " ERROR: To run LYZ2SUM you need the output file from LYZ1SUM. This file is not there! Please run LYZ1SUM first." << endl ; | |
269 | break; | |
270 | } | |
271 | else { | |
272 | TList* fInputListLYZ2SUM = (TList*)fInputFileLYZ2SUM->Get("cobjLYZ1SUM"); | |
273 | if (!fInputListLYZ2SUM) {cout<<"list is NULL pointer!"<<endl;} | |
274 | } | |
275 | cout<<"LYZ2SUM input file/list read..."<<endl; | |
c0ed6325 | 276 | } |
40ca990b | 277 | |
278 | if (LYZ2PROD){ | |
279 | // read the output directory from LYZ1PROD | |
280 | TString inputFileNameLYZ2PROD = "outputLYZ1PRODanalysis" ; | |
281 | inputFileNameLYZ2PROD += type; | |
282 | cout<<"The input directory is "<<inputFileNameLYZ2PROD.Data()<<endl; | |
283 | TFile* fInputFileLYZ2PROD = (TFile*)outputFile->FindObjectAny(inputFileNameLYZ2PROD.Data()); | |
284 | if(!fInputFileLYZ2PROD || fInputFileLYZ2PROD->IsZombie()) { | |
285 | cerr << " ERROR: To run LYZ2PROD you need the output file from LYZ1PROD. This file is not there! Please run LYZ1PROD first." << endl ; | |
286 | break; | |
287 | } | |
288 | else { | |
289 | TList* fInputListLYZ2PROD = (TList*)fInputFileLYZ2PROD->Get("cobjLYZ1PROD"); | |
290 | if (!fInputListLYZ2PROD) {cout<<"list is NULL pointer!"<<endl;} | |
291 | } | |
292 | cout<<"LYZ2PROD input file/list read..."<<endl; | |
c0ed6325 | 293 | } |
93329510 | 294 | } |
40ca990b | 295 | |
296 | ||
93329510 | 297 | if (LYZEP) { |
40ca990b | 298 | //read the outputfile of the second run |
299 | TString outputFileName = "AnalysisResults2.root"; | |
300 | TString pwd(gSystem->pwd()); | |
301 | pwd+="/"; | |
302 | pwd+=outputFileName.Data(); | |
303 | TFile *outputFile = NULL; | |
304 | if(gSystem->AccessPathName(pwd.Data(),kFileExists)) { | |
305 | cout<<"WARNING: You do not have an output file:"<<endl; | |
306 | cout<<" "<<pwd.Data()<<endl; | |
307 | exit(0); | |
308 | } else { | |
309 | outputFile = TFile::Open(pwd.Data(),"READ"); | |
310 | } | |
311 | ||
c741f5d0 | 312 | // read the output file from LYZ2SUM |
313 | TString inputFileNameLYZEP = "outputLYZ2SUManalysis" ; | |
93329510 | 314 | inputFileNameLYZEP += type; |
93329510 | 315 | cout<<"The input file is "<<inputFileNameLYZEP.Data()<<endl; |
40ca990b | 316 | TFile* fInputFileLYZEP = (TFile*)outputFile->FindObjectAny(inputFileNameLYZEP.Data()); |
93329510 | 317 | if(!fInputFileLYZEP || fInputFileLYZEP->IsZombie()) { |
5b40431d | 318 | cerr << " ERROR: To run LYZEP you need the output file from LYZ2SUM. This file is not there! Please run LYZ2SUM first." << endl ; |
93329510 | 319 | break; |
320 | } | |
321 | else { | |
c741f5d0 | 322 | TList* fInputListLYZEP = (TList*)fInputFileLYZEP->Get("cobjLYZ2SUM"); |
93329510 | 323 | if (!fInputListLYZEP) {cout<<"list is NULL pointer!"<<endl;} |
324 | } | |
325 | cout<<"LYZEP input file/list read..."<<endl; | |
326 | } | |
40ca990b | 327 | |
a02a1889 | 328 | |
44e060e0 | 329 | // Create the FMD task and add it to the manager |
330 | //=========================================================================== | |
44e060e0 | 331 | if (rptype == "FMD") { |
a02a1889 | 332 | AliFMDAnalysisTaskSE *taskfmd = NULL; |
333 | if (rptype == "FMD") { | |
334 | taskfmd = new AliFMDAnalysisTaskSE("TaskFMD"); | |
335 | mgr->AddTask(taskfmd); | |
44e060e0 | 336 | |
a02a1889 | 337 | AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance(); |
338 | pars->Init(); | |
1f37d995 | 339 | pars->SetProcessPrimary(kTRUE); //for MC only |
a02a1889 | 340 | pars->SetProcessHits(kFALSE); |
1f37d995 | 341 | |
342 | //pars->SetRealData(kTRUE); //for real data | |
343 | //pars->SetProcessPrimary(kFALSE); //for real data | |
344 | ||
a02a1889 | 345 | } |
44e060e0 | 346 | } |
a02a1889 | 347 | |
93329510 | 348 | |
349 | // Create the task, add it to the manager. | |
350 | //=========================================================================== | |
351 | AliAnalysisTaskFlowEvent *taskFE = NULL; | |
352 | if (QA) { | |
54089829 | 353 | if(useAfterBurner) |
354 | { | |
44e060e0 | 355 | taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent",rptype,kTRUE,1); |
54089829 | 356 | taskFE->SetFlow(v1,v2,v3,v4); |
357 | taskFE->SetNonFlowNumberOfTrackClones(numberOfTrackClones); | |
374a27d8 | 358 | taskFE->SetAfterburnerOn(); |
54089829 | 359 | } |
44e060e0 | 360 | else {taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent",rptype,kTRUE); } |
93329510 | 361 | taskFE->SetAnalysisType(type); |
ef4799a7 | 362 | taskFE->SetRPType(rptype); //only for ESD |
c0ed6325 | 363 | if (UseMultCut) { |
364 | taskFE->SetMinMult(multmin); | |
f6cf97c1 | 365 | taskFE->SetMaxMult(multmax); |
366 | } | |
1f37d995 | 367 | if (ExcludeRegion) { |
368 | taskFE->DefineDeadZone(excludeEtaMin, excludeEtaMax, excludePhiMin, excludePhiMax); | |
369 | } | |
370 | ||
7a01f4a7 | 371 | taskFE->SetSubeventEtaRange(minA, maxA, minB, maxB); |
f6cf97c1 | 372 | if (UsePhysicsSelection) { |
373 | taskFE->SelectCollisionCandidates(); | |
374 | cout<<"Using Physics Selection"<<endl; | |
375 | } | |
93329510 | 376 | mgr->AddTask(taskFE); |
377 | } | |
378 | else { | |
54089829 | 379 | if(useAfterBurner) |
380 | { | |
44e060e0 | 381 | taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent",rptype,kFALSE,1); |
54089829 | 382 | taskFE->SetFlow(v1,v2,v3,v4); |
383 | taskFE->SetNonFlowNumberOfTrackClones(numberOfTrackClones); | |
374a27d8 | 384 | taskFE->SetAfterburnerOn(); |
54089829 | 385 | } |
44e060e0 | 386 | else {taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent",rptype,kFALSE); } |
93329510 | 387 | taskFE->SetAnalysisType(type); |
1f37d995 | 388 | taskFE->SetRPType(rptype); //only for ESD |
c0ed6325 | 389 | if (UseMultCut) { |
390 | taskFE->SetMinMult(multmin); | |
f6cf97c1 | 391 | taskFE->SetMaxMult(multmax); |
392 | } | |
1f37d995 | 393 | if (ExcludeRegion) { |
394 | taskFE->DefineDeadZone(excludeEtaMin, excludeEtaMax, excludePhiMin, excludePhiMax); | |
395 | } | |
f6cf97c1 | 396 | taskFE->SetSubeventEtaRange(minA, maxA, minB, maxB); |
397 | if (UsePhysicsSelection) { | |
398 | taskFE->SelectCollisionCandidates(); | |
399 | cout<<"Using Physics Selection"<<endl; | |
400 | } | |
93329510 | 401 | mgr->AddTask(taskFE); |
402 | } | |
403 | ||
404 | // Create cuts using the correction framework (CORRFW) | |
405 | //=========================================================================== | |
406 | if (QA){ | |
407 | //Set TList for the QA histograms | |
408 | TList* qaRP = new TList(); | |
409 | TList* qaPOI = new TList(); | |
410 | } | |
411 | ||
c0ed6325 | 412 | //----------Event cuts---------- |
94cd9888 | 413 | AliCFEventGenCuts* mcEventCuts = new AliCFEventGenCuts("mcEventCuts","MC-level event cuts"); |
f01e9bfe | 414 | mcEventCuts->SetNTracksCut(multminESD,multmaxESD); |
40ca990b | 415 | mcEventCuts->SetRequireVtxCuts(requireVtxCuts); |
416 | mcEventCuts->SetVertexXCut(vertexXmin, vertexXmax); | |
417 | mcEventCuts->SetVertexYCut(vertexYmin, vertexYmax); | |
418 | mcEventCuts->SetVertexZCut(vertexZmin, vertexZmax); | |
94cd9888 | 419 | if (QA) { |
420 | mcEventCuts->SetQAOn(qaRP); | |
421 | } | |
422 | AliCFEventRecCuts* recEventCuts = new AliCFEventRecCuts("recEventCuts","rec-level event cuts"); | |
f01e9bfe | 423 | recEventCuts->SetNTracksCut(multminESD,multmaxESD); |
40ca990b | 424 | recEventCuts->SetRequireVtxCuts(requireVtxCuts); |
425 | recEventCuts->SetVertexXCut(vertexXmin, vertexXmax); | |
426 | recEventCuts->SetVertexYCut(vertexYmin, vertexYmax); | |
427 | recEventCuts->SetVertexZCut(vertexZmin, vertexZmax); | |
21f8d9b1 | 428 | recEventCuts->SetVertexNContributors(vertexNContributorsmin,vertexNContributorsmax); |
94cd9888 | 429 | if (QA) { |
430 | recEventCuts->SetQAOn(qaRP); | |
431 | } | |
c0ed6325 | 432 | |
433 | //----------Cuts for RP---------- | |
434 | //KINEMATICS (MC and reconstructed) | |
435 | AliCFTrackKineCuts* mcKineCutsRP = new AliCFTrackKineCuts("mcKineCutsRP","MC-level kinematic cuts"); | |
436 | mcKineCutsRP->SetPtRange(ptminRP,ptmaxRP); | |
437 | mcKineCutsRP->SetEtaRange(etaminRP,etamaxRP); | |
438 | //mcKineCutsRP->SetChargeMC(chargeRP); | |
21f8d9b1 | 439 | mcKineCutsRP->SetRequireIsCharged(isChargedRP); |
93329510 | 440 | if (QA) { |
c0ed6325 | 441 | mcKineCutsRP->SetQAOn(qaRP); |
93329510 | 442 | } |
443 | ||
c0ed6325 | 444 | AliCFTrackKineCuts *recKineCutsRP = new AliCFTrackKineCuts("recKineCutsRP","rec-level kine cuts"); |
445 | recKineCutsRP->SetPtRange(ptminRP,ptmaxRP); | |
446 | recKineCutsRP->SetEtaRange(etaminRP,etamaxRP); | |
447 | //recKineCutsRP->SetChargeRec(chargeRP); | |
21f8d9b1 | 448 | recKineCutsRP->SetRequireIsCharged(isChargedRP); |
93329510 | 449 | if (QA) { |
c0ed6325 | 450 | recKineCutsRP->SetQAOn(qaRP); |
93329510 | 451 | } |
c0ed6325 | 452 | |
453 | //PID (MC and reconstructed) | |
454 | AliCFParticleGenCuts* mcGenCutsRP = new AliCFParticleGenCuts("mcGenCutsRP","MC particle generation cuts for RP"); | |
455 | mcGenCutsRP->SetRequireIsPrimary(); | |
456 | if (UsePIDforRP) {mcGenCutsRP->SetRequirePdgCode(PdgRP);} | |
93329510 | 457 | if (QA) { |
c0ed6325 | 458 | mcGenCutsRP->SetQAOn(qaRP); |
93329510 | 459 | } |
460 | ||
c0ed6325 | 461 | int n_species = AliPID::kSPECIES ; |
462 | Double_t* prior = new Double_t[n_species]; | |
463 | ||
464 | prior[0] = 0.0244519 ; | |
465 | prior[1] = 0.0143988 ; | |
466 | prior[2] = 0.805747 ; | |
467 | prior[3] = 0.0928785 ; | |
468 | prior[4] = 0.0625243 ; | |
469 | ||
470 | AliCFTrackCutPid* cutPidRP = NULL; | |
471 | if(UsePIDforRP) { | |
472 | cutPidRP = new AliCFTrackCutPid("cutPidRP","ESD_PID for RP") ; | |
473 | cutPidRP->SetPriors(prior); | |
474 | cutPidRP->SetProbabilityCut(0.0); | |
475 | cutPidRP->SetDetectors("TPC TOF"); | |
476 | switch(TMath::Abs(PDG1)) { | |
477 | case 11 : cutPidRP->SetParticleType(AliPID::kElectron, kTRUE); break; | |
478 | case 13 : cutPidRP->SetParticleType(AliPID::kMuon , kTRUE); break; | |
479 | case 211 : cutPidRP->SetParticleType(AliPID::kPion , kTRUE); break; | |
480 | case 321 : cutPidRP->SetParticleType(AliPID::kKaon , kTRUE); break; | |
481 | case 2212 : cutPidRP->SetParticleType(AliPID::kProton , kTRUE); break; | |
482 | default : printf("UNDEFINED PID\n"); break; | |
483 | } | |
484 | if (QA) { | |
485 | cutPidRP->SetQAOn(qaRP); | |
486 | } | |
93329510 | 487 | } |
488 | ||
c0ed6325 | 489 | //TRACK QUALITY |
490 | AliCFTrackQualityCuts *recQualityCutsRP = new AliCFTrackQualityCuts("recQualityCutsRP","rec-level quality cuts"); | |
491 | recQualityCutsRP->SetMinNClusterTPC(minClustersTpcRP); | |
492 | //recQualityCutsRP->SetMinFoundClusterTPC(minFoundClustersTpcRP); //only for internal TPC QA | |
493 | recQualityCutsRP->SetMaxChi2PerClusterTPC(maxChi2PerClusterTpcRP); | |
494 | recQualityCutsRP->SetMinNdEdxClusterTPC(minDedxClusterTpcRP); //to reject secondaries | |
495 | ||
496 | recQualityCutsRP->SetMinNClusterITS(minClustersItsRP); | |
497 | recQualityCutsRP->SetMaxChi2PerClusterITS(maxChi2PerClusterItsRP); | |
498 | ||
499 | recQualityCutsRP->SetMinNClusterTRD(minClustersTrdRP); | |
500 | recQualityCutsRP->SetMinNTrackletTRD(minTrackletTrdRP); | |
501 | recQualityCutsRP->SetMinNTrackletTRDpid(minTrackletTrdPidRP); | |
502 | recQualityCutsRP->SetMaxChi2PerTrackletTRD(maxChi2PerClusterTrdRP); | |
503 | recQualityCutsRP->SetStatus(statusRP); | |
93329510 | 504 | if (QA) { |
c0ed6325 | 505 | recQualityCutsRP->SetQAOn(qaRP); |
93329510 | 506 | } |
c0ed6325 | 507 | |
508 | /* | |
509 | //How to set this? | |
510 | void SetMaxCovDiagonalElements(Float_t c1=1.e+09, Float_t c2=1.e+09, Float_t c3=1.e+09, Float_t c4=1.e+09, Float_t c5=1.e+09) | |
511 | {fCovariance11Max=c1;fCovariance22Max=c2;fCovariance33Max=c3;fCovariance44Max=c4;fCovariance55Max=c5;} | |
512 | */ | |
513 | ||
514 | //PRIMARIES | |
515 | AliCFTrackIsPrimaryCuts *recIsPrimaryCutsRP = new AliCFTrackIsPrimaryCuts("recIsPrimaryCutsRP","rec-level isPrimary cuts"); | |
516 | recIsPrimaryCutsRP->UseSPDvertex(spdVertexRP); | |
517 | recIsPrimaryCutsRP->UseTPCvertex(tpcVertexRP); | |
518 | recIsPrimaryCutsRP->SetMinDCAToVertexXY(minDcaToVertexXyRP); | |
519 | recIsPrimaryCutsRP->SetMinDCAToVertexZ(minDcaToVertexZRP); | |
520 | recIsPrimaryCutsRP->SetMaxDCAToVertexXY(maxDcaToVertexXyRP); | |
521 | recIsPrimaryCutsRP->SetMaxDCAToVertexZ(maxDcaToVertexZRP); | |
522 | recIsPrimaryCutsRP->SetDCAToVertex2D(dcaToVertex2dRP); | |
523 | recIsPrimaryCutsRP->SetAbsDCAToVertex(absDcaToVertexRP); | |
524 | recIsPrimaryCutsRP->SetMinNSigmaToVertex(minNSigmaToVertexRP); | |
525 | recIsPrimaryCutsRP->SetMaxNSigmaToVertex(maxNSigmaToVertexRP); | |
526 | recIsPrimaryCutsRP->SetMaxSigmaDCAxy(maxSigmaDcaXySP); | |
527 | recIsPrimaryCutsRP->SetMaxSigmaDCAz(maxSigmaDcaZSP); | |
528 | recIsPrimaryCutsRP->SetRequireSigmaToVertex(requireSigmaToVertexSP); | |
529 | recIsPrimaryCutsRP->SetAcceptKinkDaughters(acceptKinkDaughtersSP); | |
93329510 | 530 | if (QA) { |
c0ed6325 | 531 | recIsPrimaryCutsRP->SetQAOn(qaRP); |
93329510 | 532 | } |
533 | ||
c0ed6325 | 534 | //ACCEPTANCE |
535 | AliCFAcceptanceCuts *mcAccCutsRP = new AliCFAcceptanceCuts("mcAccCutsRP","MC acceptance cuts"); | |
536 | mcAccCutsRP->SetMinNHitITS(minTrackrefsItsRP); | |
537 | mcAccCutsRP->SetMinNHitTPC(minTrackrefsTpcRP); | |
538 | mcAccCutsRP->SetMinNHitTRD(minTrackrefsTrdRP); | |
539 | mcAccCutsRP->SetMinNHitTOF(minTrackrefsTofRP); | |
540 | mcAccCutsRP->SetMinNHitMUON(minTrackrefsMuonRP); | |
93329510 | 541 | if (QA) { |
c0ed6325 | 542 | mcAccCutsRP->SetQAOn(qaRP); |
93329510 | 543 | } |
c0ed6325 | 544 | |
93329510 | 545 | |
c0ed6325 | 546 | //----------Cuts for POI---------- |
547 | //KINEMATICS (MC and reconstructed) | |
548 | AliCFTrackKineCuts* mcKineCutsPOI = new AliCFTrackKineCuts("mcKineCutsPOI","MC-level kinematic cuts"); | |
549 | mcKineCutsPOI->SetPtRange(ptminPOI,ptmaxPOI); | |
550 | mcKineCutsPOI->SetEtaRange(etaminPOI,etamaxPOI); | |
551 | //mcKineCutsPOI->SetChargeMC(chargePOI); | |
21f8d9b1 | 552 | mcKineCutsPOI->SetRequireIsCharged(isChargedPOI); |
93329510 | 553 | if (QA) { |
c0ed6325 | 554 | mcKineCutsPOI->SetQAOn(qaPOI); |
93329510 | 555 | } |
556 | ||
c0ed6325 | 557 | AliCFTrackKineCuts *recKineCutsPOI = new AliCFTrackKineCuts("recKineCutsPOI","rec-level kine cuts"); |
558 | recKineCutsPOI->SetPtRange(ptminPOI,ptmaxPOI); | |
559 | recKineCutsPOI->SetEtaRange(etaminPOI,etamaxPOI); | |
560 | //recKineCutsPOI->SetChargeRec(chargePOI); | |
21f8d9b1 | 561 | recKineCutsPOI->SetRequireIsCharged(isChargedPOI); |
93329510 | 562 | if (QA) { |
c0ed6325 | 563 | recKineCutsPOI->SetQAOn(qaPOI); |
93329510 | 564 | } |
565 | ||
c0ed6325 | 566 | //PID (MC and reconstructed) |
567 | AliCFParticleGenCuts* mcGenCutsPOI = new AliCFParticleGenCuts("mcGenCutsPOI","MC particle generation cuts for POI"); | |
568 | mcGenCutsPOI->SetRequireIsPrimary(); | |
569 | if (UsePIDforPOI) {mcGenCutsPOI->SetRequirePdgCode(PdgPOI);} | |
93329510 | 570 | if (QA) { |
c0ed6325 | 571 | mcGenCutsPOI->SetQAOn(qaPOI); |
93329510 | 572 | } |
c0ed6325 | 573 | |
574 | AliCFTrackCutPid* cutPidPOI = NULL; | |
93329510 | 575 | if (UsePIDforPOI) { |
c0ed6325 | 576 | cutPidPOI = new AliCFTrackCutPid("cutPidPOI","ESD_PID for POI") ; |
577 | cutPidPOI->SetPriors(prior); | |
578 | cutPidPOI->SetProbabilityCut(0.0); | |
579 | cutPidPOI->SetDetectors("TPC TOF"); | |
93329510 | 580 | switch(TMath::Abs(PDG2)) { |
c0ed6325 | 581 | case 11 : cutPidPOI->SetParticleType(AliPID::kElectron, kTRUE); break; |
582 | case 13 : cutPidPOI->SetParticleType(AliPID::kMuon , kTRUE); break; | |
583 | case 211 : cutPidPOI->SetParticleType(AliPID::kPion , kTRUE); break; | |
584 | case 321 : cutPidPOI->SetParticleType(AliPID::kKaon , kTRUE); break; | |
585 | case 2212 : cutPidPOI->SetParticleType(AliPID::kProton , kTRUE); break; | |
93329510 | 586 | default : printf("UNDEFINED PID\n"); break; |
587 | } | |
588 | if (QA) { | |
c0ed6325 | 589 | cutPidPOI->SetQAOn(qaPOI); |
93329510 | 590 | } |
591 | } | |
c0ed6325 | 592 | |
593 | //TRACK QUALITY | |
594 | AliCFTrackQualityCuts *recQualityCutsPOI = new AliCFTrackQualityCuts("recQualityCutsPOI","rec-level quality cuts"); | |
595 | recQualityCutsPOI->SetMinNClusterTPC(minClustersTpcPOI); | |
596 | //recQualityCutsPOI->SetMinFoundClusterTPC(minFoundClustersTpcPOI); //only for internal TPC QA | |
597 | recQualityCutsPOI->SetMaxChi2PerClusterTPC(maxChi2PerClusterTpcPOI); | |
598 | recQualityCutsPOI->SetMinNdEdxClusterTPC(minDedxClusterTpcPOI); //to reject secondaries | |
599 | ||
600 | recQualityCutsPOI->SetMinNClusterITS(minClustersItsPOI); | |
601 | recQualityCutsPOI->SetMaxChi2PerClusterITS(maxChi2PerClusterItsPOI); | |
602 | ||
603 | recQualityCutsPOI->SetMinNClusterTRD(minClustersTrdPOI); | |
604 | recQualityCutsPOI->SetMinNTrackletTRD(minTrackletTrdPOI); | |
605 | recQualityCutsPOI->SetMinNTrackletTRDpid(minTrackletTrdPidPOI); | |
606 | recQualityCutsPOI->SetMaxChi2PerTrackletTRD(maxChi2PerClusterTrdPOI); | |
607 | recQualityCutsPOI->SetStatus(statusPOI); | |
608 | if (QA) { | |
609 | recQualityCutsPOI->SetQAOn(qaPOI); | |
610 | } | |
611 | ||
612 | //PRIMARIES | |
613 | AliCFTrackIsPrimaryCuts *recIsPrimaryCutsPOI = new AliCFTrackIsPrimaryCuts("recIsPrimaryCutsPOI","rec-level isPrimary cuts"); | |
614 | recIsPrimaryCutsPOI->UseSPDvertex(spdVertexPOI); | |
615 | recIsPrimaryCutsPOI->UseTPCvertex(tpcVertexPOI); | |
616 | recIsPrimaryCutsPOI->SetMinDCAToVertexXY(minDcaToVertexXyPOI); | |
617 | recIsPrimaryCutsPOI->SetMinDCAToVertexZ(minDcaToVertexZPOI); | |
618 | recIsPrimaryCutsPOI->SetMaxDCAToVertexXY(maxDcaToVertexXyPOI); | |
619 | recIsPrimaryCutsPOI->SetMaxDCAToVertexZ(maxDcaToVertexZPOI); | |
620 | recIsPrimaryCutsPOI->SetDCAToVertex2D(dcaToVertex2dPOI); | |
621 | recIsPrimaryCutsPOI->SetAbsDCAToVertex(absDcaToVertexPOI); | |
622 | recIsPrimaryCutsPOI->SetMinNSigmaToVertex(minNSigmaToVertexPOI); | |
623 | recIsPrimaryCutsPOI->SetMaxNSigmaToVertex(maxNSigmaToVertexPOI); | |
624 | recIsPrimaryCutsPOI->SetMaxSigmaDCAxy(maxSigmaDcaXyPOI); | |
625 | recIsPrimaryCutsPOI->SetMaxSigmaDCAz(maxSigmaDcaZPOI); | |
626 | recIsPrimaryCutsPOI->SetRequireSigmaToVertex(requireSigmaToVertexPOI); | |
627 | recIsPrimaryCutsPOI->SetAcceptKinkDaughters(acceptKinkDaughtersPOI); | |
628 | if (QA) { | |
629 | recIsPrimaryCutsPOI->SetQAOn(qaPOI); | |
630 | } | |
631 | ||
632 | //ACCEPTANCE | |
633 | AliCFAcceptanceCuts *mcAccCutsPOI = new AliCFAcceptanceCuts("mcAccCutsPOI","MC acceptance cuts"); | |
634 | mcAccCutsPOI->SetMinNHitITS(minTrackrefsItsPOI); | |
635 | mcAccCutsPOI->SetMinNHitTPC(minTrackrefsTpcPOI); | |
636 | mcAccCutsPOI->SetMinNHitTRD(minTrackrefsTrdPOI); | |
637 | mcAccCutsPOI->SetMinNHitTOF(minTrackrefsTofPOI); | |
638 | mcAccCutsPOI->SetMinNHitMUON(minTrackrefsMuonPOI); | |
639 | if (QA) { | |
640 | mcAccCutsPOI->SetQAOn(qaPOI); | |
641 | } | |
642 | ||
643 | ||
93329510 | 644 | |
c0ed6325 | 645 | //----------Create Cut Lists---------- |
94cd9888 | 646 | printf("CREATE EVENT CUTS\n"); |
c0ed6325 | 647 | TObjArray* mcEventList = new TObjArray(0); |
40ca990b | 648 | if (UseMultCutforESD) mcEventList->AddLast(mcEventCuts);//cut on mult and vertex |
94cd9888 | 649 | |
650 | TObjArray* recEventList = new TObjArray(0); | |
40ca990b | 651 | if (UseMultCutforESD) recEventList->AddLast(recEventCuts);//cut on mult and vertex |
94cd9888 | 652 | |
93329510 | 653 | printf("CREATE MC KINE CUTS\n"); |
c0ed6325 | 654 | TObjArray* mcListRP = new TObjArray(0); |
655 | if (UseKineforRP) mcListRP->AddLast(mcKineCutsRP); //cut on pt/eta/phi | |
656 | mcListRP->AddLast(mcGenCutsRP); //cut on primary and if (UsePIDforRP) MC PID | |
93329510 | 657 | |
c0ed6325 | 658 | TObjArray* mcListPOI = new TObjArray(0); |
659 | if (UseKineforPOI) mcListPOI->AddLast(mcKineCutsPOI); //cut on pt/eta/phi | |
660 | mcListPOI->AddLast(mcGenCutsPOI); //cut on primary and if (UsePIDforPOI) MC PID | |
93329510 | 661 | |
c0ed6325 | 662 | printf("CREATE MC ACCEPTANCE CUTS\n"); |
663 | TObjArray* accListRP = new TObjArray(0) ; | |
664 | if (UseAcceptanceforRP) accListRP->AddLast(mcAccCutsRP); //cut on number of track references | |
93329510 | 665 | |
c0ed6325 | 666 | TObjArray* accListPOI = new TObjArray(0) ; |
667 | if (UseAcceptanceforPOI) accListPOI->AddLast(mcAccCutsPOI); //cut on number of track references | |
93329510 | 668 | |
c0ed6325 | 669 | printf("CREATE ESD RECONSTRUCTION CUTS\n"); |
670 | TObjArray* recListRP = new TObjArray(0) ; | |
21f8d9b1 | 671 | if (UseTrackQualityforRP) recListRP->AddLast(recQualityCutsRP); //track quality |
c0ed6325 | 672 | if (UsePrimariesforRP) recListRP->AddLast(recIsPrimaryCutsRP); //cut if it is a primary |
21f8d9b1 | 673 | if (UseKineforRP) recListRP->AddLast(recKineCutsRP); //cut on pt/eta/phi |
674 | ||
c0ed6325 | 675 | TObjArray* recListPOI = new TObjArray(0) ; |
21f8d9b1 | 676 | if (UseTrackQualityforPOI) recListPOI->AddLast(recQualityCutsPOI); //track quality |
c0ed6325 | 677 | if (UsePrimariesforPOI) recListPOI->AddLast(recIsPrimaryCutsPOI); //cut if it is a primary |
21f8d9b1 | 678 | if (UseKineforPOI) recListPOI->AddLast(recKineCutsPOI); //cut on pt/eta/phi |
679 | ||
c0ed6325 | 680 | printf("CREATE ESD PID CUTS\n"); |
681 | TObjArray* fPIDCutListRP = new TObjArray(0) ; | |
682 | if(UsePIDforRP) {fPIDCutListRP->AddLast(cutPidRP);} //cut on ESD PID | |
93329510 | 683 | |
c0ed6325 | 684 | TObjArray* fPIDCutListPOI = new TObjArray(0) ; |
685 | if (UsePIDforPOI) {fPIDCutListPOI->AddLast(cutPidPOI);} //cut on ESD PID | |
93329510 | 686 | |
c0ed6325 | 687 | |
688 | //----------Add Cut Lists to the CF Manager---------- | |
93329510 | 689 | printf("CREATE INTERFACE AND CUTS\n"); |
c0ed6325 | 690 | AliCFManager* cfmgrRP = new AliCFManager(); |
691 | cfmgrRP->SetNStepEvent(3); | |
692 | cfmgrRP->SetEventCutsList(AliCFManager::kEvtGenCuts,mcEventList); | |
693 | cfmgrRP->SetEventCutsList(AliCFManager::kEvtRecCuts,recEventList); | |
694 | cfmgrRP->SetNStepParticle(4); | |
695 | cfmgrRP->SetParticleCutsList(AliCFManager::kPartGenCuts,mcListRP); | |
696 | cfmgrRP->SetParticleCutsList(AliCFManager::kPartAccCuts,accListRP); | |
697 | cfmgrRP->SetParticleCutsList(AliCFManager::kPartRecCuts,recListRP); | |
698 | cfmgrRP->SetParticleCutsList(AliCFManager::kPartSelCuts,fPIDCutListRP); | |
93329510 | 699 | |
c0ed6325 | 700 | AliCFManager* cfmgrPOI = new AliCFManager(); |
701 | cfmgrPOI->SetNStepEvent(3); | |
702 | cfmgrPOI->SetEventCutsList(AliCFManager::kEvtGenCuts,mcEventList); | |
703 | cfmgrPOI->SetEventCutsList(AliCFManager::kEvtRecCuts,recEventList); | |
704 | cfmgrPOI->SetNStepParticle(4); | |
705 | cfmgrPOI->SetParticleCutsList(AliCFManager::kPartGenCuts,mcListPOI); | |
706 | cfmgrPOI->SetParticleCutsList(AliCFManager::kPartAccCuts,accListPOI); | |
707 | cfmgrPOI->SetParticleCutsList(AliCFManager::kPartRecCuts,recListPOI); | |
708 | cfmgrPOI->SetParticleCutsList(AliCFManager::kPartSelCuts,fPIDCutListPOI); | |
93329510 | 709 | |
710 | if (QA) { | |
711 | taskFE->SetQAList1(qaRP); | |
712 | taskFE->SetQAList2(qaPOI); | |
713 | } | |
c0ed6325 | 714 | taskFE->SetCFManager1(cfmgrRP); |
715 | taskFE->SetCFManager2(cfmgrPOI); | |
93329510 | 716 | |
717 | ||
718 | ||
719 | // Create the analysis tasks, add them to the manager. | |
720 | //=========================================================================== | |
721 | if (SP){ | |
29195b69 | 722 | AliAnalysisTaskScalarProduct *taskSP = new AliAnalysisTaskScalarProduct("TaskScalarProduct",WEIGHTS[0]); |
a02a1889 | 723 | taskSP->SetRelDiffMsub(1.0); |
3c5d5752 | 724 | taskSP->SetApplyCorrectionForNUA(kFALSE); |
93329510 | 725 | mgr->AddTask(taskSP); |
726 | } | |
c741f5d0 | 727 | if (LYZ1SUM){ |
728 | AliAnalysisTaskLeeYangZeros *taskLYZ1SUM = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZerosSUM",kTRUE); | |
729 | taskLYZ1SUM->SetFirstRunLYZ(kTRUE); | |
730 | taskLYZ1SUM->SetUseSumLYZ(kTRUE); | |
731 | mgr->AddTask(taskLYZ1SUM); | |
732 | } | |
733 | if (LYZ1PROD){ | |
734 | AliAnalysisTaskLeeYangZeros *taskLYZ1PROD = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZerosPROD",kTRUE); | |
735 | taskLYZ1PROD->SetFirstRunLYZ(kTRUE); | |
736 | taskLYZ1PROD->SetUseSumLYZ(kFALSE); | |
737 | mgr->AddTask(taskLYZ1PROD); | |
738 | } | |
739 | if (LYZ2SUM){ | |
740 | AliAnalysisTaskLeeYangZeros *taskLYZ2SUM = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZerosSUM",kFALSE); | |
741 | taskLYZ2SUM->SetFirstRunLYZ(kFALSE); | |
742 | taskLYZ2SUM->SetUseSumLYZ(kTRUE); | |
743 | mgr->AddTask(taskLYZ2SUM); | |
744 | } | |
745 | if (LYZ2PROD){ | |
746 | AliAnalysisTaskLeeYangZeros *taskLYZ2PROD = new AliAnalysisTaskLeeYangZeros("TaskLeeYangZerosPROD",kFALSE); | |
747 | taskLYZ2PROD->SetFirstRunLYZ(kFALSE); | |
748 | taskLYZ2PROD->SetUseSumLYZ(kFALSE); | |
749 | mgr->AddTask(taskLYZ2PROD); | |
93329510 | 750 | } |
751 | if (LYZEP){ | |
752 | AliAnalysisTaskLYZEventPlane *taskLYZEP = new AliAnalysisTaskLYZEventPlane("TaskLYZEventPlane"); | |
753 | mgr->AddTask(taskLYZEP); | |
754 | } | |
755 | if (GFC){ | |
756 | AliAnalysisTaskCumulants *taskGFC = new AliAnalysisTaskCumulants("TaskCumulants",useWeights); | |
757 | taskGFC->SetUsePhiWeights(WEIGHTS[0]); | |
758 | taskGFC->SetUsePtWeights(WEIGHTS[1]); | |
759 | taskGFC->SetUseEtaWeights(WEIGHTS[2]); | |
760 | mgr->AddTask(taskGFC); | |
761 | } | |
762 | if (QC){ | |
763 | AliAnalysisTaskQCumulants *taskQC = new AliAnalysisTaskQCumulants("TaskQCumulants",useWeights); | |
764 | taskQC->SetUsePhiWeights(WEIGHTS[0]); | |
765 | taskQC->SetUsePtWeights(WEIGHTS[1]); | |
766 | taskQC->SetUseEtaWeights(WEIGHTS[2]); | |
067e9bc8 | 767 | taskQC->SetnBinsMult(10000); |
768 | taskQC->SetMinMult(0.); | |
769 | taskQC->SetMaxMult(10000.); | |
93329510 | 770 | mgr->AddTask(taskQC); |
771 | } | |
772 | if (FQD){ | |
773 | AliAnalysisTaskFittingQDistribution *taskFQD = new AliAnalysisTaskFittingQDistribution("TaskFittingQDistribution",kFALSE); | |
774 | taskFQD->SetUsePhiWeights(WEIGHTS[0]); | |
f0e0fbcd | 775 | taskFQD->SetqMin(0.); |
776 | taskFQD->SetqMax(1000.); | |
777 | taskFQD->SetqNbins(10000); | |
93329510 | 778 | mgr->AddTask(taskFQD); |
779 | } | |
780 | if (MCEP){ | |
781 | AliAnalysisTaskMCEventPlane *taskMCEP = new AliAnalysisTaskMCEventPlane("TaskMCEventPlane"); | |
782 | mgr->AddTask(taskMCEP); | |
783 | } | |
67a6b178 | 784 | if (MH){ |
785 | AliAnalysisTaskMixedHarmonics *taskMH = new AliAnalysisTaskMixedHarmonics("TaskMixedHarmonics",useWeights); | |
e999459d | 786 | taskMH->SetHarmonic(1); // n in cos[n(phi1+phi2-2phi3)] and cos[n(psi1+psi2-2phi3)] |
67a6b178 | 787 | taskMH->SetNoOfMultipicityBins(10); |
788 | taskMH->SetMultipicityBinWidth(2); | |
789 | taskMH->SetMinMultiplicity(3); | |
790 | taskMH->SetCorrectForDetectorEffects(kTRUE); | |
e999459d | 791 | taskMH->SetEvaluateDifferential3pCorrelator(kFALSE); // evaluate <<cos[n(psi1+psi2-2phi3)]>> (Remark: two nested loops) |
792 | taskMH->SetOppositeChargesPOI(kFALSE); // POIs psi1 and psi2 in cos[n(psi1+psi2-2phi3)] will have opposite charges | |
67a6b178 | 793 | mgr->AddTask(taskMH); |
794 | } | |
795 | if (NL){ | |
796 | AliAnalysisTaskNestedLoops *taskNL = new AliAnalysisTaskNestedLoops("TaskNestedLoops",useWeights); | |
e999459d | 797 | taskNL->SetHarmonic(1); // n in cos[n(phi1+phi2-2phi3)] and cos[n(psi1+psi2-2phi3)] |
798 | taskNL->SetEvaluateNestedLoopsForRAD(kTRUE); // RAD = Relative Angle Distribution | |
799 | taskNL->SetEvaluateNestedLoopsForMH(kTRUE); // evalaute <<cos[n(phi1+phi2-2phi3)]>> (Remark: three nested loops) | |
800 | taskNL->SetEvaluateDifferential3pCorrelator(kFALSE); // evaluate <<cos[n(psi1+psi2-2phi3)]>> (Remark: three nested loops) | |
801 | taskNL->SetOppositeChargesPOI(kFALSE); // POIs psi1 and psi2 in cos[n(psi1+psi2-2phi3)] will have opposite charges | |
67a6b178 | 802 | mgr->AddTask(taskNL); |
803 | } | |
804 | ||
93329510 | 805 | // Create the output container for the data produced by the task |
806 | // Connect to the input and output containers | |
807 | //=========================================================================== | |
808 | AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer(); | |
44e060e0 | 809 | |
810 | if (rptype == "FMD") { | |
811 | AliAnalysisDataContainer *coutputFMD = | |
812 | mgr->CreateContainer("BackgroundCorrected", TList::Class(), AliAnalysisManager::kExchangeContainer); | |
813 | //input and output taskFMD | |
814 | mgr->ConnectInput(taskfmd, 0, cinput1); | |
815 | mgr->ConnectOutput(taskfmd, 1, coutputFMD); | |
816 | //input into taskFE | |
817 | mgr->ConnectInput(taskFE,1,coutputFMD); | |
818 | } | |
a02a1889 | 819 | |
44e060e0 | 820 | AliAnalysisDataContainer *coutputFE = |
821 | mgr->CreateContainer("cobjFlowEventSimple", AliFlowEventSimple::Class(),AliAnalysisManager::kExchangeContainer); | |
93329510 | 822 | mgr->ConnectInput(taskFE,0,cinput1); |
f6cf97c1 | 823 | mgr->ConnectOutput(taskFE,1,coutputFE); |
93329510 | 824 | |
825 | if (QA) { | |
47d5b28f | 826 | TString qaNameRPFE = AliAnalysisManager::GetCommonFileName(); |
827 | qaNameRPFE += ":QAforRP_FE_"; | |
93329510 | 828 | qaNameRPFE += type; |
47d5b28f | 829 | |
830 | AliAnalysisDataContainer *coutputQA1FE = | |
831 | mgr->CreateContainer("QARPFE", TList::Class(),AliAnalysisManager::kOutputContainer,qaNameRPFE); | |
93329510 | 832 | |
47d5b28f | 833 | TString qaNamePOIFE = AliAnalysisManager::GetCommonFileName(); |
834 | qaNamePOIFE += ":QAforPOI_FE_"; | |
93329510 | 835 | qaNamePOIFE += type; |
47d5b28f | 836 | |
837 | AliAnalysisDataContainer *coutputQA2FE = | |
838 | mgr->CreateContainer("QAPOIFE", TList::Class(),AliAnalysisManager::kOutputContainer,qaNamePOIFE); | |
839 | ||
f6cf97c1 | 840 | mgr->ConnectOutput(taskFE,2,coutputQA1FE); |
841 | mgr->ConnectOutput(taskFE,3,coutputQA2FE); | |
93329510 | 842 | } |
843 | ||
844 | // Create the output containers for the data produced by the analysis tasks | |
845 | // Connect to the input and output containers | |
846 | //=========================================================================== | |
847 | if (useWeights) { | |
848 | AliAnalysisDataContainer *cinputWeights = mgr->CreateContainer("cobjWeights",TList::Class(),AliAnalysisManager::kInputContainer); | |
849 | } | |
850 | ||
851 | if(SP) { | |
47d5b28f | 852 | TString outputSP = AliAnalysisManager::GetCommonFileName(); |
853 | outputSP += ":outputSPanalysis"; | |
93329510 | 854 | outputSP+= type; |
47d5b28f | 855 | |
856 | AliAnalysisDataContainer *coutputSP = mgr->CreateContainer("cobjSP", TList::Class(),AliAnalysisManager::kOutputContainer,outputSP); | |
93329510 | 857 | mgr->ConnectInput(taskSP,0,coutputFE); |
ea456d37 | 858 | mgr->ConnectOutput(taskSP,1,coutputSP); |
29195b69 | 859 | if (WEIGHTS[0]) { |
860 | mgr->ConnectInput(taskSP,1,cinputWeights); | |
861 | cinputWeights->SetData(weightsList); | |
862 | } | |
93329510 | 863 | } |
c741f5d0 | 864 | if(LYZ1SUM) { |
47d5b28f | 865 | TString outputLYZ1SUM = AliAnalysisManager::GetCommonFileName(); |
866 | outputLYZ1SUM += ":outputLYZ1SUManalysis"; | |
c741f5d0 | 867 | outputLYZ1SUM+= type; |
47d5b28f | 868 | |
869 | AliAnalysisDataContainer *coutputLYZ1SUM = mgr->CreateContainer("cobjLYZ1SUM", TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ1SUM); | |
c741f5d0 | 870 | mgr->ConnectInput(taskLYZ1SUM,0,coutputFE); |
22063257 | 871 | mgr->ConnectOutput(taskLYZ1SUM,1,coutputLYZ1SUM); |
c741f5d0 | 872 | } |
873 | if(LYZ1PROD) { | |
47d5b28f | 874 | TString outputLYZ1PROD = AliAnalysisManager::GetCommonFileName(); |
875 | outputLYZ1PROD += ":outputLYZ1PRODanalysis"; | |
c741f5d0 | 876 | outputLYZ1PROD+= type; |
47d5b28f | 877 | |
878 | AliAnalysisDataContainer *coutputLYZ1PROD = mgr->CreateContainer("cobjLYZ1PROD", TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ1PROD); | |
c741f5d0 | 879 | mgr->ConnectInput(taskLYZ1PROD,0,coutputFE); |
22063257 | 880 | mgr->ConnectOutput(taskLYZ1PROD,1,coutputLYZ1PROD); |
c741f5d0 | 881 | } |
882 | if(LYZ2SUM) { | |
883 | AliAnalysisDataContainer *cinputLYZ2SUM = mgr->CreateContainer("cobjLYZ2SUMin",TList::Class(),AliAnalysisManager::kInputContainer); | |
47d5b28f | 884 | TString outputLYZ2SUM = AliAnalysisManager::GetCommonFileName(); |
885 | outputLYZ2SUM += ":outputLYZ2SUManalysis"; | |
c741f5d0 | 886 | outputLYZ2SUM+= type; |
47d5b28f | 887 | |
888 | AliAnalysisDataContainer *coutputLYZ2SUM = mgr->CreateContainer("cobjLYZ2SUM", TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ2SUM); | |
c741f5d0 | 889 | mgr->ConnectInput(taskLYZ2SUM,0,coutputFE); |
890 | mgr->ConnectInput(taskLYZ2SUM,1,cinputLYZ2SUM); | |
22063257 | 891 | mgr->ConnectOutput(taskLYZ2SUM,1,coutputLYZ2SUM); |
c741f5d0 | 892 | cinputLYZ2SUM->SetData(fInputListLYZ2SUM); |
893 | } | |
894 | if(LYZ2PROD) { | |
895 | AliAnalysisDataContainer *cinputLYZ2PROD = mgr->CreateContainer("cobjLYZ2PRODin",TList::Class(),AliAnalysisManager::kInputContainer); | |
47d5b28f | 896 | TString outputLYZ2PROD = AliAnalysisManager::GetCommonFileName(); |
897 | outputLYZ2PROD += ":outputLYZ2PRODanalysis"; | |
c741f5d0 | 898 | outputLYZ2PROD+= type; |
47d5b28f | 899 | |
900 | AliAnalysisDataContainer *coutputLYZ2PROD = mgr->CreateContainer("cobjLYZ2PROD", TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZ2PROD); | |
c741f5d0 | 901 | mgr->ConnectInput(taskLYZ2PROD,0,coutputFE); |
902 | mgr->ConnectInput(taskLYZ2PROD,1,cinputLYZ2PROD); | |
22063257 | 903 | mgr->ConnectOutput(taskLYZ2PROD,1,coutputLYZ2PROD); |
c741f5d0 | 904 | cinputLYZ2PROD->SetData(fInputListLYZ2PROD); |
93329510 | 905 | } |
906 | if(LYZEP) { | |
907 | AliAnalysisDataContainer *cinputLYZEP = mgr->CreateContainer("cobjLYZEPin",TList::Class(),AliAnalysisManager::kInputContainer); | |
47d5b28f | 908 | TString outputLYZEP = AliAnalysisManager::GetCommonFileName(); |
909 | outputLYZEP += ":outputLYZEPanalysis"; | |
93329510 | 910 | outputLYZEP+= type; |
47d5b28f | 911 | |
912 | AliAnalysisDataContainer *coutputLYZEP = mgr->CreateContainer("cobjLYZEP", TList::Class(),AliAnalysisManager::kOutputContainer,outputLYZEP); | |
93329510 | 913 | mgr->ConnectInput(taskLYZEP,0,coutputFE); |
914 | mgr->ConnectInput(taskLYZEP,1,cinputLYZEP); | |
22063257 | 915 | mgr->ConnectOutput(taskLYZEP,1,coutputLYZEP); |
93329510 | 916 | cinputLYZEP->SetData(fInputListLYZEP); |
917 | } | |
918 | if(GFC) { | |
47d5b28f | 919 | TString outputGFC = AliAnalysisManager::GetCommonFileName(); |
920 | outputGFC += ":outputGFCanalysis"; | |
93329510 | 921 | outputGFC+= type; |
47d5b28f | 922 | |
923 | AliAnalysisDataContainer *coutputGFC = mgr->CreateContainer("cobjGFC", TList::Class(),AliAnalysisManager::kOutputContainer,outputGFC); | |
93329510 | 924 | mgr->ConnectInput(taskGFC,0,coutputFE); |
2ed70edf | 925 | mgr->ConnectOutput(taskGFC,1,coutputGFC); |
93329510 | 926 | if (useWeights) { |
927 | mgr->ConnectInput(taskGFC,1,cinputWeights); | |
928 | cinputWeights->SetData(weightsList); | |
929 | } | |
930 | } | |
931 | if(QC) { | |
47d5b28f | 932 | TString outputQC = AliAnalysisManager::GetCommonFileName(); |
933 | outputQC += ":outputQCanalysis"; | |
93329510 | 934 | outputQC+= type; |
47d5b28f | 935 | |
936 | AliAnalysisDataContainer *coutputQC = mgr->CreateContainer("cobjQC", TList::Class(),AliAnalysisManager::kOutputContainer,outputQC); | |
93329510 | 937 | mgr->ConnectInput(taskQC,0,coutputFE); |
2ed70edf | 938 | mgr->ConnectOutput(taskQC,1,coutputQC); |
93329510 | 939 | if (useWeights) { |
940 | mgr->ConnectInput(taskQC,1,cinputWeights); | |
941 | cinputWeights->SetData(weightsList); | |
2ed70edf | 942 | } |
93329510 | 943 | } |
944 | if(FQD) { | |
47d5b28f | 945 | TString outputFQD = AliAnalysisManager::GetCommonFileName(); |
946 | outputFQD += ":outputFQDanalysis"; | |
93329510 | 947 | outputFQD+= type; |
47d5b28f | 948 | |
949 | AliAnalysisDataContainer *coutputFQD = mgr->CreateContainer("cobjFQD", TList::Class(),AliAnalysisManager::kOutputContainer,outputFQD); | |
93329510 | 950 | mgr->ConnectInput(taskFQD,0,coutputFE); |
2ed70edf | 951 | mgr->ConnectOutput(taskFQD,1,coutputFQD); |
93329510 | 952 | if(useWeights) { |
953 | mgr->ConnectInput(taskFQD,1,cinputWeights); | |
954 | cinputWeights->SetData(weightsList); | |
955 | } | |
956 | } | |
957 | if(MCEP) { | |
47d5b28f | 958 | TString outputMCEP = AliAnalysisManager::GetCommonFileName(); |
959 | outputMCEP += ":outputMCEPanalysis"; | |
93329510 | 960 | outputMCEP+= type; |
47d5b28f | 961 | |
962 | AliAnalysisDataContainer *coutputMCEP = mgr->CreateContainer("cobjMCEP", TList::Class(),AliAnalysisManager::kOutputContainer,outputMCEP); | |
93329510 | 963 | mgr->ConnectInput(taskMCEP,0,coutputFE); |
22063257 | 964 | mgr->ConnectOutput(taskMCEP,1,coutputMCEP); |
93329510 | 965 | } |
67a6b178 | 966 | if(MH) { |
967 | TString outputMH = AliAnalysisManager::GetCommonFileName(); | |
968 | outputMH += ":outputMHanalysis"; | |
969 | outputMH += type; | |
970 | ||
971 | AliAnalysisDataContainer *coutputMH = mgr->CreateContainer("cobjMH", TList::Class(),AliAnalysisManager::kOutputContainer,outputMH); | |
972 | mgr->ConnectInput(taskMH,0,coutputFE); | |
973 | mgr->ConnectOutput(taskMH,1,coutputMH); | |
974 | //if (useWeights) { | |
975 | // mgr->ConnectInput(taskMH,1,cinputWeights); | |
976 | // cinputWeights->SetData(weightsList); | |
977 | //} | |
978 | } | |
979 | if(NL) { | |
980 | TString outputNL = AliAnalysisManager::GetCommonFileName(); | |
981 | outputNL += ":outputNLanalysis"; | |
982 | outputNL += type; | |
983 | ||
984 | AliAnalysisDataContainer *coutputNL = mgr->CreateContainer("cobjNL", TList::Class(),AliAnalysisManager::kOutputContainer,outputNL); | |
985 | mgr->ConnectInput(taskNL,0,coutputFE); | |
986 | mgr->ConnectOutput(taskNL,1,coutputNL); | |
987 | //if (useWeights) { | |
988 | // mgr->ConnectInput(taskNL,1,cinputWeights); | |
989 | // cinputWeights->SetData(weightsList); | |
990 | //} | |
991 | } | |
93329510 | 992 | |
993 | // Return analysis task | |
994 | //=========================================================================== | |
995 | return taskFE; | |
996 | ||
997 | ||
998 | ||
999 | } | |
1000 | ||
1001 | ||
1002 | ||
1003 | ||
1004 |