CMS 3D CMS Logo

GsfMaterialEffectsUpdator.h

Go to the documentation of this file.
00001 #ifndef GsfMaterialEffectsUpdator_h_
00002 #define GsfMaterialEffectsUpdator_h_
00003 
00004 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
00005 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
00006 #include "DataFormats/GeometrySurface/interface/Surface.h"
00007 
00008 #include <vector>
00009 
00015 class GsfMaterialEffectsUpdator
00016 {  
00017 public:
00020   GsfMaterialEffectsUpdator ( float mass ) :
00021     theMass(mass) {}
00022 
00023   virtual ~GsfMaterialEffectsUpdator () {}
00024 
00028   virtual TrajectoryStateOnSurface updateState (const TrajectoryStateOnSurface& TSoS, 
00029                                                 const PropagationDirection propDir) const;
00032   virtual std::vector<double> weights (const TrajectoryStateOnSurface& TSoS, 
00033                                        const PropagationDirection propDir) const {
00034     // check for material
00035     if ( !TSoS.surface().mediumProperties() )  return std::vector<double>();
00036     // check for change (avoid using compute method if possible)
00037     if ( newArguments(TSoS,propDir) )  compute(TSoS,propDir);
00038     return theWeights;
00039   }
00042   virtual std::vector<double> deltaPs (const TrajectoryStateOnSurface& TSoS, 
00043                                        const PropagationDirection propDir) const {
00044     // check for material
00045     if ( !TSoS.surface().mediumProperties() )  return std::vector<double>();
00046     // check for change (avoid using compute method if possible)
00047     if ( newArguments(TSoS,propDir) )  compute(TSoS,propDir);
00048     return theDeltaPs;
00049   }
00052   virtual std::vector<AlgebraicSymMatrix55> deltaLocalErrors (const TrajectoryStateOnSurface& TSoS, 
00053                                                             const PropagationDirection propDir) const {
00054     // check for material
00055     if ( !TSoS.surface().mediumProperties() )  return std::vector<AlgebraicSymMatrix55>();
00056     // check for change (avoid using compute method if possible)
00057     if ( newArguments(TSoS,propDir) )  compute(TSoS,propDir);
00058     return theDeltaCovs;
00059   }  
00062   inline float mass () const {
00063     return theMass;
00064   }
00065 
00066   virtual GsfMaterialEffectsUpdator* clone()  const = 0;
00067 
00068 private:
00069   // here comes the actual computation of the values
00070   virtual void compute (const TrajectoryStateOnSurface&, const PropagationDirection) const = 0;
00071 
00072 protected:
00073   // check of arguments for use with cached values
00074   virtual bool newArguments (const TrajectoryStateOnSurface&, const PropagationDirection) const {
00075     return true;
00076   }
00077   // storage of arguments for later use
00078   virtual void storeArguments (const TrajectoryStateOnSurface&, const PropagationDirection) const {
00079   }
00080   
00081 private:
00082   float theMass;
00083 
00084 
00085 protected:  
00086   mutable std::vector<double> theWeights;
00087   mutable std::vector<double> theDeltaPs;
00088   mutable std::vector<AlgebraicSymMatrix55> theDeltaCovs;
00089 };
00090 
00091 #endif

Generated on Tue Jun 9 17:48:20 2009 for CMSSW by  doxygen 1.5.4