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 "AliFlowConstants.h"
22 using namespace std; //required for resolving the 'cout' symbol
25 //////////////////////////////////////////////////////////////////////////////
26 AliFlowV0::AliFlowV0()
28 // default constructor
39 for(Int_t dd=0;dd<3;dd++) { fCrossPoint[dd] = 0. ; }
40 for(Int_t dd=0;dd<2;dd++) { fDaughters[dd] = 0 ; }
42 //////////////////////////////////////////////////////////////////////////////
43 AliFlowV0::AliFlowV0(const Char_t* name)
50 //////////////////////////////////////////////////////////////////////////////
51 AliFlowV0::~AliFlowV0()
53 // default destructor (dummy)
55 //////////////////////////////////////////////////////////////////////////////
57 //////////////////////////////////////////////////////////////////////////////
58 Float_t AliFlowV0::P() const
60 // Returns the reconstructed momentum of the v0
62 float momentum = Pt()/TMath::Sqrt(1-(tanh(Eta())*tanh(Eta()))) ;
65 //////////////////////////////////////////////////////////////////////////////
66 Float_t AliFlowV0::Y() const
70 if(TMath::Abs((Float_t)P()) == TMath::Abs((Float_t)Pt())) { return 0. ; }
71 else if(TMath::Abs((Float_t)P()) < TMath::Abs((Float_t)Pt())) { cout << "v0: " << GetName() << "has Pt() > P() !!!" << endl ; }
74 double Pz = TMath::Sqrt(P()*P() - Pt()*Pt());
75 if (Eta() < 0) { Pz = -Pz ; }
76 double E = TMath::Sqrt(P()*P() + M*M) ;
77 float rapidity = 0.5*TMath::Log((E + Pz)/(E - Pz)) ;
80 //////////////////////////////////////////////////////////////////////////////
81 void AliFlowV0::SetDaughters(AliFlowTrack* pos, AliFlowTrack* neg)
83 // Sets positive and negative daughter tracks from the TrackCollection()
88 //////////////////////////////////////////////////////////////////////////////
89 void AliFlowV0::CrossPoint(Float_t Pxyz[3]) const
91 // Coordinates of the v0
93 for(Int_t ii=0;ii<3;ii++) { Pxyz[ii] = fCrossPoint[ii] ; }
95 //////////////////////////////////////////////////////////////////////////////
96 // TVector3 AliFlowV0::CrossPoint() const
98 // // Coordinates of the v0
101 // pxyz.SetXYZ(fCrossPoint[0],fCrossPoint[1],fCrossPoint[2]) ;
104 //////////////////////////////////////////////////////////////////////////////
105 void AliFlowV0::SetCrossPoint(Float_t pox,Float_t poy,Float_t poz)
107 // Sets the coordinates of the v0
109 fCrossPoint[0] = pox ; fCrossPoint[1] = poy ; fCrossPoint[2] = poz ;
111 //////////////////////////////////////////////////////////////////////////////
112 const char* AliFlowV0::Pid() const
114 // Returns the P.Id. in characters (,...) basing on the stored pdg code
115 // (MostLikelihoodPID()) .
117 const char *name[] = {"gamma","K0","K0s","K0l","Lambda0"} ;
118 int pdg_code = TMath::Abs(MostLikelihoodPID()) ;
121 if(pdg_code == 22) { p_id = name[0] ; }
122 else if(pdg_code == 311) { p_id = name[1] ; }
123 else if(pdg_code == 310) { p_id = name[2] ; }
124 else if(pdg_code == 130) { p_id = name[3] ; }
125 else if(pdg_code == 3122) { p_id = name[4] ; }
127 else { p_id = "0" ; }
131 //////////////////////////////////////////////////////////////////////////////
132 void AliFlowV0::SetPid(const Char_t* pid)
134 // Sets the P.Id. hypotesis of the track from a String imput ("K0","K0s",
135 // "K0l","Lambda0"). The string itself is not stored, what is stored is the
138 if(strstr(pid,"gamma")) { fMostLikelihoodPID = 22 ; }
139 else if(strstr(pid,"K0")) { fMostLikelihoodPID = 311 ; }
140 else if(strstr(pid,"K0s")) { fMostLikelihoodPID = 310 ; }
141 else if(strstr(pid,"K0l")) { fMostLikelihoodPID = 130 ; }
142 else if(strstr(pid,"Lambda0")) { fMostLikelihoodPID = 3122 ; }
144 else { fMostLikelihoodPID = 0 ; cout << "AliFlowV0 - !BAD IMPUT!" << endl ; }
146 //////////////////////////////////////////////////////////////////////////////
147 Float_t AliFlowV0::Mass() const { return fMass ; }
148 Float_t AliFlowV0::Phi() const { return fPhi; }
149 Float_t AliFlowV0::Eta() const { return fEta; }
150 Float_t AliFlowV0::Pt() const { return fPt; }
151 Short_t AliFlowV0::Charge() const { return 0 ; }
152 Float_t AliFlowV0::Dca() const { return fDca ; }
153 Float_t AliFlowV0::Chi2() const { return fChi2; }
154 Float_t AliFlowV0::CrossDca() const { return fCrossDCA ; }
155 Float_t AliFlowV0::V0Lenght() const { return TMath::Sqrt(fCrossPoint[0]*fCrossPoint[0] + fCrossPoint[1]*fCrossPoint[1] + fCrossPoint[2]*fCrossPoint[2]) ; }
156 Float_t AliFlowV0::Sigma() const { return fSigma ; }
157 Int_t AliFlowV0::MostLikelihoodPID() const { return fMostLikelihoodPID; }
158 Int_t AliFlowV0::Label() const { return fLabel ; }
159 AliFlowTrack* AliFlowV0::DaughterP() const { return fDaughters[0] ; }
160 AliFlowTrack* AliFlowV0::DaughterN() const { return fDaughters[1] ; }
161 //////////////////////////////////////////////////////////////////////////////
162 void AliFlowV0::SetMostLikelihoodPID(Int_t val) { fMostLikelihoodPID = val ; }
163 void AliFlowV0::SetVmass(Float_t mass) { fMass = mass ; }
164 void AliFlowV0::SetPhi(Float_t phi) { fPhi = phi; }
165 void AliFlowV0::SetEta(Float_t eta) { fEta = eta; }
166 void AliFlowV0::SetPt(Float_t pt) { fPt = pt; }
167 void AliFlowV0::SetChi2(Float_t chi2) { fChi2 = chi2; }
168 void AliFlowV0::SetDca(Float_t dca) { fDca = dca; }
169 void AliFlowV0::SetCrossDca(Float_t dca) { fCrossDCA = dca ; }
170 void AliFlowV0::SetSigma(Float_t sigma) { fSigma = sigma ; }
171 void AliFlowV0::SetLabel(Int_t label) { fLabel = label ; }
172 //////////////////////////////////////////////////////////////////////////////