CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/TrackPropagation/RungeKutta/interface/defaultRKPropagator.h

Go to the documentation of this file.
00001 #ifndef RKPropagatorDefault_H
00002 #define RKPropagatorDefault_H
00003 
00004 
00005 #include "TrackPropagation/RungeKutta/interface/RKPropagatorInS.h"
00006 #include "MagneticField/VolumeGeometry/interface/MagneticFieldProvider.h"
00007 
00008 
00009 namespace defaultRKPropagator {
00010 
00011   using RKPropagator = RKPropagatorInS;
00012 
00013   // not clear why we need all this
00014   class TrivialFieldProvider GCC11_FINAL : public MagneticFieldProvider<float> {
00015   public:
00016     
00017     TrivialFieldProvider (const MagneticField* field) : theField(field) {}
00018     
00019     LocalVectorType valueInTesla( const LocalPointType& lp) const override {
00020       // NOTE: the following transformation only works for the central volume
00021       // where global and local coordinates are numerically equal !
00022       GlobalPoint gp(lp.basicVector());
00023       return LocalVectorType(theField->inTesla(gp).basicVector());
00024     }
00025     
00026   private:  
00027     const MagneticField* theField;
00028   };
00029   
00030   class RKMagVolume GCC11_FINAL : public MagVolume {
00031   public:
00032     RKMagVolume( const PositionType& pos, const RotationType& rot, 
00033                  DDSolidShape shape, const MagneticFieldProvider<float> * mfp) :
00034       MagVolume( pos, rot, shape, mfp) {}
00035     
00036     virtual bool inside( const GlobalPoint& gp, double tolerance=0.) const {return true;}
00037     
00039     virtual const std::vector<VolumeSide>& faces() const {return theFaces;}
00040     
00041   private:
00042     std::vector<VolumeSide> theFaces;
00043   };
00044   
00045   struct Product {
00046     explicit Product(const MagneticField* field,PropagationDirection dir = alongMomentum, double tolerance = 5.e-5) : 
00047       mpf(field), 
00048       volume(MagVolume::PositionType(0,0,0), MagVolume::RotationType(),ddshapeless, &mpf),
00049       propagator(volume, dir, tolerance){}
00050     TrivialFieldProvider mpf;
00051     RKMagVolume volume;
00052     RKPropagator propagator;
00053   };
00054   
00055 }
00056 
00057 #endif // RKPropagatorDefault