CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/TrackingTools/GsfTools/src/GsfPropagatorAdapter.cc

Go to the documentation of this file.
00001 #include "TrackingTools/GsfTools/interface/GsfPropagatorAdapter.h"
00002 
00003 #include "TrackingTools/GsfTools/src/MultiStatePropagation.h"
00004 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00005 
00006 GsfPropagatorAdapter::GsfPropagatorAdapter (const Propagator& aPropagator) :
00007   Propagator(aPropagator.propagationDirection()),
00008   thePropagator(aPropagator.clone()) {}
00009 
00010 std::pair<TrajectoryStateOnSurface,double> 
00011 GsfPropagatorAdapter::propagateWithPath (const TrajectoryStateOnSurface& tsos, 
00012                                          const Plane& plane) const {
00013   MultiStatePropagation<Plane> multiPropagator(*thePropagator);
00014   return multiPropagator.propagateWithPath(tsos,plane);
00015 }
00016 
00017 std::pair<TrajectoryStateOnSurface,double> 
00018 GsfPropagatorAdapter::propagateWithPath (const TrajectoryStateOnSurface& tsos, 
00019                                          const Cylinder& cylinder) const {
00020   MultiStatePropagation<Cylinder> multiPropagator(*thePropagator);
00021   return multiPropagator.propagateWithPath(tsos,cylinder);
00022 }
00023 
00024 std::pair<TrajectoryStateOnSurface,double> 
00025 GsfPropagatorAdapter::propagateWithPath (const FreeTrajectoryState& fts, 
00026                                          const Plane& plane) const {
00028   static int nWarn(0);
00029   if ( nWarn++<5 )
00030     edm::LogInfo("GsfPropagatorAdapter") << "GsfPropagator used from FTS = single state mode!";
00031   return thePropagator->propagateWithPath(fts,plane);
00032 }
00033 
00034 std::pair<TrajectoryStateOnSurface,double> 
00035 GsfPropagatorAdapter::propagateWithPath (const FreeTrajectoryState& fts, 
00036                                          const Cylinder& cylinder) const {
00038   static int nWarn(0);
00039   if ( nWarn++<5 )
00040     edm::LogInfo("GsfPropagatorAdapter") << "GsfPropagator used from FTS = single state mode!";
00041   return thePropagator->propagateWithPath(fts,cylinder);
00042 }
00043 
00044 void GsfPropagatorAdapter::setPropagationDirection (PropagationDirection dir) const {
00045   thePropagator->setPropagationDirection(dir);
00046   Propagator::setPropagationDirection(dir);
00047 }