Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef FASTSIM_LAYERNAVIGATOR_H
0002 #define FASTSIM_LAYERNAVIGATOR_H
0003 
0004 #include <string>
0005 
0006 ///////////////////////////////////////////////
0007 // Author: L. Vanelderen, S. Kurz
0008 // Date: 29 May 2017
0009 //////////////////////////////////////////////////////////
0010 
0011 namespace fastsim {
0012   class SimplifiedGeometry;
0013   class ForwardSimplifiedGeometry;
0014   class BarrelSimplifiedGeometry;
0015   class Geometry;
0016   class Particle;
0017 
0018   //! Handles/tracks (possible) intersections of particle's trajectory and tracker layers.
0019   /*!
0020         the geometry is described by 2 sets of layers:
0021             - forward layers: 
0022                 flat layers, perpendicular to the z-axis, positioned at a given z
0023                 these layers have material / instruments between a given materialMinR and materialMaxR
0024                 no 2 forward layers should have the same z-position
0025             - barrel layers: 
0026                 cylindrically shaped layers, with the z-axis as axis, infinitely long
0027                 these layers have material / instruments for |z| < materialMaxAbsZ
0028                 no 2 barrel layers should have the same radius
0029             - forward (barrel) layers are ordered according to increasing z (r)
0030 
0031         principle
0032             - neutral particles follow a straight trajectory
0033             - charged particles follow a helix-shaped trajectory:
0034                 constant speed along the z-axis
0035                 circular path in the x-y plane
0036             => the next layer that the particle will cross is among the following 3 layers
0037                 - closest forward layer with
0038                 - z >(<) particle.z() for particles moving in the positive(negative) direction
0039                 - closest barrel layer with r < particle.r
0040                 - closest barrel layer with r > particle.r  
0041 
0042         algorithm
0043             - find the 3 candidate layers 
0044             - find the earliest positive intersection time for each of the 3 candidate layers
0045             - move the particle to the earliest intersection time
0046             - select and return the layer with the earliest positive intersection time
0047     */
0048   class LayerNavigator {
0049   public:
0050     //! Constructor.
0051     /*!
0052             \param geometry The geometry of the tracker material.
0053         */
0054     LayerNavigator(const Geometry& geometry);
0055 
0056     //! Move particle along its trajectory to the next intersection with any of the tracker layers.
0057     /*!
0058             \param particle The particle that has to be moved to the next layer.
0059             \param layer The layer to which the particle was moved in the previous call of this function (0 if first call). Returns the layer this particle was then moved to.
0060             \return true / false if propagation succeeded / failed.
0061         */
0062     bool moveParticleToNextLayer(Particle& particle, const SimplifiedGeometry*& layer);
0063 
0064   private:
0065     const Geometry* const geometry_;  //!< The geometry of the tracker material
0066     const BarrelSimplifiedGeometry*
0067         nextBarrelLayer_;  //!< Pointer to the next (direction of the particle's momentum) barrel layer
0068     const BarrelSimplifiedGeometry*
0069         previousBarrelLayer_;  //!< Pointer to the previous (opposite direction of the particle's momentum) barrel layer
0070     const ForwardSimplifiedGeometry*
0071         nextForwardLayer_;  //!< Pointer to the next (direction of the particle's momentum) forward layer
0072     const ForwardSimplifiedGeometry*
0073         previousForwardLayer_;  //!< Pointer to the previous (opposite direction of the particle's momentum) forward layer
0074     static const std::string MESSAGECATEGORY;
0075   };
0076 }  // namespace fastsim
0077 
0078 #endif