]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HBTAN/AliHBTParticle.cxx
Bug correction - Fortan sources where not commpiled
[u/mrichter/AliRoot.git] / HBTAN / AliHBTParticle.cxx
1 //Simplified TParticle class
2
3
4 #include "AliHBTParticle.h"
5
6 #include <TParticle.h>
7
8 ClassImp(AliHBTParticle)
9
10 //______________________________________________________________________________
11 AliHBTParticle::AliHBTParticle():  
12                 fPdgCode(0), fPx(0), fPy(0),fPz(0),fE(0), fVx(0), fVy(0),fVz(0),fVt(0)
13 {//empty particle
14 }
15
16
17 //______________________________________________________________________________
18 AliHBTParticle::AliHBTParticle(Int_t pdg, Double_t px, Double_t py, Double_t pz, Double_t etot,
19                      Double_t vx, Double_t vy, Double_t vz, Double_t time):
20   fPdgCode(pdg), fPx(px), fPy(py),fPz(pz),fE(etot), 
21                  fVx(vx), fVy(vy),fVz(vz),fVt(time)
22 {
23 //mormal constructor
24   
25   if (GetPDG()) {
26      fCalcMass    = GetPDG()->Mass();
27   } else {
28      Double_t a2 = fE*fE -fPx*fPx -fPy*fPy -fPz*fPz;
29      if (a2 >= 0) fCalcMass =  TMath::Sqrt(a2);
30      else         fCalcMass = -TMath::Sqrt(-a2);
31   }
32 }
33
34 //______________________________________________________________________________
35 AliHBTParticle::AliHBTParticle(const TParticle &p):
36    fPdgCode(p.GetPdgCode()), 
37    fPx(p.Px()),fPy(p.Py()),fPz(p.Pz()),fE(p.Energy()), 
38    fVx(p.Vx()),fVy(p.Vy()),fVz(p.Vz()),fVt(p.T())
39 {
40  //all copied in the initialization
41 }
42
43 //______________________________________________________________________________
44 const Char_t* AliHBTParticle::GetName() const 
45 {
46    static char def[4] = "XXX";
47    const TParticlePDG *ap = TDatabasePDG::Instance()->GetParticle(fPdgCode);
48    if (ap) return ap->GetName();
49    else    return def;
50 }
51
52
53 //______________________________________________________________________________
54
55