]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HBTAN/AliHBTParticle.cxx
New class for testing new Stepmanager added. (G. Martinez)
[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), fCalcMass(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), 
21   fPx(px), fPy(py),fPz(pz),fE(etot), 
22   fVx(vx), fVy(vy),fVz(vz),fVt(time)
23 {
24 //mormal constructor
25   
26   if (GetPDG()) {
27      fCalcMass    = GetPDG()->Mass();
28   } else {
29      Double_t a2 = fE*fE -fPx*fPx -fPy*fPy -fPz*fPz;
30      if (a2 >= 0) fCalcMass =  TMath::Sqrt(a2);
31      else         fCalcMass = -TMath::Sqrt(-a2);
32   }
33 }
34
35 //______________________________________________________________________________
36 AliHBTParticle::AliHBTParticle(const TParticle &p):
37    fPdgCode(p.GetPdgCode()),fCalcMass(p.GetCalcMass()),
38    fPx(p.Px()),fPy(p.Py()),fPz(p.Pz()),fE(p.Energy()), 
39    fVx(p.Vx()),fVy(p.Vy()),fVz(p.Vz()),fVt(p.T())
40 {
41  //all copied in the initialization
42  
43 }
44
45 //______________________________________________________________________________
46 const Char_t* AliHBTParticle::GetName() const 
47 {
48    static char def[4] = "XXX";
49    const TParticlePDG *ap = TDatabasePDG::Instance()->GetParticle(fPdgCode);
50    if (ap) return ap->GetName();
51    else    return def;
52 }
53
54
55 //______________________________________________________________________________
56
57