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"
40 ClassImp(AliFlowEventSimpleMaker)
41 //-----------------------------------------------------------------------
42 AliFlowEventSimpleMaker::AliFlowEventSimpleMaker() :
43 fMCReactionPlaneAngle(0.),
46 fEllipticFlowValue(0.),
47 fMultiplicityOfEvent(1000000000),
58 //-----------------------------------------------------------------------
59 AliFlowEventSimpleMaker::~AliFlowEventSimpleMaker()
64 //-----------------------------------------------------------------------
65 AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks( AliMCEvent* anInput, const AliCFManager* intCFManager, const AliCFManager* diffCFManager)
67 //Fills the event from the MC kinematic information
69 Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
71 if (iNumberOfInputTracks==-1) {
72 cout<<"Skipping Event -- No MC information available for this event"<<endl;
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
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);
89 while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) {
91 AliMCParticle* pParticle = (AliMCParticle*) anInput->GetTrack(itrkN);
92 //make new AliFlowTrackSimple
93 AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
94 pTrack->SetPt(pParticle->Pt() );
95 pTrack->SetEta(pParticle->Eta() );
96 pTrack->SetPhi(pParticle->Phi() );
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;
103 if (diffCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pParticle)) {
104 pTrack->SetForPOISelection(kTRUE);
105 //cout<<"differential selection. PID = "<<pParticle->Particle()->GetPdgCode()<<endl;
108 //check if any bits are set
109 const TBits* bFlowBits = pTrack->GetFlowBits();
110 if (bFlowBits->CountBits() ==0) {
111 delete pTrack; } //track will not be used anymore
113 pEvent->AddTrack(pTrack) ;
116 if (pTrack->InRPSelection())
117 { iSelParticlesRP++; }
118 if (pTrack->InPOISelection())
119 { iSelParticlesPOI++; }
125 pEvent-> SetEventNSelTracksRP(iSelParticlesRP);
126 pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle);
128 if (iSelParticlesRP >= fMinMult && iSelParticlesRP <= fMaxMult) {
129 if ( (++fCount % 100) == 0) {
130 cout<<" MC Reaction Plane Angle = "<< fMCReactionPlaneAngle << endl;
132 cout<<" iGoodTracks = "<<iGoodTracks<<endl;
133 cout<<" # of RP selected tracks = "<<iSelParticlesRP<<endl;
134 cout<<" # of POI selected tracks = "<<iSelParticlesPOI<<endl;
135 cout << "# " << fCount << " events processed" << endl;
140 cout<<"Not enough tracks in the FlowEventSimple"<<endl;
145 cout<<"Event does not pass multiplicity cuts"<<endl;
151 //-----------------------------------------------------------------------
153 AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, const AliCFManager* intCFManager, const AliCFManager* diffCFManager)
155 //Fills the event from the ESD
157 //flags for particles passing int. and diff. flow cuts
158 Bool_t bPassedRPFlowCuts = kFALSE;
159 Bool_t bPassedPOIFlowCuts = kFALSE;
161 Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
163 Int_t iGoodTracks = 0; //number of good tracks
164 Int_t itrkN = 0; //track counter
165 Int_t iSelParticlesRP = 0; //number of tracks selected for Int
166 Int_t iSelParticlesPOI = 0; //number of tracks selected for Diff
168 // cut on the multiplicity
169 if (intCFManager->CheckEventCuts(AliCFManager::kEvtRecCuts,anInput)) {
170 // cout<<"iNumberOfInputTracks = "<<iNumberOfInputTracks<<endl;
171 // create an AliFlowEventSimple
172 AliFlowEventSimple* pEvent = new AliFlowEventSimple(10);
175 while (itrkN < iNumberOfInputTracks) {
176 AliESDtrack* pParticle = anInput->GetTrack(itrkN); //get input particle
178 //check if pParticle passes the cuts
179 if (intCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
180 intCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle)) {
181 bPassedRPFlowCuts = kTRUE;
183 if (diffCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
184 diffCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle)) {
185 bPassedPOIFlowCuts = kTRUE;
188 if (bPassedRPFlowCuts || bPassedPOIFlowCuts) {
189 //make new AliFLowTrackSimple
190 AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
191 pTrack->SetPt(pParticle->Pt() );
192 pTrack->SetEta(pParticle->Eta() );
193 if (fEllipticFlowValue>0.)
194 { pTrack->SetPhi(pParticle->Phi()-fEllipticFlowValue*TMath::Sin(2*(pParticle->Phi()-fMCReactionPlaneAngle))); cout<<"Added flow to particle"<<endl; }
195 else { pTrack->SetPhi(pParticle->Phi() ); }
197 //marking the particles used for int. flow:
198 if(bPassedRPFlowCuts) {
199 pTrack->SetForRPSelection(kTRUE);
201 // assign particles to subevents
202 if (pTrack->Eta()>=fEtaMinA && pTrack->Eta()<=fEtaMaxA) {
203 pTrack->SetForSubevent(0);
205 if (pTrack->Eta()>=fEtaMinB && pTrack->Eta()<=fEtaMaxB) {
206 pTrack->SetForSubevent(1);
210 //marking the particles used for diff. flow:
211 if(bPassedPOIFlowCuts) {
212 pTrack->SetForPOISelection(kTRUE);
215 //adding particles which were used either for int. or diff. flow to the list
216 pEvent->AddTrack(pTrack);
218 }//end of if(bPassedIntFlowCuts || bPassedDiffFlowCuts)
220 bPassedRPFlowCuts = kFALSE;
221 bPassedPOIFlowCuts = kFALSE;
222 }//end of while (itrkN < iNumberOfInputTracks)
224 pEvent->SetEventNSelTracksRP(iSelParticlesRP);
225 pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle);
228 if (iSelParticlesRP >= fMinMult && iSelParticlesRP <= fMaxMult) {
229 if ( (++fCount % 100) == 0) {
230 if (!fMCReactionPlaneAngle == 0) cout<<" MC Reaction Plane Angle = "<< fMCReactionPlaneAngle << endl;
231 else cout<<" MC Reaction Plane Angle = unknown "<< endl;
232 cout<<" iGoodTracks = "<<iGoodTracks<<endl;
233 cout<<" # of RP selected tracks = "<<iSelParticlesRP<<endl;
234 cout<<" # of POI selected tracks = "<<iSelParticlesPOI<<endl;
235 cout << "# " << fCount << " events processed" << endl;
240 cout<<"Not enough tracks in the FlowEventSimple"<<endl;
245 cout<<"Event does not pass multiplicity cuts"<<endl;
251 //-----------------------------------------------------------------------
252 AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliAODEvent* anInput, const AliCFManager* intCFManager, const AliCFManager* diffCFManager)
254 //Fills the event from the AOD
256 Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
258 Int_t iN = iNumberOfInputTracks; //maximum number of tracks in AliFlowEventSimple
259 Int_t iGoodTracks = 0; //number of good tracks
260 Int_t itrkN = 0; //track counter
261 Int_t iSelParticlesPOI = 0; //number of tracks selected for Diff
262 Int_t iSelParticlesRP = 0; //number of tracks selected for Int
264 // cut on the multiplicity
265 if (intCFManager->CheckEventCuts(AliCFManager::kEvtRecCuts,anInput)) {
266 // cout<<"iNumberOfInputTracks = "<<iNumberOfInputTracks<<endl;
267 // create an AliFlowEventSimple
268 AliFlowEventSimple* pEvent = new AliFlowEventSimple(10);
271 while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) {
272 AliAODTrack* pParticle = anInput->GetTrack(itrkN); //get input particle
273 //make new AliFlowTrackSimple
274 AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
275 pTrack->SetPt(pParticle->Pt() );
276 pTrack->SetEta(pParticle->Eta() );
277 pTrack->SetPhi(pParticle->Phi() );
279 //check if pParticle passes the cuts
280 if (intCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
281 intCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle)) {
282 pTrack->SetForRPSelection(kTRUE); }
283 if (diffCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle) &&
284 diffCFManager->CheckParticleCuts(AliCFManager::kPartSelCuts,pParticle)) {
285 pTrack->SetForPOISelection(kTRUE);}
288 //check if any bits are set
289 const TBits* bFlowBits = pTrack->GetFlowBits();
290 if (bFlowBits->CountBits() ==0) {
291 delete pTrack; } //track will not be used anymore
293 pEvent->AddTrack(pTrack) ;
296 if (pTrack->InRPSelection())
297 { iSelParticlesRP++; }
298 if (pTrack->InPOISelection())
299 { iSelParticlesPOI++; }
306 pEvent-> SetEventNSelTracksRP(iSelParticlesRP);
307 pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle);
309 if (iSelParticlesRP >= fMinMult && iSelParticlesRP <= fMaxMult) {
310 if ( (++fCount % 100) == 0) {
311 if (!fMCReactionPlaneAngle == 0) cout<<" MC Reaction Plane Angle = "<< fMCReactionPlaneAngle << endl;
312 else cout<<" MC Reaction Plane Angle = unknown "<< endl;
313 cout<<" iGoodTracks = "<<iGoodTracks<<endl;
314 cout<<" # of RP selected tracks = "<<iSelParticlesRP<<endl;
315 cout<<" # of POI selected tracks = "<<iSelParticlesPOI<<endl;
316 cout << "# " << fCount << " events processed" << endl;
321 cout<<"Not enough tracks in the FlowEventSimple"<<endl;
326 cout<<"Event does not pass multiplicity cuts"<<endl;
332 //-----------------------------------------------------------------------
333 AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, const AliMCEvent* anInputMc, const AliCFManager* intCFManager, const AliCFManager* diffCFManager, Int_t anOption)
335 //fills the event with tracks from the ESD and kinematics from the MC info via the track label
338 if (!(anOption ==0 || anOption ==1)) {
339 cout<<"WRONG OPTION IN AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, AliMCEvent* anInputMc, Int_t anOption)"<<endl;
343 Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
345 Int_t iNumberOfInputTracksMC = anInputMc->GetNumberOfTracks() ;
346 if (iNumberOfInputTracksMC==-1) {
347 cout<<"Skipping Event -- No MC information available for this event"<<endl;
351 Int_t iN = iNumberOfInputTracks; //maximum number of tracks in AliFlowEventSimple
352 Int_t iGoodTracks = 0; //number of good tracks
353 Int_t itrkN = 0; //track counter
354 Int_t iSelParticlesPOI = 0; //number of tracks selected for Diff
355 Int_t iSelParticlesRP = 0; //number of tracks selected for Int
357 // cut on the multiplicity
358 if (intCFManager->CheckEventCuts(AliCFManager::kEvtRecCuts,anInput)) {
359 // cout<<"iNumberOfInputTracks = "<<iNumberOfInputTracks<<endl;
360 // create an AliFlowEventSimple
361 AliFlowEventSimple* pEvent = new AliFlowEventSimple(10);
363 //loop over ESD tracks
364 while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) {
365 AliESDtrack* pParticle = anInput->GetTrack(itrkN); //get input particle
367 Int_t iLabel = pParticle->GetLabel();
368 //match to mc particle
369 AliMCParticle* pMcParticle = (AliMCParticle*) anInputMc->GetTrack(TMath::Abs(iLabel));
372 if (TMath::Abs(pParticle->GetLabel())!=pMcParticle->Label()) cout<<"pParticle->GetLabel()!=pMcParticle->Label() "<<pParticle->GetLabel()<<" "<<pMcParticle->Label()<<endl;
374 //make new AliFlowTrackSimple
375 AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
376 if(anOption == 0) { //take the PID from the MC & the kinematics from the ESD
377 pTrack->SetPt(pParticle->Pt() );
378 pTrack->SetEta(pParticle->Eta() );
379 pTrack->SetPhi(pParticle->Phi() );
381 else if (anOption == 1) { //take the PID and kinematics from the MC
382 pTrack->SetPt(pMcParticle->Pt() );
383 pTrack->SetEta(pMcParticle->Eta() );
384 pTrack->SetPhi(pMcParticle->Phi() );
386 else { cout<<"Not a valid option"<<endl; }
388 //check if pParticle passes the cuts
390 //cout<<"take the PID from the MC & the kinematics from the ESD"<<endl;
391 if (intCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle,"mcGenCuts1") &&
392 intCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle)) {
393 pTrack->SetForRPSelection(kTRUE); }
394 if (diffCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle,"mcGenCuts2") &&
395 diffCFManager->CheckParticleCuts(AliCFManager::kPartRecCuts,pParticle)) {
396 pTrack->SetForPOISelection(kTRUE);}
398 else if (anOption == 1) {
399 //cout<<"take the PID and kinematics from the MC"<<endl;
400 if (intCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle)) {
401 pTrack->SetForRPSelection(kTRUE); }
402 if (diffCFManager->CheckParticleCuts(AliCFManager::kPartGenCuts,pMcParticle)) {
403 pTrack->SetForPOISelection(kTRUE);}
405 else { cout<<"Not a valid option"<<endl; }
407 //check if any bits are set
408 const TBits* bFlowBits = pTrack->GetFlowBits();
409 if (bFlowBits->CountBits() ==0) {
410 delete pTrack; } //track will not be used anymore
412 pEvent->AddTrack(pTrack) ;
415 if (pTrack->InRPSelection())
416 { iSelParticlesRP++; }
417 if (pTrack->InPOISelection())
418 { iSelParticlesPOI++; }
425 pEvent->SetEventNSelTracksRP(iSelParticlesRP);
426 pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle);
428 if (iSelParticlesRP >= fMinMult && iSelParticlesRP <= fMaxMult) {
429 if ( (++fCount % 100) == 0) {
430 if (!fMCReactionPlaneAngle == 0) cout<<" MC Reaction Plane Angle = "<< fMCReactionPlaneAngle << endl;
431 else cout<<" MC Reaction Plane Angle = unknown "<< endl;
432 cout << " Number of MC input tracks = " << iNumberOfInputTracksMC << endl;
433 cout<<" iGoodTracks = "<<iGoodTracks<<endl;
434 cout<<" # of RP selected tracks = "<<iSelParticlesRP<<endl;
435 cout<<" # of POI selected tracks = "<<iSelParticlesPOI<<endl;
436 cout << "# " << fCount << " events processed" << endl;
441 cout<<"Not enough tracks in the FlowEventSimple"<<endl;
446 cout<<"Event does not pass multiplicity cuts"<<endl;
453 //-----------------------------------------------------------------------
454 AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(TTree* anInput, const AliFlowTrackSimpleCuts* rpCuts, const AliFlowTrackSimpleCuts* poiCuts)
456 //fills the event from a TTree of kinematic.root files
458 // number of times to use the same particle (trick to introduce nonflow)
460 //flags for particles passing int. and diff. flow cuts
461 Bool_t bPassedRPFlowCuts = kFALSE;
462 Bool_t bPassedPOIFlowCuts = kFALSE;
465 Double_t dPtMaxRP = rpCuts->GetPtMax();
466 Double_t dPtMinRP = rpCuts->GetPtMin();
467 Double_t dEtaMaxRP = rpCuts->GetEtaMax();
468 Double_t dEtaMinRP = rpCuts->GetEtaMin();
469 Double_t dPhiMaxRP = rpCuts->GetPhiMax();
470 Double_t dPhiMinRP = rpCuts->GetPhiMin();
471 Int_t iPIDRP = rpCuts->GetPID();
473 Double_t dPtMaxPOI = poiCuts->GetPtMax();
474 Double_t dPtMinPOI = poiCuts->GetPtMin();
475 Double_t dEtaMaxPOI = poiCuts->GetEtaMax();
476 Double_t dEtaMinPOI = poiCuts->GetEtaMin();
477 Double_t dPhiMaxPOI = poiCuts->GetPhiMax();
478 Double_t dPhiMinPOI = poiCuts->GetPhiMin();
479 Int_t iPIDPOI = poiCuts->GetPID();
481 Int_t iNumberOfInputTracks = anInput->GetEntries() ;
483 TParticle* pParticle = new TParticle();
484 anInput->SetBranchAddress("Particles",&pParticle);
485 // AliFlowEventSimple* pEvent = new AliFlowEventSimple(iNumberOfInputTracks);
486 AliFlowEventSimple* pEvent = new AliFlowEventSimple(10);
488 // Int_t fMultiplicityOfEvent = 576; //multiplicity for chi=1.5
489 // Int_t fMultiplicityOfEvent = 256; //multiplicity for chi=1
490 // Int_t fMultiplicityOfEvent = 164; //multiplicity for chi=0.8
492 Int_t iGoodTracks = 0;
494 Int_t iSelParticlesRP = 0;
495 Int_t iSelParticlesPOI = 0;
497 while (itrkN < iNumberOfInputTracks) {
498 anInput->GetEntry(itrkN); //get input particle
499 if (pParticle->IsPrimary()) {
500 //checking the cuts for int. and diff. flow
501 if (pParticle->Pt() > dPtMinRP && pParticle->Pt() < dPtMaxRP &&
502 pParticle->Eta() > dEtaMinRP && pParticle->Eta() < dEtaMaxRP &&
503 pParticle->Phi() > dPhiMinRP && pParticle->Phi() < dPhiMaxRP &&
504 TMath::Abs(pParticle->GetPdgCode()) == iPIDRP) {
505 bPassedRPFlowCuts = kTRUE;
508 if (pParticle->Pt() > dPtMinPOI && pParticle->Pt() < dPtMaxPOI &&
509 pParticle->Eta() > dEtaMinPOI && pParticle->Eta() < dEtaMaxPOI &&
510 pParticle->Phi() > dPhiMinPOI && pParticle->Phi() < dPhiMaxPOI &&
511 TMath::Abs(pParticle->GetPdgCode()) == iPIDPOI){
512 bPassedPOIFlowCuts = kTRUE;
515 if (bPassedRPFlowCuts || bPassedPOIFlowCuts) {
516 for(Int_t d=0;d<fNoOfLoops;d++) {
517 AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
518 pTrack->SetPt(pParticle->Pt());
519 pTrack->SetEta(pParticle->Eta());
520 pTrack->SetPhi(pParticle->Phi()-fEllipticFlowValue*TMath::Sin(2*(pParticle->Phi()-fMCReactionPlaneAngle)));
522 //marking the particles used for int. flow:
523 if(bPassedRPFlowCuts && iSelParticlesRP < fMultiplicityOfEvent) {
524 pTrack->SetForRPSelection(kTRUE);
527 //marking the particles used for diff. flow:
528 if(bPassedPOIFlowCuts && iGoodTracks%fNoOfLoops==0) {
529 pTrack->SetForPOISelection(kTRUE);
532 //adding a particles which were used either for int. or diff. flow to the list
533 pEvent->AddTrack(pTrack);
535 }//end of for(Int_t d=0;d<iLoops;d++)
536 }//end of if(bPassedIntFlowCuts || bPassedDiffFlowCuts)
538 bPassedRPFlowCuts = kFALSE;
539 bPassedPOIFlowCuts = kFALSE;
540 }//end of while (itrkN < iNumberOfInputTracks)
542 pEvent->SetEventNSelTracksRP(iSelParticlesRP);
543 pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle);
545 if ( (++fCount % 100) == 0) {
546 if (!fMCReactionPlaneAngle == 0) cout<<" MC Reaction Plane Angle = "<< fMCReactionPlaneAngle << endl;
547 else cout<<" MC Reaction Plane Angle = unknown "<< endl;
548 cout<<" iGoodTracks = "<< iGoodTracks << endl;
549 cout<<" # of RP selected tracks = "<<iSelParticlesRP<<endl;
550 cout<<" # of POI selected tracks = "<<iSelParticlesPOI<<endl;
551 cout << "# " << fCount << " events processed" << endl;
558 //-----------------------------------------------------------------------
559 AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliMCEvent* anInput)
561 //Fills the event from the MC kinematic information
563 Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
565 AliFlowEventSimple* pEvent = new AliFlowEventSimple(10);
567 //Int_t iN = 256; //multiplicity for chi=1
568 Int_t iN = iNumberOfInputTracks;
569 Int_t iGoodTracks = 0;
571 Int_t iSelParticlesPOI = 0;
572 Int_t iSelParticlesRP = 0;
575 while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) {
576 AliMCParticle* pParticle = (AliMCParticle*) anInput->GetTrack(itrkN); //get input particle
578 if (TMath::Abs(pParticle->Eta()) < 0.9)
581 TMath::Abs(pParticle->Particle()->GetPdgCode()) == 211
582 // TMath::Abs(pParticle->Particle()->GetPdgCode()) == 211 ||
583 // TMath::Abs(pParticle->Particle()->GetPdgCode()) == 321 ||
584 // TMath::Abs(pParticle->Particle()->GetPdgCode()) == 2212
587 AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
588 pTrack->SetPt(pParticle->Pt() );
589 pTrack->SetEta(pParticle->Eta() );
590 pTrack->SetPhi(pParticle->Phi() );
591 pTrack->SetForRPSelection(kTRUE);
592 pTrack->SetForPOISelection(kTRUE);
594 if (pTrack->InRPSelection())
595 { iSelParticlesRP++; }
596 if (pTrack->InPOISelection())
597 { iSelParticlesPOI++; }
599 pEvent->AddTrack(pTrack) ;
602 TMath::Abs(pParticle->Particle()->GetPdgCode()) == 211
605 AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
606 pTrack->SetPt(pParticle->Pt() );
607 pTrack->SetEta(pParticle->Eta() );
608 pTrack->SetPhi(pParticle->Phi() );
609 pTrack->SetForRPSelection(kFALSE);
610 pTrack->SetForPOISelection(kTRUE);
612 if (pTrack->InRPSelection())
613 { iSelParticlesRP++; }
614 if (pTrack->InPOISelection())
615 { iSelParticlesPOI++; }
617 pEvent->AddTrack(pTrack);
625 pEvent-> SetEventNSelTracksRP(iSelParticlesRP);
626 pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle);
628 if ( (++fCount % 100) == 0) {
629 if (!fMCReactionPlaneAngle == 0) cout<<" MC Reaction Plane Angle = "<< fMCReactionPlaneAngle << endl;
630 else cout<<" MC Reaction Plane Angle = unknown "<< endl;
631 cout<<" iGoodTracks = "<<iGoodTracks<<endl;
632 cout<<" # of RP selected tracks = "<<iSelParticlesRP<<endl;
633 cout<<" # of POI selected tracks = "<<iSelParticlesPOI<<endl;
634 cout << "# " << fCount << " events processed" << endl;
641 //-----------------------------------------------------------------------
642 AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput)
644 //Fills the event from the ESD
646 Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
648 AliFlowEventSimple* pEvent = new AliFlowEventSimple(10);
650 //Int_t iN = 256; //multiplicity for chi=1
651 Int_t iN = iNumberOfInputTracks;
652 Int_t iGoodTracks = 0;
654 Int_t iSelParticlesPOI = 0;
655 Int_t iSelParticlesRP = 0;
660 while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) {
661 AliESDtrack* pParticle = anInput->GetTrack(itrkN); //get input particle
663 if (TMath::Abs(pParticle->Eta()) < 0.9)
668 AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
669 pTrack->SetPt(pParticle->Pt() );
670 pTrack->SetEta(pParticle->Eta() );
671 pTrack->SetPhi(pParticle->Phi() );
672 pTrack->SetForRPSelection(kTRUE);
673 pTrack->SetForPOISelection(kTRUE);
675 if (pTrack->InRPSelection())
676 { iSelParticlesRP++; }
677 if (pTrack->InPOISelection())
678 { iSelParticlesPOI++; }
680 pEvent->AddTrack(pTrack) ;
686 pEvent-> SetEventNSelTracksRP(iSelParticlesRP);
687 pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle);
689 if ( (++fCount % 100) == 0) {
690 if (!fMCReactionPlaneAngle == 0) cout<<" MC Reaction Plane Angle = "<< fMCReactionPlaneAngle << endl;
691 else cout<<" MC Reaction Plane Angle = unknown "<< endl;
692 cout<<" iGoodTracks = "<<iGoodTracks<<endl;
693 cout<<" # of RP selected tracks = "<<iSelParticlesRP<<endl;
694 cout<<" # of POI selected tracks = "<<iSelParticlesPOI<<endl;
695 cout << "# " << fCount << " events processed" << endl;
701 //-----------------------------------------------------------------------
703 AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliAODEvent* anInput)
705 //Fills the event from the AOD
707 Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
709 AliFlowEventSimple* pEvent = new AliFlowEventSimple(10);
711 //Int_t iN = 256; //multiplicity for chi=1
712 Int_t iN = iNumberOfInputTracks;
713 Int_t iGoodTracks = 0;
715 Int_t iSelParticlesPOI = 0;
716 Int_t iSelParticlesRP = 0;
719 while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) {
720 AliAODTrack* pParticle = anInput->GetTrack(itrkN); //get input particle
722 if (TMath::Abs(pParticle->Eta()) < 0.9)
724 AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
725 pTrack->SetPt(pParticle->Pt() );
726 pTrack->SetEta(pParticle->Eta() );
727 pTrack->SetPhi(pParticle->Phi() );
728 pTrack->SetForRPSelection(kTRUE);
729 pTrack->SetForPOISelection(kTRUE);
731 if (pTrack->InRPSelection())
732 { iSelParticlesRP++; }
733 if (pTrack->InPOISelection())
734 { iSelParticlesPOI++; }
736 pEvent->AddTrack(pTrack) ;
742 pEvent-> SetEventNSelTracksRP(iSelParticlesRP);
743 pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle);
745 if ( (++fCount % 100) == 0) {
746 if (!fMCReactionPlaneAngle == 0) cout<<" MC Reaction Plane Angle = "<< fMCReactionPlaneAngle << endl;
747 else cout<<" MC Reaction Plane Angle = unknown "<< endl;
748 cout<<" iGoodTracks = "<<iGoodTracks<<endl;
749 cout<<" # of RP selected tracks = "<<iSelParticlesRP<<endl;
750 cout<<" # of POI selected tracks = "<<iSelParticlesPOI<<endl;
751 cout << "# " << fCount << " events processed" << endl;
757 //-----------------------------------------------------------------------
758 AliFlowEventSimple* AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, const AliMCEvent* anInputMc, Int_t anOption)
760 //fills the event with tracks from the ESD and kinematics from the MC info via the track label
762 if (!(anOption ==0 || anOption ==1)) {
763 cout<<"WRONG OPTION IN AliFlowEventSimpleMaker::FillTracks(AliESDEvent* anInput, AliMCEvent* anInputMc, Int_t anOption)"<<endl;
767 Int_t iNumberOfInputTracks = anInput->GetNumberOfTracks() ;
769 AliFlowEventSimple* pEvent = new AliFlowEventSimple(10);
771 //Int_t iN = 256; //multiplicity for chi=1
772 Int_t iN = iNumberOfInputTracks;
773 Int_t iGoodTracks = 0;
775 Int_t iSelParticlesPOI = 0;
776 Int_t iSelParticlesRP = 0;
779 while (iGoodTracks < iN && itrkN < iNumberOfInputTracks) {
780 AliESDtrack* pParticle = anInput->GetTrack(itrkN); //get input particle
782 Int_t iLabel = pParticle->GetLabel();
783 //match to mc particle
784 AliMCParticle* pMcParticle = (AliMCParticle*) anInputMc->GetTrack(TMath::Abs(iLabel));
787 if (TMath::Abs(pParticle->GetLabel())!=pMcParticle->Label()) cout<<"pParticle->GetLabel()!=pMcParticle->Label() "<<pParticle->GetLabel()<<" "<<pMcParticle->Label()<<endl;
790 if (TMath::Abs(pParticle->Eta()) < 0.2)
793 TMath::Abs(pMcParticle->Particle()->GetPdgCode()) == 211 //pions
794 // TMath::Abs(pMcParticle->Particle()->GetPdgCode()) == 211 ||
795 // TMath::Abs(pMcParticle->Particle()->GetPdgCode()) == 321 ||
796 // TMath::Abs(pMcParticle->Particle()->GetPdgCode()) == 2212
799 AliFlowTrackSimple* pTrack = new AliFlowTrackSimple();
800 if(anOption == 0) { //take the PID from the MC & the kinematics from the ESD
801 pTrack->SetPt(pParticle->Pt() );
802 pTrack->SetEta(pParticle->Eta() );
803 pTrack->SetPhi(pParticle->Phi() );
804 pTrack->SetForRPSelection(kTRUE);
805 pTrack->SetForPOISelection(kTRUE);
807 else if (anOption == 1) { //take the PID and kinematics from the MC
808 pTrack->SetPt(pMcParticle->Pt() );
809 pTrack->SetEta(pMcParticle->Eta() );
810 pTrack->SetPhi(pMcParticle->Phi() );
811 pTrack->SetForRPSelection(kTRUE);
812 pTrack->SetForPOISelection(kTRUE);
814 else { cout<<"Not a valid option"<<endl; }
815 if (pTrack->InRPSelection())
816 { iSelParticlesRP++; }
817 if (pTrack->InPOISelection())
818 { iSelParticlesPOI++; }
820 pEvent->AddTrack(pTrack) ;
826 pEvent-> SetEventNSelTracksRP(iSelParticlesRP);
827 pEvent->SetMCReactionPlaneAngle(fMCReactionPlaneAngle);
829 if ( (++fCount % 100) == 0) {
830 if (!fMCReactionPlaneAngle == 0) cout<<" MC Reaction Plane Angle = "<< fMCReactionPlaneAngle << endl;
831 else cout<<" MC Reaction Plane Angle = unknown "<< endl;
832 cout<<" iGoodTracks = "<<iGoodTracks<<endl;
833 cout<<" # of RP selected tracks = "<<iSelParticlesRP<<endl;
834 cout<<" # of POI selected tracks = "<<iSelParticlesPOI<<endl;
835 cout << "# " << fCount << " events processed" << endl;