]>
Commit | Line | Data |
---|---|---|
f1d945a1 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | /* $Id */ | |
16 | ||
17 | #include "Riostream.h" | |
18 | #include "AliFlowEventSimpleMaker.h" | |
19 | #include "AliFlowEventSimple.h" | |
20 | #include "AliFlowTrackSimple.h" | |
21 | #include "TTree.h" | |
22 | #include "TParticle.h" | |
23 | #include "AliMCEvent.h" | |
24 | #include "AliMCParticle.h" | |
25 | #include "AliESDEvent.h" | |
26 | #include "AliESDtrack.h" | |
27 | #include "AliAODEvent.h" | |
28 | #include "AliAODTrack.h" | |
88e00a8a | 29 | #include "../../CORRFW/AliCFManager.h" |
f1d945a1 | 30 | |
31 | // AliFlowEventSimpleMaker: | |
32 | // Class to fill the AliFlowEventSimple | |
33 | // with AliFlowTrackSimple objects | |
34 | // Has fill methods for TTree, AliMCEvent, AliESDEvent and AliAODEvent | |
35 | // author: N. van der Kolk (kolk@nikhef.nl) | |
36 | ||
f1d945a1 | 37 | ClassImp(AliFlowEventSimpleMaker) |
38 | //----------------------------------------------------------------------- | |
e35ddff0 | 39 | AliFlowEventSimpleMaker::AliFlowEventSimpleMaker() |
f1d945a1 | 40 | { |
f1d945a1 | 41 | //constructor |
f1d945a1 | 42 | } |
43 | ||
f1d945a1 | 44 | //----------------------------------------------------------------------- |
45 | AliFlowEventSimpleMaker::~AliFlowEventSimpleMaker() | |
46 | { | |
e35ddff0 | 47 | //destructor |
f1d945a1 | 48 | } |
49 | ||
f1d945a1 | 50 | //----------------------------------------------------------------------- |
e35ddff0 | 51 | AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(TTree* anInput) |
f1d945a1 | 52 | { |
53 | //fills the event from a TTree of kinematic.root files | |
e35ddff0 | 54 | Bool_t bDoubleLoop = kFALSE; |
55 | ||
56 | Int_t iNumberOfInputTracks = anInput->GetEntries() ; | |
57 | //cerr<<"iNumberOfInputTracks = "<<iNumberOfInputTracks<<endl; | |
58 | TParticle* pParticle = new TParticle(); | |
59 | anInput->SetBranchAddress("Particles",&pParticle); | |
60 | // AliFlowEventSimple* pEvent = new AliFlowEventSimple(iNumberOfInputTracks); | |
61 | AliFlowEventSimple* pEvent = new AliFlowEventSimple(10); | |
62 | //cerr<<pEvent<<" pEvent "<<endl; | |
f1d945a1 | 63 | |
e35ddff0 | 64 | Int_t iN = iNumberOfInputTracks; |
65 | // Int_t iN = 576; //multiplicity for chi=1.5 | |
66 | // Int_t iN = 256; //multiplicity for chi=1 | |
67 | // Int_t iN = 164; //multiplicity for chi=0.8 | |
68 | Int_t iGoodTracks = 0; | |
69 | Int_t itrkN = 0; | |
70 | Int_t iSelParticlesDiff = 0; | |
71 | Int_t iSelParticlesInt = 0; | |
f1d945a1 | 72 | |
e35ddff0 | 73 | if (bDoubleLoop) |
f1d945a1 | 74 | { //double loop |
e35ddff0 | 75 | while (iGoodTracks < iN*2 && itrkN < iNumberOfInputTracks) |
f1d945a1 | 76 | { |
e35ddff0 | 77 | anInput->GetEntry(itrkN); //get input particle |
f1d945a1 | 78 | //cut on tracks |
e35ddff0 | 79 | if(TMath::Abs(pParticle->Eta()) < 0.9) |
f1d945a1 | 80 | { |
81 | // Int_t fLoop = floor(2.*fParticle->Pt())+2; | |
82 | // for(Int_t d=0;d<fLoop;d++) | |
83 | for(Int_t d=0;d<2;d++) | |
84 | { | |
85 | if( | |
e35ddff0 | 86 | TMath::Abs(pParticle->GetPdgCode()) == 211 |
87 | // TMath::Abs(pParticle->GetPdgCode()) == 211 || | |
88 | // TMath::Abs(pParticle->GetPdgCode()) == 321 || | |
89 | // TMath::Abs(pParticle->GetPdgCode()) == 2212 | |
f1d945a1 | 90 | ) |
91 | { | |
e35ddff0 | 92 | AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(); |
93 | pTrack->SetPt(pParticle->Pt() ); | |
94 | pTrack->SetEta(pParticle->Eta() ); | |
95 | pTrack->SetPhi(pParticle->Phi() ); | |
96 | pTrack->SetForIntegratedFlow(kTRUE); | |
97 | pTrack->SetForDifferentialFlow(kTRUE); | |
98 | ||
99 | if (pTrack->UseForIntegratedFlow()) | |
100 | { iSelParticlesInt++; } | |
101 | if (pTrack->UseForDifferentialFlow()) | |
102 | { iSelParticlesDiff++; } | |
103 | iGoodTracks++; | |
104 | pEvent->TrackCollection()->Add(pTrack); | |
f1d945a1 | 105 | } |
106 | /* | |
107 | else if( | |
e35ddff0 | 108 | TMath::Abs(pParticle->GetPdgCode()) == 2212 |
f1d945a1 | 109 | ) |
110 | { | |
e35ddff0 | 111 | AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(); |
112 | pTrack->SetPt(pParticle->Pt() ); | |
113 | pTrack->SetEta(pParticle->Eta() ); | |
114 | pTrack->SetPhi(pParticle->Phi() ); | |
115 | pTrack->SetForIntegratedFlow(kFALSE); | |
116 | pTrack->SetForDifferentialFlow(kTRUE); | |
117 | ||
118 | if (pTrack->UseForIntegratedFlow()) | |
119 | { iSelParticlesInt++; } | |
120 | if (pTrack->UseForDifferentialFlow()) | |
121 | { iSelParticlesDiff++; } | |
122 | iGoodTracks++; | |
123 | pEvent->TrackCollection()->Add(pTrack); | |
f1d945a1 | 124 | } |
125 | */ | |
126 | } | |
127 | } | |
e35ddff0 | 128 | itrkN++; |
f1d945a1 | 129 | } |
130 | } | |
131 | ||
132 | else { //normal loop | |
e35ddff0 | 133 | while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) { |
134 | anInput->GetEntry(itrkN); //get input particle | |
f1d945a1 | 135 | //cut on tracks |
e35ddff0 | 136 | if (TMath::Abs(pParticle->Eta()) < 0.2) |
f1d945a1 | 137 | { |
138 | if( | |
e35ddff0 | 139 | TMath::Abs(pParticle->GetPdgCode()) == 211 |
140 | // TMath::Abs(pParticle->GetPdgCode()) == 211 || | |
141 | // TMath::Abs(pParticle->GetPdgCode()) == 321 || | |
142 | // TMath::Abs(pParticle->GetPdgCode()) == 2212 | |
f1d945a1 | 143 | ) |
144 | { | |
e35ddff0 | 145 | AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(); |
146 | pTrack->SetPt(pParticle->Pt() ); | |
147 | pTrack->SetEta(pParticle->Eta() ); | |
148 | pTrack->SetPhi(pParticle->Phi() ); | |
149 | pTrack->SetForIntegratedFlow(kTRUE); | |
150 | pTrack->SetForDifferentialFlow(kTRUE); | |
151 | ||
152 | if (pTrack->UseForIntegratedFlow()) | |
153 | { iSelParticlesInt++; } | |
154 | if (pTrack->UseForDifferentialFlow()) | |
155 | { iSelParticlesDiff++; } | |
156 | iGoodTracks++; | |
157 | pEvent->TrackCollection()->Add(pTrack) ; | |
f1d945a1 | 158 | } |
159 | /* else if( | |
e35ddff0 | 160 | TMath::Abs(pParticle->GetPdgCode()) == 211 |
f1d945a1 | 161 | ) |
162 | { | |
e35ddff0 | 163 | AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(); |
164 | pTrack->SetPt(pParticle->Pt() ); | |
165 | pTrack->SetEta(pParticle->Eta() ); | |
166 | pTrack->SetPhi(pParticle->Phi() ); | |
167 | pTrack->SetForIntegratedFlow(kFALSE); | |
168 | pTrack->SetForDifferentialFlow(kTRUE); | |
169 | ||
170 | if (pTrack->UseForIntegratedFlow()) | |
171 | { iSelParticlesInt++; } | |
172 | if (pTrack->UseForDifferentialFlow()) | |
173 | { iSelParticlesDiff++; } | |
174 | iGoodTracks++; | |
175 | pEvent->TrackCollection()->Add(pTrack); | |
f1d945a1 | 176 | } |
177 | */ | |
178 | } | |
179 | ||
e35ddff0 | 180 | itrkN++; |
f1d945a1 | 181 | } |
182 | } | |
183 | ||
e35ddff0 | 184 | pEvent-> SetEventNSelTracksIntFlow(iSelParticlesInt); |
185 | pEvent->SetNumberOfTracks(iGoodTracks); | |
186 | cout<<" iGoodTracks = "<<iGoodTracks<<endl; | |
187 | cout << " iSelectedTracksInt = " << iSelParticlesInt << endl; | |
188 | return pEvent; | |
f1d945a1 | 189 | |
190 | } | |
191 | ||
192 | //----------------------------------------------------------------------- | |
e35ddff0 | 193 | AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliMCEvent* anInput) |
f1d945a1 | 194 | { |
195 | //Fills the event from the MC kinematic information | |
0b7f49e9 | 196 | |
e35ddff0 | 197 | Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ; |
198 | cerr<<"anInput->GetNumberOfTracks() = "<<iNumberOfInputTracks<<endl; | |
f1d945a1 | 199 | |
e35ddff0 | 200 | AliFlowEventSimple* pEvent = new AliFlowEventSimple(10); |
f1d945a1 | 201 | |
e35ddff0 | 202 | //Int_t iN = 256; //multiplicity for chi=1 |
203 | Int_t iN = iNumberOfInputTracks; | |
204 | Int_t iGoodTracks = 0; | |
205 | Int_t itrkN = 0; | |
206 | Int_t iSelParticlesDiff = 0; | |
207 | Int_t iSelParticlesInt = 0; | |
f1d945a1 | 208 | |
0b7f49e9 | 209 | //normal loop |
e35ddff0 | 210 | while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) { |
211 | AliMCParticle* pParticle = anInput->GetTrack(itrkN); //get input particle | |
0b7f49e9 | 212 | //cut on tracks |
88e00a8a | 213 | if (TMath::Abs(pParticle->Eta()) < 0.9) |
0b7f49e9 | 214 | { |
215 | if( | |
e35ddff0 | 216 | TMath::Abs(pParticle->Particle()->GetPdgCode()) == 211 |
217 | // TMath::Abs(pParticle->Particle()->GetPdgCode()) == 211 || | |
218 | // TMath::Abs(pParticle->Particle()->GetPdgCode()) == 321 || | |
219 | // TMath::Abs(pParticle->Particle()->GetPdgCode()) == 2212 | |
0b7f49e9 | 220 | ) |
221 | { | |
e35ddff0 | 222 | AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(); |
223 | pTrack->SetPt(pParticle->Pt() ); | |
224 | pTrack->SetEta(pParticle->Eta() ); | |
225 | pTrack->SetPhi(pParticle->Phi() ); | |
226 | pTrack->SetForIntegratedFlow(kTRUE); | |
227 | pTrack->SetForDifferentialFlow(kTRUE); | |
228 | ||
229 | if (pTrack->UseForIntegratedFlow()) | |
230 | { iSelParticlesInt++; } | |
231 | if (pTrack->UseForDifferentialFlow()) | |
232 | { iSelParticlesDiff++; } | |
233 | iGoodTracks++; | |
234 | pEvent->TrackCollection()->Add(pTrack) ; | |
0b7f49e9 | 235 | } |
88e00a8a | 236 | /* else if( |
e35ddff0 | 237 | TMath::Abs(pParticle->Particle()->GetPdgCode()) == 211 |
f1d945a1 | 238 | ) |
239 | { | |
e35ddff0 | 240 | AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(); |
241 | pTrack->SetPt(pParticle->Pt() ); | |
242 | pTrack->SetEta(pParticle->Eta() ); | |
243 | pTrack->SetPhi(pParticle->Phi() ); | |
244 | pTrack->SetForIntegratedFlow(kFALSE); | |
245 | pTrack->SetForDifferentialFlow(kTRUE); | |
246 | ||
247 | if (pTrack->UseForIntegratedFlow()) | |
248 | { iSelParticlesInt++; } | |
249 | if (pTrack->UseForDifferentialFlow()) | |
250 | { iSelParticlesDiff++; } | |
251 | iGoodTracks++; | |
252 | pEvent->TrackCollection()->Add(pTrack); | |
f1d945a1 | 253 | } |
254 | */ | |
0b7f49e9 | 255 | } |
f1d945a1 | 256 | |
e35ddff0 | 257 | itrkN++; |
f1d945a1 | 258 | } |
0b7f49e9 | 259 | |
e35ddff0 | 260 | pEvent-> SetEventNSelTracksIntFlow(iSelParticlesInt); |
261 | pEvent->SetNumberOfTracks(iGoodTracks); | |
262 | cout<<" iGoodTracks = "<<iGoodTracks<<endl; | |
263 | cout << " iSelectedTracksInt = " << iSelParticlesInt << endl; | |
264 | return pEvent; | |
f1d945a1 | 265 | |
266 | } | |
267 | ||
88e00a8a | 268 | |
269 | //----------------------------------------------------------------------- | |
270 | AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliMCEvent* anInput, AliCFManager* intCFManager, AliCFManager* diffCFManager) | |
271 | { | |
272 | //Fills the event from the MC kinematic information | |
273 | ||
274 | Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ; | |
275 | cerr<<"anInput->GetNumberOfTracks() = "<<iNumberOfInputTracks<<endl; | |
276 | ||
277 | AliFlowEventSimple* pEvent = new AliFlowEventSimple(10); | |
278 | ||
b7e1ac01 | 279 | Int_t iN = iNumberOfInputTracks; //maximum number of tracks in AliFlowEventSimple |
280 | Int_t iGoodTracks = 0; //number of good tracks | |
281 | Int_t itrkN = 0; //track counter | |
282 | Int_t iSelParticlesDiff = 0; //number of tracks selected for Diff | |
283 | Int_t iSelParticlesInt = 0; //number of tracks selected for Int | |
88e00a8a | 284 | |
285 | ||
286 | //normal loop | |
287 | while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) { | |
288 | //get input particle | |
289 | AliMCParticle* pParticle = anInput->GetTrack(itrkN); | |
290 | //make new AliFlowTrackSimple | |
291 | AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(); | |
292 | pTrack->SetPt(pParticle->Pt() ); | |
293 | pTrack->SetEta(pParticle->Eta() ); | |
294 | pTrack->SetPhi(pParticle->Phi() ); | |
295 | ||
296 | //check if pParticle passes the cuts | |
297 | if (intCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pParticle)) { | |
298 | pTrack->SetForIntegratedFlow(kTRUE); | |
299 | //cout<<"integrated selection. PID = "<<pParticle->Particle()->GetPdgCode()<<endl; | |
300 | } | |
301 | if (diffCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pParticle)) { | |
302 | pTrack->SetForDifferentialFlow(kTRUE); | |
303 | //cout<<"differential selection. PID = "<<pParticle->Particle()->GetPdgCode()<<endl; | |
304 | } | |
305 | ||
306 | //check if any bits are set | |
307 | TBits bFlowBits = pTrack->GetFlowBits(); | |
308 | if (bFlowBits.CountBits() != 0) { | |
309 | //cout<<"The number of bits set = "<<bFlowBits.CountBits()<<endl; | |
310 | pEvent->TrackCollection()->Add(pTrack) ; | |
311 | iGoodTracks++; | |
312 | ||
313 | if (pTrack->UseForIntegratedFlow()) | |
314 | { iSelParticlesInt++; } | |
315 | if (pTrack->UseForDifferentialFlow()) | |
316 | { iSelParticlesDiff++; } | |
317 | } | |
318 | ||
319 | itrkN++; | |
320 | } | |
321 | ||
322 | pEvent-> SetEventNSelTracksIntFlow(iSelParticlesInt); | |
323 | pEvent-> SetNumberOfTracks(iGoodTracks); | |
324 | cout<<" iGoodTracks = "<<iGoodTracks<<endl; | |
325 | cout << " iSelectedTracksInt = " << iSelParticlesInt << endl; | |
326 | return pEvent; | |
327 | ||
328 | } | |
329 | ||
330 | ||
f1d945a1 | 331 | //----------------------------------------------------------------------- |
e35ddff0 | 332 | AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput) |
f1d945a1 | 333 | { |
334 | //Fills the event from the ESD | |
0b7f49e9 | 335 | |
e35ddff0 | 336 | Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ; |
337 | cerr<<"anInput->GetNumberOfTracks() = "<<iNumberOfInputTracks<<endl; | |
f1d945a1 | 338 | |
e35ddff0 | 339 | AliFlowEventSimple* pEvent = new AliFlowEventSimple(10); |
f1d945a1 | 340 | |
e35ddff0 | 341 | //Int_t iN = 256; //multiplicity for chi=1 |
342 | Int_t iN = iNumberOfInputTracks; | |
343 | Int_t iGoodTracks = 0; | |
344 | Int_t itrkN = 0; | |
345 | Int_t iSelParticlesDiff = 0; | |
346 | Int_t iSelParticlesInt = 0; | |
f1d945a1 | 347 | |
348 | ||
0b7f49e9 | 349 | //normal loop |
e35ddff0 | 350 | while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) { |
351 | AliESDtrack* pParticle = anInput->GetTrack(itrkN); //get input particle | |
0b7f49e9 | 352 | //cut on tracks |
88e00a8a | 353 | if (TMath::Abs(pParticle->Eta()) < 0.9) |
0b7f49e9 | 354 | { |
e35ddff0 | 355 | AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(); |
356 | pTrack->SetPt(pParticle->Pt() ); | |
357 | pTrack->SetEta(pParticle->Eta() ); | |
358 | pTrack->SetPhi(pParticle->Phi() ); | |
359 | pTrack->SetForIntegratedFlow(kTRUE); | |
360 | pTrack->SetForDifferentialFlow(kTRUE); | |
361 | ||
362 | if (pTrack->UseForIntegratedFlow()) | |
363 | { iSelParticlesInt++; } | |
364 | if (pTrack->UseForDifferentialFlow()) | |
365 | { iSelParticlesDiff++; } | |
366 | iGoodTracks++; | |
367 | pEvent->TrackCollection()->Add(pTrack) ; | |
0b7f49e9 | 368 | } |
f1d945a1 | 369 | |
e35ddff0 | 370 | itrkN++; |
f1d945a1 | 371 | } |
0b7f49e9 | 372 | |
e35ddff0 | 373 | pEvent-> SetEventNSelTracksIntFlow(iSelParticlesInt); |
374 | pEvent->SetNumberOfTracks(iGoodTracks); | |
375 | cout<<" iGoodTracks = "<<iGoodTracks<<endl; | |
376 | cout << " iSelectedTracksInt = " << iSelParticlesInt << endl; | |
377 | return pEvent; | |
0b7f49e9 | 378 | |
f1d945a1 | 379 | |
380 | } | |
381 | ||
382 | ||
88e00a8a | 383 | //----------------------------------------------------------------------- |
384 | AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, AliCFManager* intCFManager, AliCFManager* diffCFManager) | |
385 | { | |
386 | //Fills the event from the ESD | |
387 | ||
388 | Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ; | |
389 | cerr<<"anInput->GetNumberOfTracks() = "<<iNumberOfInputTracks<<endl; | |
390 | ||
391 | AliFlowEventSimple* pEvent = new AliFlowEventSimple(10); | |
392 | ||
b7e1ac01 | 393 | Int_t iN = iNumberOfInputTracks; //maximum number of tracks in AliFlowEventSimple |
394 | Int_t iGoodTracks = 0; //number of good tracks | |
395 | Int_t itrkN = 0; //track counter | |
396 | Int_t iSelParticlesDiff = 0; //number of tracks selected for Diff | |
397 | Int_t iSelParticlesInt = 0; //number of tracks selected for Int | |
88e00a8a | 398 | |
399 | //normal loop | |
400 | while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) { | |
401 | AliESDtrack* pParticle = anInput->GetTrack(itrkN); //get input particle | |
402 | //make new AliFLowTrackSimple | |
403 | AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(); | |
404 | pTrack->SetPt(pParticle->Pt() ); | |
405 | pTrack->SetEta(pParticle->Eta() ); | |
406 | pTrack->SetPhi(pParticle->Phi() ); | |
407 | //check if pParticle passes the cuts | |
408 | ||
b7e1ac01 | 409 | if (intCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) && |
410 | intCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle)) { | |
88e00a8a | 411 | pTrack->SetForIntegratedFlow(kTRUE); |
412 | } | |
b7e1ac01 | 413 | if (diffCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) && |
414 | diffCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle)) { | |
88e00a8a | 415 | pTrack->SetForDifferentialFlow(kTRUE);} |
416 | ||
417 | //check if any bits are set | |
418 | TBits bFlowBits = pTrack->GetFlowBits(); | |
419 | if (bFlowBits.CountBits() !=0) { | |
420 | pEvent->TrackCollection()->Add(pTrack) ; | |
421 | iGoodTracks++; | |
422 | ||
423 | if (pTrack->UseForIntegratedFlow()) | |
424 | { iSelParticlesInt++; } | |
425 | if (pTrack->UseForDifferentialFlow()) | |
426 | { iSelParticlesDiff++; } | |
427 | ||
428 | } | |
429 | itrkN++; | |
430 | } | |
431 | ||
432 | pEvent-> SetEventNSelTracksIntFlow(iSelParticlesInt); | |
433 | pEvent->SetNumberOfTracks(iGoodTracks); | |
434 | cout<<" iGoodTracks = "<<iGoodTracks<<endl; | |
435 | cout << " iSelectedTracksInt = " << iSelParticlesInt << endl; | |
436 | return pEvent; | |
437 | ||
438 | ||
439 | } | |
f1d945a1 | 440 | |
441 | //----------------------------------------------------------------------- | |
e35ddff0 | 442 | AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliAODEvent* anInput) |
f1d945a1 | 443 | { |
444 | //Fills the event from the AOD | |
0b7f49e9 | 445 | |
e35ddff0 | 446 | Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ; |
447 | cerr<<"anInput->GetNumberOfTracks() = "<<iNumberOfInputTracks<<endl; | |
f1d945a1 | 448 | |
e35ddff0 | 449 | AliFlowEventSimple* pEvent = new AliFlowEventSimple(10); |
f1d945a1 | 450 | |
e35ddff0 | 451 | //Int_t iN = 256; //multiplicity for chi=1 |
452 | Int_t iN = iNumberOfInputTracks; | |
453 | Int_t iGoodTracks = 0; | |
454 | Int_t itrkN = 0; | |
455 | Int_t iSelParticlesDiff = 0; | |
456 | Int_t iSelParticlesInt = 0; | |
f1d945a1 | 457 | |
0b7f49e9 | 458 | //normal loop |
e35ddff0 | 459 | while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) { |
460 | AliAODTrack* pParticle = anInput->GetTrack(itrkN); //get input particle | |
0b7f49e9 | 461 | //cut on tracks |
88e00a8a | 462 | if (TMath::Abs(pParticle->Eta()) < 0.9) |
0b7f49e9 | 463 | { |
e35ddff0 | 464 | AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(); |
465 | pTrack->SetPt(pParticle->Pt() ); | |
466 | pTrack->SetEta(pParticle->Eta() ); | |
467 | pTrack->SetPhi(pParticle->Phi() ); | |
468 | pTrack->SetForIntegratedFlow(kTRUE); | |
469 | pTrack->SetForDifferentialFlow(kTRUE); | |
470 | ||
471 | if (pTrack->UseForIntegratedFlow()) | |
472 | { iSelParticlesInt++; } | |
473 | if (pTrack->UseForDifferentialFlow()) | |
474 | { iSelParticlesDiff++; } | |
475 | iGoodTracks++; | |
476 | pEvent->TrackCollection()->Add(pTrack) ; | |
0b7f49e9 | 477 | } |
f1d945a1 | 478 | |
e35ddff0 | 479 | itrkN++; |
0b7f49e9 | 480 | } |
481 | ||
e35ddff0 | 482 | pEvent-> SetEventNSelTracksIntFlow(iSelParticlesInt); |
483 | pEvent->SetNumberOfTracks(iGoodTracks); | |
484 | cout<<" iGoodTracks = "<<iGoodTracks<<endl; | |
485 | cout << " iSelectedTracksInt = " << iSelParticlesInt << endl; | |
486 | return pEvent; | |
0b7f49e9 | 487 | |
488 | } | |
88e00a8a | 489 | |
490 | ||
491 | //----------------------------------------------------------------------- | |
492 | AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliAODEvent* anInput, AliCFManager* intCFManager, AliCFManager* diffCFManager) | |
493 | { | |
494 | //Fills the event from the AOD | |
495 | ||
496 | Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ; | |
497 | cerr<<"anInput->GetNumberOfTracks() = "<<iNumberOfInputTracks<<endl; | |
498 | ||
499 | AliFlowEventSimple* pEvent = new AliFlowEventSimple(10); | |
88e00a8a | 500 | |
b7e1ac01 | 501 | Int_t iN = iNumberOfInputTracks; //maximum number of tracks in AliFlowEventSimple |
502 | Int_t iGoodTracks = 0; //number of good tracks | |
503 | Int_t itrkN = 0; //track counter | |
504 | Int_t iSelParticlesDiff = 0; //number of tracks selected for Diff | |
505 | Int_t iSelParticlesInt = 0; //number of tracks selected for Int | |
506 | ||
88e00a8a | 507 | //normal loop |
508 | while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) { | |
509 | AliAODTrack* pParticle = anInput->GetTrack(itrkN); //get input particle | |
510 | //make new AliFlowTrackSimple | |
511 | AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(); | |
512 | pTrack->SetPt(pParticle->Pt() ); | |
513 | pTrack->SetEta(pParticle->Eta() ); | |
514 | pTrack->SetPhi(pParticle->Phi() ); | |
515 | ||
516 | //check if pParticle passes the cuts | |
b7e1ac01 | 517 | if (intCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) && |
518 | intCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle)) { | |
88e00a8a | 519 | pTrack->SetForIntegratedFlow(kTRUE); } |
b7e1ac01 | 520 | if (diffCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) && |
521 | diffCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle)) { | |
88e00a8a | 522 | pTrack->SetForDifferentialFlow(kTRUE);} |
523 | ||
524 | //check if any bits are set | |
525 | TBits bFlowBits = pTrack->GetFlowBits(); | |
526 | if (bFlowBits.CountBits() !=0) { | |
527 | pEvent->TrackCollection()->Add(pTrack) ; | |
528 | iGoodTracks++; | |
529 | ||
530 | if (pTrack->UseForIntegratedFlow()) | |
531 | { iSelParticlesInt++; } | |
532 | if (pTrack->UseForDifferentialFlow()) | |
533 | { iSelParticlesDiff++; } | |
534 | ||
535 | } | |
536 | ||
537 | itrkN++; | |
538 | } | |
539 | ||
540 | pEvent-> SetEventNSelTracksIntFlow(iSelParticlesInt); | |
541 | pEvent->SetNumberOfTracks(iGoodTracks); | |
542 | cout<<" iGoodTracks = "<<iGoodTracks<<endl; | |
543 | cout << " iSelectedTracksInt = " << iSelParticlesInt << endl; | |
544 | return pEvent; | |
545 | ||
546 | } | |
547 | ||
0b7f49e9 | 548 | //----------------------------------------------------------------------- |
e35ddff0 | 549 | AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, AliMCEvent* anInputMc, Int_t anOption) |
0b7f49e9 | 550 | { |
551 | //fills the event with tracks from the ESD and kinematics from the MC info via the track label | |
552 | ||
e35ddff0 | 553 | if (!(anOption ==0 || anOption ==1)) { |
554 | cout<<"WRONG OPTION IN AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, AliMCEvent* anInputMc, Int_t anOption)"<<endl; | |
0b7f49e9 | 555 | exit(1); |
f1d945a1 | 556 | } |
557 | ||
e35ddff0 | 558 | Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ; |
559 | cerr<<"anInput->GetNumberOfTracks() = "<<iNumberOfInputTracks<<endl; | |
0b7f49e9 | 560 | |
e35ddff0 | 561 | AliFlowEventSimple* pEvent = new AliFlowEventSimple(10); |
0b7f49e9 | 562 | |
e35ddff0 | 563 | //Int_t iN = 256; //multiplicity for chi=1 |
564 | Int_t iN = iNumberOfInputTracks; | |
565 | Int_t iGoodTracks = 0; | |
566 | Int_t itrkN = 0; | |
567 | Int_t iSelParticlesDiff = 0; | |
568 | Int_t iSelParticlesInt = 0; | |
f1d945a1 | 569 | |
0b7f49e9 | 570 | //normal loop |
e35ddff0 | 571 | while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) { |
572 | AliESDtrack* pParticle = anInput->GetTrack(itrkN); //get input particle | |
0b7f49e9 | 573 | //get Label |
e35ddff0 | 574 | Int_t iLabel = pParticle->GetLabel(); |
0b7f49e9 | 575 | //match to mc particle |
e35ddff0 | 576 | AliMCParticle* pMcParticle = anInputMc->GetTrack(TMath::Abs(iLabel)); |
0b7f49e9 | 577 | |
578 | //check | |
e35ddff0 | 579 | if (TMath::Abs(pParticle->GetLabel())!=pMcParticle->Label()) cout<<"pParticle->GetLabel()!=pMcParticle->Label() "<<pParticle->GetLabel()<<" "<<pMcParticle->Label()<<endl; |
0b7f49e9 | 580 | |
581 | //cut on tracks | |
e35ddff0 | 582 | if (TMath::Abs(pParticle->Eta()) < 0.2) |
0b7f49e9 | 583 | { |
584 | if( | |
e35ddff0 | 585 | TMath::Abs(pMcParticle->Particle()->GetPdgCode()) == 211 //pions |
586 | // TMath::Abs(pMcParticle->Particle()->GetPdgCode()) == 211 || | |
587 | // TMath::Abs(pMcParticle->Particle()->GetPdgCode()) == 321 || | |
588 | // TMath::Abs(pMcParticle->Particle()->GetPdgCode()) == 2212 | |
0b7f49e9 | 589 | ) |
590 | { | |
e35ddff0 | 591 | AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(); |
592 | if(anOption == 0) { //take the PID from the MC & the kinematics from the ESD | |
593 | pTrack->SetPt(pParticle->Pt() ); | |
594 | pTrack->SetEta(pParticle->Eta() ); | |
595 | pTrack->SetPhi(pParticle->Phi() ); | |
596 | pTrack->SetForIntegratedFlow(kTRUE); | |
597 | pTrack->SetForDifferentialFlow(kTRUE); | |
0b7f49e9 | 598 | } |
e35ddff0 | 599 | else if (anOption == 1) { //take the PID and kinematics from the MC |
600 | pTrack->SetPt(pMcParticle->Pt() ); | |
601 | pTrack->SetEta(pMcParticle->Eta() ); | |
602 | pTrack->SetPhi(pMcParticle->Phi() ); | |
603 | pTrack->SetForIntegratedFlow(kTRUE); | |
604 | pTrack->SetForDifferentialFlow(kTRUE); | |
0b7f49e9 | 605 | } |
606 | else { cout<<"Not a valid option"<<endl; } | |
e35ddff0 | 607 | if (pTrack->UseForIntegratedFlow()) |
608 | { iSelParticlesInt++; } | |
609 | if (pTrack->UseForDifferentialFlow()) | |
610 | { iSelParticlesDiff++; } | |
611 | iGoodTracks++; | |
612 | pEvent->TrackCollection()->Add(pTrack) ; | |
0b7f49e9 | 613 | } |
614 | } | |
e35ddff0 | 615 | itrkN++; |
0b7f49e9 | 616 | } |
617 | ||
e35ddff0 | 618 | pEvent-> SetEventNSelTracksIntFlow(iSelParticlesInt); |
619 | pEvent->SetNumberOfTracks(iGoodTracks); | |
620 | cout<<" iGoodTracks = "<<iGoodTracks<<endl; | |
621 | cout << " iSelectedTracksInt = " << iSelParticlesInt << endl; | |
622 | return pEvent; | |
f1d945a1 | 623 | |
0b7f49e9 | 624 | |
f1d945a1 | 625 | } |
626 | ||
88e00a8a | 627 | //----------------------------------------------------------------------- |
628 | AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, AliMCEvent* anInputMc, AliCFManager* intCFManager, AliCFManager* diffCFManager, Int_t anOption) | |
629 | { | |
630 | //fills the event with tracks from the ESD and kinematics from the MC info via the track label | |
0b7f49e9 | 631 | |
b7e1ac01 | 632 | |
88e00a8a | 633 | if (!(anOption ==0 || anOption ==1)) { |
634 | cout<<"WRONG OPTION IN AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, AliMCEvent* anInputMc, Int_t anOption)"<<endl; | |
635 | exit(1); | |
636 | } | |
f1d945a1 | 637 | |
88e00a8a | 638 | Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ; |
639 | cerr<<"anInput->GetNumberOfTracks() = "<<iNumberOfInputTracks<<endl; | |
640 | ||
641 | AliFlowEventSimple* pEvent = new AliFlowEventSimple(10); | |
642 | ||
b7e1ac01 | 643 | Int_t iN = iNumberOfInputTracks; //maximum number of tracks in AliFlowEventSimple |
644 | Int_t iGoodTracks = 0; //number of good tracks | |
645 | Int_t itrkN = 0; //track counter | |
646 | Int_t iSelParticlesDiff = 0; //number of tracks selected for Diff | |
647 | Int_t iSelParticlesInt = 0; //number of tracks selected for Int | |
88e00a8a | 648 | |
b7e1ac01 | 649 | |
88e00a8a | 650 | //normal loop |
651 | while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) { | |
652 | AliESDtrack* pParticle = anInput->GetTrack(itrkN); //get input particle | |
653 | //get Label | |
654 | Int_t iLabel = pParticle->GetLabel(); | |
655 | //match to mc particle | |
656 | AliMCParticle* pMcParticle = anInputMc->GetTrack(TMath::Abs(iLabel)); | |
657 | ||
658 | //check | |
659 | if (TMath::Abs(pParticle->GetLabel())!=pMcParticle->Label()) cout<<"pParticle->GetLabel()!=pMcParticle->Label() "<<pParticle->GetLabel()<<" "<<pMcParticle->Label()<<endl; | |
660 | ||
661 | //make new AliFlowTrackSimple | |
662 | AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(); | |
663 | if(anOption == 0) { //take the PID from the MC & the kinematics from the ESD | |
664 | pTrack->SetPt(pParticle->Pt() ); | |
665 | pTrack->SetEta(pParticle->Eta() ); | |
666 | pTrack->SetPhi(pParticle->Phi() ); | |
667 | } | |
668 | else if (anOption == 1) { //take the PID and kinematics from the MC | |
669 | pTrack->SetPt(pMcParticle->Pt() ); | |
670 | pTrack->SetEta(pMcParticle->Eta() ); | |
671 | pTrack->SetPhi(pMcParticle->Phi() ); | |
672 | } | |
673 | else { cout<<"Not a valid option"<<endl; } | |
674 | ||
675 | //check if pParticle passes the cuts | |
676 | if(anOption == 0) { | |
677 | //cout<<"take the PID from the MC & the kinematics from the ESD"<<endl; | |
678 | if (intCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle,"mcGenCuts1") && | |
b7e1ac01 | 679 | intCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle)) { |
88e00a8a | 680 | pTrack->SetForIntegratedFlow(kTRUE); } |
681 | if (diffCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle,"mcGenCuts2") && | |
b7e1ac01 | 682 | diffCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle)) { |
88e00a8a | 683 | pTrack->SetForDifferentialFlow(kTRUE);} |
684 | } | |
685 | else if (anOption == 1) { | |
686 | //cout<<"take the PID and kinematics from the MC"<<endl; | |
687 | if (intCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle)) { | |
688 | pTrack->SetForIntegratedFlow(kTRUE); } | |
689 | if (diffCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle)) { | |
690 | pTrack->SetForDifferentialFlow(kTRUE);} | |
691 | } | |
692 | else { cout<<"Not a valid option"<<endl; } | |
693 | ||
694 | //check if any bits are set | |
695 | TBits bFlowBits = pTrack->GetFlowBits(); | |
696 | if (bFlowBits.CountBits() !=0) { | |
697 | pEvent->TrackCollection()->Add(pTrack) ; | |
698 | iGoodTracks++; | |
699 | ||
700 | if (pTrack->UseForIntegratedFlow()) | |
701 | { iSelParticlesInt++; } | |
702 | if (pTrack->UseForDifferentialFlow()) | |
703 | { iSelParticlesDiff++; } | |
704 | ||
705 | } | |
706 | itrkN++; | |
707 | } | |
708 | ||
709 | pEvent-> SetEventNSelTracksIntFlow(iSelParticlesInt); | |
710 | pEvent->SetNumberOfTracks(iGoodTracks); | |
711 | cout<<" iGoodTracks = "<<iGoodTracks<<endl; | |
712 | cout << " iSelectedTracksInt = " << iSelParticlesInt << endl; | |
713 | return pEvent; | |
714 | ||
715 | } | |
716 | ||
717 | ||
718 | ||
719 | ||
720 | ||
721 |