1 //////////////////////////////////////////////////////////////////////
3 // $Id: AliFlowV0.cxx 18618 2007-05-16 15:38:22Z snelling $
5 // Author: Emanuele Simili
7 //////////////////////////////////////////////////////////////////////
8 //_____________________________________________________________
11 // an array of AliFlowV0 is part of the AliFlowEvent,
12 // The object AliFlowV0 contains data members wich summarize the V0s
13 // information most useful for flow study (Pt, eta, phi, ecc.).
14 // AliFlowV0 also contains a references to the two daughter tracks
15 // in the TrackClollection() of the AliFlowEvent from wich the V0 has
16 // been reconstructed.
19 #include "AliFlowV0.h"
20 #include "AliFlowTrack.h"
21 #include "AliFlowEvent.h"
24 using namespace std; //required for resolving the 'cout' symbol
27 //////////////////////////////////////////////////////////////////////////////
28 AliFlowV0::AliFlowV0():
29 fPhi(0.), fPt(0.), fEta(0.), fChi2(0.), fMass(0.), fDca(0.), fCrossDCA(0.), fSigma(1.), fLabel(0), fMostLikelihoodPID(0), fPointAngle(0.),
30 fDaughterP(-1), fDaughterN(-1)
32 // default constructor
33 for(Int_t dd=0;dd<3;dd++) { fCrossPoint[dd] = 0. ; }
34 // fDaughterP = -1 ; fDaughterN = -1 ;
36 //////////////////////////////////////////////////////////////////////////////
37 AliFlowV0::AliFlowV0(const Char_t* name):
38 fPhi(0.), fPt(0.), fEta(0.), fChi2(0.), fMass(0.), fDca(0.), fCrossDCA(0.), fSigma(1.), fLabel(0), fMostLikelihoodPID(0), fPointAngle(0.),
39 fDaughterP(-1), fDaughterN(-1)
46 //////////////////////////////////////////////////////////////////////////////
47 AliFlowV0::~AliFlowV0()
49 // default destructor (dummy)
51 //////////////////////////////////////////////////////////////////////////////
53 //////////////////////////////////////////////////////////////////////////////
54 Float_t AliFlowV0::P() const
56 // Returns the reconstructed momentum of the v0
58 if(Pt()<=0) { return 0. ; }
59 if(Eta()==0) { return 0. ; }
61 float momentum = Pt()/TMath::Sqrt(1-(tanh(Eta())*tanh(Eta()))) ;
64 //////////////////////////////////////////////////////////////////////////////
65 Float_t AliFlowV0::Y() const
69 if(TMath::Abs((Float_t)P()) == TMath::Abs((Float_t)Pt())) { return 0. ; }
70 else if(TMath::Abs((Float_t)P()) < TMath::Abs((Float_t)Pt())) { cout << "v0: " << GetName() << " has Pt() > P() !!!" << endl ; return -1000. ; }
72 Float_t mass = Mass() ;
73 Double_t pz = TMath::Sqrt(P()*P() - Pt()*Pt());
74 if(Eta() < 0) { pz = -pz ; }
75 Double_t e = TMath::Sqrt(P()*P() + mass*mass) ;
76 Float_t rapidity = 0.5 * TMath::Log((e + pz)/(e - pz)) ;
79 //////////////////////////////////////////////////////////////////////////////
80 const char* AliFlowV0::Pid() const
82 // Returns the P.Id. in char* basing on the stored pdg code (MostLikelihoodPID()) .
84 const char *name[] = {"gamma","K0","K0s","K0l","Lambda0"} ;
85 int pdgCode = TMath::Abs(MostLikelihoodPID()) ;
88 if(pdgCode == 22) { pId = name[0] ; }
89 else if(pdgCode == 311) { pId = name[1] ; }
90 else if(pdgCode == 310) { pId = name[2] ; }
91 else if(pdgCode == 130) { pId = name[3] ; }
92 else if(pdgCode == 3122) { pId = name[4] ; }
98 //////////////////////////////////////////////////////////////////////////////
99 // void AliFlowV0::SetPid(const Char_t* pid)
101 // // Sets the P.Id. hypotesis of the track from a char* imput ("K0","Lambda0",...).
102 // // The string itself is not stored, what is stored is the PDG code.
104 // if(strstr(pid,"gamma")) { fMostLikelihoodPID = 22 ; }
105 // else if(strstr(pid,"K0")) { fMostLikelihoodPID = 311 ; }
106 // else if(strstr(pid,"K0s")) { fMostLikelihoodPID = 310 ; }
107 // else if(strstr(pid,"K0l")) { fMostLikelihoodPID = 130 ; }
108 // else if(strstr(pid,"Lambda0")) { fMostLikelihoodPID = 3122 ; }
110 // else { fMostLikelihoodPID = 0 ; cout << "AliFlowV0 - !BAD IMPUT!" << endl ; }
112 //////////////////////////////////////////////////////////////////////////////