CMS 3D CMS Logo

MaterialEffectsUpdator.cc

Go to the documentation of this file.
00001 #include "TrackingTools/TrajectoryState/interface/SurfaceSideDefinition.h"
00002 #include "TrackingTools/MaterialEffects/interface/MaterialEffectsUpdator.h"
00003 
00004 using namespace SurfaceSideDefinition;
00005 
00006 //#include "Utilities/UI/interface/SimpleConfigurable.h"
00007 //
00008 // Update of the trajectory state (implemented in base class since general for
00009 //   all classes returning deltaP and deltaCov.
00010 //
00011 TrajectoryStateOnSurface MaterialEffectsUpdator::updateState (const TrajectoryStateOnSurface& TSoS, 
00012                                                               const PropagationDirection propDir) const {
00013   //
00014   // Check if 
00015   // - material is associated to surface
00016   // - propagation direction is not anyDirection
00017   // - side of surface is not atCenterOfSurface (could be handled with 50% material?)
00018   //
00019   const Surface& surface = TSoS.surface();
00020   if ( !surface.mediumProperties() || propDir==anyDirection || 
00021        TSoS.surfaceSide()==atCenterOfSurface )  return TSoS;
00022   //
00023   // Check, if already on right side of surface
00024   //
00025   if ( (propDir==alongMomentum && TSoS.surfaceSide()==afterSurface ) ||
00026        (propDir==oppositeToMomentum && TSoS.surfaceSide()==beforeSurface ) )  return TSoS;
00027   //
00028   // Update momentum. In case of failure: return invalid state
00029   //
00030   LocalTrajectoryParameters lp = TSoS.localParameters();
00031   if ( !lp.updateP(deltaP(TSoS,propDir)) )  
00032     return TrajectoryStateOnSurface();
00033   //
00034   // Update covariance matrix?
00035   //
00036   SurfaceSide side = propDir==alongMomentum ? afterSurface : beforeSurface;
00037   if ( TSoS.hasError() ) {
00038     AlgebraicSymMatrix55 eloc = TSoS.localError().matrix() + deltaLocalError(TSoS,propDir);
00039     return TrajectoryStateOnSurface(lp,LocalTrajectoryError(eloc),surface,
00040                                     &(TSoS.globalParameters().magneticField()),side);
00041   }
00042   else {
00043     return TrajectoryStateOnSurface(lp,surface,&(TSoS.globalParameters().magneticField()),side);
00044   }
00045 }
00046 
00047 // static initialization
00048 AlgebraicSymMatrix55  MaterialEffectsUpdator::theNullMatrix;

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