11 #include <Math/AxisAngle.h> 51 std::vector<std::unique_ptr<Particle> >& secondaries,
66 minPt_ =
cfg.getParameter<
double>(
"minPt");
73 std::vector<std::unique_ptr<fastsim::Particle> >& secondaries,
78 if (particle.
charge() == 0) {
82 double radLengths = layer.getThickness(particle.
position(), particle.
momentum());
86 if (radLengths < 1E-10) {
91 if (particle.
momentum().Pt() < minPt_) {
100 double pbeta =
p2 /
e;
104 double theta0 = 0.0136 / pbeta * particle.
charge() *
std::sqrt(2. * radLengths) * (1. + 0.038 *
std::log(radLengths));
112 ROOT::Math::AxisAngle rotation1(orthogonal(particle.
momentum().Vect()),
theta);
113 ROOT::Math::AxisAngle rotation2(particle.
momentum().Vect(), phi);
116 particle.
momentum().SetXYZT(rotated.X(), rotated.Y(), rotated.Z(), particle.
momentum().E());
121 double xp = (
cos(phi) *
theta / 2. + random.
gaussShoot(0., theta0) /
sqrt(12.)) * radLengths * radLenInCm_;
122 double yp = (
sin(phi) *
theta / 2. + random.
gaussShoot(0., theta0) /
sqrt(12.)) * radLengths * radLenInCm_;
126 if (layer.isForward()) {
129 double norm = particle.
position().Rho();
143 if (!layer.isForward() &&
std::abs(layer.getGeomProperty() - particle.
position().Rho()) > 1
e-2) {
145 double scalePos = layer.getGeomProperty() / particle.
position().Rho();
153 throw cms::Exception(
"fastsim::MultipleScattering") <<
"particle no longer on layer's surface";
159 double x = fabs(aVector.X());
160 double y = fabs(aVector.Y());
161 double z = fabs(aVector.Z());
164 return x < z ?
XYZVector(0., aVector.Z(), -aVector.Y()) :
XYZVector(aVector.Y(), -aVector.X(), 0.);
166 return y < z ?
XYZVector(-aVector.Z(), 0., aVector.X()) :
XYZVector(aVector.Y(), -aVector.X(), 0.);
Implementation of a generic detector layer (base class for forward/barrel layers).
static const char * normal
Sin< T >::type sin(const T &t)
const math::XYZTLorentzVector & position() const
Return position of the particle.
~MultipleScattering() override
Default destructor.
Base class for any interaction model between a particle and a tracker layer.
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
double gaussShoot(double mean=0.0, double sigma=1.0) const
XYZVector orthogonal(const XYZVector &aVector) const
Return an orthogonal vector.
XYZVectorD XYZVector
spatial vector with cartesian internal representation
const math::XYZTLorentzVector & momentum() const
Return momentum of the particle.
MultipleScattering(const std::string &name, const edm::ParameterSet &cfg)
Constructor.
double charge() const
Return charge of the particle.
double radLenInCm_
Radiation length of material (usually silicon X0=9.360)
math::XYZVector XYZVector
Implementation of multiple scattering in the tracker layers.
#define DEFINE_EDM_PLUGIN(factory, type, name)
double flatShoot(double xmin=0.0, double xmax=1.0) const
Definition of a generic FastSim Particle which can be propagated through the detector (formerly Parti...
math::XYZVector XYZVector
void interact(Particle &particle, const SimplifiedGeometry &layer, std::vector< std::unique_ptr< Particle > > &secondaries, const RandomEngineAndDistribution &random) override
Perform the interaction.
double minPt_
Cut on minimum pT of particle.