]>
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 | **************************************************************************/ | |
92a926b8 | 15 | ///////////////////////////////////////////////////////////////////////// |
16 | // AliFlowEventSimpleMaker: | |
17 | // | |
18 | // Class to fill the AliFlowEventSimple | |
19 | // with AliFlowTrackSimple objects | |
20 | // Has fill methods for TTree, AliMCEvent, AliESDEvent and AliAODEvent | |
21 | // author: N. van der Kolk (kolk@nikhef.nl) | |
22 | ///////////////////////////////////////////////////////////////////////// | |
23 | ||
f1d945a1 | 24 | #include "Riostream.h" |
fbdb53fa | 25 | #include "TTree.h" |
26 | #include "TParticle.h" | |
f1d945a1 | 27 | #include "AliFlowEventSimpleMaker.h" |
28 | #include "AliFlowEventSimple.h" | |
29 | #include "AliFlowTrackSimple.h" | |
f1d945a1 | 30 | #include "AliMCEvent.h" |
31 | #include "AliMCParticle.h" | |
32 | #include "AliESDEvent.h" | |
33 | #include "AliESDtrack.h" | |
34 | #include "AliAODEvent.h" | |
35 | #include "AliAODTrack.h" | |
1691027b | 36 | #include "AliCFManager.h" |
b00ca27f | 37 | #include "AliFlowTrackSimpleCuts.h" |
38 | ||
f1d945a1 | 39 | |
f1d945a1 | 40 | ClassImp(AliFlowEventSimpleMaker) |
41 | //----------------------------------------------------------------------- | |
62726ef0 | 42 | AliFlowEventSimpleMaker::AliFlowEventSimpleMaker() : |
951817d5 | 43 | fMCReactionPlaneAngle(0.), |
3abe32c8 | 44 | fCount(0), |
45 | fNoOfLoops(1), | |
46 | fEllipticFlowValue(0.), | |
94cd9888 | 47 | fMultiplicityOfEvent(1000000000), |
48 | fMinMult(0), | |
b125a454 | 49 | fMaxMult(1000000000), |
50 | fEtaMinA(-1.0), | |
51 | fEtaMaxA(-0.01), | |
52 | fEtaMinB(0.01), | |
53 | fEtaMaxB(1.0) | |
f1d945a1 | 54 | { |
f1d945a1 | 55 | //constructor |
f1d945a1 | 56 | } |
57 | ||
f1d945a1 | 58 | //----------------------------------------------------------------------- |
59 | AliFlowEventSimpleMaker::~AliFlowEventSimpleMaker() | |
60 | { | |
e35ddff0 | 61 | //destructor |
f1d945a1 | 62 | } |
63 | ||
94cd9888 | 64 | //----------------------------------------------------------------------- |
fbdb53fa | 65 | AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks( AliMCEvent* anInput, const AliCFManager* intCFManager, const AliCFManager* diffCFManager) |
94cd9888 | 66 | { |
67 | //Fills the event from the MC kinematic information | |
68 | ||
69 | Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ; | |
70 | ||
71 | if (iNumberOfInputTracks==-1) { | |
72 | cout<<"Skipping Event -- No MC information available for this event"<<endl; | |
73 | return 0; | |
74 | } | |
75 | ||
76 | Int_t iN = iNumberOfInputTracks; //maximum number of tracks in AliFlowEventSimple | |
77 | Int_t iGoodTracks = 0; //number of good tracks | |
78 | Int_t itrkN = 0; //track counter | |
79 | Int_t iSelParticlesPOI = 0; //number of tracks selected for Diff | |
80 | Int_t iSelParticlesRP = 0; //number of tracks selected for Int | |
81 | ||
82 | // cut on the multiplicity | |
83 | if (intCFManager->CheckEventCuts(AliCFManager::kEvtGenCuts,anInput)) { | |
84 | // cout<<"iNumberOfInputTracks = "<<iNumberOfInputTracks<<endl; | |
85 | // create an AliFlowEventSimple | |
86 | AliFlowEventSimple* pEvent = new AliFlowEventSimple(10); | |
87 | ||
88 | //loop over tracks | |
89 | while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) { | |
90 | //get input particle | |
7aad0c47 | 91 | AliMCParticle* pParticle = (AliMCParticle*) anInput->GetTrack(itrkN); |
94cd9888 | 92 | //make new AliFlowTrackSimple |
93 | AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(); | |
94 | pTrack->SetPt(pParticle->Pt() ); | |
95 | pTrack->SetEta(pParticle->Eta() ); | |
96 | pTrack->SetPhi(pParticle->Phi() ); | |
97 | ||
98 | //check if pParticle passes the cuts | |
99 | if (intCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pParticle)) { | |
100 | pTrack->SetForRPSelection(kTRUE); | |
101 | //cout<<"integrated selection. PID = "<<pParticle->Particle()->GetPdgCode()<<endl; | |
102 | } | |
103 | if (diffCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pParticle)) { | |
104 | pTrack->SetForPOISelection(kTRUE); | |
105 | //cout<<"differential selection. PID = "<<pParticle->Particle()->GetPdgCode()<<endl; | |
106 | } | |
107 | ||
108 | //check if any bits are set | |
109 | TBits bFlowBits = pTrack->GetFlowBits(); | |
110 | if (bFlowBits.CountBits() ==0) { | |
111 | delete pTrack; } //track will not be used anymore | |
112 | else { | |
113 | pEvent->TrackCollection()->Add(pTrack) ; | |
114 | iGoodTracks++; | |
115 | ||
116 | if (pTrack->InRPSelection()) | |
117 | { iSelParticlesRP++; } | |
118 | if (pTrack->InPOISelection()) | |
119 | { iSelParticlesPOI++; } | |
120 | } | |
121 | ||
122 | itrkN++; | |
123 | } | |
124 | ||
125 | pEvent-> SetEventNSelTracksRP(iSelParticlesRP); | |
126 | pEvent-> SetNumberOfTracks(iGoodTracks); | |
127 | pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle); | |
128 | ||
129 | if (iSelParticlesRP >= fMinMult && iSelParticlesRP <= fMaxMult) { | |
130 | if ( (++fCount % 100) == 0) { | |
fbdb53fa | 131 | cout<<" MC Reaction Plane Angle = "<< fMCReactionPlaneAngle << endl; |
132 | // | |
94cd9888 | 133 | cout<<" iGoodTracks = "<<iGoodTracks<<endl; |
134 | cout<<" # of RP selected tracks = "<<iSelParticlesRP<<endl; | |
135 | cout<<" # of POI selected tracks = "<<iSelParticlesPOI<<endl; | |
136 | cout << "# " << fCount << " events processed" << endl; | |
137 | } | |
138 | return pEvent; | |
139 | } | |
140 | else { | |
141 | cout<<"Not enough tracks in the FlowEventSimple"<<endl; | |
142 | return 0; | |
143 | } | |
144 | } | |
145 | else { | |
146 | cout<<"Event does not pass multiplicity cuts"<<endl; | |
147 | return 0; | |
148 | } | |
149 | ||
150 | } | |
151 | ||
152 | //----------------------------------------------------------------------- | |
6c75368a | 153 | |
fbdb53fa | 154 | AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, const AliCFManager* intCFManager, const AliCFManager* diffCFManager) |
94cd9888 | 155 | { |
156 | //Fills the event from the ESD | |
157 | ||
158 | //flags for particles passing int. and diff. flow cuts | |
159 | Bool_t bPassedRPFlowCuts = kFALSE; | |
160 | Bool_t bPassedPOIFlowCuts = kFALSE; | |
161 | ||
162 | Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ; | |
163 | ||
164 | Int_t iGoodTracks = 0; //number of good tracks | |
165 | Int_t itrkN = 0; //track counter | |
166 | Int_t iSelParticlesRP = 0; //number of tracks selected for Int | |
167 | Int_t iSelParticlesPOI = 0; //number of tracks selected for Diff | |
168 | ||
169 | // cut on the multiplicity | |
170 | if (intCFManager->CheckEventCuts(AliCFManager::kEvtRecCuts,anInput)) { | |
171 | // cout<<"iNumberOfInputTracks = "<<iNumberOfInputTracks<<endl; | |
172 | // create an AliFlowEventSimple | |
173 | AliFlowEventSimple* pEvent = new AliFlowEventSimple(10); | |
174 | ||
175 | //loop over tracks | |
176 | while (itrkN < iNumberOfInputTracks) { | |
177 | AliESDtrack* pParticle = anInput->GetTrack(itrkN); //get input particle | |
178 | ||
179 | //check if pParticle passes the cuts | |
180 | if (intCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) && | |
181 | intCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle)) { | |
182 | bPassedRPFlowCuts = kTRUE; | |
183 | } | |
184 | if (diffCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) && | |
185 | diffCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle)) { | |
186 | bPassedPOIFlowCuts = kTRUE; | |
187 | } | |
188 | ||
189 | if (bPassedRPFlowCuts || bPassedPOIFlowCuts) { | |
190 | //make new AliFLowTrackSimple | |
191 | AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(); | |
192 | pTrack->SetPt(pParticle->Pt() ); | |
193 | pTrack->SetEta(pParticle->Eta() ); | |
fbdb53fa | 194 | if (fEllipticFlowValue>0.) |
b125a454 | 195 | { pTrack->SetPhi(pParticle->Phi()-fEllipticFlowValue*TMath::Sin(2*(pParticle->Phi()-fMCReactionPlaneAngle))); cout<<"Added flow to particle"<<endl; } |
196 | else { pTrack->SetPhi(pParticle->Phi() ); } | |
197 | ||
94cd9888 | 198 | //marking the particles used for int. flow: |
199 | if(bPassedRPFlowCuts) { | |
200 | pTrack->SetForRPSelection(kTRUE); | |
201 | iSelParticlesRP++; | |
b125a454 | 202 | // assign particles to subevents |
203 | if (pTrack->Eta()>=fEtaMinA && pTrack->Eta()<=fEtaMaxA) { | |
204 | pTrack->SetForSubevent(0); | |
205 | } | |
206 | if (pTrack->Eta()>=fEtaMinB && pTrack->Eta()<=fEtaMaxB) { | |
207 | pTrack->SetForSubevent(1); | |
208 | } | |
209 | ||
94cd9888 | 210 | } |
211 | //marking the particles used for diff. flow: | |
212 | if(bPassedPOIFlowCuts) { | |
213 | pTrack->SetForPOISelection(kTRUE); | |
214 | iSelParticlesPOI++; | |
215 | } | |
b125a454 | 216 | //adding particles which were used either for int. or diff. flow to the list |
94cd9888 | 217 | pEvent->TrackCollection()->Add(pTrack); |
218 | iGoodTracks++; | |
219 | }//end of if(bPassedIntFlowCuts || bPassedDiffFlowCuts) | |
220 | itrkN++; | |
221 | bPassedRPFlowCuts = kFALSE; | |
222 | bPassedPOIFlowCuts = kFALSE; | |
223 | }//end of while (itrkN < iNumberOfInputTracks) | |
224 | ||
225 | pEvent->SetEventNSelTracksRP(iSelParticlesRP); | |
226 | pEvent->SetNumberOfTracks(iGoodTracks); | |
227 | pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle); | |
228 | ||
229 | ||
230 | if (iSelParticlesRP >= fMinMult && iSelParticlesRP <= fMaxMult) { | |
231 | if ( (++fCount % 100) == 0) { | |
232 | if (!fMCReactionPlaneAngle == 0) cout<<" MC Reaction Plane Angle = "<< fMCReactionPlaneAngle << endl; | |
233 | else cout<<" MC Reaction Plane Angle = unknown "<< endl; | |
234 | cout<<" iGoodTracks = "<<iGoodTracks<<endl; | |
235 | cout<<" # of RP selected tracks = "<<iSelParticlesRP<<endl; | |
236 | cout<<" # of POI selected tracks = "<<iSelParticlesPOI<<endl; | |
237 | cout << "# " << fCount << " events processed" << endl; | |
238 | } | |
239 | return pEvent; | |
240 | } | |
241 | else { | |
242 | cout<<"Not enough tracks in the FlowEventSimple"<<endl; | |
243 | return 0; | |
244 | } | |
245 | } | |
246 | else { | |
247 | cout<<"Event does not pass multiplicity cuts"<<endl; | |
248 | return 0; | |
249 | } | |
250 | ||
251 | } | |
6c75368a | 252 | |
94cd9888 | 253 | //----------------------------------------------------------------------- |
fbdb53fa | 254 | AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliAODEvent* anInput, const AliCFManager* intCFManager, const AliCFManager* diffCFManager) |
94cd9888 | 255 | { |
256 | //Fills the event from the AOD | |
257 | ||
258 | Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ; | |
259 | ||
260 | Int_t iN = iNumberOfInputTracks; //maximum number of tracks in AliFlowEventSimple | |
261 | Int_t iGoodTracks = 0; //number of good tracks | |
262 | Int_t itrkN = 0; //track counter | |
263 | Int_t iSelParticlesPOI = 0; //number of tracks selected for Diff | |
264 | Int_t iSelParticlesRP = 0; //number of tracks selected for Int | |
265 | ||
266 | // cut on the multiplicity | |
267 | if (intCFManager->CheckEventCuts(AliCFManager::kEvtRecCuts,anInput)) { | |
268 | // cout<<"iNumberOfInputTracks = "<<iNumberOfInputTracks<<endl; | |
269 | // create an AliFlowEventSimple | |
270 | AliFlowEventSimple* pEvent = new AliFlowEventSimple(10); | |
271 | ||
272 | //loop over tracks | |
273 | while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) { | |
274 | AliAODTrack* pParticle = anInput->GetTrack(itrkN); //get input particle | |
275 | //make new AliFlowTrackSimple | |
276 | AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(); | |
277 | pTrack->SetPt(pParticle->Pt() ); | |
278 | pTrack->SetEta(pParticle->Eta() ); | |
279 | pTrack->SetPhi(pParticle->Phi() ); | |
280 | ||
281 | //check if pParticle passes the cuts | |
282 | if (intCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) && | |
283 | intCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle)) { | |
284 | pTrack->SetForRPSelection(kTRUE); } | |
285 | if (diffCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) && | |
286 | diffCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle)) { | |
287 | pTrack->SetForPOISelection(kTRUE);} | |
288 | ||
289 | ||
290 | //check if any bits are set | |
291 | TBits bFlowBits = pTrack->GetFlowBits(); | |
292 | if (bFlowBits.CountBits() ==0) { | |
293 | delete pTrack; } //track will not be used anymore | |
294 | else { | |
295 | pEvent->TrackCollection()->Add(pTrack) ; | |
296 | iGoodTracks++; | |
297 | ||
298 | if (pTrack->InRPSelection()) | |
299 | { iSelParticlesRP++; } | |
300 | if (pTrack->InPOISelection()) | |
301 | { iSelParticlesPOI++; } | |
302 | ||
303 | } | |
304 | ||
305 | itrkN++; | |
306 | } | |
307 | ||
308 | pEvent-> SetEventNSelTracksRP(iSelParticlesRP); | |
309 | pEvent->SetNumberOfTracks(iGoodTracks); | |
310 | pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle); | |
311 | ||
312 | if (iSelParticlesRP >= fMinMult && iSelParticlesRP <= fMaxMult) { | |
313 | if ( (++fCount % 100) == 0) { | |
314 | if (!fMCReactionPlaneAngle == 0) cout<<" MC Reaction Plane Angle = "<< fMCReactionPlaneAngle << endl; | |
315 | else cout<<" MC Reaction Plane Angle = unknown "<< endl; | |
316 | cout<<" iGoodTracks = "<<iGoodTracks<<endl; | |
317 | cout<<" # of RP selected tracks = "<<iSelParticlesRP<<endl; | |
318 | cout<<" # of POI selected tracks = "<<iSelParticlesPOI<<endl; | |
319 | cout << "# " << fCount << " events processed" << endl; | |
320 | } | |
321 | return pEvent; | |
322 | } | |
323 | else { | |
324 | cout<<"Not enough tracks in the FlowEventSimple"<<endl; | |
325 | return 0; | |
326 | } | |
327 | } | |
328 | else { | |
329 | cout<<"Event does not pass multiplicity cuts"<<endl; | |
330 | return 0; | |
331 | } | |
332 | ||
333 | } | |
334 | ||
335 | //----------------------------------------------------------------------- | |
fbdb53fa | 336 | AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, const AliMCEvent* anInputMc, const AliCFManager* intCFManager, const AliCFManager* diffCFManager, Int_t anOption) |
94cd9888 | 337 | { |
338 | //fills the event with tracks from the ESD and kinematics from the MC info via the track label | |
339 | ||
340 | ||
341 | if (!(anOption ==0 || anOption ==1)) { | |
342 | cout<<"WRONG OPTION IN AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, AliMCEvent* anInputMc, Int_t anOption)"<<endl; | |
343 | exit(1); | |
344 | } | |
345 | ||
346 | Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ; | |
347 | ||
348 | Int_t iNumberOfInputTracksMC = anInputMc->GetNumberOfTracks() ; | |
349 | if (iNumberOfInputTracksMC==-1) { | |
350 | cout<<"Skipping Event -- No MC information available for this event"<<endl; | |
351 | return 0; | |
352 | } | |
353 | ||
354 | Int_t iN = iNumberOfInputTracks; //maximum number of tracks in AliFlowEventSimple | |
355 | Int_t iGoodTracks = 0; //number of good tracks | |
356 | Int_t itrkN = 0; //track counter | |
357 | Int_t iSelParticlesPOI = 0; //number of tracks selected for Diff | |
358 | Int_t iSelParticlesRP = 0; //number of tracks selected for Int | |
359 | ||
360 | // cut on the multiplicity | |
361 | if (intCFManager->CheckEventCuts(AliCFManager::kEvtRecCuts,anInput)) { | |
362 | // cout<<"iNumberOfInputTracks = "<<iNumberOfInputTracks<<endl; | |
363 | // create an AliFlowEventSimple | |
364 | AliFlowEventSimple* pEvent = new AliFlowEventSimple(10); | |
365 | ||
366 | //loop over ESD tracks | |
367 | while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) { | |
368 | AliESDtrack* pParticle = anInput->GetTrack(itrkN); //get input particle | |
369 | //get Label | |
370 | Int_t iLabel = pParticle->GetLabel(); | |
371 | //match to mc particle | |
7aad0c47 | 372 | AliMCParticle* pMcParticle = (AliMCParticle*) anInputMc->GetTrack(TMath::Abs(iLabel)); |
94cd9888 | 373 | |
374 | //check | |
375 | if (TMath::Abs(pParticle->GetLabel())!=pMcParticle->Label()) cout<<"pParticle->GetLabel()!=pMcParticle->Label() "<<pParticle->GetLabel()<<" "<<pMcParticle->Label()<<endl; | |
376 | ||
377 | //make new AliFlowTrackSimple | |
378 | AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(); | |
379 | if(anOption == 0) { //take the PID from the MC & the kinematics from the ESD | |
380 | pTrack->SetPt(pParticle->Pt() ); | |
381 | pTrack->SetEta(pParticle->Eta() ); | |
382 | pTrack->SetPhi(pParticle->Phi() ); | |
383 | } | |
384 | else if (anOption == 1) { //take the PID and kinematics from the MC | |
385 | pTrack->SetPt(pMcParticle->Pt() ); | |
386 | pTrack->SetEta(pMcParticle->Eta() ); | |
387 | pTrack->SetPhi(pMcParticle->Phi() ); | |
388 | } | |
389 | else { cout<<"Not a valid option"<<endl; } | |
390 | ||
391 | //check if pParticle passes the cuts | |
392 | if(anOption == 0) { | |
393 | //cout<<"take the PID from the MC & the kinematics from the ESD"<<endl; | |
394 | if (intCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle,"mcGenCuts1") && | |
395 | intCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle)) { | |
396 | pTrack->SetForRPSelection(kTRUE); } | |
397 | if (diffCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle,"mcGenCuts2") && | |
398 | diffCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle)) { | |
399 | pTrack->SetForPOISelection(kTRUE);} | |
400 | } | |
401 | else if (anOption == 1) { | |
402 | //cout<<"take the PID and kinematics from the MC"<<endl; | |
403 | if (intCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle)) { | |
404 | pTrack->SetForRPSelection(kTRUE); } | |
405 | if (diffCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle)) { | |
406 | pTrack->SetForPOISelection(kTRUE);} | |
407 | } | |
408 | else { cout<<"Not a valid option"<<endl; } | |
409 | ||
410 | //check if any bits are set | |
411 | TBits bFlowBits = pTrack->GetFlowBits(); | |
412 | if (bFlowBits.CountBits() ==0) { | |
413 | delete pTrack; } //track will not be used anymore | |
414 | else { | |
415 | pEvent->TrackCollection()->Add(pTrack) ; | |
416 | iGoodTracks++; | |
417 | ||
418 | if (pTrack->InRPSelection()) | |
419 | { iSelParticlesRP++; } | |
420 | if (pTrack->InPOISelection()) | |
421 | { iSelParticlesPOI++; } | |
422 | ||
423 | } | |
424 | ||
425 | itrkN++; | |
426 | } | |
427 | ||
428 | pEvent->SetEventNSelTracksRP(iSelParticlesRP); | |
429 | pEvent->SetNumberOfTracks(iGoodTracks); | |
430 | pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle); | |
431 | ||
432 | if (iSelParticlesRP >= fMinMult && iSelParticlesRP <= fMaxMult) { | |
433 | if ( (++fCount % 100) == 0) { | |
434 | if (!fMCReactionPlaneAngle == 0) cout<<" MC Reaction Plane Angle = "<< fMCReactionPlaneAngle << endl; | |
435 | else cout<<" MC Reaction Plane Angle = unknown "<< endl; | |
436 | cout << " Number of MC input tracks = " << iNumberOfInputTracksMC << endl; | |
437 | cout<<" iGoodTracks = "<<iGoodTracks<<endl; | |
438 | cout<<" # of RP selected tracks = "<<iSelParticlesRP<<endl; | |
439 | cout<<" # of POI selected tracks = "<<iSelParticlesPOI<<endl; | |
440 | cout << "# " << fCount << " events processed" << endl; | |
441 | } | |
442 | return pEvent; | |
443 | } | |
444 | else { | |
445 | cout<<"Not enough tracks in the FlowEventSimple"<<endl; | |
446 | return 0; | |
447 | } | |
448 | } | |
449 | else { | |
450 | cout<<"Event does not pass multiplicity cuts"<<endl; | |
451 | return 0; | |
452 | } | |
453 | ||
454 | } | |
455 | ||
456 | //local methods | |
f1d945a1 | 457 | //----------------------------------------------------------------------- |
fbdb53fa | 458 | AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(TTree* anInput, const AliFlowTrackSimpleCuts* rpCuts, const AliFlowTrackSimpleCuts* poiCuts) |
f1d945a1 | 459 | { |
460 | //fills the event from a TTree of kinematic.root files | |
7f0d823b | 461 | |
462 | // number of times to use the same particle (trick to introduce nonflow) | |
7f0d823b | 463 | |
464 | //flags for particles passing int. and diff. flow cuts | |
92a926b8 | 465 | Bool_t bPassedRPFlowCuts = kFALSE; |
466 | Bool_t bPassedPOIFlowCuts = kFALSE; | |
7f0d823b | 467 | |
b00ca27f | 468 | //track cut values |
92a926b8 | 469 | Double_t dPtMaxRP = rpCuts->GetPtMax(); |
470 | Double_t dPtMinRP = rpCuts->GetPtMin(); | |
471 | Double_t dEtaMaxRP = rpCuts->GetEtaMax(); | |
472 | Double_t dEtaMinRP = rpCuts->GetEtaMin(); | |
473 | Double_t dPhiMaxRP = rpCuts->GetPhiMax(); | |
474 | Double_t dPhiMinRP = rpCuts->GetPhiMin(); | |
475 | Int_t iPIDRP = rpCuts->GetPID(); | |
7f0d823b | 476 | |
92a926b8 | 477 | Double_t dPtMaxPOI = poiCuts->GetPtMax(); |
478 | Double_t dPtMinPOI = poiCuts->GetPtMin(); | |
479 | Double_t dEtaMaxPOI = poiCuts->GetEtaMax(); | |
480 | Double_t dEtaMinPOI = poiCuts->GetEtaMin(); | |
481 | Double_t dPhiMaxPOI = poiCuts->GetPhiMax(); | |
482 | Double_t dPhiMinPOI = poiCuts->GetPhiMin(); | |
483 | Int_t iPIDPOI = poiCuts->GetPID(); | |
7f0d823b | 484 | |
e35ddff0 | 485 | Int_t iNumberOfInputTracks = anInput->GetEntries() ; |
951817d5 | 486 | |
e35ddff0 | 487 | TParticle* pParticle = new TParticle(); |
488 | anInput->SetBranchAddress("Particles",&pParticle); | |
489 | // AliFlowEventSimple* pEvent = new AliFlowEventSimple(iNumberOfInputTracks); | |
490 | AliFlowEventSimple* pEvent = new AliFlowEventSimple(10); | |
f1d945a1 | 491 | |
3abe32c8 | 492 | // Int_t fMultiplicityOfEvent = 576; //multiplicity for chi=1.5 |
493 | // Int_t fMultiplicityOfEvent = 256; //multiplicity for chi=1 | |
494 | // Int_t fMultiplicityOfEvent = 164; //multiplicity for chi=0.8 | |
989f43e5 | 495 | |
e35ddff0 | 496 | Int_t iGoodTracks = 0; |
497 | Int_t itrkN = 0; | |
92a926b8 | 498 | Int_t iSelParticlesRP = 0; |
499 | Int_t iSelParticlesPOI = 0; | |
500 | ||
7f0d823b | 501 | while (itrkN < iNumberOfInputTracks) { |
502 | anInput->GetEntry(itrkN); //get input particle | |
92a926b8 | 503 | if (pParticle->IsPrimary()) { |
504 | //checking the cuts for int. and diff. flow | |
505 | if (pParticle->Pt() > dPtMinRP && pParticle->Pt() < dPtMaxRP && | |
506 | pParticle->Eta() > dEtaMinRP && pParticle->Eta() < dEtaMaxRP && | |
507 | pParticle->Phi() > dPhiMinRP && pParticle->Phi() < dPhiMaxRP && | |
508 | TMath::Abs(pParticle->GetPdgCode()) == iPIDRP) { | |
509 | bPassedRPFlowCuts = kTRUE; | |
510 | } | |
7f0d823b | 511 | |
92a926b8 | 512 | if (pParticle->Pt() > dPtMinPOI && pParticle->Pt() < dPtMaxPOI && |
513 | pParticle->Eta() > dEtaMinPOI && pParticle->Eta() < dEtaMaxPOI && | |
514 | pParticle->Phi() > dPhiMinPOI && pParticle->Phi() < dPhiMaxPOI && | |
515 | TMath::Abs(pParticle->GetPdgCode()) == iPIDPOI){ | |
516 | bPassedPOIFlowCuts = kTRUE; | |
517 | } | |
f1d945a1 | 518 | } |
92a926b8 | 519 | if (bPassedRPFlowCuts || bPassedPOIFlowCuts) { |
3abe32c8 | 520 | for(Int_t d=0;d<fNoOfLoops;d++) { |
7f0d823b | 521 | AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(); |
522 | pTrack->SetPt(pParticle->Pt()); | |
523 | pTrack->SetEta(pParticle->Eta()); | |
33314629 | 524 | pTrack->SetPhi(pParticle->Phi()-fEllipticFlowValue*TMath::Sin(2*(pParticle->Phi()-fMCReactionPlaneAngle))); |
7f0d823b | 525 | |
526 | //marking the particles used for int. flow: | |
33314629 | 527 | if(bPassedRPFlowCuts && iSelParticlesRP < fMultiplicityOfEvent) { |
6a1a854d | 528 | pTrack->SetForRPSelection(kTRUE); |
92a926b8 | 529 | iSelParticlesRP++; |
7f0d823b | 530 | } |
531 | //marking the particles used for diff. flow: | |
3abe32c8 | 532 | if(bPassedPOIFlowCuts && iGoodTracks%fNoOfLoops==0) { |
6a1a854d | 533 | pTrack->SetForPOISelection(kTRUE); |
92a926b8 | 534 | iSelParticlesPOI++; |
7f0d823b | 535 | } |
536 | //adding a particles which were used either for int. or diff. flow to the list | |
537 | pEvent->TrackCollection()->Add(pTrack); | |
538 | iGoodTracks++; | |
539 | }//end of for(Int_t d=0;d<iLoops;d++) | |
540 | }//end of if(bPassedIntFlowCuts || bPassedDiffFlowCuts) | |
541 | itrkN++; | |
92a926b8 | 542 | bPassedRPFlowCuts = kFALSE; |
543 | bPassedPOIFlowCuts = kFALSE; | |
7f0d823b | 544 | }//end of while (itrkN < iNumberOfInputTracks) |
062e56d1 | 545 | |
92a926b8 | 546 | pEvent->SetEventNSelTracksRP(iSelParticlesRP); |
547 | pEvent->SetNumberOfTracks(iGoodTracks);//tracks used either for RP or for POI selection | |
62726ef0 | 548 | pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle); |
951817d5 | 549 | |
989f43e5 | 550 | if ( (++fCount % 100) == 0) { |
551 | if (!fMCReactionPlaneAngle == 0) cout<<" MC Reaction Plane Angle = "<< fMCReactionPlaneAngle << endl; | |
552 | else cout<<" MC Reaction Plane Angle = unknown "<< endl; | |
553 | cout<<" iGoodTracks = "<< iGoodTracks << endl; | |
554 | cout<<" # of RP selected tracks = "<<iSelParticlesRP<<endl; | |
555 | cout<<" # of POI selected tracks = "<<iSelParticlesPOI<<endl; | |
556 | cout << "# " << fCount << " events processed" << endl; | |
557 | } | |
7f0d823b | 558 | |
559 | delete pParticle; | |
e35ddff0 | 560 | return pEvent; |
f1d945a1 | 561 | } |
562 | ||
563 | //----------------------------------------------------------------------- | |
e35ddff0 | 564 | AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliMCEvent* anInput) |
f1d945a1 | 565 | { |
566 | //Fills the event from the MC kinematic information | |
0b7f49e9 | 567 | |
e35ddff0 | 568 | Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ; |
f1d945a1 | 569 | |
e35ddff0 | 570 | AliFlowEventSimple* pEvent = new AliFlowEventSimple(10); |
f1d945a1 | 571 | |
e35ddff0 | 572 | //Int_t iN = 256; //multiplicity for chi=1 |
573 | Int_t iN = iNumberOfInputTracks; | |
574 | Int_t iGoodTracks = 0; | |
575 | Int_t itrkN = 0; | |
989f43e5 | 576 | Int_t iSelParticlesPOI = 0; |
577 | Int_t iSelParticlesRP = 0; | |
f1d945a1 | 578 | |
0b7f49e9 | 579 | //normal loop |
e35ddff0 | 580 | while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) { |
7aad0c47 | 581 | AliMCParticle* pParticle = (AliMCParticle*) anInput->GetTrack(itrkN); //get input particle |
0b7f49e9 | 582 | //cut on tracks |
88e00a8a | 583 | if (TMath::Abs(pParticle->Eta()) < 0.9) |
0b7f49e9 | 584 | { |
585 | if( | |
e35ddff0 | 586 | TMath::Abs(pParticle->Particle()->GetPdgCode()) == 211 |
587 | // TMath::Abs(pParticle->Particle()->GetPdgCode()) == 211 || | |
588 | // TMath::Abs(pParticle->Particle()->GetPdgCode()) == 321 || | |
589 | // TMath::Abs(pParticle->Particle()->GetPdgCode()) == 2212 | |
0b7f49e9 | 590 | ) |
591 | { | |
e35ddff0 | 592 | AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(); |
593 | pTrack->SetPt(pParticle->Pt() ); | |
594 | pTrack->SetEta(pParticle->Eta() ); | |
595 | pTrack->SetPhi(pParticle->Phi() ); | |
6a1a854d | 596 | pTrack->SetForRPSelection(kTRUE); |
597 | pTrack->SetForPOISelection(kTRUE); | |
e35ddff0 | 598 | |
6a1a854d | 599 | if (pTrack->InRPSelection()) |
989f43e5 | 600 | { iSelParticlesRP++; } |
6a1a854d | 601 | if (pTrack->InPOISelection()) |
989f43e5 | 602 | { iSelParticlesPOI++; } |
e35ddff0 | 603 | iGoodTracks++; |
604 | pEvent->TrackCollection()->Add(pTrack) ; | |
0b7f49e9 | 605 | } |
88e00a8a | 606 | /* else if( |
e35ddff0 | 607 | TMath::Abs(pParticle->Particle()->GetPdgCode()) == 211 |
f1d945a1 | 608 | ) |
609 | { | |
e35ddff0 | 610 | AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(); |
611 | pTrack->SetPt(pParticle->Pt() ); | |
612 | pTrack->SetEta(pParticle->Eta() ); | |
613 | pTrack->SetPhi(pParticle->Phi() ); | |
6a1a854d | 614 | pTrack->SetForRPSelection(kFALSE); |
615 | pTrack->SetForPOISelection(kTRUE); | |
e35ddff0 | 616 | |
6a1a854d | 617 | if (pTrack->InRPSelection()) |
989f43e5 | 618 | { iSelParticlesRP++; } |
6a1a854d | 619 | if (pTrack->InPOISelection()) |
989f43e5 | 620 | { iSelParticlesPOI++; } |
e35ddff0 | 621 | iGoodTracks++; |
622 | pEvent->TrackCollection()->Add(pTrack); | |
f1d945a1 | 623 | } |
624 | */ | |
0b7f49e9 | 625 | } |
f1d945a1 | 626 | |
e35ddff0 | 627 | itrkN++; |
f1d945a1 | 628 | } |
0b7f49e9 | 629 | |
989f43e5 | 630 | pEvent-> SetEventNSelTracksRP(iSelParticlesRP); |
e35ddff0 | 631 | pEvent->SetNumberOfTracks(iGoodTracks); |
62726ef0 | 632 | pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle); |
62726ef0 | 633 | |
989f43e5 | 634 | if ( (++fCount % 100) == 0) { |
635 | if (!fMCReactionPlaneAngle == 0) cout<<" MC Reaction Plane Angle = "<< fMCReactionPlaneAngle << endl; | |
636 | else cout<<" MC Reaction Plane Angle = unknown "<< endl; | |
637 | cout<<" iGoodTracks = "<<iGoodTracks<<endl; | |
638 | cout<<" # of RP selected tracks = "<<iSelParticlesRP<<endl; | |
639 | cout<<" # of POI selected tracks = "<<iSelParticlesPOI<<endl; | |
640 | cout << "# " << fCount << " events processed" << endl; | |
641 | } | |
d53e4563 | 642 | |
e35ddff0 | 643 | return pEvent; |
f1d945a1 | 644 | |
645 | } | |
646 | ||
f1d945a1 | 647 | //----------------------------------------------------------------------- |
e35ddff0 | 648 | AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput) |
f1d945a1 | 649 | { |
650 | //Fills the event from the ESD | |
0b7f49e9 | 651 | |
e35ddff0 | 652 | Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ; |
f1d945a1 | 653 | |
e35ddff0 | 654 | AliFlowEventSimple* pEvent = new AliFlowEventSimple(10); |
f1d945a1 | 655 | |
e35ddff0 | 656 | //Int_t iN = 256; //multiplicity for chi=1 |
657 | Int_t iN = iNumberOfInputTracks; | |
658 | Int_t iGoodTracks = 0; | |
659 | Int_t itrkN = 0; | |
989f43e5 | 660 | Int_t iSelParticlesPOI = 0; |
661 | Int_t iSelParticlesRP = 0; | |
f1d945a1 | 662 | |
062e56d1 | 663 | |
664 | ||
0b7f49e9 | 665 | //normal loop |
e35ddff0 | 666 | while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) { |
667 | AliESDtrack* pParticle = anInput->GetTrack(itrkN); //get input particle | |
0b7f49e9 | 668 | //cut on tracks |
88e00a8a | 669 | if (TMath::Abs(pParticle->Eta()) < 0.9) |
062e56d1 | 670 | |
671 | ||
672 | ||
673 | { | |
e35ddff0 | 674 | AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(); |
675 | pTrack->SetPt(pParticle->Pt() ); | |
676 | pTrack->SetEta(pParticle->Eta() ); | |
677 | pTrack->SetPhi(pParticle->Phi() ); | |
6a1a854d | 678 | pTrack->SetForRPSelection(kTRUE); |
679 | pTrack->SetForPOISelection(kTRUE); | |
e35ddff0 | 680 | |
6a1a854d | 681 | if (pTrack->InRPSelection()) |
989f43e5 | 682 | { iSelParticlesRP++; } |
6a1a854d | 683 | if (pTrack->InPOISelection()) |
989f43e5 | 684 | { iSelParticlesPOI++; } |
e35ddff0 | 685 | iGoodTracks++; |
686 | pEvent->TrackCollection()->Add(pTrack) ; | |
0b7f49e9 | 687 | } |
f1d945a1 | 688 | |
e35ddff0 | 689 | itrkN++; |
f1d945a1 | 690 | } |
0b7f49e9 | 691 | |
989f43e5 | 692 | pEvent-> SetEventNSelTracksRP(iSelParticlesRP); |
e35ddff0 | 693 | pEvent->SetNumberOfTracks(iGoodTracks); |
62726ef0 | 694 | pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle); |
62726ef0 | 695 | |
489fdf79 | 696 | if ( (++fCount % 100) == 0) { |
697 | if (!fMCReactionPlaneAngle == 0) cout<<" MC Reaction Plane Angle = "<< fMCReactionPlaneAngle << endl; | |
698 | else cout<<" MC Reaction Plane Angle = unknown "<< endl; | |
699 | cout<<" iGoodTracks = "<<iGoodTracks<<endl; | |
700 | cout<<" # of RP selected tracks = "<<iSelParticlesRP<<endl; | |
701 | cout<<" # of POI selected tracks = "<<iSelParticlesPOI<<endl; | |
702 | cout << "# " << fCount << " events processed" << endl; | |
703 | } | |
704 | ||
705 | return pEvent; | |
706 | } | |
707 | ||
708 | //----------------------------------------------------------------------- | |
709 | ||
e35ddff0 | 710 | AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliAODEvent* anInput) |
f1d945a1 | 711 | { |
712 | //Fills the event from the AOD | |
0b7f49e9 | 713 | |
e35ddff0 | 714 | Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ; |
f1d945a1 | 715 | |
e35ddff0 | 716 | AliFlowEventSimple* pEvent = new AliFlowEventSimple(10); |
f1d945a1 | 717 | |
e35ddff0 | 718 | //Int_t iN = 256; //multiplicity for chi=1 |
719 | Int_t iN = iNumberOfInputTracks; | |
720 | Int_t iGoodTracks = 0; | |
721 | Int_t itrkN = 0; | |
989f43e5 | 722 | Int_t iSelParticlesPOI = 0; |
723 | Int_t iSelParticlesRP = 0; | |
f1d945a1 | 724 | |
0b7f49e9 | 725 | //normal loop |
e35ddff0 | 726 | while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) { |
727 | AliAODTrack* pParticle = anInput->GetTrack(itrkN); //get input particle | |
0b7f49e9 | 728 | //cut on tracks |
88e00a8a | 729 | if (TMath::Abs(pParticle->Eta()) < 0.9) |
0b7f49e9 | 730 | { |
e35ddff0 | 731 | AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(); |
732 | pTrack->SetPt(pParticle->Pt() ); | |
733 | pTrack->SetEta(pParticle->Eta() ); | |
734 | pTrack->SetPhi(pParticle->Phi() ); | |
6a1a854d | 735 | pTrack->SetForRPSelection(kTRUE); |
736 | pTrack->SetForPOISelection(kTRUE); | |
e35ddff0 | 737 | |
6a1a854d | 738 | if (pTrack->InRPSelection()) |
989f43e5 | 739 | { iSelParticlesRP++; } |
6a1a854d | 740 | if (pTrack->InPOISelection()) |
989f43e5 | 741 | { iSelParticlesPOI++; } |
e35ddff0 | 742 | iGoodTracks++; |
743 | pEvent->TrackCollection()->Add(pTrack) ; | |
0b7f49e9 | 744 | } |
f1d945a1 | 745 | |
e35ddff0 | 746 | itrkN++; |
0b7f49e9 | 747 | } |
748 | ||
989f43e5 | 749 | pEvent-> SetEventNSelTracksRP(iSelParticlesRP); |
e35ddff0 | 750 | pEvent->SetNumberOfTracks(iGoodTracks); |
62726ef0 | 751 | pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle); |
62726ef0 | 752 | |
989f43e5 | 753 | if ( (++fCount % 100) == 0) { |
754 | if (!fMCReactionPlaneAngle == 0) cout<<" MC Reaction Plane Angle = "<< fMCReactionPlaneAngle << endl; | |
755 | else cout<<" MC Reaction Plane Angle = unknown "<< endl; | |
756 | cout<<" iGoodTracks = "<<iGoodTracks<<endl; | |
757 | cout<<" # of RP selected tracks = "<<iSelParticlesRP<<endl; | |
758 | cout<<" # of POI selected tracks = "<<iSelParticlesPOI<<endl; | |
759 | cout << "# " << fCount << " events processed" << endl; | |
760 | } | |
d53e4563 | 761 | |
e35ddff0 | 762 | return pEvent; |
0b7f49e9 | 763 | } |
88e00a8a | 764 | |
0b7f49e9 | 765 | //----------------------------------------------------------------------- |
fbdb53fa | 766 | AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, const AliMCEvent* anInputMc, Int_t anOption) |
0b7f49e9 | 767 | { |
768 | //fills the event with tracks from the ESD and kinematics from the MC info via the track label | |
769 | ||
e35ddff0 | 770 | if (!(anOption ==0 || anOption ==1)) { |
771 | cout<<"WRONG OPTION IN AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, AliMCEvent* anInputMc, Int_t anOption)"<<endl; | |
0b7f49e9 | 772 | exit(1); |
f1d945a1 | 773 | } |
774 | ||
e35ddff0 | 775 | Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ; |
0b7f49e9 | 776 | |
e35ddff0 | 777 | AliFlowEventSimple* pEvent = new AliFlowEventSimple(10); |
0b7f49e9 | 778 | |
e35ddff0 | 779 | //Int_t iN = 256; //multiplicity for chi=1 |
780 | Int_t iN = iNumberOfInputTracks; | |
781 | Int_t iGoodTracks = 0; | |
782 | Int_t itrkN = 0; | |
989f43e5 | 783 | Int_t iSelParticlesPOI = 0; |
784 | Int_t iSelParticlesRP = 0; | |
f1d945a1 | 785 | |
0b7f49e9 | 786 | //normal loop |
e35ddff0 | 787 | while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) { |
788 | AliESDtrack* pParticle = anInput->GetTrack(itrkN); //get input particle | |
0b7f49e9 | 789 | //get Label |
e35ddff0 | 790 | Int_t iLabel = pParticle->GetLabel(); |
0b7f49e9 | 791 | //match to mc particle |
7aad0c47 | 792 | AliMCParticle* pMcParticle = (AliMCParticle*) anInputMc->GetTrack(TMath::Abs(iLabel)); |
0b7f49e9 | 793 | |
794 | //check | |
e35ddff0 | 795 | if (TMath::Abs(pParticle->GetLabel())!=pMcParticle->Label()) cout<<"pParticle->GetLabel()!=pMcParticle->Label() "<<pParticle->GetLabel()<<" "<<pMcParticle->Label()<<endl; |
0b7f49e9 | 796 | |
797 | //cut on tracks | |
e35ddff0 | 798 | if (TMath::Abs(pParticle->Eta()) < 0.2) |
0b7f49e9 | 799 | { |
800 | if( | |
e35ddff0 | 801 | TMath::Abs(pMcParticle->Particle()->GetPdgCode()) == 211 //pions |
802 | // TMath::Abs(pMcParticle->Particle()->GetPdgCode()) == 211 || | |
803 | // TMath::Abs(pMcParticle->Particle()->GetPdgCode()) == 321 || | |
804 | // TMath::Abs(pMcParticle->Particle()->GetPdgCode()) == 2212 | |
0b7f49e9 | 805 | ) |
806 | { | |
e35ddff0 | 807 | AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(); |
808 | if(anOption == 0) { //take the PID from the MC & the kinematics from the ESD | |
809 | pTrack->SetPt(pParticle->Pt() ); | |
810 | pTrack->SetEta(pParticle->Eta() ); | |
811 | pTrack->SetPhi(pParticle->Phi() ); | |
6a1a854d | 812 | pTrack->SetForRPSelection(kTRUE); |
813 | pTrack->SetForPOISelection(kTRUE); | |
0b7f49e9 | 814 | } |
e35ddff0 | 815 | else if (anOption == 1) { //take the PID and kinematics from the MC |
816 | pTrack->SetPt(pMcParticle->Pt() ); | |
817 | pTrack->SetEta(pMcParticle->Eta() ); | |
818 | pTrack->SetPhi(pMcParticle->Phi() ); | |
6a1a854d | 819 | pTrack->SetForRPSelection(kTRUE); |
820 | pTrack->SetForPOISelection(kTRUE); | |
0b7f49e9 | 821 | } |
822 | else { cout<<"Not a valid option"<<endl; } | |
6a1a854d | 823 | if (pTrack->InRPSelection()) |
989f43e5 | 824 | { iSelParticlesRP++; } |
6a1a854d | 825 | if (pTrack->InPOISelection()) |
989f43e5 | 826 | { iSelParticlesPOI++; } |
e35ddff0 | 827 | iGoodTracks++; |
828 | pEvent->TrackCollection()->Add(pTrack) ; | |
0b7f49e9 | 829 | } |
830 | } | |
e35ddff0 | 831 | itrkN++; |
0b7f49e9 | 832 | } |
833 | ||
989f43e5 | 834 | pEvent-> SetEventNSelTracksRP(iSelParticlesRP); |
e35ddff0 | 835 | pEvent->SetNumberOfTracks(iGoodTracks); |
62726ef0 | 836 | pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle); |
62726ef0 | 837 | |
989f43e5 | 838 | if ( (++fCount % 100) == 0) { |
839 | if (!fMCReactionPlaneAngle == 0) cout<<" MC Reaction Plane Angle = "<< fMCReactionPlaneAngle << endl; | |
840 | else cout<<" MC Reaction Plane Angle = unknown "<< endl; | |
841 | cout<<" iGoodTracks = "<<iGoodTracks<<endl; | |
842 | cout<<" # of RP selected tracks = "<<iSelParticlesRP<<endl; | |
843 | cout<<" # of POI selected tracks = "<<iSelParticlesPOI<<endl; | |
844 | cout << "# " << fCount << " events processed" << endl; | |
845 | } | |
d53e4563 | 846 | |
e35ddff0 | 847 | return pEvent; |
f1d945a1 | 848 | } |