Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:22:32

0001 #ifndef Interpolation_SpecialCylindricalMFGrid_h
0002 #define Interpolation_SpecialCylindricalMFGrid_h
0003 
0004 /** \class SpecialCylindricalMFGrid
0005  *
0006  *  Interpolator for cylindrical grids type 5 or 6 (r,phi,z) 1/sin(phi) or 1/cos(phi)
0007  *
0008  *  \author T. Todorov - updated 08 N. Amapane
0009  */
0010 
0011 #include "FWCore/Utilities/interface/Visibility.h"
0012 #include "MFGrid3D.h"
0013 
0014 namespace magneticfield::interpolation {
0015   class binary_ifstream;
0016 }
0017 
0018 class dso_internal SpecialCylindricalMFGrid : public MFGrid3D {
0019 public:
0020   using binary_ifstream = magneticfield::interpolation::binary_ifstream;
0021 
0022   /// Constructor.
0023   /// gridType = 5 => 1/sin(phi); i.e. master sector is #4
0024   /// gridType = 6 => 1/cos(phi); i.e. master sector is #1
0025   SpecialCylindricalMFGrid(binary_ifstream& istr, const GloballyPositioned<float>& vol, int gridType);
0026 
0027   LocalVector uncheckedValueInTesla(const LocalPoint& p) const override;
0028 
0029   void dump() const override;
0030 
0031   void toGridFrame(const LocalPoint& p, double& a, double& b, double& c) const override;
0032 
0033   LocalPoint fromGridFrame(double a, double b, double c) const override;
0034 
0035 private:
0036   //double RParAsFunOfPhi[4];     // R = f(phi) or const. (0,2: const. par. ; 1,3: const./sin(phi))
0037 
0038   double stepConstTerm_;
0039   double stepPhiTerm_;
0040   double startConstTerm_;
0041   double startPhiTerm_;
0042 
0043   double stepSize(double sinPhi) const { return stepConstTerm_ + stepPhiTerm_ / sinPhi; }
0044   double startingPoint(double sinPhi) const { return startConstTerm_ + startPhiTerm_ / sinPhi; }
0045   bool sector1;
0046 };
0047 
0048 #endif