CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10/src/TrackingTools/GsfTracking/interface/GsfPropagatorWithMaterial.h

Go to the documentation of this file.
00001 #ifndef GsfPropagatorWithMaterial_h_
00002 #define GsfPropagatorWithMaterial_h_
00003 
00004 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
00005 #include "TrackingTools/GsfTools/interface/GsfPropagatorAdapter.h"
00006 #include "TrackingTools/GsfTracking/interface/GsfMaterialEffectsUpdator.h"
00007 #include "TrackingTools/GsfTracking/interface/FullConvolutionWithMaterial.h"
00008 #include "DataFormats/GeometryCommonDetAlgo/interface/DeepCopyPointerByClone.h"
00009 
00010 class MagneticField;
00011 
00012 // #include "Utilities/Timing/interface/TimingReport.h"
00013 
00023 class GsfPropagatorWithMaterial : public Propagator {
00024 
00025  public:
00026   // Constructors
00030   GsfPropagatorWithMaterial(const Propagator& Propagator,
00031                             const GsfMaterialEffectsUpdator& MEUpdator);
00034   GsfPropagatorWithMaterial(const GsfPropagatorAdapter& Propagator,
00035                             const FullConvolutionWithMaterial& Convolutor);
00036 
00037   ~GsfPropagatorWithMaterial() {}
00038 
00041   virtual TrajectoryStateOnSurface propagate (const TrajectoryStateOnSurface& tsos, 
00042                                               const Surface& surface) const
00043   {
00044     return Propagator::propagate(tsos,surface);
00045   }
00049   virtual TrajectoryStateOnSurface propagate (const TrajectoryStateOnSurface& tsos, 
00050                                               const Plane& plane) const
00051   {
00052     return propagateWithPath(tsos,plane).first;
00053   }
00057   virtual TrajectoryStateOnSurface propagate (const TrajectoryStateOnSurface& tsos, 
00058                                               const Cylinder& cylinder) const
00059   {
00060     return propagateWithPath(tsos,cylinder).first;
00061   }
00062 
00066   virtual std::pair<TrajectoryStateOnSurface,double> 
00067   propagateWithPath (const TrajectoryStateOnSurface& tsos, 
00068                      const Surface& surface) const
00069   {
00070     return Propagator::propagateWithPath(tsos,surface);
00071   }
00074   virtual std::pair<TrajectoryStateOnSurface,double> 
00075   propagateWithPath (const TrajectoryStateOnSurface&, 
00076                      const Plane&) const;
00079   virtual std::pair<TrajectoryStateOnSurface,double> 
00080   propagateWithPath (const TrajectoryStateOnSurface&, 
00081                      const Cylinder&) const;
00082 
00086   virtual TrajectoryStateOnSurface propagate (const FreeTrajectoryState& fts, 
00087                                               const Surface& surface) const
00088   {
00089     return Propagator::propagate(fts,surface);
00090   }
00095   virtual TrajectoryStateOnSurface propagate (const FreeTrajectoryState& fts, 
00096                                               const Plane& plane) const
00097   {
00098     return propagateWithPath(fts,plane).first;
00099   }
00104   virtual TrajectoryStateOnSurface propagate (const FreeTrajectoryState& fts, 
00105                                               const Cylinder& cylinder) const
00106   {
00107     return propagateWithPath(fts,cylinder).first;
00108   }
00109 
00114   virtual std::pair<TrajectoryStateOnSurface,double> propagateWithPath (const FreeTrajectoryState& fts, 
00115                                                                    const Surface& surface) const
00116   {
00117     return Propagator::propagateWithPath(fts,surface);
00118   }
00122   virtual std::pair<TrajectoryStateOnSurface,double> propagateWithPath (const FreeTrajectoryState&, 
00123                                                                    const Plane&) const;
00127   virtual std::pair<TrajectoryStateOnSurface,double> propagateWithPath (const FreeTrajectoryState&, 
00128                                                                    const Cylinder&) const;
00129 
00130   virtual bool setMaxDirectionChange( float phiMax) { 
00131     return theGeometricalPropagator->setMaxDirectionChange(phiMax);
00132   }
00133 
00134  virtual void setPropagationDirection (PropagationDirection dir) const;
00135 
00136   enum MaterialLocation {atSource, atDestination, fromDirection};
00145   void setMaterialLocation (const MaterialLocation location) {
00146     theMaterialLocation = location;
00147   }
00149   const Propagator& geometricalPropagator() const {
00150     return *theGeometricalPropagator;
00151   }
00153   const FullConvolutionWithMaterial& convolutionWithMaterial() const {
00154     return *theConvolutor;
00155   }
00156 
00157   virtual GsfPropagatorWithMaterial* clone() const
00158   {
00159     return new GsfPropagatorWithMaterial(*theGeometricalPropagator,*theConvolutor);
00160   }
00161 
00162   const MagneticField* magneticField() const {return theGeometricalPropagator->magneticField();}
00163 
00164 private:
00165 //   /// Definition of timers (temporary)
00166 //   void defineTimer();
00168   std::pair<TrajectoryStateOnSurface,double> 
00169   convoluteWithMaterial (const std::pair<TrajectoryStateOnSurface,double>&) const;
00171   TrajectoryStateOnSurface
00172   convoluteStateWithMaterial (const TrajectoryStateOnSurface, const PropagationDirection) const;
00174   bool materialAtSource() const;
00175 
00176 private:
00177   // Geometrical propagator
00178   DeepCopyPointerByClone<GsfPropagatorAdapter> theGeometricalPropagator;
00179   // Material effects & convolution
00180   DeepCopyPointerByClone<FullConvolutionWithMaterial> theConvolutor;
00181   // Use material at source?
00182   MaterialLocation theMaterialLocation;
00183 
00184   typedef std::pair<TrajectoryStateOnSurface,double> TsosWP;
00185   typedef std::vector<TrajectoryStateOnSurface> MultiTSOS;
00186 
00187 //   static TimingReport::Item* propWithPathTimer1;
00188 //   static TimingReport::Item* propWithPathTimer2;
00189   
00190 };
00191 
00192 #endif