]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HBTAN/AliHBTParticle.cxx
fRefVolumeId for reference volume identification added.
[u/mrichter/AliRoot.git] / HBTAN / AliHBTParticle.cxx
CommitLineData
1b446896 1//Simplified TParticle class
2
3
4#include "AliHBTParticle.h"
5
6#include <TParticle.h>
7
8ClassImp(AliHBTParticle)
9
10//______________________________________________________________________________
11AliHBTParticle::AliHBTParticle():
35d14c47 12 fPdgCode(0), fCalcMass(0),fPx(0), fPy(0),fPz(0),fE(0), fVx(0), fVy(0),fVz(0),fVt(0)
1b446896 13{//empty particle
14}
15
16
17//______________________________________________________________________________
18AliHBTParticle::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):
35d14c47 20 fPdgCode(pdg),
21 fPx(px), fPy(py),fPz(pz),fE(etot),
22 fVx(vx), fVy(vy),fVz(vz),fVt(time)
1b446896 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//______________________________________________________________________________
36AliHBTParticle::AliHBTParticle(const TParticle &p):
eb6db3b6 37 fPdgCode(p.GetPdgCode()),fCalcMass(p.GetCalcMass()),
1b446896 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
eb6db3b6 42
1b446896 43}
44
45//______________________________________________________________________________
46const 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