3 Nikolai Amelin, Ludmila Malinina, Timur Pocheptsov (C) JINR/Dubna
4 amelin@sunhe.jinr.ru, malinina@sunhe.jinr.ru, pocheptsov@sunhe.jinr.ru
11 #include "ParticlePDG.h"
13 #ifndef PARTICLE_INCLUDED
17 Particle::Particle(ParticlePDG *prop):
20 fLastMotherDecayCoor(),
21 fLastMotherDecayMom(),
22 fParticleProperties(prop),
23 fLastInteractionTime(0.),
24 fInteractionNumber(0),
25 fPythiaStatusCode(-1),
31 fFirstDaughterIndex(-1),
32 fLastDaughterIndex(-1),
38 Particle::Particle(ParticlePDG *prop, const TLorentzVector &pos,
39 const TLorentzVector &mom, Double_t lit, Int_t lin, Int_t type):
42 fLastMotherDecayCoor(),
43 fLastMotherDecayMom(),
44 fParticleProperties(prop),
45 fLastInteractionTime(lit),
46 fInteractionNumber(lin),
47 fPythiaStatusCode(-1),
53 fFirstDaughterIndex(-1),
54 fLastDaughterIndex(-1),
59 Particle::Particle(ParticlePDG *prop, const TLorentzVector &pos, const TLorentzVector &mom,
60 Double_t t, Int_t n, Int_t ty, Int_t motherPdg, const TLorentzVector &mPos,
61 const TLorentzVector &mMom):
64 fLastMotherDecayCoor(mPos),
65 fLastMotherDecayMom(mMom),
66 fParticleProperties(prop),
67 fLastInteractionTime(t),
68 fInteractionNumber(n),
69 fPythiaStatusCode(-1),
70 fLastMotherPdg(motherPdg),
75 fFirstDaughterIndex(-1),
76 fLastDaughterIndex(-1),
81 Particle::Particle(const Particle& copy) :
82 fPosition(copy.Pos()),
83 fMomentum(copy.Mom()),
84 fLastMotherDecayCoor(copy.GetLastMotherDecayCoor()),
85 fLastMotherDecayMom(copy.GetLastMotherDecayMom()),
86 fParticleProperties(copy.Def()),
87 fLastInteractionTime(copy.GetLastInterTime()),
88 fInteractionNumber(copy.GetLastInterNumber()),
89 fPythiaStatusCode(copy.GetPythiaStatusCode()),
90 fLastMotherPdg(copy.GetLastMotherPdg()),
91 fType(copy.GetType()),
92 fIndex(copy.GetIndex()),
93 fMotherIndex(copy.GetMother()),
94 fNDaughters(copy.GetNDaughters()),
95 fFirstDaughterIndex(copy.GetFirstDaughterIndex()),
96 fLastDaughterIndex(copy.GetLastDaughterIndex()),
97 fDecayed(copy.GetDecayed())
101 Particle & Particle::operator=(const Particle& /*copy*/) {
106 Int_t Particle::Encoding() const {
107 return fParticleProperties->GetPDG();
110 Double_t Particle::TableMass() const {
111 return fParticleProperties->GetMass();
114 Double_t Particle::Eta() const {
115 if(fMomentum.P() != fMomentum.Pz())
116 return 0.5 * TMath::Log((fMomentum.P() + fMomentum.Pz()) / (fMomentum.P()-fMomentum.Pz()));
120 Double_t Particle::Rapidity() const {
121 if (fMomentum.E() != fMomentum.Pz())
122 return 0.5 * TMath::Log((fMomentum.E() + fMomentum.Pz()) / (fMomentum.E() - fMomentum.Pz()));
126 Double_t Particle::Phi() const {
127 return TMath::Pi()+TMath::ATan2(-fMomentum.Py(), -fMomentum.Px());
130 Double_t Particle::Theta() const {
131 return !fMomentum.Pz() ? TMath::Pi() / 2 : TMath::ACos(fMomentum.Pz() / fMomentum.P());
134 Double_t Particle::Pt() const {
135 return TMath::Sqrt(fMomentum.Px() * fMomentum.Px() + fMomentum.Py() * fMomentum.Py());
138 Double_t S(const TLorentzVector &v1, const TLorentzVector &v2) {
139 return TMath::Power(v1.T() + v2.T(), 2) - TMath::Power(v1.X() + v2.X(), 2) -
140 TMath::Power(v1.Y() + v2.Y(), 2) - TMath::Power(v1.Z() + v2.Z(), 2);
143 Double_t T(const TLorentzVector & v1, const TLorentzVector & v2) {
144 return TMath::Power(v1.T() - v2.T(), 2) - TMath::Power(v1.X() - v2.X(), 2) -
145 TMath::Power(v1.Y() - v2.Y(), 2) - TMath::Power(v1.Z() - v2.Z(), 2);
148 void ParticleAllocator::AddParticle(const Particle & p, List_t &list) {
149 if(fFreeNodes.empty())
152 list.splice(list.end(), fFreeNodes, fFreeNodes.begin());
157 void ParticleAllocator::FreeListNode(List_t & list, LPIT_t it) {
158 fFreeNodes.splice(fFreeNodes.end(), list, it);
161 void ParticleAllocator::FreeList(List_t & list) {
162 fFreeNodes.splice(fFreeNodes.end(), list);