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"
45 ClassImp(AliFlowEventSimple)
47 //-----------------------------------------------------------------------
48 AliFlowEventSimple::AliFlowEventSimple():
49 fTrackCollection(NULL),
50 fReferenceMultiplicity(0),
53 fMCReactionPlaneAngle(0.),
54 fMCReactionPlaneAngleIsSet(kFALSE),
55 fAfterBurnerPrecision(0.001),
56 fUserModified(kFALSE),
57 fNumberOfTracksWrap(NULL),
58 fNumberOfRPsWrap(NULL),
59 fMCReactionPlaneAngleWrap(NULL)
61 cout << "AliFlowEventSimple: Default constructor to be used only by root for io" << endl;
64 //-----------------------------------------------------------------------
65 AliFlowEventSimple::AliFlowEventSimple( Int_t n,
66 ConstructionMethod method,
72 fTrackCollection(new TObjArray(n)),
73 fReferenceMultiplicity(0),
76 fMCReactionPlaneAngle(0.),
77 fMCReactionPlaneAngleIsSet(kFALSE),
78 fAfterBurnerPrecision(0.001),
79 fUserModified(kFALSE),
80 fNumberOfTracksWrap(NULL),
81 fNumberOfRPsWrap(NULL),
82 fMCReactionPlaneAngleWrap(NULL)
85 // if second argument is set to AliFlowEventSimple::kGenerate
86 // it generates n random tracks with given Pt distribution
87 // (a sane default is provided), phi and eta are uniform
89 if (method==kGenerate)
90 Generate(n,ptDist,phiMin,phiMax,etaMin,etaMax);
93 //-----------------------------------------------------------------------
94 AliFlowEventSimple::AliFlowEventSimple(const AliFlowEventSimple& anEvent):
96 fTrackCollection((TObjArray*)(anEvent.fTrackCollection)->Clone()),
97 fReferenceMultiplicity(anEvent.fReferenceMultiplicity),
98 fNumberOfTracks(anEvent.fNumberOfTracks),
99 fNumberOfRPs(anEvent.fNumberOfRPs),
100 fMCReactionPlaneAngle(anEvent.fMCReactionPlaneAngle),
101 fMCReactionPlaneAngleIsSet(anEvent.fMCReactionPlaneAngleIsSet),
102 fAfterBurnerPrecision(anEvent.fAfterBurnerPrecision),
103 fUserModified(anEvent.fUserModified),
104 fNumberOfTracksWrap(anEvent.fNumberOfTracksWrap),
105 fNumberOfRPsWrap(anEvent.fNumberOfRPsWrap),
106 fMCReactionPlaneAngleWrap(anEvent.fMCReactionPlaneAngleWrap)
111 //-----------------------------------------------------------------------
112 AliFlowEventSimple& AliFlowEventSimple::operator=(const AliFlowEventSimple& anEvent)
114 //assignment operator
115 if (&anEvent==this) return *this; //check self-assignment
116 if (fTrackCollection) fTrackCollection->Delete();
117 delete fTrackCollection;
118 fTrackCollection = (TObjArray*)(anEvent.fTrackCollection)->Clone(); //deep copy
119 fReferenceMultiplicity = anEvent.fReferenceMultiplicity;
120 fNumberOfTracks = anEvent.fNumberOfTracks;
121 fNumberOfRPs = anEvent.fNumberOfRPs;
122 fMCReactionPlaneAngle = anEvent.fMCReactionPlaneAngle;
123 fMCReactionPlaneAngleIsSet = anEvent.fMCReactionPlaneAngleIsSet;
124 fAfterBurnerPrecision = anEvent.fAfterBurnerPrecision;
125 fUserModified=anEvent.fUserModified;
126 fNumberOfTracksWrap = anEvent.fNumberOfTracksWrap;
127 fNumberOfRPsWrap = anEvent.fNumberOfRPsWrap;
128 fMCReactionPlaneAngleWrap=anEvent.fMCReactionPlaneAngleWrap;
132 //-----------------------------------------------------------------------
133 AliFlowEventSimple::~AliFlowEventSimple()
136 if (fTrackCollection) fTrackCollection->Delete();
137 delete fTrackCollection;
138 delete fNumberOfTracksWrap;
139 delete fNumberOfRPsWrap;
140 delete fMCReactionPlaneAngleWrap;
143 //-----------------------------------------------------------------------
144 void AliFlowEventSimple::Generate(Int_t nParticles,
151 //generate nParticles random tracks uniform in phi and eta
152 //according to the specified pt distribution
155 static TF1 ptdistribution("ptSpectra","x*TMath::Exp(-pow(0.13957*0.13957+x*x,0.5)/0.4)",0.1,10.);
156 ptDist=&ptdistribution;
159 for (Int_t i=0; i<nParticles; i++)
161 AliFlowTrackSimple* track = new AliFlowTrackSimple();
162 track->SetPhi( gRandom->Uniform(phiMin,phiMax) );
163 track->SetEta( gRandom->Uniform(etaMin,etaMax) );
164 track->SetPt( ptDist->GetRandom() );
165 track->SetCharge( (gRandom->Uniform()-0.5<0)?-1:1 );
168 fMCReactionPlaneAngle=gRandom->Uniform(0.0,TMath::TwoPi());
169 fMCReactionPlaneAngleIsSet=kTRUE;
173 //-----------------------------------------------------------------------
174 AliFlowTrackSimple* AliFlowEventSimple::GetTrack(Int_t i)
176 //get track i from collection
177 if (i>=fNumberOfTracks) return NULL;
178 AliFlowTrackSimple* pTrack = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i)) ;
182 //-----------------------------------------------------------------------
183 void AliFlowEventSimple::AddTrack( AliFlowTrackSimple* track )
185 //add a track, delete the old one if necessary
186 if (fNumberOfTracks < fTrackCollection->GetEntriesFast())
188 TObject* o = fTrackCollection->At(fNumberOfTracks);
191 fTrackCollection->AddAtAndExpand(track,fNumberOfTracks);
195 //-----------------------------------------------------------------------
196 AliFlowVector AliFlowEventSimple::GetQ(Int_t n, TList *weightsList, Bool_t usePhiWeights, Bool_t usePtWeights, Bool_t useEtaWeights)
198 // calculate Q-vector in harmonic n without weights (default harmonic n=2)
205 Double_t sumOfWeights = 0.;
209 Double_t dWeight = 1.;
211 AliFlowTrackSimple* pTrack = NULL;
214 Double_t dBinWidthPt = 0.;
215 Double_t dPtMin = 0.;
216 Double_t dBinWidthEta = 0.;
217 Double_t dEtaMin = 0.;
219 Double_t wPhi = 1.; // weight Phi
220 Double_t wPt = 1.; // weight Pt
221 Double_t wEta = 1.; // weight Eta
223 TH1F *phiWeights = NULL;
224 TH1D *ptWeights = NULL;
225 TH1D *etaWeights = NULL;
231 phiWeights = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights"));
232 if(phiWeights) nBinsPhi = phiWeights->GetNbinsX();
236 ptWeights = dynamic_cast<TH1D *>(weightsList->FindObject("pt_weights"));
239 dBinWidthPt = ptWeights->GetBinWidth(1); // assuming that all bins have the same width
240 dPtMin = (ptWeights->GetXaxis())->GetXmin();
245 etaWeights = dynamic_cast<TH1D *>(weightsList->FindObject("eta_weights"));
248 dBinWidthEta = etaWeights->GetBinWidth(1); // assuming that all bins have the same width
249 dEtaMin = (etaWeights->GetXaxis())->GetXmin();
252 } // end of if(weightsList)
255 for(Int_t i=0; i<fNumberOfTracks; i++)
257 pTrack = (AliFlowTrackSimple*)fTrackCollection->At(i);
260 if(pTrack->InRPSelection())
262 dPhi = pTrack->Phi();
264 dEta = pTrack->Eta();
265 dWeight = pTrack->Weight();
267 // determine Phi weight: (to be improved, I should here only access it + the treatment of gaps in the if statement)
268 if(phiWeights && nBinsPhi)
270 wPhi = phiWeights->GetBinContent(1+(Int_t)(TMath::Floor(dPhi*nBinsPhi/TMath::TwoPi())));
272 // determine v'(pt) weight:
273 if(ptWeights && dBinWidthPt)
275 wPt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt)));
277 // determine v'(eta) weight:
278 if(etaWeights && dBinWidthEta)
280 wEta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta)));
283 // building up the weighted Q-vector:
284 dQX += dWeight*wPhi*wPt*wEta*TMath::Cos(iOrder*dPhi);
285 dQY += dWeight*wPhi*wPt*wEta*TMath::Sin(iOrder*dPhi);
287 // weighted multiplicity:
288 sumOfWeights += dWeight*wPhi*wPt*wEta;
290 } // end of if (pTrack->InRPSelection())
291 } // end of if (pTrack)
294 cerr << "no particle!!!"<<endl;
296 } // loop over particles
299 vQ.SetMult(sumOfWeights);
305 //-----------------------------------------------------------------------
306 void AliFlowEventSimple::Get2Qsub(AliFlowVector* Qarray, Int_t n, TList *weightsList, Bool_t usePhiWeights, Bool_t usePtWeights, Bool_t useEtaWeights)
309 // calculate Q-vector in harmonic n without weights (default harmonic n=2)
314 Double_t sumOfWeights = 0.;
318 Double_t dWeight = 1.;
320 AliFlowTrackSimple* pTrack = NULL;
322 Int_t iNbinsPhiSub0 = 0;
323 Int_t iNbinsPhiSub1 = 0;
324 Double_t dBinWidthPt = 0.;
325 Double_t dPtMin = 0.;
326 Double_t dBinWidthEta= 0.;
327 Double_t dEtaMin = 0.;
329 Double_t dWphi = 1.; // weight Phi
330 Double_t dWpt = 1.; // weight Pt
331 Double_t dWeta = 1.; // weight Eta
333 TH1F* phiWeightsSub0 = NULL;
334 TH1F* phiWeightsSub1 = NULL;
335 TH1D* ptWeights = NULL;
336 TH1D* etaWeights = NULL;
342 phiWeightsSub0 = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights_sub0"));
344 iNbinsPhiSub0 = phiWeightsSub0->GetNbinsX();
346 phiWeightsSub1 = dynamic_cast<TH1F *>(weightsList->FindObject("phi_weights_sub1"));
348 iNbinsPhiSub1 = phiWeightsSub1->GetNbinsX();
353 ptWeights = dynamic_cast<TH1D *>(weightsList->FindObject("pt_weights"));
356 dBinWidthPt = ptWeights->GetBinWidth(1); // assuming that all bins have the same width
357 dPtMin = (ptWeights->GetXaxis())->GetXmin();
362 etaWeights = dynamic_cast<TH1D *>(weightsList->FindObject("eta_weights"));
365 dBinWidthEta = etaWeights->GetBinWidth(1); // assuming that all bins have the same width
366 dEtaMin = (etaWeights->GetXaxis())->GetXmin();
369 } // end of if(weightsList)
371 //loop over the two subevents
372 for (Int_t s=0; s<2; s++)
375 for(Int_t i=0; i<fNumberOfTracks; i++)
377 pTrack = (AliFlowTrackSimple*)fTrackCollection->At(i);
380 if(pTrack->InRPSelection())
382 if (pTrack->InSubevent(s))
384 dPhi = pTrack->Phi();
386 dEta = pTrack->Eta();
387 dWeight = pTrack->Weight();
389 // determine Phi weight: (to be improved, I should here only access it + the treatment of gaps in the if statement)
392 if(phiWeightsSub0 && iNbinsPhiSub0) {
393 Int_t phiBin = 1+(Int_t)(TMath::Floor(dPhi*iNbinsPhiSub0/TMath::TwoPi()));
394 //use the phi value at the center of the bin
395 dPhi = phiWeightsSub0->GetBinCenter(phiBin);
396 dWphi = phiWeightsSub0->GetBinContent(phiBin);
401 if(phiWeightsSub1 && iNbinsPhiSub1) {
402 Int_t phiBin = 1+(Int_t)(TMath::Floor(dPhi*iNbinsPhiSub1/TMath::TwoPi()));
403 //use the phi value at the center of the bin
404 dPhi = phiWeightsSub1->GetBinCenter(phiBin);
405 dWphi = phiWeightsSub1->GetBinContent(phiBin);
409 // determine v'(pt) weight:
410 if(ptWeights && dBinWidthPt)
412 dWpt=ptWeights->GetBinContent(1+(Int_t)(TMath::Floor((dPt-dPtMin)/dBinWidthPt)));
415 // determine v'(eta) weight:
416 if(etaWeights && dBinWidthEta)
418 dWeta=etaWeights->GetBinContent(1+(Int_t)(TMath::Floor((dEta-dEtaMin)/dBinWidthEta)));
421 // building up the weighted Q-vector:
422 dQX += dWeight*dWphi*dWpt*dWeta*TMath::Cos(iOrder*dPhi);
423 dQY += dWeight*dWphi*dWpt*dWeta*TMath::Sin(iOrder*dPhi);
425 // weighted multiplicity:
426 sumOfWeights+=dWeight*dWphi*dWpt*dWeta;
429 } // end of if (pTrack->InRPSelection())
430 } // end of if (pTrack)
433 cerr << "no particle!!!"<<endl;
435 } // loop over particles
436 Qarray[s].Set(dQX,dQY);
437 Qarray[s].SetMult(sumOfWeights);
447 //-----------------------------------------------------------------------
448 void AliFlowEventSimple::Print(Option_t *option) const
450 // -*-*-*-*-*Print some global quantities for this histogram collection class *-*-*-*-*-*-*-*
451 // ===============================================
452 // printf( "TH1.Print Name = %s, Entries= %d, Total sum= %g\n",GetName(),Int_t(fEntries),GetSumOfWeights());
453 printf( "Class.Print Name = %s, #tracks= %d, Number of RPs= %d, MC EventPlaneAngle= %f\n",
454 GetName(),fNumberOfTracks, fNumberOfRPs, fMCReactionPlaneAngle );
456 TString optionstr(option);
457 if (!optionstr.Contains("all")) return;
458 if (fTrackCollection)
460 fTrackCollection->Print(option);
464 printf( "Empty track collection \n");
468 //-----------------------------------------------------------------------
469 void AliFlowEventSimple::Browse(TBrowser *b)
473 if (!fNumberOfTracksWrap)
475 fNumberOfTracksWrap = new TParameter<int>("fNumberOfTracks", fNumberOfTracks);
476 b->Add(fNumberOfTracksWrap);
478 if (!fNumberOfRPsWrap)
480 fNumberOfRPsWrap = new TParameter<int>("fNumberOfRPs", fNumberOfRPs);
481 b->Add(fNumberOfRPsWrap);
483 if (!fMCReactionPlaneAngleWrap)
485 fMCReactionPlaneAngleWrap = new TParameter<double>(" fMCReactionPlaneAngle", fMCReactionPlaneAngle);
486 b->Add( fMCReactionPlaneAngleWrap);
488 if (fTrackCollection) b->Add(fTrackCollection,"AliFlowTracksSimple");
491 //-----------------------------------------------------------------------
492 AliFlowEventSimple::AliFlowEventSimple( TTree* inputTree,
493 const AliFlowTrackSimpleCuts* rpCuts,
494 const AliFlowTrackSimpleCuts* poiCuts):
495 fTrackCollection(NULL),
496 fReferenceMultiplicity(0),
499 fMCReactionPlaneAngle(0.),
500 fMCReactionPlaneAngleIsSet(kFALSE),
501 fAfterBurnerPrecision(0.001),
502 fUserModified(kFALSE),
503 fNumberOfTracksWrap(NULL),
504 fNumberOfRPsWrap(NULL),
505 fMCReactionPlaneAngleWrap(NULL)
507 //constructor, fills the event from a TTree of kinematic.root files
508 //applies RP and POI cuts, tags the tracks
510 Int_t numberOfInputTracks = inputTree->GetEntries() ;
511 fTrackCollection = new TObjArray(numberOfInputTracks/2);
513 TParticle* pParticle = new TParticle();
514 inputTree->SetBranchAddress("Particles",&pParticle);
516 Int_t iSelParticlesPOI = 0;
518 for (Int_t i=0; i<numberOfInputTracks; i++)
520 inputTree->GetEntry(i); //get input particle
522 if (!pParticle) continue; //no particle
523 if (!pParticle->IsPrimary()) continue;
525 Bool_t rpOK = rpCuts->PassesCuts(pParticle);
526 Bool_t poiOK = poiCuts->PassesCuts(pParticle);
530 AliFlowTrackSimple* pTrack = new AliFlowTrackSimple(pParticle);
532 //marking the particles used for int. flow:
535 pTrack->SetForRPSelection(kTRUE);
538 //marking the particles used for diff. flow:
541 pTrack->SetForPOISelection(kTRUE);
544 //adding a particles which were used either for int. or diff. flow to the list
551 //_____________________________________________________________________________
552 void AliFlowEventSimple::CloneTracks(Int_t n)
554 //clone every track n times to add non-flow
555 if (n<=0) return; //no use to clone stuff zero or less times
556 Int_t ntracks = fNumberOfTracks;
557 fTrackCollection->Expand((n+1)*fNumberOfTracks);
558 for (Int_t i=0; i<n; i++)
560 for (Int_t itrack=0; itrack<ntracks; itrack++)
562 AliFlowTrackSimple* track = dynamic_cast<AliFlowTrackSimple*>(fTrackCollection->At(itrack));
563 if (!track) continue;
564 AddTrack(static_cast<AliFlowTrackSimple*>(track->Clone()));
570 //_____________________________________________________________________________
571 void AliFlowEventSimple::ResolutionPt(Double_t res)
573 //smear pt of all tracks by gaussian with sigma=res
574 for (Int_t i=0; i<fNumberOfTracks; i++)
576 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
577 if (track) track->ResolutionPt(res);
582 //_____________________________________________________________________________
583 void AliFlowEventSimple::TagSubeventsInEta( Double_t etaMinA,
588 //Flag two subevents in given eta ranges
589 for (Int_t i=0; i<fNumberOfTracks; i++)
591 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
592 if (!track) continue;
593 track->ResetSubEventTags();
594 Double_t eta=track->Eta();
595 if (eta >= etaMinA && eta <= etaMaxA) track->SetForSubevent(0);
596 if (eta >= etaMinB && eta <= etaMaxB) track->SetForSubevent(1);
600 //_____________________________________________________________________________
601 void AliFlowEventSimple::TagSubeventsByCharge()
603 //Flag two subevents in given eta ranges
604 for (Int_t i=0; i<fNumberOfTracks; i++)
606 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
607 if (!track) continue;
608 track->ResetSubEventTags();
609 Int_t charge=track->Charge();
610 if (charge<0) track->SetForSubevent(0);
611 if (charge>0) track->SetForSubevent(1);
615 //_____________________________________________________________________________
616 void AliFlowEventSimple::AddV1( Double_t v1 )
618 //add v2 to all tracks wrt the reaction plane angle
619 for (Int_t i=0; i<fNumberOfTracks; i++)
621 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
622 if (track) track->AddV1(v1, fMCReactionPlaneAngle, fAfterBurnerPrecision);
627 //_____________________________________________________________________________
628 void AliFlowEventSimple::AddV2( Double_t v2 )
630 //add v2 to all tracks wrt the reaction plane angle
631 for (Int_t i=0; i<fNumberOfTracks; i++)
633 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
634 if (track) track->AddV2(v2, fMCReactionPlaneAngle, fAfterBurnerPrecision);
639 //_____________________________________________________________________________
640 void AliFlowEventSimple::AddV3( Double_t v3 )
642 //add v3 to all tracks wrt the reaction plane angle
643 for (Int_t i=0; i<fNumberOfTracks; i++)
645 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
646 if (track) track->AddV3(v3, fMCReactionPlaneAngle, fAfterBurnerPrecision);
651 //_____________________________________________________________________________
652 void AliFlowEventSimple::AddV4( Double_t v4 )
654 //add v4 to all tracks wrt the reaction plane angle
655 for (Int_t i=0; i<fNumberOfTracks; i++)
657 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
658 if (track) track->AddV4(v4, fMCReactionPlaneAngle, fAfterBurnerPrecision);
663 //_____________________________________________________________________________
664 void AliFlowEventSimple::AddV5( Double_t v5 )
666 //add v4 to all tracks wrt the reaction plane angle
667 for (Int_t i=0; i<fNumberOfTracks; i++)
669 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
670 if (track) track->AddV5(v5, fMCReactionPlaneAngle, fAfterBurnerPrecision);
675 //_____________________________________________________________________________
676 void AliFlowEventSimple::AddFlow( Double_t v1, Double_t v2, Double_t v3, Double_t v4, Double_t v5,
677 Double_t rp1, Double_t rp2, Double_t rp3, Double_t rp4, Double_t rp5 )
679 //add flow to all tracks wrt the reaction plane angle, for all harmonic separate angle
680 for (Int_t i=0; i<fNumberOfTracks; i++)
682 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
683 if (track) track->AddFlow(v1,v2,v3,v4,v5,rp1,rp2,rp3,rp4,rp5,fAfterBurnerPrecision);
688 //_____________________________________________________________________________
689 void AliFlowEventSimple::AddFlow( Double_t v1, Double_t v2, Double_t v3, Double_t v4, Double_t v5 )
691 //add flow to all tracks wrt the reaction plane angle
692 for (Int_t i=0; i<fNumberOfTracks; i++)
694 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
695 if (track) track->AddFlow(v1,v2,v3,v4,v5,fMCReactionPlaneAngle, fAfterBurnerPrecision);
700 //_____________________________________________________________________________
701 void AliFlowEventSimple::AddV2( TF1* ptDepV2 )
703 //add v2 to all tracks wrt the reaction plane angle
704 for (Int_t i=0; i<fNumberOfTracks; i++)
706 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
707 if (!track) continue;
708 Double_t v2 = ptDepV2->Eval(track->Pt());
709 track->AddV2(v2, fMCReactionPlaneAngle, fAfterBurnerPrecision);
714 //_____________________________________________________________________________
715 void AliFlowEventSimple::TagRP( const AliFlowTrackSimpleCuts* cuts )
717 //tag tracks as reference particles (RPs)
718 for (Int_t i=0; i<fNumberOfTracks; i++)
720 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
721 if (!track) continue;
722 Bool_t pass=cuts->PassesCuts(track);
723 Bool_t rpTrack=track->InRPSelection();
726 if (!rpTrack) fNumberOfRPs++; //only increase if not already tagged
730 if (rpTrack) fNumberOfRPs--; //only decrease if detagging
732 track->SetForRPSelection(pass);
736 //_____________________________________________________________________________
737 void AliFlowEventSimple::TagPOI( const AliFlowTrackSimpleCuts* cuts )
739 //tag tracks as particles of interest (POIs)
740 for (Int_t i=0; i<fNumberOfTracks; i++)
742 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
743 if (!track) continue;
744 Bool_t pass=cuts->PassesCuts(track);
745 track->SetForPOISelection(pass);
749 //_____________________________________________________________________________
750 void AliFlowEventSimple::DefineDeadZone( Double_t etaMin,
755 //mark tracks in given eta-phi region as dead
756 //by resetting the flow bits
757 for (Int_t i=0; i<fNumberOfTracks; i++)
759 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
760 Double_t eta = track->Eta();
761 Double_t phi = track->Phi();
762 if (eta>etaMin && eta<etaMax && phi>phiMin && phi<phiMax)
764 if (track->InRPSelection()) fNumberOfRPs--;
765 track->ResetFlowTags();
770 //_____________________________________________________________________________
771 Int_t AliFlowEventSimple::CleanUpDeadTracks()
773 //remove tracks that have no flow tags set and cleanup the container
774 //returns number of cleaned tracks
776 for (Int_t i=0; i<fNumberOfTracks; i++)
778 AliFlowTrackSimple* track = static_cast<AliFlowTrackSimple*>(fTrackCollection->At(i));
779 if (!track) continue;
780 if (track->IsDead()) {delete track;track=NULL;ncleaned++;}
782 fTrackCollection->Compress(); //clean up empty slots
783 fNumberOfTracks-=ncleaned; //update number of tracks
787 //_____________________________________________________________________________
788 TF1* AliFlowEventSimple::SimplePtDepV2()
790 //return a standard pt dependent v2 formula, user has to clean up!
791 return new TF1("StandardPtDepV2","((x<1.0)*(0.05/1.0)*x+(x>=1.0)*0.05)");
794 //_____________________________________________________________________________
795 TF1* AliFlowEventSimple::SimplePtSpectrum()
797 //return a standard pt spectrum, user has to clean up!
798 return new TF1("StandardPtSpectrum","x*TMath::Exp(-pow(0.13957*0.13957+x*x,0.5)/0.4)",0.1,10.);
801 //_____________________________________________________________________________
802 void AliFlowEventSimple::ClearFast()
804 //clear the counter without deleting allocated objects so they can be reused
805 fReferenceMultiplicity = 0;
808 fMCReactionPlaneAngle = 0.0;
809 fMCReactionPlaneAngleIsSet = kFALSE;
810 fAfterBurnerPrecision = 0.001;
811 fUserModified = kFALSE;