CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
EnergyLossSimulator Class Reference

#include <EnergyLossSimulator.h>

Inheritance diagram for EnergyLossSimulator:
MaterialEffectsSimulator

Public Member Functions

const XYZTLorentzVectordeltaMom () const
 Returns the actual energy lost. More...
 
 EnergyLossSimulator (const RandomEngine *engine, double A, double Z, double density, double radLen)
 Constructor. More...
 
double mostLikelyLoss () const
 Return most probable energy loss. More...
 
 ~EnergyLossSimulator ()
 Default Destructor. More...
 
- Public Member Functions inherited from MaterialEffectsSimulator
RHEP_const_iter beginDaughters () const
 Returns const iterator to the beginning of the daughters list. More...
 
int closestDaughterId ()
 The id of the closest charged daughter (filled for nuclear interactions only) More...
 
double eMass () const
 Electron mass in GeV/c2. More...
 
RHEP_const_iter endDaughters () const
 Returns const iterator to the end of the daughters list. More...
 
double excitE () const
 Mean excitation energy (in GeV) More...
 
 MaterialEffectsSimulator (const RandomEngine *engine, double A=28.0855, double Z=14.0000, double density=2.329, double radLen=9.360)
 
unsigned nDaughters () const
 Returns the number of daughters. More...
 
XYZVector orthogonal (const XYZVector &) const
 A vector orthogonal to another one (because it's not in XYZTLorentzVector) More...
 
double radLenIncm () const
 One radiation length in cm. More...
 
double rho () const
 Density in g/cm3. More...
 
void setNormalVector (const GlobalVector &normal)
 Sets the vector normal to the surface traversed. More...
 
double theA () const
 A. More...
 
double theZ () const
 Z. More...
 
void updateState (ParticlePropagator &myTrack, double radlen)
 Compute the material effect (calls the sub class) More...
 
virtual ~MaterialEffectsSimulator ()
 

Private Member Functions

void compute (ParticlePropagator &Particle)
 The real dE/dx generation and particle update. More...
 

Private Attributes

XYZTLorentzVector deltaP
 The actual energy loss. More...
 
double mostProbableLoss
 The most probable enery loss. More...
 
LandauFluctuationGeneratortheGenerator
 The Landau Fluctuation generator. More...
 

Additional Inherited Members

- Public Types inherited from MaterialEffectsSimulator
typedef std::vector
< RawParticle >
::const_iterator 
RHEP_const_iter
 
- Protected Attributes inherited from MaterialEffectsSimulator
std::vector< RawParticle_theUpdatedState
 
double A
 
double density
 
double radLen
 
double radLengths
 
const RandomEnginerandom
 
int theClosestChargedDaughterId
 
GlobalVector theNormalVector
 
double Z
 

Detailed Description

Definition at line 26 of file EnergyLossSimulator.h.

Constructor & Destructor Documentation

EnergyLossSimulator::EnergyLossSimulator ( const RandomEngine engine,
double  A,
double  Z,
double  density,
double  radLen 
)

Constructor.

Definition at line 7 of file EnergyLossSimulator.cc.

References theGenerator.

8  :
10 {
11 
13 
14 }
LandauFluctuationGenerator * theGenerator
The Landau Fluctuation generator.
MaterialEffectsSimulator(const RandomEngine *engine, double A=28.0855, double Z=14.0000, double density=2.329, double radLen=9.360)
EnergyLossSimulator::~EnergyLossSimulator ( )

Default Destructor.

Definition at line 16 of file EnergyLossSimulator.cc.

References theGenerator.

16  {
17 
18  delete theGenerator;
19 
20 }
LandauFluctuationGenerator * theGenerator
The Landau Fluctuation generator.

Member Function Documentation

void EnergyLossSimulator::compute ( ParticlePropagator Particle)
privatevirtual

The real dE/dx generation and particle update.

Implements MaterialEffectsSimulator.

Definition at line 23 of file EnergyLossSimulator.cc.

References RawParticle::charge(), deltaP, MaterialEffectsSimulator::eMass(), MaterialEffectsSimulator::excitE(), LandauFluctuationGenerator::landau(), create_public_lumi_plots::log, RawParticle::mass(), max(), mostProbableLoss, p2, MaterialEffectsSimulator::radLengths, MaterialEffectsSimulator::radLenIncm(), MaterialEffectsSimulator::rho(), mathSSE::sqrt(), MaterialEffectsSimulator::theA(), theGenerator, and MaterialEffectsSimulator::theZ().

24 {
25 
26  // FamosHistos* myHistos = FamosHistos::instance();
27 
28  // double gamma_e = 0.577215664901532861; // Euler constant
29 
30  // The thickness in cm
31  double thick = radLengths * radLenIncm();
32 
33  // This is a simple version (a la PDG) of a dE/dx generator.
34  // It replaces the buggy GEANT3 -> C++ former version.
35  // Author : Patrick Janot - 8-Jan-2004
36 
37  double p2 = Particle.Vect().Mag2();
38  double verySmallP2 = 0.0001;
39  if (p2<=verySmallP2) {
40  deltaP.SetXYZT(0.,0.,0.,0.);
41  return;
42  }
43  double m2 = Particle.mass() * Particle.mass();
44  double e2 = p2+m2;
45 
46  double beta2 = p2/e2;
47  double gama2 = e2/m2;
48 
49  double charge2 = Particle.charge() * Particle.charge();
50 
51  // Energy loss spread in GeV
52  double eSpread = 0.1536E-3*charge2*(theZ()/theA())*rho()*thick/beta2;
53 
54  // Most probable energy loss (from the integrated Bethe-Bloch equation)
55  mostProbableLoss = eSpread * ( log ( 2.*eMass()*beta2*gama2*eSpread
56  / (excitE()*excitE()) )
57  - beta2 + 0.200 );
58 
59  // This one can be needed on output (but is not used internally)
60  // meanEnergyLoss = 2.*eSpread * ( log ( 2.*eMass()*beta2*gama2 /excitE() ) - beta2 );
61 
62  // Generate the energy loss with Landau fluctuations
63  double dedx = mostProbableLoss + eSpread * theGenerator->landau();
64 
65  // Compute the new energy and momentum
66  double aBitAboveMass = Particle.mass()*1.0001;
67  double newE = std::max(aBitAboveMass,Particle.e()-dedx);
68  // double newE = std::max(Particle.mass(),Particle.e()-dedx);
69  double fac = std::sqrt((newE*newE-m2)/p2);
70 
71 
72  // Update the momentum
73  deltaP.SetXYZT(Particle.Px()*(1.-fac),Particle.Py()*(1.-fac),
74  Particle.Pz()*(1.-fac),Particle.E()-newE);
75  Particle.SetXYZT(Particle.Px()*fac,Particle.Py()*fac,
76  Particle.Pz()*fac,newE);
77 
78 }
double rho() const
Density in g/cm3.
double mass() const
get the MEASURED mass
Definition: RawParticle.h:282
double mostProbableLoss
The most probable enery loss.
double landau() const
Random generator of the dE/dX spread (Landau function)
const T & max(const T &a, const T &b)
T sqrt(T t)
Definition: SSEVec.h:46
double eMass() const
Electron mass in GeV/c2.
double charge() const
get the MEASURED charge
Definition: RawParticle.h:281
double p2[4]
Definition: TauolaWrapper.h:90
LandauFluctuationGenerator * theGenerator
The Landau Fluctuation generator.
double excitE() const
Mean excitation energy (in GeV)
double radLenIncm() const
One radiation length in cm.
XYZTLorentzVector deltaP
The actual energy loss.
const XYZTLorentzVector& EnergyLossSimulator::deltaMom ( ) const
inline

Returns the actual energy lost.

Definition at line 41 of file EnergyLossSimulator.h.

References deltaP.

Referenced by MuonSimHitProducer::applyMaterialEffects(), and CalorimetryManager::MuonMipSimulation().

41 { return deltaP; }
XYZTLorentzVector deltaP
The actual energy loss.
double EnergyLossSimulator::mostLikelyLoss ( ) const
inline

Return most probable energy loss.

Definition at line 38 of file EnergyLossSimulator.h.

References mostProbableLoss.

Referenced by MuonSimHitProducer::applyMaterialEffects().

38 { return mostProbableLoss; }
double mostProbableLoss
The most probable enery loss.

Member Data Documentation

XYZTLorentzVector EnergyLossSimulator::deltaP
private

The actual energy loss.

Definition at line 54 of file EnergyLossSimulator.h.

Referenced by compute(), and deltaMom().

double EnergyLossSimulator::mostProbableLoss
private

The most probable enery loss.

Definition at line 51 of file EnergyLossSimulator.h.

Referenced by compute(), and mostLikelyLoss().

LandauFluctuationGenerator* EnergyLossSimulator::theGenerator
private

The Landau Fluctuation generator.

Definition at line 45 of file EnergyLossSimulator.h.

Referenced by compute(), EnergyLossSimulator(), and ~EnergyLossSimulator().