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
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 ()
 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 *)
 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 ( double  A,
double  Z,
double  density,
double  radLen 
)

Default Constructor.

Definition at line 6 of file MultipleScatteringSimulator.cc.

References sqr12, and mathSSE::sqrt().

7  :
9 {
10  sqr12 = std::sqrt(12.);
11 }
T sqrt(T t)
Definition: SSEVec.h:48
MaterialEffectsSimulator(double A=28.0855, double Z=14.0000, double density=2.329, double radLen=9.360)
double sqr12
Save (a tiny bit of) time.
MultipleScatteringSimulator::~MultipleScatteringSimulator ( )
inline

Default Destructor.

Definition at line 34 of file MultipleScatteringSimulator.h.

34 {} ;

Member Function Documentation

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

The real dE/dx generation and particle update.

Implements MaterialEffectsSimulator.

Definition at line 13 of file MultipleScatteringSimulator.cc.

References RawParticle::charge(), funct::cos(), delta, alignCSCRings::e, RandomEngineAndDistribution::flatShoot(), RandomEngineAndDistribution::gaussShoot(), create_public_lumi_plots::log, RawParticle::mass(), MaterialEffectsSimulator::orthogonal(), p2, phi, MaterialEffectsSimulator::radLengths, MaterialEffectsSimulator::radLenIncm(), RawParticle::rotate(), funct::sin(), sqr12, mathSSE::sqrt(), MaterialEffectsSimulator::theNormalVector, theta(), RawParticle::translate(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

14 {
15 
16  double p2 = Particle.Vect().Mag2();
17  double m2 = Particle.mass()*Particle.mass();
18  double e = std::sqrt(p2+m2);
19 
20  double pbeta = p2/e; // This is p*beta
21 
22  // Average multiple scattering angle from Moliere radius
23  // The sqrt(2) factor is because of the *space* angle
24  double theta0 = 0.0136 / pbeta * Particle.charge()
25  * std::sqrt(2.*radLengths)
26  * (1. + 0.038*std::log(radLengths));
27 
28  // Generate multiple scattering space angle perpendicular to the particle motion
29  double theta = random->gaussShoot(0.,theta0);
30  // Plus a random rotation angle around the particle motion
31  double phi = 2. * 3.14159265358979323 * random->flatShoot();
32  // The two rotations
33  RawParticle::Rotation rotation1(orthogonal(Particle.Vect()),theta);
34  RawParticle::Rotation rotation2(Particle.Vect(),phi);
35  // Rotate!
36  Particle.rotate(rotation1);
37  Particle.rotate(rotation2);
38 
39  // Generate mutiple scattering displacements in cm (assuming the detectors
40  // are silicon only to determine the thickness) in the directions orthogonal
41  // to the vector normal to the surface
42  double xp = (cos(phi)*theta/2. + random->gaussShoot(0.,theta0)/sqr12)
43  * radLengths * radLenIncm();
44  double yp = (sin(phi)*theta/2. + random->gaussShoot(0.,theta0)/sqr12)
45  * radLengths * radLenIncm();
46 
47  // Determine a unitary vector tangent to the surface
48  // This tangent vector is unitary because "normal" is
49  // either (0,0,1) in the Endcap or (x,y,0) in the Barrel !
51  XYZVector tangent = orthogonal(normal);
52  // The total displacement
53  XYZVector delta = xp*tangent + yp*normal.Cross(tangent);
54  // Translate!
55  Particle.translate(delta);
56 
57 }
dbl * delta
Definition: mlp_gen.cc:36
void translate(const XYZVector &t)
Definition: RawParticle.h:315
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Theta< T > theta() const
T y() const
Definition: PV3DBase.h:63
XYZVector orthogonal(const XYZVector &) const
A vector orthogonal to another one (because it&#39;s not in XYZTLorentzVector)
TRandom random
Definition: MVATrainer.cc:138
double mass() const
get the MEASURED mass
Definition: RawParticle.h:283
math::XYZVector XYZVector
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
void rotate(double rphi, const XYZVector &raxis)
Definition: RawParticle.cc:155
double charge() const
get the MEASURED charge
Definition: RawParticle.h:282
double p2[4]
Definition: TauolaWrapper.h:90
ROOT::Math::AxisAngle Rotation
Definition: RawParticle.h:35
double radLenIncm() const
One radiation length in cm.
T x() const
Definition: PV3DBase.h:62
double sqr12
Save (a tiny bit of) time.

Member Data Documentation

double MultipleScatteringSimulator::sqr12
private

Save (a tiny bit of) time.

Definition at line 44 of file MultipleScatteringSimulator.h.

Referenced by compute(), and MultipleScatteringSimulator().