CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/TrackPropagation/RungeKutta/src/RKLocalFieldProvider.cc

Go to the documentation of this file.
00001 #include "RKLocalFieldProvider.h"
00002 #include "MagneticField/Engine/interface/MagneticField.h"
00003 #include "MagneticField/VolumeGeometry/interface/MagVolume.h"
00004 
00005 RKLocalFieldProvider::RKLocalFieldProvider( const MagVolume& vol) :
00006   theVolume( vol), theFrame(vol), transform_(false) {}
00007 
00008 RKLocalFieldProvider::RKLocalFieldProvider( const MagVolume& vol, const Frame& frame) :
00009   theVolume( vol), theFrame(frame), transform_(true) {}
00010 
00011 RKLocalFieldProvider::Vector RKLocalFieldProvider::inTesla( const LocalPoint& lp) const 
00012 {
00013   if unlikely(transform_) {
00014       LocalPoint vlp( theVolume.toLocal( theFrame.toGlobal( lp)));
00015       return theFrame.toLocal( theVolume.toGlobal( theVolume.fieldInTesla( vlp))).basicVector();
00016     }
00017   return theVolume.fieldInTesla( lp).basicVector();
00018 
00019 }
00020