CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 namespace edm {class ParameterSet;}
23 
24 class MagGeometry {
25 public:
26 
29 
31  MagGeometry(const edm::ParameterSet& config, const std::vector<MagBLayer *>& ,
32  const std::vector<MagESector *>& ,
33  const std::vector<MagVolume6Faces*>& ,
34  const std::vector<MagVolume6Faces*>& );
35  MagGeometry(const edm::ParameterSet& config, const std::vector<MagBLayer const*>& ,
36  const std::vector<MagESector const*>& ,
37  const std::vector<MagVolume6Faces const*>& ,
38  const std::vector<MagVolume6Faces const*>& );
39 
41  ~MagGeometry();
42 
44  GlobalVector fieldInTesla(const GlobalPoint & gp) const;
45 
47  MagVolume const * findVolume(const GlobalPoint & gp, double tolerance=0.) const;
48 
49  // Deprecated, will be removed
50  bool isZSymmetric() const {return false;}
51 
52  // FIXME: only for temporary tests, should be removed.
53  const std::vector<MagVolume6Faces const*> & barrelVolumes() const {return theBVolumes;}
54  const std::vector<MagVolume6Faces const*> & endcapVolumes() const {return theEVolumes;}
55 
56 private:
57 
58  friend class MagGeometryExerciser; // for debug purposes
59 
60  // Linear search (for debug purposes only)
61  MagVolume const* findVolume1(const GlobalPoint & gp, double tolerance=0.) const;
62 
63 
64  bool inBarrel(const GlobalPoint& gp) const;
65 
66  mutable std::atomic<MagVolume const*> lastVolume; // Cache last volume found
67 
68  std::vector<MagBLayer const*> theBLayers;
69  std::vector<MagESector const*> theESectors;
70 
71  // FIXME: only for temporary tests, should be removed.
72  std::vector<MagVolume6Faces const*> theBVolumes;
73  std::vector<MagVolume6Faces const*> theEVolumes;
74 
77 
80 };
81 #endif
82 
Surface::GlobalVector GlobalVector
Definition: MagGeometry.h:27
bool isZSymmetric() const
Definition: MagGeometry.h:50
const std::vector< MagVolume6Faces const * > & endcapVolumes() const
Definition: MagGeometry.h:54
MagGeometry(const edm::ParameterSet &config, const std::vector< MagBLayer * > &, const std::vector< MagESector * > &, const std::vector< MagVolume6Faces * > &, const std::vector< MagVolume6Faces * > &)
Constructor.
Definition: MagGeometry.cc:24
std::atomic< MagVolume const * > lastVolume
Definition: MagGeometry.h:66
~MagGeometry()
Destructor.
Definition: MagGeometry.cc:66
bool inBarrel(const GlobalPoint &gp) const
Definition: MagGeometry.cc:191
MagVolume const * findVolume(const GlobalPoint &gp, double tolerance=0.) const
Find a volume.
Definition: MagGeometry.cc:142
std::vector< MagESector const * > theESectors
Definition: MagGeometry.h:69
friend class MagGeometryExerciser
Definition: MagGeometry.h:58
PeriodicBinFinderInPhi< float > const * theEndcapBinFinder
Definition: MagGeometry.h:76
MagVolume const * findVolume1(const GlobalPoint &gp, double tolerance=0.) const
Definition: MagGeometry.cc:106
std::vector< MagBLayer const * > theBLayers
Definition: MagGeometry.h:68
Surface::GlobalPoint GlobalPoint
Definition: MagGeometry.h:28
std::vector< MagVolume6Faces const * > theBVolumes
Definition: MagGeometry.h:72
GlobalVector fieldInTesla(const GlobalPoint &gp) const
Return field vector at the specified global point.
Definition: MagGeometry.cc:83
std::vector< MagVolume6Faces const * > theEVolumes
Definition: MagGeometry.h:73
const std::vector< MagVolume6Faces const * > & barrelVolumes() const
Definition: MagGeometry.h:53
MagBinFinders::GeneralBinFinderInR< double > const * theBarrelBinFinder
Definition: MagGeometry.h:75
bool cacheLastVolume
Definition: MagGeometry.h:78
int geometryVersion
Definition: MagGeometry.h:79