]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FLOW/AliFlowV0.cxx
Trigger maximum amplitude patch value and postion stored in ESDs, possibility to...
[u/mrichter/AliRoot.git] / PWG2 / FLOW / AliFlowV0.cxx
CommitLineData
30a892e3 1//////////////////////////////////////////////////////////////////////
2//
3// $Id$
4//
5// Author: Emanuele Simili
6//
7//////////////////////////////////////////////////////////////////////
8//_____________________________________________________________
9//
10// Description:
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.
17//
18
19#include "AliFlowV0.h"
20#include "AliFlowConstants.h"
21#include <iostream>
22using namespace std; //required for resolving the 'cout' symbol
23
f847c9e2 24ClassImp(AliFlowV0)
30a892e3 25//////////////////////////////////////////////////////////////////////////////
26AliFlowV0::AliFlowV0()
27{
28 // default constructor
29
30 fPhi = 0. ;
31 fEta = 0. ;
32 fPt = 0. ;
33 fChi2 = 0. ;
34 fMass = 0. ;
35 fDca = 0. ;
36 fCrossDCA = 0. ;
37 fSigma = 1. ;
38 fLabel = 0 ;
39 for(Int_t dd=0;dd<3;dd++) { fCrossPoint[dd] = 0. ; }
40 for(Int_t dd=0;dd<2;dd++) { fDaughters[dd] = 0 ; }
41}
42//////////////////////////////////////////////////////////////////////////////
43AliFlowV0::AliFlowV0(const Char_t* name)
44{
45 // TNamed constructor
46
47 SetName(name) ;
48 AliFlowV0() ;
49}
50//////////////////////////////////////////////////////////////////////////////
51AliFlowV0::~AliFlowV0()
52{
53 // default destructor (dummy)
54}
55//////////////////////////////////////////////////////////////////////////////
56
57//////////////////////////////////////////////////////////////////////////////
58Float_t AliFlowV0::P() const
59{
60 // Returns the reconstructed momentum of the v0
61
9777bfcb 62 if(Pt()<=0) { return 0. ; }
63 if(Eta()==0) { return 0. ; }
64
30a892e3 65 float momentum = Pt()/TMath::Sqrt(1-(tanh(Eta())*tanh(Eta()))) ;
66 return momentum;
67}
68//////////////////////////////////////////////////////////////////////////////
69Float_t AliFlowV0::Y() const
70{
71 // Rapidity of the v0
72
73 if(TMath::Abs((Float_t)P()) == TMath::Abs((Float_t)Pt())) { return 0. ; }
9777bfcb 74 else if(TMath::Abs((Float_t)P()) < TMath::Abs((Float_t)Pt())) { cout << "v0: " << GetName() << "has Pt() > P() !!!" << endl ; return -1000. ; }
30a892e3 75 // -
76 float M = Mass() ;
77 double Pz = TMath::Sqrt(P()*P() - Pt()*Pt());
78 if (Eta() < 0) { Pz = -Pz ; }
79 double E = TMath::Sqrt(P()*P() + M*M) ;
80 float rapidity = 0.5*TMath::Log((E + Pz)/(E - Pz)) ;
81 return rapidity ;
82}
83//////////////////////////////////////////////////////////////////////////////
84void AliFlowV0::SetDaughters(AliFlowTrack* pos, AliFlowTrack* neg)
85{
86 // Sets positive and negative daughter tracks from the TrackCollection()
87
88 fDaughters[0] = pos ;
89 fDaughters[1] = neg ;
90}
91//////////////////////////////////////////////////////////////////////////////
92void AliFlowV0::CrossPoint(Float_t Pxyz[3]) const
93{
94 // Coordinates of the v0
95
96 for(Int_t ii=0;ii<3;ii++) { Pxyz[ii] = fCrossPoint[ii] ; }
97}
98//////////////////////////////////////////////////////////////////////////////
99// TVector3 AliFlowV0::CrossPoint() const
100// {
101// // Coordinates of the v0
102//
103// TVector3 pxyz ;
104// pxyz.SetXYZ(fCrossPoint[0],fCrossPoint[1],fCrossPoint[2]) ;
105// return pxyz ;
106// }
107//////////////////////////////////////////////////////////////////////////////
108void AliFlowV0::SetCrossPoint(Float_t pox,Float_t poy,Float_t poz)
109{
110 // Sets the coordinates of the v0
111
112 fCrossPoint[0] = pox ; fCrossPoint[1] = poy ; fCrossPoint[2] = poz ;
113}
114//////////////////////////////////////////////////////////////////////////////
115const char* AliFlowV0::Pid() const
116{
117 // Returns the P.Id. in characters (,...) basing on the stored pdg code
118 // (MostLikelihoodPID()) .
119
120 const char *name[] = {"gamma","K0","K0s","K0l","Lambda0"} ;
121 int pdg_code = TMath::Abs(MostLikelihoodPID()) ;
122
123 TString p_id = "" ;
124 if(pdg_code == 22) { p_id = name[0] ; }
125 else if(pdg_code == 311) { p_id = name[1] ; }
126 else if(pdg_code == 310) { p_id = name[2] ; }
127 else if(pdg_code == 130) { p_id = name[3] ; }
128 else if(pdg_code == 3122) { p_id = name[4] ; }
129 // ...
130 else { p_id = "0" ; }
131
132 return p_id.Data() ;
133}
134//////////////////////////////////////////////////////////////////////////////
135void AliFlowV0::SetPid(const Char_t* pid)
136{
137 // Sets the P.Id. hypotesis of the track from a String imput ("K0","K0s",
138 // "K0l","Lambda0"). The string itself is not stored, what is stored is the
139 // PDG code.
140
141 if(strstr(pid,"gamma")) { fMostLikelihoodPID = 22 ; }
142 else if(strstr(pid,"K0")) { fMostLikelihoodPID = 311 ; }
143 else if(strstr(pid,"K0s")) { fMostLikelihoodPID = 310 ; }
144 else if(strstr(pid,"K0l")) { fMostLikelihoodPID = 130 ; }
145 else if(strstr(pid,"Lambda0")) { fMostLikelihoodPID = 3122 ; }
146 // ...
147 else { fMostLikelihoodPID = 0 ; cout << "AliFlowV0 - !BAD IMPUT!" << endl ; }
148}
149//////////////////////////////////////////////////////////////////////////////
150Float_t AliFlowV0::Mass() const { return fMass ; }
151Float_t AliFlowV0::Phi() const { return fPhi; }
152Float_t AliFlowV0::Eta() const { return fEta; }
153Float_t AliFlowV0::Pt() const { return fPt; }
154Short_t AliFlowV0::Charge() const { return 0 ; }
155Float_t AliFlowV0::Dca() const { return fDca ; }
156Float_t AliFlowV0::Chi2() const { return fChi2; }
157Float_t AliFlowV0::CrossDca() const { return fCrossDCA ; }
158Float_t AliFlowV0::V0Lenght() const { return TMath::Sqrt(fCrossPoint[0]*fCrossPoint[0] + fCrossPoint[1]*fCrossPoint[1] + fCrossPoint[2]*fCrossPoint[2]) ; }
159Float_t AliFlowV0::Sigma() const { return fSigma ; }
160Int_t AliFlowV0::MostLikelihoodPID() const { return fMostLikelihoodPID; }
161Int_t AliFlowV0::Label() const { return fLabel ; }
162AliFlowTrack* AliFlowV0::DaughterP() const { return fDaughters[0] ; }
163AliFlowTrack* AliFlowV0::DaughterN() const { return fDaughters[1] ; }
164//////////////////////////////////////////////////////////////////////////////
165void AliFlowV0::SetMostLikelihoodPID(Int_t val) { fMostLikelihoodPID = val ; }
166void AliFlowV0::SetVmass(Float_t mass) { fMass = mass ; }
167void AliFlowV0::SetPhi(Float_t phi) { fPhi = phi; }
168void AliFlowV0::SetEta(Float_t eta) { fEta = eta; }
169void AliFlowV0::SetPt(Float_t pt) { fPt = pt; }
170void AliFlowV0::SetChi2(Float_t chi2) { fChi2 = chi2; }
171void AliFlowV0::SetDca(Float_t dca) { fDca = dca; }
172void AliFlowV0::SetCrossDca(Float_t dca) { fCrossDCA = dca ; }
173void AliFlowV0::SetSigma(Float_t sigma) { fSigma = sigma ; }
174void AliFlowV0::SetLabel(Int_t label) { fLabel = label ; }
175//////////////////////////////////////////////////////////////////////////////