CMS 3D CMS Logo

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

Implementation of most probable energy loss by ionization in the tracker layers. More...

Inheritance diagram for fastsim::EnergyLoss:
fastsim::InteractionModel

Public Member Functions

 EnergyLoss (const std::string &name, const edm::ParameterSet &cfg)
 Constructor. More...
 
void interact (fastsim::Particle &particle, const SimplifiedGeometry &layer, std::vector< std::unique_ptr< fastsim::Particle > > &secondaries, const RandomEngineAndDistribution &random) override
 Perform the interaction. More...
 
 ~EnergyLoss () override
 Default destructor. More...
 
- Public Member Functions inherited from fastsim::InteractionModel
const std::string getName ()
 Return (unique) name of this interaction. More...
 
 InteractionModel (std::string name)
 Constructor. More...
 
virtual void registerProducts (edm::ProducesCollector) const
 In case interaction produces and stores content in the event (e.g. TrackerSimHits). More...
 
virtual void storeProducts (edm::Event &iEvent)
 In case interaction produces and stores content in the event (e.g. TrackerSimHits). More...
 
virtual ~InteractionModel ()
 Default destructor. More...
 

Private Attributes

double A_
 Atomic weight of material (usually silicon A=28.0855) More...
 
double density_
 Density of material (usually silicon rho=2.329) More...
 
double minMomentum_
 Minimum momentum of incoming (charged) particle. More...
 
double radLenInCm_
 Radiation length of material (usually silicon X0=9.360) More...
 
LandauFluctuationGenerator theGenerator
 Generator to do Landau fluctuation. More...
 
double Z_
 Atomic number of material (usually silicon Z=14) More...
 

Detailed Description

Implementation of most probable energy loss by ionization in the tracker layers.

Computes the most probable energy loss by ionization from a charged particle in the tracker layer, smears it with Landau fluctuations and returns the particle with modified energy. The deposited energy is assigned with a produced SimHit (if active material hit).

See also
TrackerSimHitProducer

Definition at line 32 of file EnergyLoss.cc.

Constructor & Destructor Documentation

◆ EnergyLoss()

fastsim::EnergyLoss::EnergyLoss ( const std::string &  name,
const edm::ParameterSet cfg 
)

Constructor.

Definition at line 62 of file EnergyLoss.cc.

64  // Set the minimal momentum
65  minMomentum_ = cfg.getParameter<double>("minMomentumCut");
66  // Material properties
67  A_ = cfg.getParameter<double>("A");
68  Z_ = cfg.getParameter<double>("Z");
69  density_ = cfg.getParameter<double>("density");
70  radLenInCm_ = cfg.getParameter<double>("radLen");
71 }

References A_, looper::cfg, density_, minMomentum_, radLenInCm_, and Z_.

◆ ~EnergyLoss()

fastsim::EnergyLoss::~EnergyLoss ( )
inlineoverride

Default destructor.

Definition at line 38 of file EnergyLoss.cc.

38 { ; };

Member Function Documentation

◆ interact()

void fastsim::EnergyLoss::interact ( fastsim::Particle particle,
const SimplifiedGeometry layer,
std::vector< std::unique_ptr< fastsim::Particle > > &  secondaries,
const RandomEngineAndDistribution random 
)
overridevirtual

Perform the interaction.

Parameters
particleThe particle that interacts with the matter.
layerThe detector layer that interacts with the particle.
secondariesParticles that are produced in the interaction (if any).
randomThe Random Engine.

Implements fastsim::InteractionModel.

Definition at line 73 of file EnergyLoss.cc.

76  {
77  // Reset the energy deposit in the layer
78  particle.setEnergyDeposit(0);
79 
80  //
81  // no material
82  //
83  double radLengths = layer.getThickness(particle.position(), particle.momentum());
84  if (radLengths < 1E-10) {
85  return;
86  }
87 
88  //
89  // only charged particles
90  //
91  if (particle.charge() == 0) {
92  return;
93  }
94 
95  //
96  // minimum momentum
97  //
98  double p2 = particle.momentum().Vect().Mag2();
99  if (p2 < minMomentum_ * minMomentum_) {
100  return;
101  }
102 
103  // Mean excitation energy (in GeV)
104  double excitE = 12.5E-9 * Z_;
105 
106  // The thickness in cm
107  double thick = radLengths * radLenInCm_;
108 
109  // This is a simple version (a la PDG) of a dE/dx generator.
110  // It replaces the buggy GEANT3 -> C++ former version.
111  // Author : Patrick Janot - 8-Jan-2004
112 
113  double m2 = particle.momentum().mass() * particle.momentum().mass();
114  double e2 = p2 + m2;
115 
116  double beta2 = p2 / e2;
117  double gama2 = e2 / m2;
118 
119  double charge2 = particle.charge() * particle.charge();
120 
121  // Energy loss spread in GeV
122  double eSpread = 0.1536E-3 * charge2 * (Z_ / A_) * density_ * thick / beta2;
123 
124  // Most probable energy loss (from the integrated Bethe-Bloch equation)
125  double mostProbableLoss =
126  eSpread * (log(2. * fastsim::Constants::eMass * beta2 * gama2 * eSpread / (excitE * excitE)) - beta2 + 0.200);
127 
128  // Generate the energy loss with Landau fluctuations
129  double dedx = mostProbableLoss + eSpread * theGenerator.landau(&random);
130 
131  // Compute the new energy and momentum
132  double newE = particle.momentum().e() - dedx;
133 
134  // Particle is stopped
135  double eDiff2 = newE * newE - m2;
136  if (eDiff2 < 0) {
137  particle.momentum().SetXYZT(0., 0., 0., 0.);
138  // The energy is deposited in the detector
139  // Assigned with SimHit (if active layer) -> see TrackerSimHitProducer
140  particle.setEnergyDeposit(particle.momentum().e() - particle.momentum().mass());
141  return;
142  }
143 
144  // Relative change in momentum
145  double fac = std::sqrt(eDiff2 / p2);
146 
147  // The energy is deposited in the detector
148  // Assigned with SimHit (if active layer) -> see TrackerSimHitProducer
149  particle.setEnergyDeposit(dedx);
150 
151  // Update the momentum
152  particle.momentum().SetXYZT(
153  particle.momentum().Px() * fac, particle.momentum().Py() * fac, particle.momentum().Pz() * fac, newE);
154 }

References fastsim::Particle::charge(), fastsim::Constants::eMass, fastsim::SimplifiedGeometry::getThickness(), dqm-mbProfile::log, fastsim::Particle::momentum(), p2, fastsim::Particle::position(), fastsim::Particle::setEnergyDeposit(), and mathSSE::sqrt().

Member Data Documentation

◆ A_

double fastsim::EnergyLoss::A_
private

Atomic weight of material (usually silicon A=28.0855)

Definition at line 57 of file EnergyLoss.cc.

Referenced by EnergyLoss().

◆ density_

double fastsim::EnergyLoss::density_
private

Density of material (usually silicon rho=2.329)

Definition at line 55 of file EnergyLoss.cc.

Referenced by EnergyLoss().

◆ minMomentum_

double fastsim::EnergyLoss::minMomentum_
private

Minimum momentum of incoming (charged) particle.

Definition at line 54 of file EnergyLoss.cc.

Referenced by EnergyLoss().

◆ radLenInCm_

double fastsim::EnergyLoss::radLenInCm_
private

Radiation length of material (usually silicon X0=9.360)

Definition at line 56 of file EnergyLoss.cc.

Referenced by EnergyLoss().

◆ theGenerator

LandauFluctuationGenerator fastsim::EnergyLoss::theGenerator
private

Generator to do Landau fluctuation.

Definition at line 53 of file EnergyLoss.cc.

◆ Z_

double fastsim::EnergyLoss::Z_
private

Atomic number of material (usually silicon Z=14)

Definition at line 58 of file EnergyLoss.cc.

Referenced by EnergyLoss().

fastsim::Particle::momentum
const math::XYZTLorentzVector & momentum() const
Return momentum of the particle.
Definition: Particle.h:143
fastsim::EnergyLoss::density_
double density_
Density of material (usually silicon rho=2.329)
Definition: EnergyLoss.cc:55
fastsim::EnergyLoss::theGenerator
LandauFluctuationGenerator theGenerator
Generator to do Landau fluctuation.
Definition: EnergyLoss.cc:53
fastsim::Particle::setEnergyDeposit
void setEnergyDeposit(double energyDeposit)
Set the energy the particle deposited in the tracker layer that was last hit (ionization).
Definition: Particle.h:87
fastsim::EnergyLoss::Z_
double Z_
Atomic number of material (usually silicon Z=14)
Definition: EnergyLoss.cc:58
fastsim::InteractionModel
Base class for any interaction model between a particle and a tracker layer.
Definition: InteractionModel.h:29
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
p2
double p2[4]
Definition: TauolaWrapper.h:90
fastsim::Particle::position
const math::XYZTLorentzVector & position() const
Return position of the particle.
Definition: Particle.h:140
fastsim::EnergyLoss::radLenInCm_
double radLenInCm_
Radiation length of material (usually silicon X0=9.360)
Definition: EnergyLoss.cc:56
fastsim::Constants::eMass
static constexpr double eMass
Electron mass[GeV].
Definition: Constants.h:13
fastsim::Particle::charge
double charge() const
Return charge of the particle.
Definition: Particle.h:137
LandauFluctuationGenerator::landau
double landau(RandomEngineAndDistribution const *random) const
Random generator of the dE/dX spread (Landau function)
Definition: LandauFluctuationGenerator.h:29
looper.cfg
cfg
Definition: looper.py:297
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
fastsim::EnergyLoss::A_
double A_
Atomic weight of material (usually silicon A=28.0855)
Definition: EnergyLoss.cc:57
fastsim::EnergyLoss::minMomentum_
double minMomentum_
Minimum momentum of incoming (charged) particle.
Definition: EnergyLoss.cc:54
LandauFluctuationGenerator
Definition: LandauFluctuationGenerator.h:20