# Project CMSSW displayed by LXR

File indexing completed on 2024-04-06 12:11:20

```0001
0002 #ifndef FASTSIM_HELIXTRAJECTORY_H
0003 #define FASTSIM_HELIXTRAJECTORY_H
0004
0005 #include "FastSimulation/SimplifiedGeometryPropagator/interface/Trajectory.h"
0006
0007 ///////////////////////////////////////////////
0008 // Author: L. Vanelderen, S. Kurz
0009 // Date: 29 May 2017
0010 //////////////////////////////////////////////////////////
0011
0012 namespace fastsim {
0013   //! Mathematical representation of a helix.
0014   /*!
0015         Reflects trajectory of a charged particle in a magnetic field.
0016         The trajectory is defined by cylindrical coordinates (see definition of variables for more information).
0017     */
0018   class HelixTrajectory : public Trajectory {
0019   public:
0020     //! Constructor.
0021     /*!
0022             The magnetic field is (to good approximation) constant between two tracker layers (and only in Z-direction).
0023             \param particle A (usually charged) particle.
0024             \param magneticFieldZ The magnetic field.
0025         */
0026     HelixTrajectory(const Particle& particle, double magneticFieldZ);
0027
0028     //! Check if an intersection of the trajectory with a barrel layer exists.
0029     /*!
0030             \param layer A barrel layer.
0031         */
0032     bool crosses(const BarrelSimplifiedGeometry& layer) const override;
0033
0034     //! Return delta time (t*c) of the next intersection of trajectory and barrel layer
0035     /*!
0036             This function solves the quadratic equation (basically intersection of two circles with a given radius)
0037             in order to calculate the moment in time when the particle's trajectory intersects with a given barrel layer.
0038             \param layer A barrel layer.
0039             \param onLayer Specify if the particle already is on the layer (in that case the second solution has to be picked).
0040             \return t*c [ns * cm/ns] of next intersection (-1 if there is none).
0041         */
0042     double nextCrossingTimeC(const BarrelSimplifiedGeometry& layer, bool onLayer = false) const override;
0043
0044     //! Move the particle along the helix trajectory for a given time.
0045     /*!
0046             \param deltaTimeC Time in units of t*c..
0047         */
0048     void move(double deltaTimeC) override;
0049
0050     //! Return distance of particle from center of the detector if it was at given angle phi of the helix
0051     /*!
0052             \param phi angle of the helix
0053         */
0054     double getRadParticle(double phi) const;
0055
0056   private:
0057     const double radius_;  //!< The radius of the helix
0058     const double phi_;     //!< The angle of the particle alone the helix.
0059         //!< Ranges from 0 to 2PI: 0 corresponds to the positive X direction, phi increases counterclockwise
0060     const double centerX_;   //!< X-coordinate of the center of the helix
0061     const double centerY_;   //!< Y-coordinate of the center of the helix
0062     const double centerR_;   //!< Distance of the center of the helix from the center of the tracker
0063     const double minR_;      //!< The minimal distance of the helix from the center of the tracker
0064     const double maxR_;      //!< The maximum distance of the helix from the center of the tracker
0065     const double phiSpeed_;  //!< The angular speed of the particle on the helix trajectory
0066   };
0067 }  // namespace fastsim
0068
0069 #endif```