1 //////////////////////////////////////////////////////////////////////
3 // $Id: AliFlowMaker.cxx 18618 2007-05-16 15:38:22Z snelling $
5 // Author: Emanuele Simili
7 //////////////////////////////////////////////////////////////////////
8 //_____________________________________________________________
11 // AliFlowMaker provides the method to create AliFlowEvent(s)
12 // from AliESD(s). Very basic track cuts are applyed.
13 // The present class can be used in a simple AliRoot macro or in a
14 // more complex enviroment such as AliSelector or AliTask.
16 //////////////////////////////////////////////////////////////////////
18 #ifndef ALIFLOWMAKER_CXX
19 #define ALIFLOWMAKER_CXX
26 #include "TClonesArray.h"
30 #include "AliESDVertex.h"
31 #include "AliESDtrack.h"
33 //#include "AliKalmanTrack.h"
36 #include "AliFlowEvent.h"
37 #include "AliFlowTrack.h"
38 #include "AliFlowV0.h"
39 #include "AliFlowConstants.h"
40 #include "AliFlowMaker.h"
46 using namespace std; //required for resolving the 'cout' symbol
48 ClassImp(AliFlowMaker)
49 //-----------------------------------------------------------------------
50 AliFlowMaker::AliFlowMaker():
51 fEventNumber(0), fTrackNumber(0), fV0Number(0), fGoodTracks(0), fGoodV0s(0),
52 fGoodTracksEta(0), fPosiTracks(0), fNegaTracks(0), fUnconstrained(0),
53 fSumAll(0), fCutEvts(0), fCutTrks(0), fCutV0s(0), fCounter(0), fMovedTr(0x0),
54 fNewAli(kFALSE), fLoopTrks(kTRUE), fLoopV0s(kTRUE),
55 fESD(0x0), fTrack(0x0), fV0(0x0), fVertex(0x0),
56 fRunID(0), fNumberOfEvents(0), fNumberOfTracks(0),
57 fNumberOfV0s(0), fMagField(0),
58 fFlowEvent(0x0), fFlowTrack(0x0), fFlowV0(0x0),
59 fNHits(0), fElow(0.001), fEup(1000.)
61 // default constructor
62 // resets counters , sets defaults
64 for(Int_t bb=0;bb<5;bb++) { fBayesianAll[bb] = 0 ; } ;
67 fLabel[0] = 0 ; fLabel[1] = -1 ;
69 //-----------------------------------------------------------------------
70 AliFlowMaker::~AliFlowMaker()
72 // default destructor (no actions)
74 //-----------------------------------------------------------------------
76 //-----------------------------------------------------------------------
77 AliFlowEvent* AliFlowMaker::FillFlowEvent(AliESD* fESD)
79 // From the AliESD (input) fills the AliFlowEvent (output) .
80 // It loops on track & v0 and calls the methods to fill the arrays .
83 fFlowEvent = new AliFlowEvent(10000) ; if(!fFlowEvent) { return 0 ; }
84 //cout << " -evt- " << fFlowEvent << endl ;
86 fRunID = fESD->GetRunNumber() ;
88 // fEventNumber = fESD->GetEventNumber() ;
89 fNumberOfTracks = fESD->GetNumberOfTracks() ;
90 fNumberOfV0s = fESD->GetNumberOfV0s() ;
92 cout << " *evt n. " << fEventNumber << " (run " << fRunID << ") - tracks: " << fNumberOfTracks << " , v0s " << fNumberOfV0s << endl ;
94 // Clean the vector of links esd-flowEvt
95 fMovedTr.clear(); // Remove all elements
98 fFlowEvent->SetRunID(fRunID) ;
99 fFlowEvent->SetEventID(fEventNumber) ;
100 fFlowEvent->SetOrigMult((UInt_t)fNumberOfTracks) ;
102 // Run information (fixed - ???)
103 fMagField = fESD->GetMagneticField() ; // cout << " *fMagField " << fMagField << endl ;
104 fFlowEvent->SetMagneticField(fMagField) ;
105 fFlowEvent->SetCenterOfMassEnergy(AliFlowConstants::fgCenterOfMassEnergy) ;
106 fFlowEvent->SetBeamMassNumberEast(AliFlowConstants::fgBeamMassNumberEast) ;
107 fFlowEvent->SetBeamMassNumberWest(AliFlowConstants::fgBeamMassNumberWest) ;
109 // Trigger information (now is: ULon64_t - some trigger mask)
110 fFlowEvent->SetL0TriggerWord((Int_t)fESD->GetTriggerMask());
112 // Get primary vertex position
113 fVertex = (AliESDVertex*)fESD->GetVertex() ;
114 Double_t position[3] ;
115 fVertex->GetXYZ(position) ;
116 fFlowEvent->SetVertexPos((Float_t)position[0],(Float_t)position[1],(Float_t)position[2]) ;
118 // Zero Degree Calorimeter information
119 Int_t zdcp = fESD->GetZDCParticipants() ;
121 zdce[0] = fESD->GetZDCN1Energy() + fESD->GetZDCN2Energy();
122 zdce[1] = fESD->GetZDCP1Energy() + fESD->GetZDCP2Energy() ;
123 zdce[2] = fESD->GetZDCEMEnergy() ;
124 fFlowEvent->SetZDCpart(zdcp);
125 fFlowEvent->SetZDCenergy(zdce[0],zdce[1],zdce[2]);
131 for(fTrackNumber=0;fTrackNumber<fNumberOfTracks;fTrackNumber++)
133 fTrack = fESD->GetTrack(fTrackNumber) ;
134 if(CheckTrack(fTrack))
136 FillFlowTrack(fTrack) ;
138 fMovedTr.push_back(fFlowEvent->TrackCollection()->GetLast()) ;
140 else { fMovedTr.push_back(-1) ; badTrks++ ; continue ; }
142 fCutTrks += badTrks ;
143 } // cout << " -track number- : " << fTrackNumber << endl ;
149 for(fV0Number=0;fV0Number<fNumberOfV0s;fV0Number++)
151 fV0 = fESD->GetV0(fV0Number) ;
157 else { badV0s++ ; continue ; }
160 } // cout << " -v0 number- : " << fV0Number << endl ;
163 fFlowEvent->SetCentrality();
168 //----------------------------------------------------------------------
169 AliFlowTrack* AliFlowMaker::FillFlowTrack(AliESDtrack* fTrack)
171 // From the AliESDtrack (input) fills the AliFlowTrack (output) .
173 TString name = "" ; name += fTrackNumber ;
174 Int_t idx = fFlowEvent->TrackCollection()->GetEntries() ;
175 fFlowTrack = (AliFlowTrack*)(fFlowEvent->TrackCollection()->New(idx)) ;
176 fFlowTrack->SetName(name.Data()) ;
178 // cout << " -tr- " << name.Data() << "(" << idx << ")" << endl ;
180 // ESD particle label (link: KineTree-ESD)
181 Int_t label = TMath::Abs(fTrack->GetLabel());
182 fFlowTrack->SetLabel(label) ;
184 // signed DCA from ESDtrack
185 Float_t xy = 0 ; Float_t z = 0 ;
186 fTrack->GetImpactParameters(xy,z) ;
187 fFlowTrack->SetDcaSigned(xy,z) ;
190 Float_t dcaBis[2] ; Float_t dcaCov[3] ;
191 for(Int_t dd=0;dd<3;dd++) { dcaCov[dd] = 0. ; }
192 fTrack->GetImpactParameters(dcaBis, dcaCov) ;
193 fFlowTrack->SetDcaError(dcaCov[0],dcaCov[1],dcaCov[2]) ;
195 // UnConstrained (global) first
197 fTrack->GetPxPyPz(gD) ;
199 Float_t phiGl = (Float_t)Phi(gD) ;
200 if(phiGl<0) { phiGl += 2*TMath::Pi() ; }
201 fFlowTrack->SetPhiGlobal(phiGl) ;
202 Float_t ptGl = (Float_t)Pt(gD) ; if(ptGl<=0) { cout << " !!! ptGlobal = " << ptGl << endl ; }
203 fFlowTrack->SetPtGlobal(ptGl) ;
204 Float_t etaGl = (Float_t)Eta(gD) ;
205 fFlowTrack->SetEtaGlobal(etaGl) ;
209 Double_t par1 ; Double_t par2 ; Double_t par3[3] ;
210 if(fTrack->GetConstrainedExternalParameters(par1,par2,par3))
212 fTrack->GetConstrainedPxPyPz(cD) ;
214 else { for(Int_t iii=0;iii<3;iii++) { cD[iii] =0 ; } }
216 if(Norm(cD)!=0.) // ConstrainedPxPyPz != 0 if ConstrainedChi2 < something ...
218 Float_t phi = (Float_t)Phi(cD) ;
219 if(phi<0) { phi += 2*TMath::Pi() ; }
220 fFlowTrack->SetPhi(phi) ;
221 Float_t pt = (Float_t)Pt(cD) ; if(pt<=0) { cout << " !!! pt = " << pt << endl ; }
222 fFlowTrack->SetPt(pt) ;
223 Float_t eta = (Float_t)Eta(cD) ;
224 fFlowTrack->SetEta(eta) ;
226 // number of constrainable tracks with |eta| < AliFlowConstants::fgEtaGood (0.9)
227 if(TMath::Abs(eta) < AliFlowConstants::fgEtaMid) { fGoodTracksEta++ ; }
229 else // in case Constriction impossible for track, fill the UnConstrained (global)
232 fFlowTrack->SetPhi(0.) ;
233 fFlowTrack->SetPt(0.) ;
234 fFlowTrack->SetEta(0.) ;
237 // positive - negative tracks
238 Int_t trkSign = (Int_t)fTrack->GetSign() ;
239 fFlowTrack->SetCharge(trkSign) ;
240 if(trkSign>0) { fPosiTracks++ ; }
241 else if(trkSign<0) { fNegaTracks++ ; }
244 // Tracking parameters (fit , TPC , ITS , dE/dx)
245 fFlowTrack->SetChi2(fTrack->GetConstrainedChi2()) ;
246 fFlowTrack->SetTrackLength(fTrack->GetIntegratedLength()) ;
248 Int_t idXt[180] ; // used for Cluster Map ( see AliESDtrack::GetTPCclusters() ) // old: Int
249 Int_t idX[6] ; // used for Cluster Map ( see AliESDtrack::GetITSclusters() ) // old: UInt
250 Int_t idxr[130] ; // used for Cluster Map ( see AliESDtrack::GetTRDclusters() ) // old: UInt
252 Int_t fNFound = 0 ; // *!* fNFoundable (in AliTPCtrack) ... added by M.Ianov
255 Float_t detPid6[AliFlowConstants::kPid] ;
258 for(Int_t gg=0;gg<3;gg++) { pVecAt[gg] = gD[gg] ; }
259 Bool_t boh ; Float_t pAt = 0 ; // to get p at each detector
261 if(fNewAli) { boh = fTrack->GetPxPyPzAt(AliFlowConstants::fgTPCx, fMagField, pVecAt) ; }
262 else { boh = fTrack->GetInnerParam()->GetPxPyPzAt(AliFlowConstants::fgTPCx, fMagField, pVecAt) ; }
263 pAt = (Float_t)Norm(pVecAt) ; if(!pAt) { pAt = (Float_t)Norm(gD) ; }
264 nClus = fTrack->GetTPCclusters(idXt) ;
265 fNFound = fTrack->GetTPCNclsF() ; // was 160
266 if( (fTrack->GetStatus() & AliESDtrack::kTPCpid) != 0 )
268 fTrack->GetTPCpid(detPid) ;
269 for(Int_t bb=0;bb<5;bb++) { detPid6[bb] = detPid[bb] ; } detPid6[5] = 0. ;
270 fFlowTrack->SetRespFunTPC(detPid6) ;
272 fFlowTrack->SetMaxPtsTPC(fNFound) ;
273 fFlowTrack->SetFitPtsTPC(nClus) ;
274 fFlowTrack->SetDedxTPC(fTrack->GetTPCsignal()) ;
275 fFlowTrack->SetChi2TPC((Float_t)(fTrack->GetTPCchi2())) ;
276 fFlowTrack->SetPatTPC(pAt) ;
278 if(fNewAli) { boh = fTrack->GetPxPyPzAt(AliFlowConstants::fgITSx, fMagField, pVecAt) ; }
279 else { boh = fTrack->GetInnerParam()->GetPxPyPzAt(AliFlowConstants::fgITSx, fMagField, pVecAt) ; }
280 pAt = (Float_t)Norm(pVecAt) ; if(!pAt) { pAt = (Float_t)Norm(gD) ; }
281 nClus = fTrack->GetITSclusters(idX) ;
282 fNFound = 6 ; // ? fixed
283 if( (fTrack->GetStatus() & AliESDtrack::kITSpid) != 0 )
285 fTrack->GetITSpid(detPid) ;
286 for(Int_t bb=0;bb<5;bb++) { detPid6[bb] = detPid[bb] ; } detPid6[5] = 0. ;
287 fFlowTrack->SetRespFunITS(detPid6) ;
289 fFlowTrack->SetMaxPtsITS(fNFound) ;
290 fFlowTrack->SetFitPtsITS(nClus) ;
291 fFlowTrack->SetDedxITS(fTrack->GetITSsignal()) ;
292 fFlowTrack->SetChi2ITS((Float_t)(fTrack->GetITSchi2())) ;
293 fFlowTrack->SetPatITS(pAt) ;
295 if(fNewAli) { boh = fTrack->GetPxPyPzAt(AliFlowConstants::fgTRDx, fMagField, pVecAt) ; }
296 else { boh = fTrack->GetInnerParam()->GetPxPyPzAt(AliFlowConstants::fgTRDx, fMagField, pVecAt) ; }
297 pAt = (Float_t)Norm(pVecAt) ; if(!pAt) { pAt = (Float_t)Norm(gD) ; }
298 nClus = fTrack->GetTRDclusters(idxr) ;
299 fNFound = fTrack->GetTRDncls() ; // was 130
300 if( (fTrack->GetStatus() & AliESDtrack::kTRDpid) != 0 )
302 fTrack->GetTRDpid(detPid) ;
303 for(Int_t bb=0;bb<5;bb++) { detPid6[bb] = detPid[bb] ; } detPid6[5] = 0. ;
304 fFlowTrack->SetRespFunTRD(detPid6) ;
306 fFlowTrack->SetMaxPtsTRD(fNFound) ;
307 fFlowTrack->SetNhitsTRD(nClus) ;
308 fFlowTrack->SetSigTRD(fTrack->GetTRDsignal()) ;
309 fFlowTrack->SetChi2TRD((Float_t)fTrack->GetTRDchi2()) ;
310 fFlowTrack->SetPatTRD(pAt) ;
312 if(fNewAli) { boh = fTrack->GetPxPyPzAt(AliFlowConstants::fgTOFx, fMagField, pVecAt) ; }
313 else { boh = fTrack->GetInnerParam()->GetPxPyPzAt(AliFlowConstants::fgTOFx, fMagField, pVecAt) ; }
314 pAt = (Float_t)Norm(pVecAt) ; if(!pAt) { pAt = (Float_t)Norm(gD) ; }
315 nClus = fTrack->GetTOFcluster() ;
316 fNFound = 0 ; if(fTrack->GetTOFCalChannel() > 0) { fNFound = 1 ; }
317 if( (fTrack->GetStatus() & AliESDtrack::kTOFpid) != 0 )
319 fTrack->GetTOFpid(detPid) ;
320 for(Int_t bb=0;bb<5;bb++) { detPid6[bb] = detPid[bb] ; } detPid6[5] = 0. ;
321 fFlowTrack->SetRespFunTOF(detPid6) ;
323 fFlowTrack->SetMaxPtsTOF(fNFound) ;
324 fFlowTrack->SetNhitsTOF(nClus) ;
325 fFlowTrack->SetTofTOF(fTrack->GetTOFsignal()) ;
326 fFlowTrack->SetChi2TOF(fTrack->GetTOFchi2()) ;
327 fFlowTrack->SetPatTOF(pAt) ;
329 Double_t rIn[3] ; rIn[0] = 0. ; rIn[1] = 0. ; rIn[2] = 0. ;
330 Double_t rOut[3] ; rOut[0] = 0. ; rOut[1] = 0. ; rOut[2] = 0. ;
332 fTrack->GetInnerXYZ(rIn) ;
333 fFlowTrack->SetZFirstPoint(rIn[2]) ;
334 //fTrack->GetXYZAt(AliFlowConstants::fgTPCx,fMagField,rOut) ;
335 fTrack->GetOuterXYZ(rOut) ;
336 fFlowTrack->SetZLastPoint(rOut[2]) ;
338 // ESD-P.Id. = 5-vector of Best detectors probabilities for [e , mu , pi , K , p]
339 Double_t trkPid[5] ; fTrack->GetESDpid(trkPid) ;
340 Double_t trkPid6[AliFlowConstants::kPid] ;
341 for(Int_t bb=0;bb<5;bb++) { trkPid6[bb] = trkPid[bb] ; }
342 trkPid6[5] = 0. ; // *!* implement P.Id. for Deuterim
344 // Bayesian P.Id. method (weighted probabilities for [e , mu , pi , K , p , d])
346 Double_t bayePid[AliFlowConstants::kPid] ; // normalized P.id
347 Double_t storedPid[AliFlowConstants::kPid] ; // stored P.id
348 for(Int_t nB=0;nB<AliFlowConstants::kPid;nB++) { bsum += trkPid6[nB]*AliFlowConstants::fgBayesian[nB] ; }
351 for(Int_t nB=0;nB<AliFlowConstants::kPid;nB++)
353 bayePid[nB] = trkPid6[nB]*AliFlowConstants::fgBayesian[nB] / bsum ;
354 storedPid[nB] = trkPid6[nB] ;
357 else { cout << " ERROR - Empty Bayesian Vector !!! " << endl ; }
359 fFlowTrack->SetElectronPositronProb(storedPid[0]);
360 fFlowTrack->SetMuonPlusMinusProb(storedPid[1]);
361 fFlowTrack->SetPionPlusMinusProb(storedPid[2]);
362 fFlowTrack->SetKaonPlusMinusProb(storedPid[3]);
363 fFlowTrack->SetProtonPbarProb(storedPid[4]);
364 fFlowTrack->SetDeuteriumAntiDeuteriumProb(storedPid[5]); // *!* implement P.Id. for Deuterim
366 // P.id. label given via the weighted prob.
367 const Int_t kCode[] = {11,13,211,321,2212,10010020} ;
368 Int_t kkk = 2 ; // if No id. -> then is a Pi
369 Float_t pidMax = bayePid[2] ; // (if all equal, Pi probability get's the advantage to be the first)
370 for(Int_t iii=0; iii<5; iii++)
372 if(bayePid[iii]>pidMax) { kkk = iii ; pidMax = bayePid[iii] ; } // !!! Bayesian as well !!!
374 fBayesianAll[kkk]++ ; fSumAll++ ; // goes on filling the vector of observed abundance
376 Int_t pdgCode = trkSign*kCode[kkk] ;
377 fFlowTrack->SetMostLikelihoodPID(pdgCode);
381 //-----------------------------------------------------------------------
382 AliFlowV0* AliFlowMaker::FillFlowV0(AliESDv0* fV0)
384 // From the AliESDv0 (input) fills the AliFlowV0 (output) .
386 TString name = "" ; name += fV0Number ;
387 Int_t idx = fFlowEvent->V0Collection()->GetEntries() ;
388 fFlowV0 = (AliFlowV0*)(fFlowEvent->V0Collection()->New(idx)) ;
389 fFlowV0->SetName(name.Data()) ;
391 // cout << " -v0- " << name.Data() << "(" << idx << ")" << endl ;
393 // ESD particle label (link: KineTree-ESD)
394 Int_t label = -1 ; // TMath::Abs(fV0->GetLabel());
395 fFlowV0->SetLabel(label) ;
397 // reconstructed momentum of the V0
399 fV0->GetPxPyPz(pxyz[0],pxyz[1],pxyz[2]) ;
401 Float_t phi = (Float_t)Phi(pxyz) ; if(phi<0) { phi += 2*TMath::Pi() ; }
402 fFlowV0->SetPhi(phi) ;
403 Float_t pt = (Float_t)Pt(pxyz) ;
405 Float_t eta = (Float_t)Eta(pxyz) ;
406 fFlowV0->SetEta(eta) ;
408 // reconstructed position of the V0
410 fV0->GetXYZ(xyz[0],xyz[1],xyz[2]) ;
411 fFlowV0->SetCrossPoint(xyz[0],xyz[1],xyz[2]) ;
413 // V0's impact parameter & error (chi2 , DCA , sigma , pointing angle)
414 //fFlowV0->SetDca((Float_t)fV0->GetD()) ; // GetDistNorm
415 //fFlowV0->SetSigma((Float_t)fV0->GetDistSigma()) ;
416 //fFlowV0->SetCosPointingAngle((Float_t)fV0->GetV0CosineOfPointingAngle()) ;
417 //fFlowV0->SetDaughtersDca(fV0->GetDcaV0Daughters()) ;
418 //fFlowV0->SetChi2((Float_t)fV0->GetChi2V0()) ; // AliRoot v4-04-Release (December 2006)
419 //fFlowV0->SetChi2((Float_t)fV0->GetChi2()) ; // AliRoot v4-04-Release (old)
420 // ...when they'll stop changing the methods I'll enable the above lines. For now:
422 fFlowV0->SetSigma(0.1);
423 fFlowV0->SetCosPointingAngle(1.) ;
424 fFlowV0->SetDaughtersDca(0.) ;
425 fFlowV0->SetChi2(1.) ;
428 Int_t pdgCode = fV0->GetPdgCode() ;
429 fFlowV0->SetMostLikelihoodPID(pdgCode);
432 fFlowV0->SetVmass((Float_t)fV0->GetEffMass()) ;
435 Int_t pN = fV0->GetPindex() ;
436 Int_t nN = fV0->GetNindex() ;
437 fFlowV0->SetDaughters(fMovedTr[pN],fMovedTr[nN]) ;
441 //-----------------------------------------------------------------------
442 Bool_t AliFlowMaker::CheckTrack(AliESDtrack* fTrack) const
444 // applies track cuts (pE , nHits , label)
446 if(!fTrack) { return kFALSE ; }
448 Int_t idXt[180] ; // used for Cluster Map ( see AliESDtrack::GetTPCclusters() )
449 Int_t nHits = fTrack->GetTPCclusters(idXt) ;
450 Float_t pE = fTrack->GetP() ;
451 Int_t label = fTrack->GetLabel() ;
453 if(fNHits && (nHits<=fNHits)) { return kFALSE ; }
454 if((fElow < fEup) && ((pE<fElow) || (pE>fEup))) { return kFALSE ; }
455 if((fLabel[0] < fLabel[1]) && ((label<fLabel[0]) || (label>fLabel[1]))) { return kFALSE ; }
456 //if(fPrimary && ...) { return kFALSE ; }
460 //-----------------------------------------------------------------------
461 Bool_t AliFlowMaker::CheckV0(AliESDv0* fV0) const
463 // applies v0 cuts (mass>fElow, daughters included in the tracks)
465 if(!fV0) { return kFALSE ; }
467 Int_t pN = fV0->GetPindex() ;
468 Int_t nN = fV0->GetNindex() ;
469 Float_t iMass = (Float_t)fV0->GetEffMass() ;
471 if(iMass < fElow) { return kFALSE ; }
472 if(fMovedTr[pN] < 0) { return kFALSE ; }
473 if(fMovedTr[nN] < 0) { return kFALSE ; }
477 //-----------------------------------------------------------------------
478 Bool_t AliFlowMaker::CheckEvent(AliESD* fESD) const
480 // applies event cuts (dummy)
482 if(!fESD) { return kFALSE ; }
486 //-----------------------------------------------------------------------
487 void AliFlowMaker::PrintCutList()
489 // Prints the list of Cuts
491 cout << " * ESD cuts list * " << endl ;
492 if(fLabel[0]<fLabel[1])
494 cout << " Track Label [ " << fLabel[0] << " , " << fLabel[1] << " ] " << endl ;
498 cout << " TPC clusters > " << fNHits << endl ;
502 cout << " Track Energy (P_total) [ " << fElow << " , " << fEup << " ] " << endl ;
506 cout << " V0 invariant mass > " << fElow << endl ;
508 cout << " * * " << endl ;
510 //-----------------------------------------------------------------------
512 //-----------------------------------------------------------------------
513 //*** USEFULL METHODS for a 3-array of double (~ TVector3) ***
514 //-----------------------------------------------------------------------
515 Double_t AliFlowMaker::Norm(Double_t nu[3])
517 // returns the norm of a double[3]
519 Double_t norm2 = nu[0]*nu[0] + nu[1]*nu[1] + nu[2]*nu[2] ;
520 return TMath::Sqrt(norm2) ;
522 //-----------------------------------------------------------------------
523 Double_t AliFlowMaker::Phi(Double_t nu[3])
525 // returns the azimuthal angle of a double[3]
527 if(nu[0]==0 && nu[1]==0) { return 0. ; }
528 else { return TMath::ATan2(nu[1],nu[0]) ; }
530 //-----------------------------------------------------------------------
531 Double_t AliFlowMaker::Pt(Double_t nu[3])
533 // returns the transvers momentum of a double[3]
535 Double_t trans = nu[0]*nu[0] + nu[1]*nu[1] ;
536 return TMath::Sqrt(trans) ;
538 //-----------------------------------------------------------------------
539 Double_t AliFlowMaker::Eta(Double_t nu[3])
541 // returns the PseudoRapidity of a double[3]
542 // if transvers momentum = 0 --> returns +/- 1.000
544 Double_t m = Norm(nu) ;
545 if(nu[0]!=0 || nu[1]!=0) { return 0.5*TMath::Log((m+nu[2])/(m-nu[2])) ; }
546 else { return TMath::Sign((Double_t)1000.,nu[2]) ; }
548 //-----------------------------------------------------------------------