Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-14 02:34:17

0001 #ifndef RKPropagatorDefault_H
0002 #define RKPropagatorDefault_H
0003 
0004 #include "TrackPropagation/RungeKutta/interface/RKPropagatorInS.h"
0005 #include "MagneticField/VolumeGeometry/interface/MagneticFieldProvider.h"
0006 
0007 namespace defaultRKPropagator {
0008 
0009   using RKPropagator = RKPropagatorInS;
0010 
0011   // not clear why we need all this
0012   class TrivialFieldProvider final : public MagneticFieldProvider<float> {
0013   public:
0014     TrivialFieldProvider(const MagneticField* field) : theField(field) {}
0015 
0016     LocalVectorType valueInTesla(const LocalPointType& lp) const override {
0017       // NOTE: the following transformation only works for the central volume
0018       // where global and local coordinates are numerically equal !
0019       GlobalPoint gp(lp.basicVector());
0020       return LocalVectorType(theField->inTesla(gp).basicVector());
0021     }
0022 
0023   private:
0024     const MagneticField* theField;
0025   };
0026 
0027   class RKMagVolume final : public MagVolume {
0028   public:
0029     RKMagVolume(const PositionType& pos, const RotationType& rot, const MagneticFieldProvider<float>* mfp)
0030         : MagVolume(pos, rot, mfp) {
0031       setNominalValue();
0032     }
0033 
0034     bool inside(const GlobalPoint& gp, double tolerance = 0.) const override { return true; }
0035 
0036     /// Access to volume faces - dummy implementation
0037     const std::vector<VolumeSide>& faces() const override { return theFaces; }
0038 
0039   private:
0040     std::vector<VolumeSide> theFaces;
0041   };
0042 
0043   struct Product {
0044     explicit Product(const MagneticField* field, PropagationDirection dir = alongMomentum, double tolerance = 5.e-5)
0045         : mpf(field),
0046           volume(MagVolume::PositionType(0, 0, 0), MagVolume::RotationType(), &mpf),
0047           propagator(volume, dir, tolerance) {}
0048     TrivialFieldProvider mpf;
0049     RKMagVolume volume;
0050     RKPropagator propagator;
0051   };
0052 
0053 }  // namespace defaultRKPropagator
0054 
0055 #endif  // RKPropagatorDefault