CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/MagneticField/VolumeBasedEngine/interface/MagGeometry.h

Go to the documentation of this file.
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   // Deprecated, will be removed
00047   bool isZSymmetric() const {return false;}
00048 
00049   // FIXME: only for temporary tests, should be removed.
00050   const std::vector<MagVolume6Faces*> & barrelVolumes() const {return theBVolumes;}
00051   const std::vector<MagVolume6Faces*> & endcapVolumes() const {return theEVolumes;}
00052 
00053 private:
00054 
00055   friend class MagGeometryExerciser; // for debug purposes
00056 
00057   // Linear search (for debug purposes only)
00058   MagVolume * findVolume1(const GlobalPoint & gp, double tolerance=0.) const;
00059 
00060 
00061   bool inBarrel(const GlobalPoint& gp) const;
00062 
00063   mutable MagVolume * lastVolume; // Cache last volume found
00064 
00065   std::vector<MagBLayer *> theBLayers;
00066   std::vector<MagESector *> theESectors;
00067 
00068   // FIXME: only for temporary tests, should be removed.
00069   std::vector<MagVolume6Faces*> theBVolumes;
00070   std::vector<MagVolume6Faces*> theEVolumes;
00071 
00072   MagBinFinders::GeneralBinFinderInR<double>* theBarrelBinFinder;
00073   PeriodicBinFinderInPhi<float> * theEndcapBinFinder;
00074 
00075   bool cacheLastVolume;
00076   int geometryVersion;
00077 };
00078 #endif
00079