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::ProducerBase &producer) 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 35 of file EnergyLoss.cc.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 63 of file EnergyLoss.cc.

References A_, density_, edm::ParameterSet::getParameter(), minMomentum_, radLenInCm_, and Z_.

65 {
66  // Set the minimal momentum
67  minMomentum_ = cfg.getParameter<double>("minMomentumCut");
68  // Material properties
69  A_ = cfg.getParameter<double>("A");
70  Z_ = cfg.getParameter<double>("Z");
71  density_ = cfg.getParameter<double>("density");
72  radLenInCm_ = cfg.getParameter<double>("radLen");
73 }
T getParameter(std::string const &) const
double Z_
Atomic number of material (usually silicon Z=14)
Definition: EnergyLoss.cc:59
double radLenInCm_
Radiation length of material (usually silicon X0=9.360)
Definition: EnergyLoss.cc:57
double A_
Atomic weight of material (usually silicon A=28.0855)
Definition: EnergyLoss.cc:58
Base class for any interaction model between a particle and a tracker layer.
LandauFluctuationGenerator theGenerator
Generator to do Landau fluctuation.
Definition: EnergyLoss.cc:54
double minMomentum_
Minimum momentum of incoming (charged) particle.
Definition: EnergyLoss.cc:55
double density_
Density of material (usually silicon rho=2.329)
Definition: EnergyLoss.cc:56
fastsim::EnergyLoss::~EnergyLoss ( )
inlineoverride

Default destructor.

Definition at line 42 of file EnergyLoss.cc.

References interact(), and random.

42 {;};

Member Function Documentation

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 75 of file EnergyLoss.cc.

References A_, fastsim::Particle::charge(), DEFINE_EDM_PLUGIN, density_, reco::e2, fastsim::Constants::eMass, fastsim::SimplifiedGeometry::getThickness(), LandauFluctuationGenerator::landau(), cmsBatch::log, minMomentum_, fastsim::Particle::momentum(), p2, fastsim::Particle::position(), radLenInCm_, fastsim::Particle::setEnergyDeposit(), mathSSE::sqrt(), theGenerator, and Z_.

Referenced by ~EnergyLoss().

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  {
86  return;
87  }
88 
89  //
90  // only charged particles
91  //
92  if(particle.charge()==0)
93  {
94  return;
95  }
96 
97  //
98  // minimum momentum
99  //
100  double p2 = particle.momentum().Vect().Mag2();
101  if(p2 < minMomentum_ * minMomentum_){
102  return;
103  }
104 
105  // Mean excitation energy (in GeV)
106  double excitE = 12.5E-9 * Z_;
107 
108  // The thickness in cm
109  double thick = radLengths * radLenInCm_;
110 
111  // This is a simple version (a la PDG) of a dE/dx generator.
112  // It replaces the buggy GEANT3 -> C++ former version.
113  // Author : Patrick Janot - 8-Jan-2004
114 
115  double m2 = particle.momentum().mass() * particle.momentum().mass();
116  double e2 = p2 + m2;
117 
118  double beta2 = p2 / e2;
119  double gama2 = e2 / m2;
120 
121  double charge2 = particle.charge() * particle.charge();
122 
123  // Energy loss spread in GeV
124  double eSpread = 0.1536E-3 * charge2 * (Z_ / A_) * density_ * thick / beta2;
125 
126  // Most probable energy loss (from the integrated Bethe-Bloch equation)
127  double mostProbableLoss = eSpread * (
128  log(2. * fastsim::Constants::eMass * beta2 * gama2 * eSpread / (excitE*excitE))
129  - beta2 + 0.200);
130 
131  // Generate the energy loss with Landau fluctuations
132  double dedx = mostProbableLoss + eSpread * theGenerator.landau(&random);
133 
134  // Compute the new energy and momentum
135  double newE = particle.momentum().e() - dedx;
136 
137  // Particle is stopped
138  double eDiff2 = newE * newE - m2;
139  if(eDiff2 < 0){
140  particle.momentum().SetXYZT(0.,0.,0.,0.);
141  // The energy is deposited in the detector
142  // Assigned with SimHit (if active layer) -> see TrackerSimHitProducer
143  particle.setEnergyDeposit(particle.momentum().e() - particle.momentum().mass());
144  return;
145  }
146 
147  // Relative change in momentum
148  double fac = std::sqrt(eDiff2 / p2);
149 
150  // The energy is deposited in the detector
151  // Assigned with SimHit (if active layer) -> see TrackerSimHitProducer
152  particle.setEnergyDeposit(dedx);
153 
154  // Update the momentum
155  particle.momentum().SetXYZT(particle.momentum().Px() * fac,
156  particle.momentum().Py() * fac,
157  particle.momentum().Pz() * fac,
158  newE);
159 }
const math::XYZTLorentzVector & position() const
Return position of the particle.
Definition: Particle.h:142
double Z_
Atomic number of material (usually silicon Z=14)
Definition: EnergyLoss.cc:59
double radLenInCm_
Radiation length of material (usually silicon X0=9.360)
Definition: EnergyLoss.cc:57
double A_
Atomic weight of material (usually silicon A=28.0855)
Definition: EnergyLoss.cc:58
static double constexpr eMass
Electron mass[GeV].
Definition: Constants.h:17
LandauFluctuationGenerator theGenerator
Generator to do Landau fluctuation.
Definition: EnergyLoss.cc:54
T sqrt(T t)
Definition: SSEVec.h:18
double minMomentum_
Minimum momentum of incoming (charged) particle.
Definition: EnergyLoss.cc:55
double p2[4]
Definition: TauolaWrapper.h:90
double landau(RandomEngineAndDistribution const *random) const
Random generator of the dE/dX spread (Landau function)
double charge() const
Return charge of the particle.
Definition: Particle.h:139
double density_
Density of material (usually silicon rho=2.329)
Definition: EnergyLoss.cc:56
Float e2
Definition: deltaR.h:21
const math::XYZTLorentzVector & momentum() const
Return momentum of the particle.
Definition: Particle.h:145
void setEnergyDeposit(double energyDeposit)
Set the energy the particle deposited in the tracker layer that was last hit (ionization).
Definition: Particle.h:92

Member Data Documentation

double fastsim::EnergyLoss::A_
private

Atomic weight of material (usually silicon A=28.0855)

Definition at line 58 of file EnergyLoss.cc.

Referenced by EnergyLoss(), and interact().

double fastsim::EnergyLoss::density_
private

Density of material (usually silicon rho=2.329)

Definition at line 56 of file EnergyLoss.cc.

Referenced by EnergyLoss(), and interact().

double fastsim::EnergyLoss::minMomentum_
private

Minimum momentum of incoming (charged) particle.

Definition at line 55 of file EnergyLoss.cc.

Referenced by EnergyLoss(), and interact().

double fastsim::EnergyLoss::radLenInCm_
private

Radiation length of material (usually silicon X0=9.360)

Definition at line 57 of file EnergyLoss.cc.

Referenced by EnergyLoss(), and interact().

LandauFluctuationGenerator fastsim::EnergyLoss::theGenerator
private

Generator to do Landau fluctuation.

Definition at line 54 of file EnergyLoss.cc.

Referenced by interact().

double fastsim::EnergyLoss::Z_
private

Atomic number of material (usually silicon Z=14)

Definition at line 59 of file EnergyLoss.cc.

Referenced by EnergyLoss(), and interact().