CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
MultipleScatteringSimulator Class Reference

#include <MultipleScatteringSimulator.h>

Inheritance diagram for MultipleScatteringSimulator:
MaterialEffectsSimulator

Public Member Functions

 MultipleScatteringSimulator (double A, double Z, double density, double radLen)
 Default Constructor. More...
 
 ~MultipleScatteringSimulator () override
 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 (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...
 
virtual void save ()
 Used by NuclearInteractionSimulator to save last sampled event. 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, RandomEngineAndDistribution const *)
 Compute the material effect (calls the sub class) More...
 
virtual ~MaterialEffectsSimulator ()
 

Private Member Functions

void compute (ParticlePropagator &Particle, RandomEngineAndDistribution const *) override
 The real dE/dx generation and particle update. More...
 

Private Attributes

double sqr12
 Save (a tiny bit of) time. 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
 
int theClosestChargedDaughterId
 
GlobalVector theNormalVector
 
double Z
 

Detailed Description

Definition at line 26 of file MultipleScatteringSimulator.h.

Constructor & Destructor Documentation

◆ MultipleScatteringSimulator()

MultipleScatteringSimulator::MultipleScatteringSimulator ( double  A,
double  Z,
double  density,
double  radLen 
)

Default Constructor.

Definition at line 6 of file MultipleScatteringSimulator.cc.

8  sqr12 = std::sqrt(12.);
9 }

References sqr12, and mathSSE::sqrt().

◆ ~MultipleScatteringSimulator()

MultipleScatteringSimulator::~MultipleScatteringSimulator ( )
inlineoverride

Default Destructor.

Definition at line 32 of file MultipleScatteringSimulator.h.

32 {};

Member Function Documentation

◆ compute()

void MultipleScatteringSimulator::compute ( ParticlePropagator Particle,
RandomEngineAndDistribution const *  random 
)
overrideprivatevirtual

The real dE/dx generation and particle update.

Implements MaterialEffectsSimulator.

Definition at line 11 of file MultipleScatteringSimulator.cc.

11  {
12  double p2 = Particle.particle().Vect().Mag2();
13  double m2 = Particle.particle().mass() * Particle.particle().mass();
14  double e = std::sqrt(p2 + m2);
15 
16  double pbeta = p2 / e; // This is p*beta
17 
18  // Average multiple scattering angle from Moliere radius
19  // The sqrt(2) factor is because of the *space* angle
20  double theta0 =
21  0.0136 / pbeta * Particle.particle().charge() * std::sqrt(2. * radLengths) * (1. + 0.038 * std::log(radLengths));
22 
23  // Generate multiple scattering space angle perpendicular to the particle motion
24  double theta = random->gaussShoot(0., theta0);
25  // Plus a random rotation angle around the particle motion
26  double phi = 2. * 3.14159265358979323 * random->flatShoot();
27  // The two rotations
28  RawParticle::Rotation rotation1(orthogonal(Particle.particle().Vect()), theta);
29  RawParticle::Rotation rotation2(Particle.particle().Vect(), phi);
30  // Rotate!
31  Particle.particle().rotate(rotation1);
32  Particle.particle().rotate(rotation2);
33 
34  // Generate mutiple scattering displacements in cm (assuming the detectors
35  // are silicon only to determine the thickness) in the directions orthogonal
36  // to the vector normal to the surface
37  double xp = (cos(phi) * theta / 2. + random->gaussShoot(0., theta0) / sqr12) * radLengths * radLenIncm();
38  double yp = (sin(phi) * theta / 2. + random->gaussShoot(0., theta0) / sqr12) * radLengths * radLenIncm();
39 
40  // Determine a unitary vector tangent to the surface
41  // This tangent vector is unitary because "normal" is
42  // either (0,0,1) in the Endcap or (x,y,0) in the Barrel !
44  XYZVector tangent = orthogonal(normal);
45  // The total displacement
46  XYZVector delta = xp * tangent + yp * normal.Cross(tangent);
47  // Translate!
48  Particle.particle().translate(delta);
49 }

References funct::cos(), dumpMFGeometry_cfg::delta, MillePedeFileConverter_cfg::e, RandomEngineAndDistribution::flatShoot(), RandomEngineAndDistribution::gaussShoot(), dqm-mbProfile::log, callgraph::m2, MaterialEffectsSimulator::orthogonal(), p2, phi, MaterialEffectsSimulator::radLengths, MaterialEffectsSimulator::radLenIncm(), funct::sin(), sqr12, mathSSE::sqrt(), MaterialEffectsSimulator::theNormalVector, theta(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Member Data Documentation

◆ sqr12

double MultipleScatteringSimulator::sqr12
private

Save (a tiny bit of) time.

Definition at line 40 of file MultipleScatteringSimulator.h.

Referenced by compute(), and MultipleScatteringSimulator().

PV3DBase::x
T x() const
Definition: PV3DBase.h:59
MaterialEffectsSimulator::theNormalVector
GlobalVector theNormalVector
Definition: MaterialEffectsSimulator.h:92
XYZVector
math::XYZVector XYZVector
Definition: RawParticle.h:26
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
MaterialEffectsSimulator::orthogonal
XYZVector orthogonal(const XYZVector &) const
A vector orthogonal to another one (because it's not in XYZTLorentzVector)
Definition: MaterialEffectsSimulator.cc:30
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
MaterialEffectsSimulator::Z
double Z
Definition: MaterialEffectsSimulator.h:88
p2
double p2[4]
Definition: TauolaWrapper.h:90
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
MaterialEffectsSimulator::MaterialEffectsSimulator
MaterialEffectsSimulator(double A=28.0855, double Z=14.0000, double density=2.329, double radLen=9.360)
Definition: MaterialEffectsSimulator.cc:9
MaterialEffectsSimulator::radLengths
double radLengths
Definition: MaterialEffectsSimulator.h:84
dumpMFGeometry_cfg.delta
delta
Definition: dumpMFGeometry_cfg.py:25
MaterialEffectsSimulator::density
double density
Definition: MaterialEffectsSimulator.h:89
A
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
MultipleScatteringSimulator::sqr12
double sqr12
Save (a tiny bit of) time.
Definition: MultipleScatteringSimulator.h:40
DDAxes::phi
callgraph.m2
m2
Definition: callgraph.py:38
MaterialEffectsSimulator::radLen
double radLen
Definition: MaterialEffectsSimulator.h:90
RawParticle::Rotation
ROOT::Math::AxisAngle Rotation
Definition: RawParticle.h:44
Particle
Definition: Particle.py:1
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
MaterialEffectsSimulator::radLenIncm
double radLenIncm() const
One radiation length in cm.
Definition: MaterialEffectsSimulator.h:44