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 **************************************************************************/
16 /*****************************************************************
17 AliFlowEventSimple: A simple event
20 origin: Naomi van der Kolk (kolk@nikhef.nl)
21 Ante Bilandzic (anteb@nikhef.nl)
22 Raimond Snellings (Raimond.Snellings@nikhef.nl)
23 mods: Mikolaj Krzewicki (mikolaj.krzewicki@cern.ch)
24 *****************************************************************/
26 #include "Riostream.h"
27 #include "TObjArray.h"
31 #include "TParticle.h"
37 #include "TParameter.h"
39 #include "AliFlowVector.h"
40 #include "AliFlowTrackSimple.h"
41 #include "AliFlowTrackSimpleCuts.h"
42 #include "AliFlowEventSimple.h"
48 ClassImp(AliFlowEventSimple)
50 //-----------------------------------------------------------------------
51 AliFlowEventSimple::AliFlowEventSimple():
52 fTrackCollection(NULL),
53 fReferenceMultiplicity(0),
56 fMCReactionPlaneAngle(0.),
57 fMCReactionPlaneAngleIsSet(kFALSE),
58 fAfterBurnerPrecision(0.001),
59 fUserModified(kFALSE),
60 fNumberOfTracksWrap(NULL),
61 fNumberOfRPsWrap(NULL),
62 fMCReactionPlaneAngleWrap(NULL)
64 cout << "AliFlowEventSimple: Default constructor to be used only by root for io" << endl;
67 //-----------------------------------------------------------------------
68 AliFlowEventSimple::AliFlowEventSimple( Int_t n,
69 ConstructionMethod method,
75 fTrackCollection(new TObjArray(n)),
76 fReferenceMultiplicity(0),
79 fMCReactionPlaneAngle(0.),
80 fMCReactionPlaneAngleIsSet(kFALSE),
81 fAfterBurnerPrecision(0.001),
82 fUserModified(kFALSE),
83 fNumberOfTracksWrap(NULL),
84 fNumberOfRPsWrap(NULL),
85 fMCReactionPlaneAngleWrap(NULL)
88 // if second argument is set to AliFlowEventSimple::kGenerate
89 // it generates n random tracks with given Pt distribution
90 // (a sane default is provided), phi and eta are uniform
92 if (method==kGenerate)
93 Generate(n,ptDist,phiMin,phiMax,etaMin,etaMax);
96 //-----------------------------------------------------------------------
97 AliFlowEventSimple::AliFlowEventSimple(const AliFlowEventSimple& anEvent):
99 fTrackCollection((TObjArray*)(anEvent.fTrackCollection)->Clone()),
100 fReferenceMultiplicity(anEvent.fReferenceMultiplicity),
101 fNumberOfTracks(anEvent.fNumberOfTracks),
102 fNumberOfRPs(anEvent.fNumberOfRPs),
103 fMCReactionPlaneAngle(anEvent.fMCReactionPlaneAngle),
104 fMCReactionPlaneAngleIsSet(anEvent.fMCReactionPlaneAngleIsSet),
105 fAfterBurnerPrecision(anEvent.fAfterBurnerPrecision),
106 fUserModified(anEvent.fUserModified),
107 fNumberOfTracksWrap(anEvent.fNumberOfTracksWrap),
108 fNumberOfRPsWrap(anEvent.fNumberOfRPsWrap),
109 fMCReactionPlaneAngleWrap(anEvent.fMCReactionPlaneAngleWrap)
114 //-----------------------------------------------------------------------
115 AliFlowEventSimple& AliFlowEventSimple::operator=(const AliFlowEventSimple& anEvent)
117 //assignment operator
118 if (&anEvent==this) return *this; //check self-assignment
119 if (fTrackCollection) fTrackCollection->Delete();
120 delete fTrackCollection;
121 fTrackCollection = (TObjArray*)(anEvent.fTrackCollection)->Clone(); //deep copy
122 fReferenceMultiplicity = anEvent.fReferenceMultiplicity;
123 fNumberOfTracks = anEvent.fNumberOfTracks;
124 fNumberOfRPs = anEvent.fNumberOfRPs;
125 fMCReactionPlaneAngle = anEvent.fMCReactionPlaneAngle;
126 fMCReactionPlaneAngleIsSet = anEvent.fMCReactionPlaneAngleIsSet;
127 fAfterBurnerPrecision = anEvent.fAfterBurnerPrecision;
128 fUserModified=anEvent.fUserModified;
129 fNumberOfTracksWrap = anEvent.fNumberOfTracksWrap;
130 fNumberOfRPsWrap = anEvent.fNumberOfRPsWrap;
131 fMCReactionPlaneAngleWrap=anEvent.fMCReactionPlaneAngleWrap;
135 //-----------------------------------------------------------------------
136 AliFlowEventSimple::~AliFlowEventSimple()
139 if (fTrackCollection) fTrackCollection->Delete();
140 delete fTrackCollection;
141 delete fNumberOfTracksWrap;
142 delete fNumberOfRPsWrap;
143 delete fMCReactionPlaneAngleWrap;
146 //-----------------------------------------------------------------------
147 void AliFlowEventSimple::Generate(Int_t nParticles,
154 //generate nParticles random tracks uniform in phi and eta
155 //according to the specified pt distribution
158 static TF1 ptdistribution("ptSpectra","x*TMath::Exp(-pow(0.13957*0.13957+x*x,0.5)/0.4)",0.1,10.);
159 ptDist=&ptdistribution;
162 for (Int_t i=0; i<nParticles; i++)
164 AliFlowTrackSimple* track = new AliFlowTrackSimple();
165 track->SetPhi( gRandom->Uniform(phiMin,phiMax) );
166 track->SetEta( gRandom->Uniform(etaMin,etaMax) );
167 track->SetPt( ptDist->GetRandom() );
168 track->SetCharge( (gRandom->Uniform()-0.5<0)?-1:1 );
171 fMCReactionPlaneAngle=gRandom->Uniform(0.0,TMath::TwoPi());
172 fMCReactionPlaneAngleIsSet=kTRUE;
176 //-----------------------------------------------------------------------
177 AliFlowTrackSimple* AliFlowEventSimple::GetTrack(Int_t i)
179 //get track i from collection
180 if (i>=fNumberOfTracks) return NULL;
181 AliFlowTrackSimple* pTrack = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i)) ;
185 //-----------------------------------------------------------------------
186 void AliFlowEventSimple::AddTrack( AliFlowTrackSimple* track )
188 //add a track, delete the old one if necessary
189 if (fNumberOfTracks < fTrackCollection->GetEntriesFast())
191 TObject* o = fTrackCollection->At(fNumberOfTracks);
194 fTrackCollection->AddAtAndExpand(track,fNumberOfTracks);
198 //-----------------------------------------------------------------------
199 AliFlowVector AliFlowEventSimple::GetQ(Int_t n, TList *weightsList, Bool_t usePhiWeights, Bool_t usePtWeights, Bool_t useEtaWeights)
201 // calculate Q-vector in harmonic n without weights (default harmonic n=2)
208 Double_t sumOfWeights = 0.;
212 Double_t dWeight = 1.;
214 AliFlowTrackSimple* pTrack = NULL;
217 Double_t dBinWidthPt = 0.;
218 Double_t dPtMin = 0.;
219 Double_t dBinWidthEta = 0.;
220 Double_t dEtaMin = 0.;
222 Double_t wPhi = 1.; // weight Phi
223 Double_t wPt = 1.; // weight Pt
224 Double_t wEta = 1.; // weight Eta
226 TH1F *phiWeights = NULL;
227 TH1D *ptWeights = NULL;
228 TH1D *etaWeights = NULL;
234 phiWeights = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights"));
235 if(phiWeights) nBinsPhi = phiWeights->GetNbinsX();
239 ptWeights = dynamic_cast<TH1D *>(weightsList->FindObject("pt_weights"));
242 dBinWidthPt = ptWeights->GetBinWidth(1); // assuming that all bins have the same width
243 dPtMin = (ptWeights->GetXaxis())->GetXmin();
248 etaWeights = dynamic_cast<TH1D *>(weightsList->FindObject("eta_weights"));
251 dBinWidthEta = etaWeights->GetBinWidth(1); // assuming that all bins have the same width
252 dEtaMin = (etaWeights->GetXaxis())->GetXmin();
255 } // end of if(weightsList)
258 for(Int_t i=0; i<fNumberOfTracks; i++)
260 pTrack = (AliFlowTrackSimple*)fTrackCollection->At(i);
263 if(pTrack->InRPSelection())
265 dPhi = pTrack->Phi();
267 dEta = pTrack->Eta();
268 dWeight = pTrack->Weight();
270 // determine Phi weight: (to be improved, I should here only access it + the treatment of gaps in the if statement)
271 if(phiWeights && nBinsPhi)
273 wPhi = phiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhi/TMath::TwoPi())));
275 // determine v'(pt) weight:
276 if(ptWeights && dBinWidthPt)
278 wPt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt)));
280 // determine v'(eta) weight:
281 if(etaWeights && dBinWidthEta)
283 wEta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta)));
286 // building up the weighted Q-vector:
287 dQX += dWeight*wPhi*wPt*wEta*TMath::Cos(iOrder*dPhi);
288 dQY += dWeight*wPhi*wPt*wEta*TMath::Sin(iOrder*dPhi);
290 // weighted multiplicity:
291 sumOfWeights += dWeight*wPhi*wPt*wEta;
293 } // end of if (pTrack->InRPSelection())
294 } // end of if (pTrack)
297 cerr << "no particle!!!"<<endl;
299 } // loop over particles
302 vQ.SetMult(sumOfWeights);
308 //-----------------------------------------------------------------------
309 void AliFlowEventSimple::Get2Qsub(AliFlowVector* Qarray, Int_t n, TList *weightsList, Bool_t usePhiWeights, Bool_t usePtWeights, Bool_t useEtaWeights)
312 // calculate Q-vector in harmonic n without weights (default harmonic n=2)
317 Double_t sumOfWeights = 0.;
321 Double_t dWeight = 1.;
323 AliFlowTrackSimple* pTrack = NULL;
325 Int_t iNbinsPhiSub0 = 0;
326 Int_t iNbinsPhiSub1 = 0;
327 Double_t dBinWidthPt = 0.;
328 Double_t dPtMin = 0.;
329 Double_t dBinWidthEta= 0.;
330 Double_t dEtaMin = 0.;
332 Double_t dWphi = 1.; // weight Phi
333 Double_t dWpt = 1.; // weight Pt
334 Double_t dWeta = 1.; // weight Eta
336 TH1F* phiWeightsSub0 = NULL;
337 TH1F* phiWeightsSub1 = NULL;
338 TH1D* ptWeights = NULL;
339 TH1D* etaWeights = NULL;
345 phiWeightsSub0 = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights_sub0"));
347 iNbinsPhiSub0 = phiWeightsSub0->GetNbinsX();
349 phiWeightsSub1 = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights_sub1"));
351 iNbinsPhiSub1 = phiWeightsSub1->GetNbinsX();
356 ptWeights = dynamic_cast<TH1D *>(weightsList->FindObject("pt_weights"));
359 dBinWidthPt = ptWeights->GetBinWidth(1); // assuming that all bins have the same width
360 dPtMin = (ptWeights->GetXaxis())->GetXmin();
365 etaWeights = dynamic_cast<TH1D *>(weightsList->FindObject("eta_weights"));
368 dBinWidthEta = etaWeights->GetBinWidth(1); // assuming that all bins have the same width
369 dEtaMin = (etaWeights->GetXaxis())->GetXmin();
372 } // end of if(weightsList)
374 //loop over the two subevents
375 for (Int_t s=0; s<2; s++)
378 for(Int_t i=0; i<fNumberOfTracks; i++)
380 pTrack = (AliFlowTrackSimple*)fTrackCollection->At(i);
383 if(pTrack->InRPSelection())
385 if (pTrack->InSubevent(s))
387 dPhi = pTrack->Phi();
389 dEta = pTrack->Eta();
390 dWeight = pTrack->Weight();
392 // determine Phi weight: (to be improved, I should here only access it + the treatment of gaps in the if statement)
395 if(phiWeightsSub0 && iNbinsPhiSub0) {
396 Int_t phiBin = 1+(Int_t)(TMath::Floor(dPhi*iNbinsPhiSub0/TMath::TwoPi()));
397 //use the phi value at the center of the bin
398 dPhi = phiWeightsSub0->GetBinCenter(phiBin);
399 dWphi = phiWeightsSub0->GetBinContent(phiBin);
404 if(phiWeightsSub1 && iNbinsPhiSub1) {
405 Int_t phiBin = 1+(Int_t)(TMath::Floor(dPhi*iNbinsPhiSub1/TMath::TwoPi()));
406 //use the phi value at the center of the bin
407 dPhi = phiWeightsSub1->GetBinCenter(phiBin);
408 dWphi = phiWeightsSub1->GetBinContent(phiBin);
412 // determine v'(pt) weight:
413 if(ptWeights && dBinWidthPt)
415 dWpt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt)));
418 // determine v'(eta) weight:
419 if(etaWeights && dBinWidthEta)
421 dWeta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta)));
424 // building up the weighted Q-vector:
425 dQX += dWeight*dWphi*dWpt*dWeta*TMath::Cos(iOrder*dPhi);
426 dQY += dWeight*dWphi*dWpt*dWeta*TMath::Sin(iOrder*dPhi);
428 // weighted multiplicity:
429 sumOfWeights+=dWeight*dWphi*dWpt*dWeta;
432 } // end of if (pTrack->InRPSelection())
433 } // end of if (pTrack)
436 cerr << "no particle!!!"<<endl;
438 } // loop over particles
439 Qarray[s].Set(dQX,dQY);
440 Qarray[s].SetMult(sumOfWeights);
450 //-----------------------------------------------------------------------
451 void AliFlowEventSimple::Print(Option_t *option) const
453 // -*-*-*-*-*Print some global quantities for this histogram collection class *-*-*-*-*-*-*-*
454 // ===============================================
455 // printf( "TH1.Print Name = %s, Entries= %d, Total sum= %g\n",GetName(),Int_t(fEntries),GetSumOfWeights());
456 printf( "Class.Print Name = %s, #tracks= %d, Number of RPs= %d, MC EventPlaneAngle= %f\n",
457 GetName(),fNumberOfTracks, fNumberOfRPs, fMCReactionPlaneAngle );
459 TString optionstr(option);
460 if (!optionstr.Contains("all")) return;
461 if (fTrackCollection)
463 fTrackCollection->Print(option);
467 printf( "Empty track collection \n");
471 //-----------------------------------------------------------------------
472 void AliFlowEventSimple::Browse(TBrowser *b)
476 if (!fNumberOfTracksWrap)
478 fNumberOfTracksWrap = new TParameter<int>("fNumberOfTracks", fNumberOfTracks);
479 b->Add(fNumberOfTracksWrap);
481 if (!fNumberOfRPsWrap)
483 fNumberOfRPsWrap = new TParameter<int>("fNumberOfRPs", fNumberOfRPs);
484 b->Add(fNumberOfRPsWrap);
486 if (!fMCReactionPlaneAngleWrap)
488 fMCReactionPlaneAngleWrap = new TParameter<double>(" fMCReactionPlaneAngle", fMCReactionPlaneAngle);
489 b->Add( fMCReactionPlaneAngleWrap);
491 if (fTrackCollection) b->Add(fTrackCollection,"AliFlowTracksSimple");
494 //-----------------------------------------------------------------------
495 AliFlowEventSimple::AliFlowEventSimple( TTree* inputTree,
496 const AliFlowTrackSimpleCuts* rpCuts,
497 const AliFlowTrackSimpleCuts* poiCuts):
498 fTrackCollection(NULL),
499 fReferenceMultiplicity(0),
502 fMCReactionPlaneAngle(0.),
503 fMCReactionPlaneAngleIsSet(kFALSE),
504 fAfterBurnerPrecision(0.001),
505 fUserModified(kFALSE),
506 fNumberOfTracksWrap(NULL),
507 fNumberOfRPsWrap(NULL),
508 fMCReactionPlaneAngleWrap(NULL)
510 //constructor, fills the event from a TTree of kinematic.root files
511 //applies RP and POI cuts, tags the tracks
513 Int_t numberOfInputTracks = inputTree->GetEntries() ;
514 fTrackCollection = new TObjArray(numberOfInputTracks/2);
516 TParticle* pParticle = new TParticle();
517 inputTree->SetBranchAddress("Particles",&pParticle);
519 Int_t iSelParticlesPOI = 0;
521 for (Int_t i=0; i<numberOfInputTracks; i++)
523 inputTree->GetEntry(i); //get input particle
525 if (!pParticle) continue; //no particle
526 if (!pParticle->IsPrimary()) continue;
528 Bool_t rpOK = rpCuts->PassesCuts(pParticle);
529 Bool_t poiOK = poiCuts->PassesCuts(pParticle);
533 AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(pParticle);
535 //marking the particles used for int. flow:
538 pTrack->SetForRPSelection(kTRUE);
541 //marking the particles used for diff. flow:
544 pTrack->SetForPOISelection(kTRUE);
547 //adding a particles which were used either for int. or diff. flow to the list
554 //_____________________________________________________________________________
555 void AliFlowEventSimple::CloneTracks(Int_t n)
557 //clone every track n times to add non-flow
558 if (n<=0) return; //no use to clone stuff zero or less times
559 Int_t ntracks = fNumberOfTracks;
560 fTrackCollection->Expand((n+1)*fNumberOfTracks);
561 for (Int_t i=0; i<n; i++)
563 for (Int_t itrack=0; itrack<ntracks; itrack++)
565 AliFlowTrackSimple* track = dynamic_cast<AliFlowTrackSimple*>(fTrackCollection->At(itrack));
566 if (!track) continue;
567 AddTrack(static_cast<AliFlowTrackSimple*>(track->Clone()));
573 //_____________________________________________________________________________
574 void AliFlowEventSimple::ResolutionPt(Double_t res)
576 //smear pt of all tracks by gaussian with sigma=res
577 for (Int_t i=0; i<fNumberOfTracks; i++)
579 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
580 if (track) track->ResolutionPt(res);
585 //_____________________________________________________________________________
586 void AliFlowEventSimple::TagSubeventsInEta( Double_t etaMinA,
591 //Flag two subevents in given eta ranges
592 for (Int_t i=0; i<fNumberOfTracks; i++)
594 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
595 if (!track) continue;
596 track->ResetSubEventTags();
597 Double_t eta=track->Eta();
598 if (eta >= etaMinA && eta <= etaMaxA) track->SetForSubevent(0);
599 if (eta >= etaMinB && eta <= etaMaxB) track->SetForSubevent(1);
603 //_____________________________________________________________________________
604 void AliFlowEventSimple::TagSubeventsByCharge()
606 //Flag two subevents in given eta ranges
607 for (Int_t i=0; i<fNumberOfTracks; i++)
609 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
610 if (!track) continue;
611 track->ResetSubEventTags();
612 Int_t charge=track->Charge();
613 if (charge<0) track->SetForSubevent(0);
614 if (charge>0) track->SetForSubevent(1);
618 //_____________________________________________________________________________
619 void AliFlowEventSimple::AddV1( Double_t v1 )
621 //add v2 to all tracks wrt the reaction plane angle
622 for (Int_t i=0; i<fNumberOfTracks; i++)
624 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
625 if (track) track->AddV1(v1, fMCReactionPlaneAngle, fAfterBurnerPrecision);
630 //_____________________________________________________________________________
631 void AliFlowEventSimple::AddV2( Double_t v2 )
633 //add v2 to all tracks wrt the reaction plane angle
634 for (Int_t i=0; i<fNumberOfTracks; i++)
636 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
637 if (track) track->AddV2(v2, fMCReactionPlaneAngle, fAfterBurnerPrecision);
642 //_____________________________________________________________________________
643 void AliFlowEventSimple::AddV3( Double_t v3 )
645 //add v3 to all tracks wrt the reaction plane angle
646 for (Int_t i=0; i<fNumberOfTracks; i++)
648 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
649 if (track) track->AddV3(v3, fMCReactionPlaneAngle, fAfterBurnerPrecision);
654 //_____________________________________________________________________________
655 void AliFlowEventSimple::AddV4( Double_t v4 )
657 //add v4 to all tracks wrt the reaction plane angle
658 for (Int_t i=0; i<fNumberOfTracks; i++)
660 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
661 if (track) track->AddV4(v4, fMCReactionPlaneAngle, fAfterBurnerPrecision);
666 //_____________________________________________________________________________
667 void AliFlowEventSimple::AddV5( Double_t v5 )
669 //add v4 to all tracks wrt the reaction plane angle
670 for (Int_t i=0; i<fNumberOfTracks; i++)
672 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
673 if (track) track->AddV5(v5, fMCReactionPlaneAngle, fAfterBurnerPrecision);
678 //_____________________________________________________________________________
679 void AliFlowEventSimple::AddFlow( Double_t v1, Double_t v2, Double_t v3, Double_t v4, Double_t v5,
680 Double_t rp1, Double_t rp2, Double_t rp3, Double_t rp4, Double_t rp5 )
682 //add flow to all tracks wrt the reaction plane angle, for all harmonic separate angle
683 for (Int_t i=0; i<fNumberOfTracks; i++)
685 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
686 if (track) track->AddFlow(v1,v2,v3,v4,v5,rp1,rp2,rp3,rp4,rp5,fAfterBurnerPrecision);
691 //_____________________________________________________________________________
692 void AliFlowEventSimple::AddFlow( Double_t v1, Double_t v2, Double_t v3, Double_t v4, Double_t v5 )
694 //add flow to all tracks wrt the reaction plane angle
695 for (Int_t i=0; i<fNumberOfTracks; i++)
697 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
698 if (track) track->AddFlow(v1,v2,v3,v4,v5,fMCReactionPlaneAngle, fAfterBurnerPrecision);
703 //_____________________________________________________________________________
704 void AliFlowEventSimple::AddV2( TF1* ptDepV2 )
706 //add v2 to all tracks wrt the reaction plane angle
707 for (Int_t i=0; i<fNumberOfTracks; i++)
709 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
710 if (!track) continue;
711 Double_t v2 = ptDepV2->Eval(track->Pt());
712 track->AddV2(v2, fMCReactionPlaneAngle, fAfterBurnerPrecision);
717 //_____________________________________________________________________________
718 void AliFlowEventSimple::TagRP( const AliFlowTrackSimpleCuts* cuts )
720 //tag tracks as reference particles (RPs)
721 for (Int_t i=0; i<fNumberOfTracks; i++)
723 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
724 if (!track) continue;
725 Bool_t pass=cuts->PassesCuts(track);
726 Bool_t rpTrack=track->InRPSelection();
729 if (!rpTrack) fNumberOfRPs++; //only increase if not already tagged
733 if (rpTrack) fNumberOfRPs--; //only decrease if detagging
735 track->SetForRPSelection(pass);
739 //_____________________________________________________________________________
740 void AliFlowEventSimple::TagPOI( const AliFlowTrackSimpleCuts* cuts )
742 //tag tracks as particles of interest (POIs)
743 for (Int_t i=0; i<fNumberOfTracks; i++)
745 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
746 if (!track) continue;
747 Bool_t pass=cuts->PassesCuts(track);
748 track->SetForPOISelection(pass);
752 //_____________________________________________________________________________
753 void AliFlowEventSimple::DefineDeadZone( Double_t etaMin,
758 //mark tracks in given eta-phi region as dead
759 //by resetting the flow bits
760 for (Int_t i=0; i<fNumberOfTracks; i++)
762 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
763 Double_t eta = track->Eta();
764 Double_t phi = track->Phi();
765 if (eta>etaMin && eta<etaMax && phi>phiMin && phi<phiMax)
767 if (track->InRPSelection()) fNumberOfRPs--;
768 track->ResetFlowTags();
773 //_____________________________________________________________________________
774 Int_t AliFlowEventSimple::CleanUpDeadTracks()
776 //remove tracks that have no flow tags set and cleanup the container
777 //returns number of cleaned tracks
779 for (Int_t i=0; i<fNumberOfTracks; i++)
781 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
782 if (!track) continue;
783 if (track->IsDead()) {delete track;track=NULL;ncleaned++;}
785 fTrackCollection->Compress(); //clean up empty slots
786 fNumberOfTracks-=ncleaned; //update number of tracks
790 //_____________________________________________________________________________
791 TF1* AliFlowEventSimple::SimplePtDepV2()
793 //return a standard pt dependent v2 formula, user has to clean up!
794 return new TF1("StandardPtDepV2","((x<1.0)*(0.05/1.0)*x+(x>=1.0)*0.05)");
797 //_____________________________________________________________________________
798 TF1* AliFlowEventSimple::SimplePtSpectrum()
800 //return a standard pt spectrum, user has to clean up!
801 return new TF1("StandardPtSpectrum","x*TMath::Exp(-pow(0.13957*0.13957+x*x,0.5)/0.4)",0.1,10.);
804 //_____________________________________________________________________________
805 void AliFlowEventSimple::ClearFast()
807 //clear the counter without deleting allocated objects so they can be reused
808 fReferenceMultiplicity = 0;
811 fMCReactionPlaneAngle = 0.0;
812 fMCReactionPlaneAngleIsSet = kFALSE;
813 fAfterBurnerPrecision = 0.001;
814 fUserModified = kFALSE;