CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes
Particle Class Reference

#include <Particle.h>

Classes

class  Particle
 

Public Member Functions

void Boost (const TLorentzVector &val)
 
void Boost (const TVector3 &val)
 
ParticlePDGDef () const
 
ParticlePDGDef (ParticlePDG *newProp)
 
double E () const
 
double E (double val)
 
int Encoding () const
 
double Eta () const
 
bool GetDecayed () const
 
int GetFirstDaughterIndex ()
 
int GetIndex ()
 
int GetLastDaughterIndex ()
 
int GetLastInterNumber () const
 
double GetLastInterTime () const
 
const TLorentzVector & GetLastMotherDecayCoor () const
 
const TLorentzVector & GetLastMotherDecayMom () const
 
int GetLastMotherPdg () const
 
int GetMother ()
 
int GetNDaughters ()
 
int GetPythiaStatusCode ()
 
int GetType () const
 
void IncInter ()
 
TLorentzVector & Mom ()
 
const TLorentzVector & Mom () const
 
TLorentzVector & Mom (const TLorentzVector &val)
 
 Particle (ParticlePDG *pdg, const TLorentzVector &pos, const TLorentzVector &mom, double lastInterTime, int lastInterNum, int type, int motherPdg, const TLorentzVector &motherPos, const TLorentzVector &motherMom)
 
 Particle (ParticlePDG *pdg, const TLorentzVector &pos, const TLorentzVector &mom, double lastInterTime=0., int lastInterNum=0, int type=0)
 
 Particle (ParticlePDG *pdg=nullptr)
 
double Phi () const
 
TLorentzVector & Pos ()
 
const TLorentzVector & Pos () const
 
TLorentzVector & Pos (const TLorentzVector &val)
 
double Pt () const
 
double Px () const
 
double Px (double val)
 
double Py () const
 
double Py (double val)
 
double Pz () const
 
double Pz (double val)
 
double Rapidity () const
 
void SetDecayed ()
 
void SetFirstDaughterIndex (int index)
 
int SetIndex ()
 
void SetLastDaughterIndex (int index)
 
void SetLastInterNumber (int value)
 
void SetLastInterTime (double value)
 
TLorentzVector & SetLastMotherDecayCoor (const TLorentzVector &val)
 
TLorentzVector & SetLastMotherDecayMom (const TLorentzVector &val)
 
void SetLastMotherPdg (int value)
 
void SetMother (int value)
 
void SetPythiaStatusCode (int code)
 
void SetType (int value)
 
void Shift (const TVector3 &val)
 
double T () const
 
double T (double val)
 
double TableMass () const
 
double Theta () const
 
void TransformMomentum (const TRotation &rotator)
 
void TransformPosition (const TRotation &rotator)
 
double X () const
 
double X (double val)
 
double Y () const
 
double Y (double val)
 
double Z () const
 
double Z (double val)
 

Static Public Member Functions

static int GetLastIndex ()
 
static void InitIndexing ()
 

Protected Attributes

bool fDecayed
 
int fFirstDaughterIndex
 
int fIndex
 
int fInteractionNumber
 
int fLastDaughterIndex
 
double fLastInteractionTime
 
TLorentzVector fLastMotherDecayCoor
 
TLorentzVector fLastMotherDecayMom
 
int fLastMotherPdg
 
TLorentzVector fMomentum
 
int fMotherIndex
 
int fNDaughters
 
ParticlePDGfParticleProperties
 
TLorentzVector fPosition
 
int fPythiaStatusCode
 
int fType
 

Static Protected Attributes

static int fLastIndex
 

Detailed Description

Definition at line 21 of file Particle.h.

Constructor & Destructor Documentation

◆ Particle() [1/3]

Particle::Particle ( ParticlePDG pdg = nullptr)

Definition at line 13 of file Particle.cc.

14  : fParticleProperties(prop),
18  fLastMotherPdg(0),
19  fType(0),
20  fIndex(-1),
21  fMotherIndex(-1),
22  fNDaughters(0),
25  fDecayed(kFALSE) {}

◆ Particle() [2/3]

Particle::Particle ( ParticlePDG pdg,
const TLorentzVector &  pos,
const TLorentzVector &  mom,
double  lastInterTime = 0.,
int  lastInterNum = 0,
int  type = 0 
)

Definition at line 27 of file Particle.cc.

29  : fPosition(pos),
30  fMomentum(mom),
32  fIndex(-1),
33  fMotherIndex(-1),
34  fNDaughters(0),
37  fDecayed(kFALSE) {
39  fInteractionNumber = lin;
40  fParticleProperties = prop;
41  fType = type;
42 }

References fInteractionNumber, fLastInteractionTime, fParticleProperties, and fType.

◆ Particle() [3/3]

Particle::Particle ( ParticlePDG pdg,
const TLorentzVector &  pos,
const TLorentzVector &  mom,
double  lastInterTime,
int  lastInterNum,
int  type,
int  motherPdg,
const TLorentzVector &  motherPos,
const TLorentzVector &  motherMom 
)

Definition at line 44 of file Particle.cc.

53  : fPosition(pos),
54  fMomentum(mom),
56  fLastMotherDecayMom(mMom),
58  fIndex(-1),
59  fMotherIndex(-1),
60  fNDaughters(0),
63  fDecayed(kFALSE) {
64  fParticleProperties = prop;
67  fType = ty;
68  fLastMotherPdg = motherPdg;
69 }

References fInteractionNumber, fLastInteractionTime, fLastMotherPdg, fParticleProperties, fType, dqmiodumpmetadata::n, and OrderedSet::t.

Member Function Documentation

◆ Boost() [1/2]

void Particle::Boost ( const TLorentzVector &  val)
inline

Definition at line 111 of file Particle.h.

111 { fMomentum.Boost(val.BoostVector()); }

References fMomentum, and heppy_batch::val.

◆ Boost() [2/2]

void Particle::Boost ( const TVector3 &  val)
inline

Definition at line 110 of file Particle.h.

110 { fMomentum.Boost(val); }

References fMomentum, and heppy_batch::val.

◆ Def() [1/2]

ParticlePDG* Particle::Def ( ) const
inline

Definition at line 126 of file Particle.h.

126 { return fParticleProperties; }

References fParticleProperties.

◆ Def() [2/2]

ParticlePDG* Particle::Def ( ParticlePDG newProp)
inline

Definition at line 127 of file Particle.h.

127 { return fParticleProperties = newProp; }

References fParticleProperties.

◆ E() [1/2]

double Particle::E ( ) const
inline

Definition at line 94 of file Particle.h.

94 { return fMomentum.E(); }

References fMomentum.

◆ E() [2/2]

double Particle::E ( double  val)
inline

Definition at line 95 of file Particle.h.

95  {
96  fMomentum.SetE(val);
97  return val;
98  }

References fMomentum, and heppy_batch::val.

◆ Encoding()

int Particle::Encoding ( ) const

Definition at line 71 of file Particle.cc.

71 { return fParticleProperties->GetPDG(); }

References fParticleProperties, and ParticlePDG::GetPDG().

◆ Eta()

double Particle::Eta ( ) const

Definition at line 75 of file Particle.cc.

75  {
76  if (fMomentum.P() != fMomentum.Pz())
77  return 0.5 * TMath::Log((fMomentum.P() + fMomentum.Pz()) / (fMomentum.P() - fMomentum.Pz()));
78  else
79  return 1.e30;
80 }

References fMomentum.

◆ GetDecayed()

bool Particle::GetDecayed ( ) const
inline

Definition at line 108 of file Particle.h.

108 { return fDecayed; }

References fDecayed.

◆ GetFirstDaughterIndex()

int Particle::GetFirstDaughterIndex ( )
inline

Definition at line 153 of file Particle.h.

153 { return fFirstDaughterIndex; }

References fFirstDaughterIndex.

◆ GetIndex()

int Particle::GetIndex ( )
inline

Definition at line 138 of file Particle.h.

138 { return fIndex; }

References fIndex.

◆ GetLastDaughterIndex()

int Particle::GetLastDaughterIndex ( )
inline

Definition at line 154 of file Particle.h.

154 { return fLastDaughterIndex; }

References fLastDaughterIndex.

◆ GetLastIndex()

static int Particle::GetLastIndex ( )
inlinestatic

Definition at line 139 of file Particle.h.

139 { return fLastIndex; }

References fLastIndex.

◆ GetLastInterNumber()

int Particle::GetLastInterNumber ( ) const
inline

Definition at line 164 of file Particle.h.

164 { return fInteractionNumber; }

References fInteractionNumber.

◆ GetLastInterTime()

double Particle::GetLastInterTime ( ) const
inline

Definition at line 162 of file Particle.h.

162 { return fLastInteractionTime; }

References fLastInteractionTime.

◆ GetLastMotherDecayCoor()

const TLorentzVector& Particle::GetLastMotherDecayCoor ( ) const
inline

Definition at line 157 of file Particle.h.

157 { return fLastMotherDecayCoor; }

References fLastMotherDecayCoor.

◆ GetLastMotherDecayMom()

const TLorentzVector& Particle::GetLastMotherDecayMom ( ) const
inline

Definition at line 159 of file Particle.h.

159 { return fLastMotherDecayMom; }

References fLastMotherDecayMom.

◆ GetLastMotherPdg()

int Particle::GetLastMotherPdg ( ) const
inline

Definition at line 130 of file Particle.h.

130 { return fLastMotherPdg; }

References fLastMotherPdg.

◆ GetMother()

int Particle::GetMother ( )
inline

Definition at line 142 of file Particle.h.

142 { return fMotherIndex; }

References fMotherIndex.

◆ GetNDaughters()

int Particle::GetNDaughters ( )
inline

Definition at line 147 of file Particle.h.

147  {
148  if (fFirstDaughterIndex == -1 || fLastDaughterIndex == -1)
149  return 0;
150  else
152  }

References fFirstDaughterIndex, and fLastDaughterIndex.

◆ GetPythiaStatusCode()

int Particle::GetPythiaStatusCode ( )
inline

Definition at line 146 of file Particle.h.

146 { return fPythiaStatusCode; }

References fPythiaStatusCode.

◆ GetType()

int Particle::GetType ( ) const
inline

Definition at line 168 of file Particle.h.

168 { return fType; }

References fType.

◆ IncInter()

void Particle::IncInter ( )
inline

Definition at line 165 of file Particle.h.

165 { ++fInteractionNumber; }

References fInteractionNumber.

◆ InitIndexing()

static void Particle::InitIndexing ( )
inlinestatic

Definition at line 140 of file Particle.h.

140 { fLastIndex = -1; }

References fLastIndex.

Referenced by gen::Hydjet2Hadronizer::generatePartonsAndHadronize().

◆ Mom() [1/3]

TLorentzVector& Particle::Mom ( )
inline

Definition at line 103 of file Particle.h.

103 { return fMomentum; }

References fMomentum.

◆ Mom() [2/3]

const TLorentzVector& Particle::Mom ( ) const
inline

Definition at line 104 of file Particle.h.

104 { return fMomentum; }

References fMomentum.

◆ Mom() [3/3]

TLorentzVector& Particle::Mom ( const TLorentzVector &  val)
inline

Definition at line 105 of file Particle.h.

105 { return fMomentum = val; }

References fMomentum, and heppy_batch::val.

◆ Phi()

double Particle::Phi ( ) const

Definition at line 89 of file Particle.cc.

89 { return TMath::Pi() + TMath::ATan2(-fMomentum.Py(), -fMomentum.Px()); }

References fMomentum, and Pi.

◆ Pos() [1/3]

TLorentzVector& Particle::Pos ( )
inline

Definition at line 100 of file Particle.h.

100 { return fPosition; }

References fPosition.

◆ Pos() [2/3]

const TLorentzVector& Particle::Pos ( ) const
inline

Definition at line 101 of file Particle.h.

101 { return fPosition; }

References fPosition.

◆ Pos() [3/3]

TLorentzVector& Particle::Pos ( const TLorentzVector &  val)
inline

Definition at line 102 of file Particle.h.

102 { return fPosition = val; }

References fPosition, and heppy_batch::val.

◆ Pt()

double Particle::Pt ( ) const

Definition at line 95 of file Particle.cc.

95 { return TMath::Sqrt(fMomentum.Px() * fMomentum.Px() + fMomentum.Py() * fMomentum.Py()); }

References fMomentum.

◆ Px() [1/2]

double Particle::Px ( ) const
inline

Definition at line 79 of file Particle.h.

79 { return fMomentum.Px(); }

References fMomentum.

◆ Px() [2/2]

double Particle::Px ( double  val)
inline

Definition at line 80 of file Particle.h.

80  {
81  fMomentum.SetPx(val);
82  return val;
83  }

References fMomentum, and heppy_batch::val.

◆ Py() [1/2]

double Particle::Py ( ) const
inline

Definition at line 84 of file Particle.h.

84 { return fMomentum.Py(); }

References fMomentum.

◆ Py() [2/2]

double Particle::Py ( double  val)
inline

Definition at line 85 of file Particle.h.

85  {
86  fMomentum.SetPy(val);
87  return val;
88  }

References fMomentum, and heppy_batch::val.

◆ Pz() [1/2]

double Particle::Pz ( ) const
inline

Definition at line 89 of file Particle.h.

89 { return fMomentum.Pz(); }

References fMomentum.

◆ Pz() [2/2]

double Particle::Pz ( double  val)
inline

Definition at line 90 of file Particle.h.

90  {
91  fMomentum.SetPz(val);
92  return val;
93  }

References fMomentum, and heppy_batch::val.

◆ Rapidity()

double Particle::Rapidity ( ) const

Definition at line 82 of file Particle.cc.

82  {
83  if (fMomentum.E() != fMomentum.Pz())
84  return 0.5 * TMath::Log((fMomentum.E() + fMomentum.Pz()) / (fMomentum.E() - fMomentum.Pz()));
85  else
86  return 1.e30;
87 }

References fMomentum.

◆ SetDecayed()

void Particle::SetDecayed ( )
inline

Definition at line 107 of file Particle.h.

107 { fDecayed = kTRUE; }

References fDecayed.

◆ SetFirstDaughterIndex()

void Particle::SetFirstDaughterIndex ( int  index)
inline

Definition at line 143 of file Particle.h.

References fFirstDaughterIndex.

◆ SetIndex()

int Particle::SetIndex ( )
inline

Definition at line 134 of file Particle.h.

134  {
135  fIndex = ++fLastIndex;
136  return fIndex;
137  }

References fIndex, and fLastIndex.

◆ SetLastDaughterIndex()

void Particle::SetLastDaughterIndex ( int  index)
inline

Definition at line 144 of file Particle.h.

References fLastDaughterIndex.

◆ SetLastInterNumber()

void Particle::SetLastInterNumber ( int  value)
inline

Definition at line 163 of file Particle.h.

References fInteractionNumber, and relativeConstraints::value.

◆ SetLastInterTime()

void Particle::SetLastInterTime ( double  value)
inline

Definition at line 161 of file Particle.h.

References fLastInteractionTime, and relativeConstraints::value.

◆ SetLastMotherDecayCoor()

TLorentzVector& Particle::SetLastMotherDecayCoor ( const TLorentzVector &  val)
inline

Definition at line 156 of file Particle.h.

156 { return fLastMotherDecayCoor = val; }

References fLastMotherDecayCoor, and heppy_batch::val.

◆ SetLastMotherDecayMom()

TLorentzVector& Particle::SetLastMotherDecayMom ( const TLorentzVector &  val)
inline

Definition at line 158 of file Particle.h.

158 { return fLastMotherDecayMom = val; }

References fLastMotherDecayMom, and heppy_batch::val.

◆ SetLastMotherPdg()

void Particle::SetLastMotherPdg ( int  value)
inline

Definition at line 129 of file Particle.h.

129 { fLastMotherPdg = value; }

References fLastMotherPdg, and relativeConstraints::value.

◆ SetMother()

void Particle::SetMother ( int  value)
inline

Definition at line 141 of file Particle.h.

141 { fMotherIndex = value; }

References fMotherIndex, and relativeConstraints::value.

◆ SetPythiaStatusCode()

void Particle::SetPythiaStatusCode ( int  code)
inline

Definition at line 145 of file Particle.h.

145 { fPythiaStatusCode = code; }

References fPythiaStatusCode.

◆ SetType()

void Particle::SetType ( int  value)
inline

Definition at line 167 of file Particle.h.

167 { fType = value; }

References fType, and relativeConstraints::value.

◆ Shift()

void Particle::Shift ( const TVector3 &  val)
inline

Definition at line 114 of file Particle.h.

114 { fPosition += TLorentzVector(val, 0.); }

References fPosition, and heppy_batch::val.

◆ T() [1/2]

double Particle::T ( ) const
inline

Definition at line 74 of file Particle.h.

74 { return fPosition.T(); }

References fPosition.

◆ T() [2/2]

double Particle::T ( double  val)
inline

Definition at line 75 of file Particle.h.

75  {
76  fPosition.SetT(val);
77  return val;
78  }

References fPosition, and heppy_batch::val.

◆ TableMass()

double Particle::TableMass ( ) const

Definition at line 73 of file Particle.cc.

73 { return fParticleProperties->GetMass(); }

References fParticleProperties, and ParticlePDG::GetMass().

◆ Theta()

double Particle::Theta ( ) const

Definition at line 91 of file Particle.cc.

91  {
92  return !fMomentum.Pz() ? TMath::Pi() / 2 : TMath::ACos(fMomentum.Pz() / fMomentum.P());
93 }

References fMomentum, and Pi.

◆ TransformMomentum()

void Particle::TransformMomentum ( const TRotation &  rotator)
inline

Definition at line 112 of file Particle.h.

112 { fMomentum *= rotator; }

References fMomentum.

◆ TransformPosition()

void Particle::TransformPosition ( const TRotation &  rotator)
inline

Definition at line 113 of file Particle.h.

113 { fPosition *= rotator; }

References fPosition.

◆ X() [1/2]

double Particle::X ( ) const
inline

Definition at line 59 of file Particle.h.

59 { return fPosition.X(); }

References fPosition.

Referenced by svgfig.Curve.Sample::__repr__().

◆ X() [2/2]

double Particle::X ( double  val)
inline

Definition at line 60 of file Particle.h.

60  {
61  fPosition.SetX(val);
62  return val;
63  }

References fPosition, and heppy_batch::val.

Referenced by svgfig.Curve.Sample::__repr__().

◆ Y() [1/2]

double Particle::Y ( ) const
inline

Definition at line 64 of file Particle.h.

64 { return fPosition.Y(); }

References fPosition.

◆ Y() [2/2]

double Particle::Y ( double  val)
inline

Definition at line 65 of file Particle.h.

65  {
66  fPosition.SetY(val);
67  return val;
68  }

References fPosition, and heppy_batch::val.

◆ Z() [1/2]

double Particle::Z ( ) const
inline

Definition at line 69 of file Particle.h.

69 { return fPosition.Z(); }

References fPosition.

◆ Z() [2/2]

double Particle::Z ( double  val)
inline

Definition at line 70 of file Particle.h.

70  {
71  fPosition.SetZ(val);
72  return val;
73  }

References fPosition, and heppy_batch::val.

Member Data Documentation

◆ fDecayed

bool Particle::fDecayed
protected

Definition at line 39 of file Particle.h.

Referenced by GetDecayed(), and SetDecayed().

◆ fFirstDaughterIndex

int Particle::fFirstDaughterIndex
protected

Definition at line 36 of file Particle.h.

Referenced by GetFirstDaughterIndex(), GetNDaughters(), and SetFirstDaughterIndex().

◆ fIndex

int Particle::fIndex
protected

Definition at line 33 of file Particle.h.

Referenced by GetIndex(), and SetIndex().

◆ fInteractionNumber

int Particle::fInteractionNumber
protected

Definition at line 29 of file Particle.h.

Referenced by GetLastInterNumber(), IncInter(), Particle(), and SetLastInterNumber().

◆ fLastDaughterIndex

int Particle::fLastDaughterIndex
protected

Definition at line 37 of file Particle.h.

Referenced by GetLastDaughterIndex(), GetNDaughters(), and SetLastDaughterIndex().

◆ fLastIndex

int Particle::fLastIndex
staticprotected

Definition at line 38 of file Particle.h.

Referenced by GetLastIndex(), InitIndexing(), and SetIndex().

◆ fLastInteractionTime

double Particle::fLastInteractionTime
protected

Definition at line 28 of file Particle.h.

Referenced by GetLastInterTime(), Particle(), and SetLastInterTime().

◆ fLastMotherDecayCoor

TLorentzVector Particle::fLastMotherDecayCoor
protected

Definition at line 25 of file Particle.h.

Referenced by GetLastMotherDecayCoor(), and SetLastMotherDecayCoor().

◆ fLastMotherDecayMom

TLorentzVector Particle::fLastMotherDecayMom
protected

Definition at line 26 of file Particle.h.

Referenced by GetLastMotherDecayMom(), and SetLastMotherDecayMom().

◆ fLastMotherPdg

int Particle::fLastMotherPdg
protected

Definition at line 31 of file Particle.h.

Referenced by GetLastMotherPdg(), Particle(), and SetLastMotherPdg().

◆ fMomentum

TLorentzVector Particle::fMomentum
protected

Definition at line 24 of file Particle.h.

Referenced by Boost(), E(), Eta(), Mom(), Phi(), Pt(), Px(), Py(), Pz(), Rapidity(), Theta(), and TransformMomentum().

◆ fMotherIndex

int Particle::fMotherIndex
protected

Definition at line 34 of file Particle.h.

Referenced by GetMother(), and SetMother().

◆ fNDaughters

int Particle::fNDaughters
protected

◆ fParticleProperties

ParticlePDG* Particle::fParticleProperties
protected

Definition at line 27 of file Particle.h.

Referenced by Def(), Encoding(), Particle(), and TableMass().

◆ fPosition

TLorentzVector Particle::fPosition
protected

Definition at line 23 of file Particle.h.

Referenced by Pos(), Shift(), T(), TransformPosition(), X(), Y(), and Z().

◆ fPythiaStatusCode

int Particle::fPythiaStatusCode
protected

Definition at line 30 of file Particle.h.

Referenced by GetPythiaStatusCode(), and SetPythiaStatusCode().

◆ fType

int Particle::fType
protected

Definition at line 32 of file Particle.h.

Referenced by GetType(), Particle(), and SetType().

Particle::fLastIndex
static int fLastIndex
Definition: Particle.h:38
Particle::fPosition
TLorentzVector fPosition
Definition: Particle.h:23
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
Particle::fInteractionNumber
int fInteractionNumber
Definition: Particle.h:29
Particle::fMomentum
TLorentzVector fMomentum
Definition: Particle.h:24
Particle::fPythiaStatusCode
int fPythiaStatusCode
Definition: Particle.h:30
pos
Definition: PixelAliasList.h:18
Particle::fFirstDaughterIndex
int fFirstDaughterIndex
Definition: Particle.h:36
Particle::fLastMotherDecayCoor
TLorentzVector fLastMotherDecayCoor
Definition: Particle.h:25
Particle::fLastDaughterIndex
int fLastDaughterIndex
Definition: Particle.h:37
OrderedSet.t
t
Definition: OrderedSet.py:90
Particle::fMotherIndex
int fMotherIndex
Definition: Particle.h:34
Particle::fLastInteractionTime
double fLastInteractionTime
Definition: Particle.h:28
ParticlePDG::GetMass
double GetMass()
Definition: ParticlePDG.h:70
type
type
Definition: HCALResponse.h:21
heppy_batch.val
val
Definition: heppy_batch.py:351
Particle::fLastMotherDecayMom
TLorentzVector fLastMotherDecayMom
Definition: Particle.h:26
Particle::fNDaughters
int fNDaughters
Definition: Particle.h:35
relativeConstraints.value
value
Definition: relativeConstraints.py:53
Particle::fType
int fType
Definition: Particle.h:32
Particle::fDecayed
bool fDecayed
Definition: Particle.h:39
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
Pi
const double Pi
Definition: CosmicMuonParameters.h:18
Particle::fLastMotherPdg
int fLastMotherPdg
Definition: Particle.h:31
ParticlePDG::GetPDG
int GetPDG()
Definition: ParticlePDG.h:69
Particle::fParticleProperties
ParticlePDG * fParticleProperties
Definition: Particle.h:27
Particle::fIndex
int fIndex
Definition: Particle.h:33