00001 #ifndef _CR_MATERIALEFFECTSUPDATOR_H_
00002 #define _CR_MATERIALEFFECTSUPDATOR_H_
00003
00015 #include "DataFormats/GeometrySurface/interface/Surface.h"
00016 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h"
00017 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
00018 class MaterialEffectsUpdator
00019 {
00020 public:
00023 MaterialEffectsUpdator ( float mass ) :
00024 theMass(mass),
00025 theDeltaP(0.),
00026 theDeltaCov() {}
00029
00030
00031 virtual ~MaterialEffectsUpdator () {}
00032
00036 virtual TrajectoryStateOnSurface updateState (const TrajectoryStateOnSurface& TSoS,
00037 const PropagationDirection propDir) const;
00040 virtual double deltaP (const TrajectoryStateOnSurface& TSoS, const PropagationDirection propDir) const {
00041
00042 if ( !TSoS.surface().mediumProperties() ) return 0.;
00043
00044 if ( newArguments(TSoS,propDir) ) compute(TSoS,propDir);
00045 return theDeltaP;
00046 }
00047
00048
00051 virtual const AlgebraicSymMatrix55 &deltaLocalError (const TrajectoryStateOnSurface& TSoS,
00052 const PropagationDirection propDir) const {
00053
00054 if ( !TSoS.surface().mediumProperties() ) return theNullMatrix;
00055
00056 if ( newArguments(TSoS,propDir) ) compute(TSoS,propDir);
00057 return theDeltaCov;
00058 }
00061 inline float mass () const {
00062 return theMass;
00063 }
00064
00065 virtual MaterialEffectsUpdator* clone() const = 0;
00066
00067 private:
00068
00069 virtual void compute (const TrajectoryStateOnSurface&, const PropagationDirection) const = 0;
00070
00071 protected:
00072
00073 virtual bool newArguments (const TrajectoryStateOnSurface&, const PropagationDirection) const {
00074 return true;
00075 }
00076
00077 virtual void storeArguments (const TrajectoryStateOnSurface&, const PropagationDirection) const {
00078 }
00079
00080 private:
00081 float theMass;
00082
00083
00084 protected:
00085 mutable double theDeltaP;
00086 mutable AlgebraicSymMatrix55 theDeltaCov;
00087 static AlgebraicSymMatrix55 theNullMatrix;
00088 };
00089
00090 #endif