Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:31

0001 #ifndef GsfPropagatorWithMaterial_h_
0002 #define GsfPropagatorWithMaterial_h_
0003 
0004 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
0005 #include "TrackingTools/GsfTools/interface/GsfPropagatorAdapter.h"
0006 #include "TrackingTools/GsfTracking/interface/GsfMaterialEffectsUpdator.h"
0007 #include "TrackingTools/GsfTracking/interface/FullConvolutionWithMaterial.h"
0008 #include "DataFormats/GeometryCommonDetAlgo/interface/DeepCopyPointerByClone.h"
0009 
0010 class MagneticField;
0011 
0012 // #include "Utilities/Timing/interface/TimingReport.h"
0013 
0014 /** \class GsfPropagatorWithMaterial
0015  * Propagation including material effects on destination surface
0016  * for multiple trajectory states.
0017  * Propagates components independently using a specific propagator
0018  * for the geometrical part and a GsfMaterialEffectsUpdator to include
0019  * multiple scattering and energy loss at the destination.
0020  * The number of components will increase according to the result
0021  * of the GsfMaterialEffectsUpdator.
0022  */
0023 class GsfPropagatorWithMaterial : public Propagator {
0024 public:
0025   // Constructors
0026   /** Constructor with explicit single state propagator and
0027    * material effects objects.
0028    */
0029   GsfPropagatorWithMaterial(const Propagator& Propagator, const GsfMaterialEffectsUpdator& MEUpdator);
0030   /** Constructor with explicit multi state propagator and convolutor.
0031    */
0032   GsfPropagatorWithMaterial(const GsfPropagatorAdapter& Propagator, const FullConvolutionWithMaterial& Convolutor);
0033 
0034   ~GsfPropagatorWithMaterial() override {}
0035 
0036   using Propagator::propagate;
0037   using Propagator::propagateWithPath;
0038 
0039   /** Propagation to plane with path length calculation.
0040    */
0041   std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const TrajectoryStateOnSurface&,
0042                                                                 const Plane&) const override;
0043 
0044   /** Propagation to cylinder with path length calculation.
0045    */
0046   std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const TrajectoryStateOnSurface&,
0047                                                                 const Cylinder&) const override;
0048 
0049   /** Propagation to plane with path length calculation.
0050    *  Use from FTS implies single state (better use PropagatorWithMaterial)!
0051    */
0052   std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const FreeTrajectoryState&,
0053                                                                 const Plane&) const override;
0054   /** Propagation to cylinder with path length calculation.
0055    *  Use from FTS implies single state (better use PropagatorWithMaterial)!
0056    */
0057   std::pair<TrajectoryStateOnSurface, double> propagateWithPath(const FreeTrajectoryState&,
0058                                                                 const Cylinder&) const override;
0059 
0060   bool setMaxDirectionChange(float phiMax) override { return theGeometricalPropagator->setMaxDirectionChange(phiMax); }
0061 
0062   void setPropagationDirection(PropagationDirection dir) override;
0063 
0064   enum MaterialLocation { atSource, atDestination, fromDirection };
0065   /** Choice of location for including material effects:
0066    *  fromDirection is equivalent to atSource for propagation alongMomentum
0067    *  and to atDestination for propagation oppositeToMomentum.
0068    *  Inclusion of material effects at the source (either explicitely or
0069    *  implicitely) is not possible if propagating with anyDirection and
0070    *  will effectively disable material effects when propagating from
0071    *  a FreeTrajectoryState.
0072    */
0073   void setMaterialLocation(const MaterialLocation location) { theMaterialLocation = location; }
0074   /// Access to the geometrical propagator
0075   const Propagator& geometricalPropagator() const { return *theGeometricalPropagator; }
0076   /// Access to the convolutor and thus to the material effects
0077   const FullConvolutionWithMaterial& convolutionWithMaterial() const { return *theConvolutor; }
0078 
0079   GsfPropagatorWithMaterial* clone() const override {
0080     return new GsfPropagatorWithMaterial(*theGeometricalPropagator, *theConvolutor);
0081   }
0082 
0083   const MagneticField* magneticField() const override { return theGeometricalPropagator->magneticField(); }
0084 
0085 private:
0086   //   /// Definition of timers (temporary)
0087   //   void defineTimer();
0088   /// Convolution of state+path with material effects
0089   std::pair<TrajectoryStateOnSurface, double> convoluteWithMaterial(
0090       const std::pair<TrajectoryStateOnSurface, double>&) const;
0091   /// Convolution of state with material effects
0092   TrajectoryStateOnSurface convoluteStateWithMaterial(const TrajectoryStateOnSurface, const PropagationDirection) const;
0093   /// Inclusion of material at the source?
0094   bool materialAtSource() const;
0095 
0096 private:
0097   // Geometrical propagator
0098   DeepCopyPointerByClone<GsfPropagatorAdapter> theGeometricalPropagator;
0099   // Material effects & convolution
0100   DeepCopyPointerByClone<FullConvolutionWithMaterial> theConvolutor;
0101   // Use material at source?
0102   MaterialLocation theMaterialLocation;
0103 
0104   typedef std::pair<TrajectoryStateOnSurface, double> TsosWP;
0105   typedef std::vector<TrajectoryStateOnSurface> MultiTSOS;
0106 
0107   //   static TimingReport::Item* propWithPathTimer1;
0108   //   static TimingReport::Item* propWithPathTimer2;
0109 };
0110 
0111 #endif