File indexing completed on 2024-04-06 12:22:35
0001 #ifndef MagGeometry_H
0002 #define MagGeometry_H
0003
0004
0005
0006
0007
0008
0009
0010 #include "DataFormats/GeometrySurface/interface/BoundPlane.h"
0011 #include "MagneticField/Layers/interface/MagBinFinders.h"
0012
0013 #include <vector>
0014 #include <atomic>
0015
0016 class MagBLayer;
0017 class MagESector;
0018 class MagVolume;
0019 class MagVolume6Faces;
0020 template <class T>
0021 class PeriodicBinFinderInPhi;
0022
0023 class MagGeometry {
0024 public:
0025 typedef Surface::GlobalVector GlobalVector;
0026 typedef Surface::GlobalPoint GlobalPoint;
0027
0028
0029 MagGeometry(int geomVersion,
0030 const std::vector<MagBLayer*>&,
0031 const std::vector<MagESector*>&,
0032 const std::vector<MagVolume6Faces*>&,
0033 const std::vector<MagVolume6Faces*>&);
0034 MagGeometry(int geomVersion,
0035 const std::vector<MagBLayer const*>&,
0036 const std::vector<MagESector const*>&,
0037 const std::vector<MagVolume6Faces const*>&,
0038 const std::vector<MagVolume6Faces const*>&);
0039
0040
0041 ~MagGeometry();
0042
0043
0044 GlobalVector fieldInTesla(const GlobalPoint& gp) const;
0045
0046
0047 MagVolume const* findVolume(const GlobalPoint& gp, double tolerance = 0.) const;
0048
0049
0050 const std::vector<MagVolume6Faces const*>& barrelVolumes() const { return theBVolumes; }
0051 const std::vector<MagVolume6Faces const*>& endcapVolumes() const { return theEVolumes; }
0052
0053 private:
0054 friend class MagGeometryExerciser;
0055
0056
0057 MagVolume const* findVolume1(const GlobalPoint& gp, double tolerance = 0.) const;
0058
0059 bool inBarrel(const GlobalPoint& gp) const;
0060
0061 const int me_;
0062
0063 std::vector<MagBLayer const*> theBLayers;
0064 std::vector<MagESector const*> theESectors;
0065
0066
0067 std::vector<MagVolume6Faces const*> theBVolumes;
0068 std::vector<MagVolume6Faces const*> theEVolumes;
0069
0070 MagBinFinders::GeneralBinFinderInR<double> const* theBarrelBinFinder;
0071 PeriodicBinFinderInPhi<float> const* theEndcapBinFinder;
0072
0073 bool cacheLastVolume;
0074 int geometryVersion;
0075
0076
0077 double theBarrelRsq1;
0078 double theBarrelRsq2;
0079 double theBarrelZ0;
0080 double theBarrelZ1;
0081 double theBarrelZ2;
0082 };
0083 #endif