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