Main Page
Namespaces
Classes
Package Documentation
FastSimulation
MaterialEffects
src
MultipleScatteringSimulator.cc
Go to the documentation of this file.
1
#include "
FastSimulation/MaterialEffects/interface/MultipleScatteringSimulator.h
"
2
#include "
FastSimulation/Utilities/interface/RandomEngineAndDistribution.h
"
3
4
#include <cmath>
5
6
MultipleScatteringSimulator::MultipleScatteringSimulator
(
7
double
A
,
double
Z
,
double
density,
double
radLen) :
8
MaterialEffectsSimulator
(A,Z,density,radLen)
9
{
10
sqr12
=
std::sqrt
(12.);
11
}
12
13
void
MultipleScatteringSimulator::compute
(
ParticlePropagator
&
Particle
,
RandomEngineAndDistribution
const
*
random
)
14
{
15
16
double
p2
= Particle.
particle
().
Vect
().Mag2();
17
double
m2 = Particle.
particle
().
mass
()*Particle.
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.
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.
particle
().
Vect
()),theta);
34
RawParticle::Rotation
rotation2(Particle.
particle
().
Vect
(),
phi
);
35
// Rotate!
36
Particle.
particle
().
rotate
(rotation1);
37
Particle.
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 !
50
XYZVector
normal(
theNormalVector
.
x
(),
theNormalVector
.
y
(),
theNormalVector
.
z
());
51
XYZVector
tangent =
orthogonal
(normal);
52
// The total displacement
53
XYZVector
delta
= xp*tangent + yp*normal.Cross(tangent);
54
// Translate!
55
Particle.
particle
().
translate
(delta);
56
57
}
58
delta
dbl * delta
Definition:
mlp_gen.cc:36
RawParticle::translate
void translate(const XYZVector &t)
Definition:
RawParticle.h:380
RawParticle::Vect
XYZVector Vect() const
the momentum threevector
Definition:
RawParticle.h:342
RandomEngineAndDistribution::flatShoot
double flatShoot(double xmin=0.0, double xmax=1.0) const
Definition:
RandomEngineAndDistribution.h:29
Particle
Definition:
Particle.py:1
funct::sin
Sin< T >::type sin(const T &t)
Definition:
Sin.h:22
theta
Geom::Theta< T > theta() const
Definition:
Basic3DVectorLD.h:179
PV3DBase::y
T y() const
Definition:
PV3DBase.h:63
MaterialEffectsSimulator::orthogonal
XYZVector orthogonal(const XYZVector &) const
A vector orthogonal to another one (because it's not in XYZTLorentzVector)
Definition:
MaterialEffectsSimulator.cc:35
MultipleScatteringSimulator::compute
void compute(ParticlePropagator &Particle, RandomEngineAndDistribution const *) override
The real dE/dx generation and particle update.
Definition:
MultipleScatteringSimulator.cc:13
random
TRandom random
Definition:
MVATrainer.cc:138
MillePedeFileConverter_cfg.e
e
Definition:
MillePedeFileConverter_cfg.py:37
BaseParticlePropagator::particle
RawParticle const & particle() const
The particle being propagated.
Definition:
BaseParticlePropagator.h:169
RawParticle::mass
double mass() const
get the MEASURED mass
Definition:
RawParticle.h:314
DDAxes::phi
ParticlePropagator
Definition:
ParticlePropagator.h:28
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:18
PV3DBase::z
T z() const
Definition:
PV3DBase.h:64
funct::cos
Cos< T >::type cos(const T &t)
Definition:
Cos.h:22
RawParticle::rotate
void rotate(double rphi, const XYZVector &raxis)
Definition:
RawParticle.cc:83
RawParticle::charge
double charge() const
get the MEASURED charge
Definition:
RawParticle.h:313
p2
double p2[4]
Definition:
TauolaWrapper.h:90
MultipleScatteringSimulator::MultipleScatteringSimulator
MultipleScatteringSimulator(double A, double Z, double density, double radLen)
Default Constructor.
Definition:
MultipleScatteringSimulator.cc:6
MultipleScatteringSimulator.h
cmsBatch.log
log
Definition:
cmsBatch.py:343
MaterialEffectsSimulator::radLengths
double radLengths
Definition:
MaterialEffectsSimulator.h:91
DOFs::Z
Definition:
AlignPCLThresholdsWriter.cc:40
RawParticle::Rotation
ROOT::Math::AxisAngle Rotation
Definition:
RawParticle.h:47
RandomEngineAndDistribution::gaussShoot
double gaussShoot(double mean=0.0, double sigma=1.0) const
Definition:
RandomEngineAndDistribution.h:33
MaterialEffectsSimulator::radLenIncm
double radLenIncm() const
One radiation length in cm.
Definition:
MaterialEffectsSimulator.h:49
RandomEngineAndDistribution.h
patCaloMETCorrections_cff.A
A
Definition:
patCaloMETCorrections_cff.py:43
XYZVector
math::XYZVector XYZVector
Definition:
RawParticle.h:28
PV3DBase::x
T x() const
Definition:
PV3DBase.h:62
RandomEngineAndDistribution
Definition:
RandomEngineAndDistribution.h:18
MaterialEffectsSimulator::theNormalVector
GlobalVector theNormalVector
Definition:
MaterialEffectsSimulator.h:99
MaterialEffectsSimulator
Definition:
MaterialEffectsSimulator.h:25
MultipleScatteringSimulator::sqr12
double sqr12
Save (a tiny bit of) time.
Definition:
MultipleScatteringSimulator.h:44
Generated for CMSSW Reference Manual by
1.8.11