1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 /////////////////////////////////////////////////////////////////////////
16 // AliFlowEventSimpleMaker:
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 /////////////////////////////////////////////////////////////////////////
24 #include "Riostream.h"
26 #include "TParticle.h"
27 #include "AliFlowEventSimpleMaker.h"
28 #include "AliFlowEventSimple.h"
29 #include "AliFlowTrackSimple.h"
30 #include "AliMCEvent.h"
31 #include "AliMCParticle.h"
32 #include "AliESDEvent.h"
33 #include "AliESDtrack.h"
34 #include "AliAODEvent.h"
35 #include "AliAODTrack.h"
36 #include "AliCFManager.h"
37 #include "AliFlowTrackSimpleCuts.h"
41 ClassImp(AliFlowEventSimpleMaker)
42 //-----------------------------------------------------------------------
43 AliFlowEventSimpleMaker::AliFlowEventSimpleMaker() :
44 fMCReactionPlaneAngle(0.),
47 fEllipticFlowValue(0.),
48 fMultiplicityOfEvent(1000000000),
59 //-----------------------------------------------------------------------
60 AliFlowEventSimpleMaker::~AliFlowEventSimpleMaker()
65 //-----------------------------------------------------------------------
66 AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks( AliMCEvent* anInput, const AliCFManager* intCFManager, const AliCFManager* diffCFManager)
68 //Fills the event from the MC kinematic information
70 Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
72 if (iNumberOfInputTracks==-1) {
73 cout<<"Skipping Event -- No MC information available for this event"<<endl;
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
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);
90 while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) {
92 AliMCParticle* pParticle = (AliMCParticle*) anInput->GetTrack(itrkN);
93 //make new AliFlowTrackSimple
94 AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
95 pTrack->SetPt(pParticle->Pt() );
96 pTrack->SetEta(pParticle->Eta() );
97 pTrack->SetPhi(pParticle->Phi() );
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;
104 if (diffCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pParticle)) {
105 pTrack->SetForPOISelection(kTRUE);
106 //cout<<"differential selection. PID = "<<pParticle->Particle()->GetPdgCode()<<endl;
109 //check if any bits are set
110 const TBits* bFlowBits = pTrack->GetFlowBits();
111 if (bFlowBits->CountBits() ==0) {
112 delete pTrack; } //track will not be used anymore
114 pEvent->AddTrack(pTrack) ;
117 if (pTrack->InRPSelection())
118 { iSelParticlesRP++; }
119 if (pTrack->InPOISelection())
120 { iSelParticlesPOI++; }
126 pEvent-> SetEventNSelTracksRP(iSelParticlesRP);
127 pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle);
129 if (iSelParticlesRP >= fMinMult && iSelParticlesRP <= fMaxMult) {
130 if ( (++fCount % 100) == 0) {
131 cout<<" MC Reaction Plane Angle = "<< fMCReactionPlaneAngle << endl;
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;
141 cout<<"Not enough tracks in the FlowEventSimple"<<endl;
146 cout<<"Event does not pass multiplicity cuts"<<endl;
152 //-----------------------------------------------------------------------
154 AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, const AliCFManager* intCFManager, const AliCFManager* diffCFManager)
156 //Fills the event from the ESD
158 //flags for particles passing int. and diff. flow cuts
159 Bool_t bPassedRPFlowCuts = kFALSE;
160 Bool_t bPassedPOIFlowCuts = kFALSE;
162 Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
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
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);
176 while (itrkN < iNumberOfInputTracks) {
177 AliESDtrack* pParticle = anInput->GetTrack(itrkN); //get input particle
179 //check if pParticle passes the cuts
180 if (intCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
181 intCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle)) {
182 bPassedRPFlowCuts = kTRUE;
184 if (diffCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
185 diffCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle)) {
186 bPassedPOIFlowCuts = kTRUE;
189 if (bPassedRPFlowCuts || bPassedPOIFlowCuts) {
190 //make new AliFLowTrackSimple
191 AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
192 pTrack->SetPt(pParticle->Pt() );
193 pTrack->SetEta(pParticle->Eta() );
194 if (fEllipticFlowValue>0.)
195 { pTrack->SetPhi(pParticle->Phi()-fEllipticFlowValue*TMath::Sin(2*(pParticle->Phi()-fMCReactionPlaneAngle))); cout<<"Added flow to particle"<<endl; }
196 else { pTrack->SetPhi(pParticle->Phi() ); }
198 //marking the particles used for int. flow:
199 if(bPassedRPFlowCuts) {
200 pTrack->SetForRPSelection(kTRUE);
202 // assign particles to subevents
203 if (pTrack->Eta()>=fEtaMinA && pTrack->Eta()<=fEtaMaxA) {
204 pTrack->SetForSubevent(0);
206 if (pTrack->Eta()>=fEtaMinB && pTrack->Eta()<=fEtaMaxB) {
207 pTrack->SetForSubevent(1);
211 //marking the particles used for diff. flow:
212 if(bPassedPOIFlowCuts) {
213 pTrack->SetForPOISelection(kTRUE);
216 //adding particles which were used either for int. or diff. flow to the list
217 pEvent->AddTrack(pTrack);
219 }//end of if(bPassedIntFlowCuts || bPassedDiffFlowCuts)
221 bPassedRPFlowCuts = kFALSE;
222 bPassedPOIFlowCuts = kFALSE;
223 }//end of while (itrkN < iNumberOfInputTracks)
225 pEvent->SetEventNSelTracksRP(iSelParticlesRP);
226 pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle);
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;
241 cout<<"Not enough tracks in the FlowEventSimple"<<endl;
246 cout<<"Event does not pass multiplicity cuts"<<endl;
252 //-----------------------------------------------------------------------
253 AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliAODEvent* anInput, const AliCFManager* intCFManager, const AliCFManager* diffCFManager)
255 //Fills the event from the AOD
257 Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
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
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);
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() );
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);}
289 //check if any bits are set
290 const TBits* bFlowBits = pTrack->GetFlowBits();
291 if (bFlowBits->CountBits() ==0) {
292 delete pTrack; } //track will not be used anymore
294 pEvent->AddTrack(pTrack) ;
297 if (pTrack->InRPSelection())
298 { iSelParticlesRP++; }
299 if (pTrack->InPOISelection())
300 { iSelParticlesPOI++; }
307 pEvent-> SetEventNSelTracksRP(iSelParticlesRP);
308 pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle);
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;
322 cout<<"Not enough tracks in the FlowEventSimple"<<endl;
327 cout<<"Event does not pass multiplicity cuts"<<endl;
333 //-----------------------------------------------------------------------
334 AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, const AliMCEvent* anInputMc, const AliCFManager* intCFManager, const AliCFManager* diffCFManager, Int_t anOption)
336 //fills the event with tracks from the ESD and kinematics from the MC info via the track label
339 if (!(anOption ==0 || anOption ==1)) {
340 cout<<"WRONG OPTION IN AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, AliMCEvent* anInputMc, Int_t anOption)"<<endl;
344 Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
346 Int_t iNumberOfInputTracksMC = anInputMc->GetNumberOfTracks() ;
347 if (iNumberOfInputTracksMC==-1) {
348 cout<<"Skipping Event -- No MC information available for this event"<<endl;
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
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);
364 //loop over ESD tracks
365 while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) {
366 AliESDtrack* pParticle = anInput->GetTrack(itrkN); //get input particle
368 Int_t iLabel = pParticle->GetLabel();
369 //match to mc particle
370 AliMCParticle* pMcParticle = (AliMCParticle*) anInputMc->GetTrack(TMath::Abs(iLabel));
373 if (TMath::Abs(pParticle->GetLabel())!=pMcParticle->Label()) cout<<"pParticle->GetLabel()!=pMcParticle->Label() "<<pParticle->GetLabel()<<" "<<pMcParticle->Label()<<endl;
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() );
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() );
387 else { cout<<"Not a valid option"<<endl; }
389 //check if pParticle passes the cuts
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);}
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);}
406 else { cout<<"Not a valid option"<<endl; }
408 //check if any bits are set
409 const TBits* bFlowBits = pTrack->GetFlowBits();
410 if (bFlowBits->CountBits() ==0) {
411 delete pTrack; } //track will not be used anymore
413 pEvent->AddTrack(pTrack) ;
416 if (pTrack->InRPSelection())
417 { iSelParticlesRP++; }
418 if (pTrack->InPOISelection())
419 { iSelParticlesPOI++; }
426 pEvent->SetEventNSelTracksRP(iSelParticlesRP);
427 pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle);
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;
442 cout<<"Not enough tracks in the FlowEventSimple"<<endl;
447 cout<<"Event does not pass multiplicity cuts"<<endl;
454 //-----------------------------------------------------------------------
455 AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(TTree* anInput, const AliFlowTrackSimpleCuts* rpCuts, const AliFlowTrackSimpleCuts* poiCuts)
457 //fills the event from a TTree of kinematic.root files
459 // number of times to use the same particle (trick to introduce nonflow)
461 //flags for particles passing int. and diff. flow cuts
462 Bool_t bPassedRPFlowCuts = kFALSE;
463 Bool_t bPassedPOIFlowCuts = kFALSE;
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();
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();
482 Int_t iNumberOfInputTracks = anInput->GetEntries() ;
484 TParticle* pParticle = new TParticle();
485 anInput->SetBranchAddress("Particles",&pParticle);
486 // AliFlowEventSimple* pEvent = new AliFlowEventSimple(iNumberOfInputTracks);
487 AliFlowEventSimple* pEvent = new AliFlowEventSimple(10);
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
493 Int_t iGoodTracks = 0;
495 Int_t iSelParticlesRP = 0;
496 Int_t iSelParticlesPOI = 0;
498 while (itrkN < iNumberOfInputTracks) {
499 anInput->GetEntry(itrkN); //get input particle
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;
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;
516 if (bPassedRPFlowCuts || bPassedPOIFlowCuts) {
517 for(Int_t d=0;d<fNoOfLoops;d++) {
518 AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
519 pTrack->SetPt(pParticle->Pt());
520 pTrack->SetEta(pParticle->Eta());
521 pTrack->SetPhi(pParticle->Phi()-fEllipticFlowValue*TMath::Sin(2*(pParticle->Phi()-fMCReactionPlaneAngle)));
523 //marking the particles used for int. flow:
524 if(bPassedRPFlowCuts && iSelParticlesRP < fMultiplicityOfEvent) {
525 pTrack->SetForRPSelection(kTRUE);
528 //marking the particles used for diff. flow:
529 if(bPassedPOIFlowCuts && iGoodTracks%fNoOfLoops==0) {
530 pTrack->SetForPOISelection(kTRUE);
533 //adding a particles which were used either for int. or diff. flow to the list
534 pEvent->AddTrack(pTrack);
536 }//end of for(Int_t d=0;d<iLoops;d++)
537 }//end of if(bPassedIntFlowCuts || bPassedDiffFlowCuts)
539 bPassedRPFlowCuts = kFALSE;
540 bPassedPOIFlowCuts = kFALSE;
541 }//end of while (itrkN < iNumberOfInputTracks)
543 pEvent->SetEventNSelTracksRP(iSelParticlesRP);
544 pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle);
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;
559 //-----------------------------------------------------------------------
560 AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliMCEvent* anInput)
562 //Fills the event from the MC kinematic information
564 Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
566 AliFlowEventSimple* pEvent = new AliFlowEventSimple(10);
568 //Int_t iN = 256; //multiplicity for chi=1
569 Int_t iN = iNumberOfInputTracks;
570 Int_t iGoodTracks = 0;
572 Int_t iSelParticlesPOI = 0;
573 Int_t iSelParticlesRP = 0;
576 while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) {
577 AliMCParticle* pParticle = (AliMCParticle*) anInput->GetTrack(itrkN); //get input particle
579 if (TMath::Abs(pParticle->Eta()) < 0.9)
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
588 AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
589 pTrack->SetPt(pParticle->Pt() );
590 pTrack->SetEta(pParticle->Eta() );
591 pTrack->SetPhi(pParticle->Phi() );
592 pTrack->SetForRPSelection(kTRUE);
593 pTrack->SetForPOISelection(kTRUE);
595 if (pTrack->InRPSelection())
596 { iSelParticlesRP++; }
597 if (pTrack->InPOISelection())
598 { iSelParticlesPOI++; }
600 pEvent->AddTrack(pTrack) ;
603 TMath::Abs(pParticle->Particle()->GetPdgCode()) == 211
606 AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
607 pTrack->SetPt(pParticle->Pt() );
608 pTrack->SetEta(pParticle->Eta() );
609 pTrack->SetPhi(pParticle->Phi() );
610 pTrack->SetForRPSelection(kFALSE);
611 pTrack->SetForPOISelection(kTRUE);
613 if (pTrack->InRPSelection())
614 { iSelParticlesRP++; }
615 if (pTrack->InPOISelection())
616 { iSelParticlesPOI++; }
618 pEvent->AddTrack(pTrack);
626 pEvent-> SetEventNSelTracksRP(iSelParticlesRP);
627 pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle);
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;
642 //-----------------------------------------------------------------------
643 AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput)
645 //Fills the event from the ESD
647 Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
649 AliFlowEventSimple* pEvent = new AliFlowEventSimple(10);
651 //Int_t iN = 256; //multiplicity for chi=1
652 Int_t iN = iNumberOfInputTracks;
653 Int_t iGoodTracks = 0;
655 Int_t iSelParticlesPOI = 0;
656 Int_t iSelParticlesRP = 0;
661 while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) {
662 AliESDtrack* pParticle = anInput->GetTrack(itrkN); //get input particle
664 if (TMath::Abs(pParticle->Eta()) < 0.9)
669 AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
670 pTrack->SetPt(pParticle->Pt() );
671 pTrack->SetEta(pParticle->Eta() );
672 pTrack->SetPhi(pParticle->Phi() );
673 pTrack->SetForRPSelection(kTRUE);
674 pTrack->SetForPOISelection(kTRUE);
676 if (pTrack->InRPSelection())
677 { iSelParticlesRP++; }
678 if (pTrack->InPOISelection())
679 { iSelParticlesPOI++; }
681 pEvent->AddTrack(pTrack) ;
687 pEvent-> SetEventNSelTracksRP(iSelParticlesRP);
688 pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle);
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;
702 //-----------------------------------------------------------------------
704 AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliAODEvent* anInput)
706 //Fills the event from the AOD
708 Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
710 AliFlowEventSimple* pEvent = new AliFlowEventSimple(10);
712 //Int_t iN = 256; //multiplicity for chi=1
713 Int_t iN = iNumberOfInputTracks;
714 Int_t iGoodTracks = 0;
716 Int_t iSelParticlesPOI = 0;
717 Int_t iSelParticlesRP = 0;
720 while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) {
721 AliAODTrack* pParticle = anInput->GetTrack(itrkN); //get input particle
723 if (TMath::Abs(pParticle->Eta()) < 0.9)
725 AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
726 pTrack->SetPt(pParticle->Pt() );
727 pTrack->SetEta(pParticle->Eta() );
728 pTrack->SetPhi(pParticle->Phi() );
729 pTrack->SetForRPSelection(kTRUE);
730 pTrack->SetForPOISelection(kTRUE);
732 if (pTrack->InRPSelection())
733 { iSelParticlesRP++; }
734 if (pTrack->InPOISelection())
735 { iSelParticlesPOI++; }
737 pEvent->AddTrack(pTrack) ;
743 pEvent-> SetEventNSelTracksRP(iSelParticlesRP);
744 pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle);
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;
758 //-----------------------------------------------------------------------
759 AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, const AliMCEvent* anInputMc, Int_t anOption)
761 //fills the event with tracks from the ESD and kinematics from the MC info via the track label
763 if (!(anOption ==0 || anOption ==1)) {
764 cout<<"WRONG OPTION IN AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, AliMCEvent* anInputMc, Int_t anOption)"<<endl;
768 Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
770 AliFlowEventSimple* pEvent = new AliFlowEventSimple(10);
772 //Int_t iN = 256; //multiplicity for chi=1
773 Int_t iN = iNumberOfInputTracks;
774 Int_t iGoodTracks = 0;
776 Int_t iSelParticlesPOI = 0;
777 Int_t iSelParticlesRP = 0;
780 while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) {
781 AliESDtrack* pParticle = anInput->GetTrack(itrkN); //get input particle
783 Int_t iLabel = pParticle->GetLabel();
784 //match to mc particle
785 AliMCParticle* pMcParticle = (AliMCParticle*) anInputMc->GetTrack(TMath::Abs(iLabel));
788 if (TMath::Abs(pParticle->GetLabel())!=pMcParticle->Label()) cout<<"pParticle->GetLabel()!=pMcParticle->Label() "<<pParticle->GetLabel()<<" "<<pMcParticle->Label()<<endl;
791 if (TMath::Abs(pParticle->Eta()) < 0.2)
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
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() );
805 pTrack->SetForRPSelection(kTRUE);
806 pTrack->SetForPOISelection(kTRUE);
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() );
812 pTrack->SetForRPSelection(kTRUE);
813 pTrack->SetForPOISelection(kTRUE);
815 else { cout<<"Not a valid option"<<endl; }
816 if (pTrack->InRPSelection())
817 { iSelParticlesRP++; }
818 if (pTrack->InPOISelection())
819 { iSelParticlesPOI++; }
821 pEvent->AddTrack(pTrack) ;
827 pEvent-> SetEventNSelTracksRP(iSelParticlesRP);
828 pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle);
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;