CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/TrackPropagation/RungeKutta/src/AnalyticalErrorPropagation.cc

Go to the documentation of this file.
00001 #include "AnalyticalErrorPropagation.h"
00002 
00003 #include "TrackingTools/AnalyticalJacobians/interface/AnalyticalCurvilinearJacobian.h"
00004 #include "TrackingTools/TrajectoryState/interface/SurfaceSideDefinition.h"
00005 
00006 //#include "FWCore/MessageLogger/interface/MessageLogger.h"
00007 
00008 
00009 std::pair<TrajectoryStateOnSurface,double>
00010 AnalyticalErrorPropagation::operator()( const FreeTrajectoryState& startingState, 
00011                                         const Surface& surface, SurfaceSideDefinition::SurfaceSide side,
00012                                         const GlobalTrajectoryParameters& destParameters, 
00013                                         const double& s) const
00014 {
00015   if (startingState.hasError()) {
00016 
00017     //
00018     // compute jacobian
00019     //
00020 
00021     // FIXME: Compute mean B field between startingState and destParameters and pass it to analyticalJacobian
00022     //GlobalPoint xStart = startingState.position();
00023     //GlobalPoint xDest = destParameters.position();
00024     //GlobalVector h1  = destParameters.magneticFieldInInverseGeV(xStart);
00025     //GlobalVector h2  = destParameters.magneticFieldInInverseGeV(xDest);
00026     //GlobalVector h = 0.5*(h1+h2);
00027     //LogDebug("RungeKutta") << "AnalyticalErrorPropagation: The Fields are: " << h1 << ", " << h2 << ", " << h ; 
00028     
00029     // 
00030     AnalyticalCurvilinearJacobian analyticalJacobian(startingState.parameters(), 
00031                                                      destParameters.position(), 
00032                                                      destParameters.momentum(), s);
00033     AlgebraicMatrix55 jacobian(analyticalJacobian.jacobian());
00034     CurvilinearTrajectoryError cte( ROOT::Math::Similarity(jacobian, startingState.curvilinearError().matrix()));
00035     return std::pair<TrajectoryStateOnSurface,double>(TrajectoryStateOnSurface(destParameters,cte,surface,side),s);
00036   }
00037   else {
00038     //
00039     // return state without errors
00040     //
00041     return std::pair<TrajectoryStateOnSurface,double>(TrajectoryStateOnSurface(destParameters,surface,side),s);
00042   }
00043 }
00044