11 #include <Math/AxisAngle.h>
51 std::vector<std::unique_ptr<Particle> >& secondaries,
73 std::vector<std::unique_ptr<fastsim::Particle> >& secondaries,
78 if (particle.
charge() == 0) {
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_;
129 double norm = particle.
position().Rho();
137 particle.
position().Y() + delta.Y(),
138 particle.
position().Z() + delta.Z(),
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.);
static std::vector< std::string > checklist log
Implementation of a generic detector layer (base class for forward/barrel layers).
const math::XYZTLorentzVector & position() const
Return position of the particle.
virtual const double getThickness(const math::XYZTLorentzVector &position) const =0
Return thickness of the layer at a given position.
double flatShoot(double xmin=0.0, double xmax=1.0) const
Sin< T >::type sin(const T &t)
Geom::Theta< T > theta() const
~MultipleScattering() override
Default destructor.
constexpr std::array< uint8_t, layerIndexSize > layer
Base class for any interaction model between a particle and a tracker layer.
XYZVector orthogonal(const XYZVector &aVector) const
Return an orthogonal vector.
Cos< T >::type cos(const T &t)
Abs< T >::type abs(const T &t)
XYZVectorD XYZVector
spatial vector with cartesian internal representation
virtual bool isForward() const =0
Returns false/true depending if the object is a (non-abstract) barrel/forward layer.
const double getGeomProperty() const
Return geometric attribute of the layer.
double charge() const
Return charge of the particle.
T getParameter(std::string const &) const
MultipleScattering(const std::string &name, const edm::ParameterSet &cfg)
Constructor.
double radLenInCm_
Radiation length of material (usually silicon X0=9.360)
double gaussShoot(double mean=0.0, double sigma=1.0) const
Implementation of multiple scattering in the tracker layers.
const math::XYZTLorentzVector & momentum() const
Return momentum of the particle.
#define DEFINE_EDM_PLUGIN(factory, type, name)
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.