1 //////////////////////////////////////////////////////////////////////
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 fDaughterP(0x0), fDaughterN(0x0)
31 // default constructor
43 for(Int_t dd=0;dd<3;dd++) { fCrossPoint[dd] = 0. ; }
44 // fDaughterP = 0 ; fDaughterN = 0 ;
46 //////////////////////////////////////////////////////////////////////////////
47 AliFlowV0::AliFlowV0(const Char_t* name)
54 //////////////////////////////////////////////////////////////////////////////
55 AliFlowV0::~AliFlowV0()
57 // default destructor (dummy)
59 //////////////////////////////////////////////////////////////////////////////
61 //////////////////////////////////////////////////////////////////////////////
62 Float_t AliFlowV0::P() const
64 // Returns the reconstructed momentum of the v0
66 if(Pt()<=0) { return 0. ; }
67 if(Eta()==0) { return 0. ; }
69 float momentum = Pt()/TMath::Sqrt(1-(tanh(Eta())*tanh(Eta()))) ;
72 //////////////////////////////////////////////////////////////////////////////
73 Float_t AliFlowV0::Y() const
77 if(TMath::Abs((Float_t)P()) == TMath::Abs((Float_t)Pt())) { return 0. ; }
78 else if(TMath::Abs((Float_t)P()) < TMath::Abs((Float_t)Pt())) { cout << "v0: " << GetName() << "has Pt() > P() !!!" << endl ; return -1000. ; }
80 Float_t mass = Mass() ;
81 Double_t pz = TMath::Sqrt(P()*P() - Pt()*Pt());
82 if(Eta() < 0) { pz = -pz ; }
83 Double_t e = TMath::Sqrt(P()*P() + mass*mass) ;
84 Float_t rapidity = 0.5 * TMath::Log((e + pz)/(e - pz)) ;
87 //////////////////////////////////////////////////////////////////////////////
88 const char* AliFlowV0::Pid() const
90 // Returns the P.Id. in char* basing on the stored pdg code (MostLikelihoodPID()) .
92 const char *name[] = {"gamma","K0","K0s","K0l","Lambda0"} ;
93 int pdgCode = TMath::Abs(MostLikelihoodPID()) ;
96 if(pdgCode == 22) { pId = name[0] ; }
97 else if(pdgCode == 311) { pId = name[1] ; }
98 else if(pdgCode == 310) { pId = name[2] ; }
99 else if(pdgCode == 130) { pId = name[3] ; }
100 else if(pdgCode == 3122) { pId = name[4] ; }
106 //////////////////////////////////////////////////////////////////////////////
107 void AliFlowV0::SetPid(const Char_t* pid)
109 // Sets the P.Id. hypotesis of the track from a char* imput ("K0","Lambda0",...).
110 // The string itself is not stored, what is stored is the PDG code.
112 if(strstr(pid,"gamma")) { fMostLikelihoodPID = 22 ; }
113 else if(strstr(pid,"K0")) { fMostLikelihoodPID = 311 ; }
114 else if(strstr(pid,"K0s")) { fMostLikelihoodPID = 310 ; }
115 else if(strstr(pid,"K0l")) { fMostLikelihoodPID = 130 ; }
116 else if(strstr(pid,"Lambda0")) { fMostLikelihoodPID = 3122 ; }
118 else { fMostLikelihoodPID = 0 ; cout << "AliFlowV0 - !BAD IMPUT!" << endl ; }
120 //////////////////////////////////////////////////////////////////////////////