CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

MultipleScatteringSimulator Class Reference

#include <MultipleScatteringSimulator.h>

Inheritance diagram for MultipleScatteringSimulator:
MaterialEffectsSimulator

List of all members.

Public Member Functions

 MultipleScatteringSimulator (const RandomEngine *engine, double A, double Z, double density, double radLen)
 Default Constructor.
 ~MultipleScatteringSimulator ()
 Default Destructor.

Private Member Functions

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

Private Attributes

double sqr12
 Save (a tiny bit of) time.

Detailed Description

Definition at line 26 of file MultipleScatteringSimulator.h.


Constructor & Destructor Documentation

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

Default Constructor.

Definition at line 6 of file MultipleScatteringSimulator.cc.

References sqr12, and mathSSE::sqrt().

MultipleScatteringSimulator::~MultipleScatteringSimulator ( ) [inline]

Default Destructor.

Definition at line 35 of file MultipleScatteringSimulator.h.

{} ;

Member Function Documentation

void MultipleScatteringSimulator::compute ( ParticlePropagator Particle) [private, virtual]

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, RandomEngine::flatShoot(), RandomEngine::gaussShoot(), create_public_lumi_plots::log, RawParticle::mass(), MaterialEffectsSimulator::orthogonal(), p2, phi, MaterialEffectsSimulator::radLengths, MaterialEffectsSimulator::radLenIncm(), MaterialEffectsSimulator::random, 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().

{

  double p2 = Particle.Vect().Mag2();
  double m2 = Particle.mass()*Particle.mass();
  double e = std::sqrt(p2+m2);

  double pbeta = p2/e;  // This is p*beta

  // Average multiple scattering angle from Moliere radius
  // The sqrt(2) factor is because of the *space* angle
  double theta0 = 0.0136 / pbeta * Particle.charge() 
                                 * std::sqrt(2.*radLengths) 
                                 * (1. + 0.038*std::log(radLengths));

  // Generate multiple scattering space angle perpendicular to the particle motion
  double theta = random->gaussShoot(0.,theta0); 
  // Plus a random rotation angle around the particle motion
  double phi = 2. * 3.14159265358979323 * random->flatShoot();
  // The two rotations
  RawParticle::Rotation rotation1(orthogonal(Particle.Vect()),theta);
  RawParticle::Rotation rotation2(Particle.Vect(),phi);
  // Rotate!
  Particle.rotate(rotation1); 
  Particle.rotate(rotation2);

  // Generate mutiple scattering displacements in cm (assuming the detectors
  // are silicon only to determine the thickness) in the directions orthogonal
  // to the vector normal to the surface
  double xp = (cos(phi)*theta/2. + random->gaussShoot(0.,theta0)/sqr12)
              * radLengths * radLenIncm();               
  double yp = (sin(phi)*theta/2. + random->gaussShoot(0.,theta0)/sqr12)
              * radLengths * radLenIncm();

  // Determine a unitary vector tangent to the surface
  // This tangent vector is unitary because "normal" is
  // either (0,0,1) in the Endcap  or (x,y,0) in the Barrel !
  XYZVector normal(theNormalVector.x(),theNormalVector.y(),theNormalVector.z());
  XYZVector tangent = orthogonal(normal); 
  // The total displacement 
  XYZVector delta = xp*tangent + yp*normal.Cross(tangent);
  // Translate!
  Particle.translate(delta);

}

Member Data Documentation

Save (a tiny bit of) time.

Definition at line 45 of file MultipleScatteringSimulator.h.

Referenced by compute(), and MultipleScatteringSimulator().