CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Particle.cc
Go to the documentation of this file.
1 /*
2 
3 Nikolai Amelin, Ludmila Malinina, Timur Pocheptsov (C) JINR/Dubna
4 amelin@sunhe.jinr.ru, malinina@sunhe.jinr.ru, pocheptsov@sunhe.jinr.ru
5 November. 2, 2005
6 
7 */
8 
9 #include <TMath.h>
12 
14  : fParticleProperties(prop),
15  fLastInteractionTime(0.),
16  fInteractionNumber(0),
17  fPythiaStatusCode(-1),
18  fLastMotherPdg(0),
19  fType(0),
20  fIndex(-1),
21  fMotherIndex(-1),
22  fNDaughters(0),
23  fFirstDaughterIndex(-1),
24  fLastDaughterIndex(-1),
25  fDecayed(kFALSE)
26 {}
27 
28 Particle::Particle(ParticlePDG *prop, const TLorentzVector &pos,
29  const TLorentzVector &mom, double lit, int lin, int type)
30  : fPosition(pos),
31  fMomentum(mom),
32  fPythiaStatusCode(-1),
33  fIndex(-1),
34  fMotherIndex(-1),
35  fNDaughters(0),
36  fFirstDaughterIndex(-1),
37  fLastDaughterIndex(-1),
38  fDecayed(kFALSE)
39 {
41  fInteractionNumber = lin;
42  fParticleProperties = prop;
43  fType = type;
44 }
45 
46 Particle::Particle(ParticlePDG *prop, const TLorentzVector &pos, const TLorentzVector &mom,
47  double t, int n, int ty, int motherPdg, const TLorentzVector &mPos,
48  const TLorentzVector &mMom)
49  : fPosition(pos), fMomentum(mom),
50  fLastMotherDecayCoor(mPos),
51  fLastMotherDecayMom(mMom),
52  fPythiaStatusCode(-1),
53  fIndex(-1),
54  fMotherIndex(-1),
55  fNDaughters(0),
56  fFirstDaughterIndex(-1),
57  fLastDaughterIndex(-1),
58  fDecayed(kFALSE)
59 {
60  fParticleProperties = prop;
63  fType = ty;
64  fLastMotherPdg = motherPdg;
65 }
66 
67 int Particle::Encoding() const {
68  return fParticleProperties->GetPDG();
69 }
70 
71 double Particle::TableMass() const {
72  return fParticleProperties->GetMass();
73 }
74 
75 double Particle::Eta() const {
76  if(fMomentum.P() != fMomentum.Pz())
77  return 0.5 * TMath::Log((fMomentum.P() + fMomentum.Pz()) / (fMomentum.P()-fMomentum.Pz()));
78  else return 1.e30;
79 }
80 
81 double Particle::Rapidity() const {
82  if (fMomentum.E() != fMomentum.Pz())
83  return 0.5 * TMath::Log((fMomentum.E() + fMomentum.Pz()) / (fMomentum.E() - fMomentum.Pz()));
84  else return 1.e30;
85 }
86 
87 double Particle::Phi() const {
88  return TMath::Pi()+TMath::ATan2(-fMomentum.Py(), -fMomentum.Px());
89 }
90 
91 double Particle::Theta() const {
92  return !fMomentum.Pz() ? TMath::Pi() / 2 : TMath::ACos(fMomentum.Pz() / fMomentum.P());
93 }
94 
95 double Particle::Pt() const {
96  return TMath::Sqrt(fMomentum.Px() * fMomentum.Px() + fMomentum.Py() * fMomentum.Py());
97 }
98 
99 double S(const TLorentzVector &v1, const TLorentzVector &v2) {
100  return TMath::Power(v1.T() + v2.T(), 2) - TMath::Power(v1.X() + v2.X(), 2) -
101  TMath::Power(v1.Y() + v2.Y(), 2) - TMath::Power(v1.Z() + v2.Z(), 2);
102 }
103 
104 double T(const TLorentzVector & v1, const TLorentzVector & v2) {
105  return TMath::Power(v1.T() - v2.T(), 2) - TMath::Power(v1.X() - v2.X(), 2) -
106  TMath::Power(v1.Y() - v2.Y(), 2) - TMath::Power(v1.Z() - v2.Z(), 2);
107 }
108 
110  if(fFreeNodes.empty())
111  list.push_back(p);
112  else {
113  list.splice(list.end(), fFreeNodes, fFreeNodes.begin());
114  list.back() = p;
115  }
116 }
117 
119  fFreeNodes.splice(fFreeNodes.end(), list, it);
120 }
121 
123  fFreeNodes.splice(fFreeNodes.end(), list);
124 }
const double Pi
type
Definition: HCALResponse.h:21
int GetPDG()
Definition: ParticlePDG.h:67
double Phi() const
Definition: Particle.cc:87
std::list< Particle > List_t
Definition: Particle.h:141
int Encoding() const
Definition: Particle.cc:67
void FreeListNode(List_t &list, LPIT_t it)
Definition: Particle.cc:118
double Pt() const
Definition: Particle.cc:95
int fLastMotherPdg
Definition: Particle.h:31
ParticlePDG * fParticleProperties
Definition: Particle.h:27
void FreeList(List_t &list)
Definition: Particle.cc:122
double Eta() const
Definition: Particle.cc:75
double fLastInteractionTime
Definition: Particle.h:28
double TableMass() const
Definition: Particle.cc:71
List_t fFreeNodes
Definition: Particle.h:151
TLorentzVector fMomentum
Definition: Particle.h:24
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:99
int fType
Definition: Particle.h:32
int fInteractionNumber
Definition: Particle.h:29
double GetMass()
Definition: ParticlePDG.h:68
double Rapidity() const
Definition: Particle.cc:81
void AddParticle(const Particle &particle, List_t &list)
Definition: Particle.cc:109
std::list< Particle >::iterator LPIT_t
Definition: Particle.h:142
long double T
double Theta() const
Definition: Particle.cc:91
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
Particle(ParticlePDG *pdg=0)
Definition: Particle.cc:13