CMS 3D CMS Logo

MagGeometry.h
Go to the documentation of this file.
1 #ifndef MagGeometry_H
2 #define MagGeometry_H
3 
13 
14 #include <vector>
15 #include <atomic>
16 
17 class MagBLayer;
18 class MagESector;
19 class MagVolume;
20 class MagVolume6Faces;
21 template <class T> class PeriodicBinFinderInPhi;
22 
23 class MagGeometry {
24 public:
25 
28 
30  MagGeometry(int geomVersion, const std::vector<MagBLayer *>& ,
31  const std::vector<MagESector *>& ,
32  const std::vector<MagVolume6Faces*>& ,
33  const std::vector<MagVolume6Faces*>& );
34  MagGeometry(int geomVersion, const std::vector<MagBLayer const*>& ,
35  const std::vector<MagESector const*>& ,
36  const std::vector<MagVolume6Faces const*>& ,
37  const std::vector<MagVolume6Faces const*>& );
38 
40  ~MagGeometry();
41 
43  GlobalVector fieldInTesla(const GlobalPoint & gp) const;
44 
46  MagVolume const * findVolume(const GlobalPoint & gp, double tolerance=0.) const;
47 
48  // Deprecated, will be removed
49  bool isZSymmetric() const {return false;}
50 
51  // FIXME: only for temporary tests, should be removed.
52  const std::vector<MagVolume6Faces const*> & barrelVolumes() const {return theBVolumes;}
53  const std::vector<MagVolume6Faces const*> & endcapVolumes() const {return theEVolumes;}
54 
55 private:
56 
57  friend class MagGeometryExerciser; // for debug purposes
58 
59  // Linear search (for debug purposes only)
60  MagVolume const* findVolume1(const GlobalPoint & gp, double tolerance=0.) const;
61 
62 
63  bool inBarrel(const GlobalPoint& gp) const;
64 
65  mutable std::atomic<MagVolume const*> lastVolume; // Cache last volume found
66 
67  std::vector<MagBLayer const*> theBLayers;
68  std::vector<MagESector const*> theESectors;
69 
70  // FIXME: only for temporary tests, should be removed.
71  std::vector<MagVolume6Faces const*> theBVolumes;
72  std::vector<MagVolume6Faces const*> theEVolumes;
73 
76 
79 };
80 #endif
81 
Surface::GlobalVector GlobalVector
Definition: MagGeometry.h:26
bool isZSymmetric() const
Definition: MagGeometry.h:49
const std::vector< MagVolume6Faces const * > & endcapVolumes() const
Definition: MagGeometry.h:53
std::atomic< MagVolume const * > lastVolume
Definition: MagGeometry.h:65
~MagGeometry()
Destructor.
Definition: MagGeometry.cc:61
bool inBarrel(const GlobalPoint &gp) const
Definition: MagGeometry.cc:186
MagVolume const * findVolume(const GlobalPoint &gp, double tolerance=0.) const
Find a volume.
Definition: MagGeometry.cc:137
std::vector< MagESector const * > theESectors
Definition: MagGeometry.h:68
friend class MagGeometryExerciser
Definition: MagGeometry.h:57
PeriodicBinFinderInPhi< float > const * theEndcapBinFinder
Definition: MagGeometry.h:75
MagVolume const * findVolume1(const GlobalPoint &gp, double tolerance=0.) const
Definition: MagGeometry.cc:101
std::vector< MagBLayer const * > theBLayers
Definition: MagGeometry.h:67
Surface::GlobalPoint GlobalPoint
Definition: MagGeometry.h:27
std::vector< MagVolume6Faces const * > theBVolumes
Definition: MagGeometry.h:71
GlobalVector fieldInTesla(const GlobalPoint &gp) const
Return field vector at the specified global point.
Definition: MagGeometry.cc:78
MagGeometry(int geomVersion, const std::vector< MagBLayer * > &, const std::vector< MagESector * > &, const std::vector< MagVolume6Faces * > &, const std::vector< MagVolume6Faces * > &)
Constructor.
Definition: MagGeometry.cc:23
std::vector< MagVolume6Faces const * > theEVolumes
Definition: MagGeometry.h:72
const std::vector< MagVolume6Faces const * > & barrelVolumes() const
Definition: MagGeometry.h:52
MagBinFinders::GeneralBinFinderInR< double > const * theBarrelBinFinder
Definition: MagGeometry.h:74
bool cacheLastVolume
Definition: MagGeometry.h:77
int geometryVersion
Definition: MagGeometry.h:78