Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:26:46

0001 #ifndef FASTSIM_STRAIGHTTRAJECTORY_H
0002 #define FASTSIM_STRAIGHTTRAJECTORY_H
0003 
0004 #include "FastSimulation/SimplifiedGeometryPropagator/interface/Trajectory.h"
0005 
0006 ///////////////////////////////////////////////
0007 // Author: L. Vanelderen, S. Kurz
0008 // Date: 29 May 2017
0009 //////////////////////////////////////////////////////////
0010 
0011 namespace fastsim {
0012   //! Mathematical representation of a straight trajectory.
0013   /*!
0014         Reflects trajectory of a uncharged particle.
0015     */
0016   class StraightTrajectory : public Trajectory {
0017   public:
0018     //! Constructor.
0019     /*
0020             \param particle A (usually uncharged) particle (or charged particle with very high pT so that trajectory can be considered straight).
0021         */
0022     StraightTrajectory(const Particle& particle) : Trajectory(particle) { ; }
0023 
0024     //! Use Copy Constructor.
0025     /*
0026             \param trajectory StraightTrajectory does not have any special attribues so it can be copied right away
0027         */
0028     StraightTrajectory(const Trajectory& trajectory) : Trajectory(trajectory) { ; }
0029 
0030     //! Check if an intersection of the trajectory with a barrel layer exists.
0031     /*!
0032             There is always an intersection between a straight line and a barrel layer unless the trajectory is parallel to z axis. In this case, the particle is not propagated anyways since it will not hit any detector material.
0033             \param layer A barrel layer.
0034             \return true
0035         */
0036     bool crosses(const BarrelSimplifiedGeometry& layer) const override { return true; }
0037 
0038     //! Return delta time (t*c) of the next intersection of trajectory and barrel layer
0039     /*!
0040             This function solves the quadratic equation (basically intersection a circle with a given radius and a straight line) in order to calculate the moment in time when the particle's trajectory intersects with a given barrel layer.
0041             \param layer A barrel layer.
0042             \param onLayer Specify if the particle already is on the layer (in that case the second solution has to be picked).
0043             \return t*c [ns * cm/ns] of next intersection (-1 if there is none).
0044         */
0045     double nextCrossingTimeC(const BarrelSimplifiedGeometry& layer, bool onLayer = false) const override;
0046 
0047     //! Move the particle along the helix trajectory for a given time.
0048     /*!
0049             \param deltaTimeC Time in units of t*c..
0050         */
0051     void move(double deltaTimeC) override;
0052   };
0053 }  // namespace fastsim
0054 
0055 #endif