Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef MagneticField_VolumeBasedMagneticField_h
0002 #define MagneticField_VolumeBasedMagneticField_h
0003 
0004 /** \class VolumeBasedMagneticField
0005  *
0006  *  Field engine providing interpolation within the full CMS region.
0007  *
0008  *  \author N. Amapane - CERN
0009  */
0010 
0011 #include "MagneticField/Engine/interface/MagneticField.h"
0012 #include "MagneticField/VolumeBasedEngine/interface/MagGeometry.h"
0013 
0014 // Class for testing VolumeBasedMagneticField
0015 class testMagneticField;
0016 class testMagGeometryAnalyzer;
0017 
0018 class VolumeBasedMagneticField final : public MagneticField {
0019   // For tests
0020   friend class testMagneticField;
0021   friend class testMagGeometryAnalyzer;
0022 
0023 public:
0024   //  VolumeBasedMagneticField(const DDCompactView & cpv);
0025   VolumeBasedMagneticField(int geomVersion,
0026                            const std::vector<MagBLayer*>& theBLayers,
0027                            const std::vector<MagESector*>& theESectors,
0028                            const std::vector<MagVolume6Faces*>& theBVolumes,
0029                            const std::vector<MagVolume6Faces*>& theEVolumes,
0030                            float rMax,
0031                            float zMax,
0032                            const MagneticField* param = nullptr,
0033                            bool isParamFieldOwned = false);
0034   ~VolumeBasedMagneticField() override;
0035 
0036   /// Copy constructor implement a shallow copy (ie no ownership of actual engines)
0037   VolumeBasedMagneticField(const VolumeBasedMagneticField& vbf);
0038 
0039   /// Returns a shallow copy.
0040   MagneticField* clone() const override;
0041 
0042   GlobalVector inTesla(const GlobalPoint& g) const override;
0043 
0044   GlobalVector inTeslaUnchecked(const GlobalPoint& g) const override;
0045 
0046   const MagVolume* findVolume(const GlobalPoint& gp) const;
0047 
0048   bool isDefined(const GlobalPoint& gp) const override;
0049 
0050 private:
0051   const MagGeometry* field;
0052   float maxRsq;
0053   float maxZ;
0054   const MagneticField* paramField;
0055   bool magGeomOwned;
0056   bool paramFieldOwned;
0057 };
0058 
0059 #endif