CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MagGeometry.h
Go to the documentation of this file.
1 #ifndef MagGeometry_H
2 #define MagGeometry_H
3 
12 
13 #include <vector>
14 #include <atomic>
15 
16 class MagBLayer;
17 class MagESector;
18 class MagVolume;
19 class MagVolume6Faces;
20 template <class T>
22 
23 class MagGeometry {
24 public:
27 
29  MagGeometry(int geomVersion,
30  const std::vector<MagBLayer*>&,
31  const std::vector<MagESector*>&,
32  const std::vector<MagVolume6Faces*>&,
33  const std::vector<MagVolume6Faces*>&);
34  MagGeometry(int geomVersion,
35  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 
45 
47  MagVolume const* findVolume(const GlobalPoint& gp, double tolerance = 0.) const;
48 
49  // FIXME: only for temporary tests, should be removed.
50  const std::vector<MagVolume6Faces const*>& barrelVolumes() const { return theBVolumes; }
51  const std::vector<MagVolume6Faces const*>& endcapVolumes() const { return theEVolumes; }
52 
53 private:
54  friend class MagGeometryExerciser; // for debug purposes
55 
56  // Linear search (for debug purposes only)
57  MagVolume const* findVolume1(const GlobalPoint& gp, double tolerance = 0.) const;
58 
59  bool inBarrel(const GlobalPoint& gp) const;
60 
61  const int me_; // Instance ID, to trigger cache invalidation at IOV boundaries
62 
63  std::vector<MagBLayer const*> theBLayers;
64  std::vector<MagESector const*> theESectors;
65 
66  // FIXME: only for temporary tests, should be removed.
67  std::vector<MagVolume6Faces const*> theBVolumes;
68  std::vector<MagVolume6Faces const*> theEVolumes;
69 
72 
75 
76  // boundaries of internal barrel-endcap volume separation
77  double theBarrelRsq1;
78  double theBarrelRsq2;
79  double theBarrelZ0;
80  double theBarrelZ1;
81  double theBarrelZ2;
82 };
83 #endif
Surface::GlobalVector GlobalVector
Definition: MagGeometry.h:25
const std::vector< MagVolume6Faces const * > & endcapVolumes() const
Definition: MagGeometry.h:51
double theBarrelRsq1
Definition: MagGeometry.h:77
const double tolerance
~MagGeometry()
Destructor.
Definition: MagGeometry.cc:107
double theBarrelZ2
Definition: MagGeometry.h:81
bool inBarrel(const GlobalPoint &gp) const
Definition: MagGeometry.cc:237
MagVolume const * findVolume(const GlobalPoint &gp, double tolerance=0.) const
Find a volume.
Definition: MagGeometry.cc:184
double theBarrelZ0
Definition: MagGeometry.h:79
std::vector< MagESector const * > theESectors
Definition: MagGeometry.h:64
friend class MagGeometryExerciser
Definition: MagGeometry.h:54
PeriodicBinFinderInPhi< float > const * theEndcapBinFinder
Definition: MagGeometry.h:71
MagVolume const * findVolume1(const GlobalPoint &gp, double tolerance=0.) const
Definition: MagGeometry.cc:143
double theBarrelRsq2
Definition: MagGeometry.h:78
std::vector< MagBLayer const * > theBLayers
Definition: MagGeometry.h:63
Surface::GlobalPoint GlobalPoint
Definition: MagGeometry.h:26
std::vector< MagVolume6Faces const * > theBVolumes
Definition: MagGeometry.h:67
const int me_
Definition: MagGeometry.h:61
GlobalVector fieldInTesla(const GlobalPoint &gp) const
Return field vector at the specified global point.
Definition: MagGeometry.cc:123
MagGeometry(int geomVersion, const std::vector< MagBLayer * > &, const std::vector< MagESector * > &, const std::vector< MagVolume6Faces * > &, const std::vector< MagVolume6Faces * > &)
Constructor.
Definition: MagGeometry.cc:32
std::vector< MagVolume6Faces const * > theEVolumes
Definition: MagGeometry.h:68
double theBarrelZ1
Definition: MagGeometry.h:80
const std::vector< MagVolume6Faces const * > & barrelVolumes() const
Definition: MagGeometry.h:50
MagBinFinders::GeneralBinFinderInR< double > const * theBarrelBinFinder
Definition: MagGeometry.h:70
bool cacheLastVolume
Definition: MagGeometry.h:73
int geometryVersion
Definition: MagGeometry.h:74