]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/FLOW/Attic/AliFlowV0.cxx
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGCF / FLOW / Attic / AliFlowV0.cxx
1 //////////////////////////////////////////////////////////////////////
2 //
3 // $Id: AliFlowV0.cxx 18618 2007-05-16 15:38:22Z snelling $
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 "AliFlowTrack.h"
21 #include "AliFlowEvent.h"
22
23 #include <iostream>
24 using namespace std; //required for resolving the 'cout' symbol
25
26 ClassImp(AliFlowV0) 
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)
31 {
32  // default constructor  
33   for(Int_t dd=0;dd<3;dd++) { fCrossPoint[dd] = 0. ; }
34   // fDaughterP = -1  ; fDaughterN = -1  ;
35 }
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)
40 {
41  // TNamed constructor 
42  
43  SetName(name) ;
44  AliFlowV0() ;
45 }
46 //////////////////////////////////////////////////////////////////////////////
47 AliFlowV0::~AliFlowV0() 
48 {
49  // default destructor (dummy)
50 }
51 //////////////////////////////////////////////////////////////////////////////
52
53 //////////////////////////////////////////////////////////////////////////////
54 Float_t  AliFlowV0::P() const 
55
56  // Returns the reconstructed momentum of the v0
57
58  if(Pt()<=0)  { return 0. ; }
59  if(Eta()==0) { return 0. ; }
60
61  float momentum = Pt()/TMath::Sqrt(1-(tanh(Eta())*tanh(Eta()))) ; 
62  return momentum; 
63 }
64 //////////////////////////////////////////////////////////////////////////////
65 Float_t  AliFlowV0::Y() const 
66 {
67  // Rapidity of the v0
68
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. ; }
71  // -
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)) ;
77  return rapidity ;
78 }
79 //////////////////////////////////////////////////////////////////////////////
80 const char* AliFlowV0::Pid() const
81 {
82  // Returns the P.Id. in char* basing on the stored pdg code (MostLikelihoodPID()) .
83  
84  const char *name[] = {"gamma","K0","K0s","K0l","Lambda0"} ;
85  int pdgCode = TMath::Abs(MostLikelihoodPID()) ;
86
87  TString pId = "" ;
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] ; }
93  // ...
94  else                     { pId = "0" ; }
95  
96  return pId.Data() ; 
97 }
98 //////////////////////////////////////////////////////////////////////////////
99 // void AliFlowV0::SetPid(const Char_t* pid)            
100 // { 
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.
103 //  
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 ; }
109 //  // ...
110 //  else { fMostLikelihoodPID = 0 ; cout << "AliFlowV0 - !BAD IMPUT!" << endl ; }
111 // }
112 //////////////////////////////////////////////////////////////////////////////