00001 #ifndef MagGeometry_H 00002 #define MagGeometry_H 00003 00012 #include "DataFormats/GeometrySurface/interface/BoundPlane.h" 00013 #include "MagneticField/Layers/src/MagBinFinders.h" 00014 #include "DetectorDescription/Core/interface/DDCompactView.h" 00015 00016 #include <vector> 00017 00018 class MagBLayer; 00019 class MagESector; 00020 class MagVolume; 00021 class MagVolume6Faces; 00022 template <class T> class PeriodicBinFinderInPhi; 00023 namespace edm {class ParameterSet;} 00024 00025 class MagGeometry { 00026 public: 00027 00028 typedef Surface::GlobalVector GlobalVector; 00029 typedef Surface::GlobalPoint GlobalPoint; 00030 00032 MagGeometry(const edm::ParameterSet& config, std::vector<MagBLayer *> , 00033 std::vector<MagESector *> , 00034 std::vector<MagVolume6Faces*> , 00035 std::vector<MagVolume6Faces*> ); 00036 00038 ~MagGeometry(); 00039 00041 GlobalVector fieldInTesla(const GlobalPoint & gp) const; 00042 00044 MagVolume * findVolume(const GlobalPoint & gp, double tolerance=0.) const; 00045 00046 bool isZSymmetric() const; 00047 00048 // FIXME: only for temporary tests, should be removed. 00049 const std::vector<MagVolume6Faces*> & barrelVolumes() const {return theBVolumes;} 00050 const std::vector<MagVolume6Faces*> & endcapVolumes() const {return theEVolumes;} 00051 00052 private: 00053 00054 friend class MagGeometryExerciser; // for debug purposes 00055 00056 // Linear search (for debug purposes only) 00057 MagVolume * findVolume1(const GlobalPoint & gp, double tolerance=0.) const; 00058 00059 00060 bool inBarrel(const GlobalPoint& gp) const; 00061 00062 mutable MagVolume * lastVolume; // Cache last volume found 00063 00064 std::vector<MagBLayer *> theBLayers; 00065 std::vector<MagESector *> theESectors; 00066 00067 // FIXME: only for temporary tests, should be removed. 00068 std::vector<MagVolume6Faces*> theBVolumes; 00069 std::vector<MagVolume6Faces*> theEVolumes; 00070 00071 MagBinFinders::GeneralBinFinderInR<double>* theBarrelBinFinder; 00072 PeriodicBinFinderInPhi<float> * theEndcapBinFinder; 00073 00074 bool cacheLastVolume; 00075 bool v_85l; 00076 }; 00077 #endif 00078