]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HBTAN/AliHBTParticle.h
Smaller changes
[u/mrichter/AliRoot.git] / HBTAN / AliHBTParticle.h
CommitLineData
1b446896 1#ifndef ALIHBTPARTICLE
2#define ALIHBTPARTICLE
3
4//Ali HBT Particle: simplified class TParticle
5//Simplified in order to minimize the size of object
6// - we want to keep a lot of such a objects in memory
7
8#include <TObject.h>
9#include <TLorentzVector.h>
10#include <TMath.h>
11#include <TDatabasePDG.h>
12
13class TParticle;
14
15class AliHBTParticle : public TObject
16{
17
18public:
19 // ****** constructors and destructor
20 AliHBTParticle();
21
22 AliHBTParticle(Int_t pdg, Double_t px, Double_t py, Double_t pz, Double_t etot,
23 Double_t vx, Double_t vy, Double_t vz, Double_t time);
24
25 AliHBTParticle(const TParticle& p);
26
27 virtual ~AliHBTParticle(){};
28
29
30 Int_t GetPdgCode () const { return fPdgCode; }
31 Double_t GetCalcMass () const { return fCalcMass; }
32 Double_t GetMass () { return GetPDG()->Mass();}
33
34 TParticlePDG* GetPDG (){return TDatabasePDG::Instance()->GetParticle(fPdgCode);}
35
36 Int_t Beauty () { return GetPDG()->Beauty(); }
37 Int_t Charm () { return GetPDG()->Charm(); }
38 Int_t Strangeness () { return GetPDG()->Strangeness();}
39 void ProductionVertex(TLorentzVector &v) { v.SetXYZT(fVx,fVy,fVz,fVt);}
40
41
42 Double_t Vx () const { return fVx;}
43 Double_t Vy () const { return fVy;}
44 Double_t Vz () const { return fVz;}
45 Double_t T () const { return fVt;}
46
47 Double_t Px () const { return fPx; } //X coordinate of the momentum
48 Double_t Py () const { return fPy; } //Y coordinate of the momentum
49 Double_t Pz () const { return fPz; } //Z coordinate of the momentum
50 Double_t P () const //momentum
51 { return TMath::Sqrt(fPx*fPx+fPy*fPy+fPz*fPz); }
52
53 void Momentum(TLorentzVector &v) { v.SetPxPyPzE(fPx,fPy,fPz,fE);}
54
55 Double_t Pt () const //transverse momentum
56 { return TMath::Sqrt(fPx*fPx+fPy*fPy); }
57 Double_t Energy() const { return fE; }
58
59 //Pseudo Rapidity
60 Double_t Eta () const { if (P() != fPz) return 0.5*TMath::Log((P()+fPz)/(P()-fPz));
61 else return 1.e30;}
62
63 //Rapidity
64 Double_t Y () const { if (fE != fPz) return 0.5*TMath::Log((fE+fPz)/(fE-fPz));
65 else return 1.e30;}
66
67 Double_t Phi () const { return kPI+TMath::ATan2(-fPy,-fPx); }
68
69 Double_t Theta () const { return (fPz==0)?kPI/2:TMath::ACos(fPz/P()); }
70
71 // setters
72
73
74 void SetMomentum(Double_t px, Double_t py, Double_t pz, Double_t e)
75 {fPx=px; fPy=py; fPz=pz; fE=e;}
76 void SetMomentum(const TLorentzVector& p)
77 {SetMomentum(p.Px(),p.Py(),p.Pz(),p.Energy());}
78
79 void SetProductionVertex(Double_t vx, Double_t vy, Double_t vz, Double_t t)
80 {fVx=vx; fVy=vy; fVz=vz; fVt=t;}
81 void SetProductionVertex(const TLorentzVector& v)
82 {SetProductionVertex(v.X(),v.Y(),v.Z(),v.T());}
83 const Char_t* GetName() const;
84
85protected:
86
87 Int_t fPdgCode; // PDG code of the particle
88 Double_t fCalcMass; // Calculated mass
89
90 Double_t fPx; // x component of momentum
91 Double_t fPy; // y component of momentum
92 Double_t fPz; // z component of momentum
93 Double_t fE; // Energy
94
95 Double_t fVx; // x of production vertex
96 Double_t fVy; // y of production vertex
97 Double_t fVz; // z of production vertex
98 Double_t fVt; // t of production vertex
99
100public:
101 ClassDef(AliHBTParticle,1) // TParticle vertex particle information
102};
103
104#endif