CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Friends
fastsim::Particle Class Reference

Definition of a generic FastSim Particle which can be propagated through the detector (formerly ParticlePropagator) More...

#include <Particle.h>

Public Member Functions

double charge () const
 Return charge of the particle. More...
 
bool chargeIsSet () const
 Check if charge of particle was set. More...
 
double gamma () const
 Return Lorentz' gamma factor. More...
 
int genParticleIndex () const
 Return index of the particle in the genParticle vector. More...
 
double getEnergyDeposit () const
 Return the energy the particle deposited in the tracker layer that was last hit (ionization). More...
 
double getMotherDeltaR () const
 Get delta R to mother particle (only makes sense if mother and daughter charged). More...
 
int getMotherPdgId () const
 Get pdgIdto mother particle (only makes sense if mother and daughter charged). More...
 
int getMotherSimTrackIndex () const
 Get index of simTrack of mother particle (only makes sense if mother and daughter charged). More...
 
double isLooper () const
 Check if this particle is about to do a loop in the tracker or the direction of the momentum is going inwards. More...
 
bool isOnLayer (bool isForward, int index)
 Check if particle is on layer. More...
 
bool isStable () const
 Returns true if particle is considered stable. More...
 
math::XYZTLorentzVectormomentum ()
 Return momentum of the particle. More...
 
const math::XYZTLorentzVectormomentum () const
 Return momentum of the particle. More...
 
 Particle (int pdgId, const math::XYZTLorentzVector &position, const math::XYZTLorentzVector &momentum)
 Constructor. More...
 
int pdgId () const
 Return pdgId of the particle. More...
 
math::XYZTLorentzVectorposition ()
 Return position of the particle. More...
 
const math::XYZTLorentzVectorposition () const
 Return position of the particle. More...
 
double remainingProperLifeTimeC () const
 Return the particle's remaining proper lifetime[in ct]. More...
 
bool remainingProperLifeTimeIsSet () const
 Check if remaining proper lifetime of particle is set. More...
 
void resetMother ()
 Reset all information stored about the mother particle. More...
 
void resetOnLayer ()
 Reset layer this particle is currently on (i.e. particle is not on a layer anyomre) More...
 
void setCharge (double charge)
 Set the charge of the particle. More...
 
void setEnergyDeposit (double energyDeposit)
 Set the energy the particle deposited in the tracker layer that was last hit (ionization). More...
 
void setGenParticleIndex (int index)
 Set index of the particle in the genParticle vector (if applies). More...
 
void setLooper ()
 This particle is about to do a loop in the tracker or the direction of the momentum is going inwards. More...
 
void setMotherDeltaR (const math::XYZTLorentzVector &motherMomentum)
 Set delta R to mother particle (only necessary if mother and daughter charged). More...
 
void setMotherPdgId (int motherPpdId)
 Set pdgId of the mother particle (only necessary if mother and daughter charged). More...
 
void setMotherSimTrackIndex (int id)
 Set the index of the SimTrack of the mother particle (only necessary if mother and daughter charged). More...
 
void setOnLayer (bool isForward, int index)
 Set layer this particle is currently on. More...
 
void setRemainingProperLifeTimeC (double remainingProperLifeTimeC)
 Set the particle's remaining proper lifetime if not stable [in ct]. More...
 
void setSimTrackIndex (int index)
 Set the index of the SimTrack of this particle. More...
 
void setSimVertexIndex (int index)
 Set the index of the origin SimVertex of this particle. More...
 
void setStable ()
 Particle is stable. More...
 
int simTrackIndex () const
 Return index of the SimTrack. More...
 
int simVertexIndex () const
 Return index of the origin vertex. More...
 

Private Attributes

double charge_
 charge of the particle in elemntary units More...
 
double energyDeposit_
 energy deposit through ionization in the previous tracker layer More...
 
int genParticleIndex_
 index of the particle in the vector of genParticles (if applies) More...
 
bool isLooper_
 this particle is about to do a loop or momentum goes inwards More...
 
bool isOnForwardLayer_
 the layer this particle is currently on: is it a ForwardLayer More...
 
int isOnLayerIndex_
 the layer this particle is currently on: the index of the layer More...
 
math::XYZTLorentzVector momentum_
 momentum of the particle More...
 
double motherDeltaR_
 delta R to mother particle if both charged More...
 
int motherPpdId_
 pdgId of mother particle if both charged More...
 
int motherSimTrackIndex_
 simTrack index of mother particle if both charged More...
 
const int pdgId_
 pdgId of the particle More...
 
math::XYZTLorentzVector position_
 position of the particle More...
 
double remainingProperLifeTimeC_
 remaining proper lifetime of the particle in units of t*c More...
 
int simTrackIndex_
 index of the simTrack More...
 
int simVertexIndex_
 index of the origin vertex More...
 

Friends

std::ostream & operator<< (std::ostream &os, const Particle &particle)
 Some basic output. More...
 

Detailed Description

Definition of a generic FastSim Particle which can be propagated through the detector (formerly ParticlePropagator)

Contains all information necessary for the propagation and tracking of a particle:

Definition at line 16 of file Particle.h.

Constructor & Destructor Documentation

◆ Particle()

fastsim::Particle::Particle ( int  pdgId,
const math::XYZTLorentzVector position,
const math::XYZTLorentzVector momentum 
)
inline

Constructor.

Parameters
pdgIdThe pdgId of the particle.
positionThe position of the particle.
momentumThe momentum of the particle.

Definition at line 24 of file Particle.h.

25  : pdgId_(pdgId),
26  charge_(-999.),
29  remainingProperLifeTimeC_(-999.) // lifetime in ct
30  ,
31  simTrackIndex_(-1),
32  simVertexIndex_(-1),
34  isOnForwardLayer_(false),
35  isOnLayerIndex_(-1),
36  energyDeposit_(0),
37  isLooper_(false),
38  motherDeltaR_(-1),
39  motherPpdId_(0),
40  motherSimTrackIndex_(-999) {
41  ;
42  }

Member Function Documentation

◆ charge()

double fastsim::Particle::charge ( void  ) const
inline

◆ chargeIsSet()

bool fastsim::Particle::chargeIsSet ( ) const
inline

Check if charge of particle was set.

Definition at line 174 of file Particle.h.

174 { return charge_ != -999.; }

References charge_.

◆ gamma()

double fastsim::Particle::gamma ( ) const
inline

Return Lorentz' gamma factor.

Definition at line 180 of file Particle.h.

180 { return momentum().Gamma(); }

References momentum().

Referenced by fastsim::LayerNavigator::moveParticleToNextLayer().

◆ genParticleIndex()

int fastsim::Particle::genParticleIndex ( ) const
inline

Return index of the particle in the genParticle vector.

Returns -1 if not a genParticle.

Definition at line 165 of file Particle.h.

165 { return genParticleIndex_; }

References genParticleIndex_.

Referenced by fastsim::ParticleManager::addSimTrack(), and FastSimProducer::createFSimTrack().

◆ getEnergyDeposit()

double fastsim::Particle::getEnergyDeposit ( ) const
inline

◆ getMotherDeltaR()

double fastsim::Particle::getMotherDeltaR ( ) const
inline

Get delta R to mother particle (only makes sense if mother and daughter charged).

Needed for FastSim (cheat) tracking: daughter can continue the track of the mother.

See also
fastsim::ParticleManager::addSecondaries(const math::XYZTLorentzVector & vertexPosition, int parentSimTrackIndex, std::vector<std::unique_ptr<Particle> > & secondaries)

Definition at line 202 of file Particle.h.

202 { return motherDeltaR_; }

References motherDeltaR_.

Referenced by fastsim::Decayer::decay(), and fastsim::NuclearInteractionFTF::interact().

◆ getMotherPdgId()

int fastsim::Particle::getMotherPdgId ( ) const
inline

Get pdgIdto mother particle (only makes sense if mother and daughter charged).

Needed for FastSim (cheat) tracking: daughter can continue the track of the mother.

See also
fastsim::ParticleManager::addSecondaries(const math::XYZTLorentzVector & vertexPosition, int parentSimTrackIndex, std::vector<std::unique_ptr<Particle> > & secondaries)

Definition at line 209 of file Particle.h.

209 { return motherPpdId_; }

References motherPpdId_.

Referenced by fastsim::Decayer::decay(), and fastsim::NuclearInteractionFTF::interact().

◆ getMotherSimTrackIndex()

int fastsim::Particle::getMotherSimTrackIndex ( ) const
inline

Get index of simTrack of mother particle (only makes sense if mother and daughter charged).

Needed for FastSim (cheat) tracking: daughter can continue the track of the mother.

See also
fastsim::ParticleManager::addSecondaries(const math::XYZTLorentzVector & vertexPosition, int parentSimTrackIndex, std::vector<std::unique_ptr<Particle> > & secondaries)

Definition at line 216 of file Particle.h.

216 { return motherSimTrackIndex_; }

References motherSimTrackIndex_.

Referenced by fastsim::TrackerSimHitProducer::interact().

◆ isLooper()

double fastsim::Particle::isLooper ( ) const
inline

Check if this particle is about to do a loop in the tracker or the direction of the momentum is going inwards.

The TrackerSimHitProducer has the option not to store SimHits in this case, since tracking not possible (just leads to fakes).

See also
fastsim::TrackerSimHitProducer::interact(Particle & particle,const SimplifiedGeometry & layer,std::vector<std::unique_ptr<Particle> > & secondaries,const RandomEngineAndDistribution & random)

Definition at line 195 of file Particle.h.

195 { return isLooper_; }

References isLooper_.

Referenced by fastsim::TrackerSimHitProducer::interact().

◆ isOnLayer()

bool fastsim::Particle::isOnLayer ( bool  isForward,
int  index 
)
inline

Check if particle is on layer.

Definition at line 168 of file Particle.h.

References ecaldqm::isForward(), isOnForwardLayer_, and isOnLayerIndex_.

Referenced by fastsim::LayerNavigator::moveParticleToNextLayer().

◆ isStable()

bool fastsim::Particle::isStable ( ) const
inline

Returns true if particle is considered stable.

Definition at line 171 of file Particle.h.

171 { return remainingProperLifeTimeC_ == -1.; }

References remainingProperLifeTimeC_.

Referenced by FastSimProducer::createFSimTrack(), fastsim::LayerNavigator::moveParticleToNextLayer(), and fastsim::operator<<().

◆ momentum() [1/2]

math::XYZTLorentzVector& fastsim::Particle::momentum ( )
inline

Return momentum of the particle.

Definition at line 226 of file Particle.h.

226 { return momentum_; }

References momentum_.

◆ momentum() [2/2]

const math::XYZTLorentzVector& fastsim::Particle::momentum ( ) const
inline

◆ pdgId()

int fastsim::Particle::pdgId ( ) const
inline

◆ position() [1/2]

math::XYZTLorentzVector& fastsim::Particle::position ( )
inline

Return position of the particle.

Definition at line 223 of file Particle.h.

223 { return position_; }

References position_.

◆ position() [2/2]

const math::XYZTLorentzVector& fastsim::Particle::position ( ) const
inline

◆ remainingProperLifeTimeC()

double fastsim::Particle::remainingProperLifeTimeC ( ) const
inline

Return the particle's remaining proper lifetime[in ct].

Returns -1 in case particle is stable.

Returns
Important: defined in units of c*t!

Definition at line 150 of file Particle.h.

150 { return remainingProperLifeTimeC_; }

References remainingProperLifeTimeC_.

Referenced by FastSimProducer::createFSimTrack(), fastsim::LayerNavigator::moveParticleToNextLayer(), and setRemainingProperLifeTimeC().

◆ remainingProperLifeTimeIsSet()

bool fastsim::Particle::remainingProperLifeTimeIsSet ( ) const
inline

Check if remaining proper lifetime of particle is set.

Definition at line 177 of file Particle.h.

177 { return remainingProperLifeTimeC_ != -999.; }

References remainingProperLifeTimeC_.

◆ resetMother()

void fastsim::Particle::resetMother ( )
inline

Reset all information stored about the mother particle.

Definition at line 123 of file Particle.h.

123  {
124  motherDeltaR_ = -1;
125  motherPpdId_ = 0;
126  motherSimTrackIndex_ = -999;
127  }

References motherDeltaR_, motherPpdId_, and motherSimTrackIndex_.

◆ resetOnLayer()

void fastsim::Particle::resetOnLayer ( )
inline

Reset layer this particle is currently on (i.e. particle is not on a layer anyomre)

Definition at line 78 of file Particle.h.

78 { isOnLayerIndex_ = -1; }

References isOnLayerIndex_.

Referenced by fastsim::LayerNavigator::moveParticleToNextLayer().

◆ setCharge()

void fastsim::Particle::setCharge ( double  charge)
inline

Set the charge of the particle.

Definition at line 69 of file Particle.h.

69 { charge_ = charge; }

References charge(), and charge_.

◆ setEnergyDeposit()

void fastsim::Particle::setEnergyDeposit ( double  energyDeposit)
inline

◆ setGenParticleIndex()

void fastsim::Particle::setGenParticleIndex ( int  index)
inline

Set index of the particle in the genParticle vector (if applies).

Definition at line 55 of file Particle.h.

References genParticleIndex_.

◆ setLooper()

void fastsim::Particle::setLooper ( )
inline

This particle is about to do a loop in the tracker or the direction of the momentum is going inwards.

The TrackerSimHitProducer has the option not to store SimHits in this case, since tracking not possible (just leads to fakes).

See also
fastsim::TrackerSimHitProducer::interact(Particle & particle,const SimplifiedGeometry & layer,std::vector<std::unique_ptr<Particle> > & secondaries,const RandomEngineAndDistribution & random)

Definition at line 94 of file Particle.h.

94 { isLooper_ = true; }

References isLooper_.

Referenced by fastsim::TrackerSimHitProducer::interact().

◆ setMotherDeltaR()

void fastsim::Particle::setMotherDeltaR ( const math::XYZTLorentzVector motherMomentum)
inline

Set delta R to mother particle (only necessary if mother and daughter charged).

Needed for FastSim (cheat) tracking: daughter can continue the track of the mother.

Parameters
motherMomentumThe momentum 4-vector of the mother particle.
See also
fastsim::ParticleManager::addSecondaries(const math::XYZTLorentzVector & vertexPosition, int parentSimTrackIndex, std::vector<std::unique_ptr<Particle> > & secondaries)

Definition at line 102 of file Particle.h.

102  {
103  motherDeltaR_ = (momentum_.Vect().Unit().Cross(motherMomentum.Vect().Unit())).R();
104  }

References momentum_, and motherDeltaR_.

◆ setMotherPdgId()

void fastsim::Particle::setMotherPdgId ( int  motherPpdId)
inline

Set pdgId of the mother particle (only necessary if mother and daughter charged).

Needed for FastSim (cheat) tracking: daughter can continue the track of the mother.

Parameters
motherPpdIdThe pdgId of the mother particle.
See also
fastsim::ParticleManager::addSecondaries(const math::XYZTLorentzVector & vertexPosition, int parentSimTrackIndex, std::vector<std::unique_ptr<Particle> > & secondaries)

Definition at line 112 of file Particle.h.

112 { motherPpdId_ = motherPpdId; }

References motherPpdId_.

◆ setMotherSimTrackIndex()

void fastsim::Particle::setMotherSimTrackIndex ( int  id)
inline

Set the index of the SimTrack of the mother particle (only necessary if mother and daughter charged).

Needed for FastSim (cheat) tracking: daughter can continue the track of the mother.

Parameters
idThe Id of the SimTrack of the mother particle.
See also
fastsim::ParticleManager::addSecondaries(const math::XYZTLorentzVector & vertexPosition, int parentSimTrackIndex, std::vector<std::unique_ptr<Particle> > & secondaries)

Definition at line 120 of file Particle.h.

References triggerObjects_cff::id, and motherSimTrackIndex_.

◆ setOnLayer()

void fastsim::Particle::setOnLayer ( bool  isForward,
int  index 
)
inline

Set layer this particle is currently on.

Definition at line 72 of file Particle.h.

72  {
75  }

References ecaldqm::isForward(), isOnForwardLayer_, and isOnLayerIndex_.

Referenced by fastsim::LayerNavigator::moveParticleToNextLayer().

◆ setRemainingProperLifeTimeC()

void fastsim::Particle::setRemainingProperLifeTimeC ( double  remainingProperLifeTimeC)
inline

Set the particle's remaining proper lifetime if not stable [in ct].

Parameters
remainingProperLifeTimeCImportant: defined in units of c*t!

Definition at line 64 of file Particle.h.

References remainingProperLifeTimeC(), and remainingProperLifeTimeC_.

Referenced by fastsim::LayerNavigator::moveParticleToNextLayer().

◆ setSimTrackIndex()

void fastsim::Particle::setSimTrackIndex ( int  index)
inline

Set the index of the SimTrack of this particle.

Definition at line 49 of file Particle.h.

49 { simTrackIndex_ = index; }

References simTrackIndex_.

◆ setSimVertexIndex()

void fastsim::Particle::setSimVertexIndex ( int  index)
inline

Set the index of the origin SimVertex of this particle.

Definition at line 52 of file Particle.h.

References simVertexIndex_.

◆ setStable()

void fastsim::Particle::setStable ( )
inline

Particle is stable.

Definition at line 58 of file Particle.h.

References remainingProperLifeTimeC_.

◆ simTrackIndex()

int fastsim::Particle::simTrackIndex ( ) const
inline

◆ simVertexIndex()

int fastsim::Particle::simVertexIndex ( ) const
inline

Return index of the origin vertex.

Returns -1 for primary vertex.

Definition at line 159 of file Particle.h.

159 { return simVertexIndex_; }

References simVertexIndex_.

Referenced by fastsim::ParticleManager::addSimTrack(), and FastSimProducer::createFSimTrack().

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const Particle particle 
)
friend

Some basic output.

Member Data Documentation

◆ charge_

double fastsim::Particle::charge_
private

charge of the particle in elemntary units

Definition at line 232 of file Particle.h.

Referenced by charge(), chargeIsSet(), and setCharge().

◆ energyDeposit_

double fastsim::Particle::energyDeposit_
private

energy deposit through ionization in the previous tracker layer

Definition at line 241 of file Particle.h.

Referenced by getEnergyDeposit(), and setEnergyDeposit().

◆ genParticleIndex_

int fastsim::Particle::genParticleIndex_
private

index of the particle in the vector of genParticles (if applies)

Definition at line 238 of file Particle.h.

Referenced by genParticleIndex(), and setGenParticleIndex().

◆ isLooper_

bool fastsim::Particle::isLooper_
private

this particle is about to do a loop or momentum goes inwards

Definition at line 242 of file Particle.h.

Referenced by isLooper(), and setLooper().

◆ isOnForwardLayer_

bool fastsim::Particle::isOnForwardLayer_
private

the layer this particle is currently on: is it a ForwardLayer

Definition at line 239 of file Particle.h.

Referenced by isOnLayer(), and setOnLayer().

◆ isOnLayerIndex_

int fastsim::Particle::isOnLayerIndex_
private

the layer this particle is currently on: the index of the layer

Definition at line 240 of file Particle.h.

Referenced by isOnLayer(), resetOnLayer(), and setOnLayer().

◆ momentum_

math::XYZTLorentzVector fastsim::Particle::momentum_
private

momentum of the particle

Definition at line 234 of file Particle.h.

Referenced by momentum(), fastsim::operator<<(), and setMotherDeltaR().

◆ motherDeltaR_

double fastsim::Particle::motherDeltaR_
private

delta R to mother particle if both charged

Definition at line 243 of file Particle.h.

Referenced by getMotherDeltaR(), resetMother(), and setMotherDeltaR().

◆ motherPpdId_

int fastsim::Particle::motherPpdId_
private

pdgId of mother particle if both charged

Definition at line 244 of file Particle.h.

Referenced by getMotherPdgId(), resetMother(), and setMotherPdgId().

◆ motherSimTrackIndex_

int fastsim::Particle::motherSimTrackIndex_
private

simTrack index of mother particle if both charged

Definition at line 245 of file Particle.h.

Referenced by getMotherSimTrackIndex(), resetMother(), and setMotherSimTrackIndex().

◆ pdgId_

const int fastsim::Particle::pdgId_
private

pdgId of the particle

Definition at line 231 of file Particle.h.

Referenced by fastsim::operator<<(), and pdgId().

◆ position_

math::XYZTLorentzVector fastsim::Particle::position_
private

position of the particle

Definition at line 233 of file Particle.h.

Referenced by fastsim::operator<<(), and position().

◆ remainingProperLifeTimeC_

double fastsim::Particle::remainingProperLifeTimeC_
private

remaining proper lifetime of the particle in units of t*c

Definition at line 235 of file Particle.h.

Referenced by isStable(), fastsim::operator<<(), remainingProperLifeTimeC(), remainingProperLifeTimeIsSet(), setRemainingProperLifeTimeC(), and setStable().

◆ simTrackIndex_

int fastsim::Particle::simTrackIndex_
private

index of the simTrack

Definition at line 236 of file Particle.h.

Referenced by setSimTrackIndex(), and simTrackIndex().

◆ simVertexIndex_

int fastsim::Particle::simVertexIndex_
private

index of the origin vertex

Definition at line 237 of file Particle.h.

Referenced by setSimVertexIndex(), and simVertexIndex().

fastsim::Particle::momentum
const math::XYZTLorentzVector & momentum() const
Return momentum of the particle.
Definition: Particle.h:143
fastsim::Particle::charge_
double charge_
charge of the particle in elemntary units
Definition: Particle.h:232
fastsim::Particle::momentum_
math::XYZTLorentzVector momentum_
momentum of the particle
Definition: Particle.h:234
fastsim::Particle::simTrackIndex_
int simTrackIndex_
index of the simTrack
Definition: Particle.h:236
fastsim::Particle::pdgId_
const int pdgId_
pdgId of the particle
Definition: Particle.h:231
fastsim::Particle::isOnForwardLayer_
bool isOnForwardLayer_
the layer this particle is currently on: is it a ForwardLayer
Definition: Particle.h:239
ecaldqm::isForward
bool isForward(DetId const &)
Definition: EcalDQMCommonUtils.cc:243
fastsim::Particle::motherDeltaR_
double motherDeltaR_
delta R to mother particle if both charged
Definition: Particle.h:243
fastsim::Particle::position_
math::XYZTLorentzVector position_
position of the particle
Definition: Particle.h:233
fastsim::Particle::remainingProperLifeTimeC_
double remainingProperLifeTimeC_
remaining proper lifetime of the particle in units of t*c
Definition: Particle.h:235
fastsim::Particle::isLooper_
bool isLooper_
this particle is about to do a loop or momentum goes inwards
Definition: Particle.h:242
fastsim::Particle::position
const math::XYZTLorentzVector & position() const
Return position of the particle.
Definition: Particle.h:140
fastsim::Particle::simVertexIndex_
int simVertexIndex_
index of the origin vertex
Definition: Particle.h:237
fastsim::Particle::motherSimTrackIndex_
int motherSimTrackIndex_
simTrack index of mother particle if both charged
Definition: Particle.h:245
fastsim::Particle::pdgId
int pdgId() const
Return pdgId of the particle.
Definition: Particle.h:134
fastsim::Particle::isOnLayerIndex_
int isOnLayerIndex_
the layer this particle is currently on: the index of the layer
Definition: Particle.h:240
fastsim::Particle::charge
double charge() const
Return charge of the particle.
Definition: Particle.h:137
fastsim::Particle::genParticleIndex_
int genParticleIndex_
index of the particle in the vector of genParticles (if applies)
Definition: Particle.h:238
fastsim::Particle::energyDeposit_
double energyDeposit_
energy deposit through ionization in the previous tracker layer
Definition: Particle.h:241
fastsim::Particle::motherPpdId_
int motherPpdId_
pdgId of mother particle if both charged
Definition: Particle.h:244
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
fastsim::Particle::remainingProperLifeTimeC
double remainingProperLifeTimeC() const
Return the particle's remaining proper lifetime[in ct].
Definition: Particle.h:150
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46