CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
GeomDet.h
Go to the documentation of this file.
1 #ifndef CommonDet_GeomDet_H
2 #define CommonDet_GeomDet_H
3 
11 
18 
19 #include <vector>
20 
22 
23 class Topology;
24 class GeomDetType;
25 class SurfaceDeformation;
26 
27 class GeomDet {
28 public:
30 
31  explicit GeomDet(Plane* plane) : thePlane(plane) {}
32  explicit GeomDet(const ReferenceCountingPointer<Plane>& plane) : thePlane(plane) {}
33 
34  virtual ~GeomDet();
35 
37  const Plane& surface() const { return *thePlane; }
38 
40  const Plane& specificSurface() const { return *thePlane; }
41 
43  const Surface::PositionType& position() const { return surface().position(); }
44 
46  const Surface::RotationType& rotation() const { return surface().rotation(); }
47 
49  GlobalPoint toGlobal(const Local2DPoint& lp) const { return surface().toGlobal(lp); }
50 
52  GlobalPoint toGlobal(const Local3DPoint& lp) const { return surface().toGlobal(lp); }
53 
55  GlobalVector toGlobal(const LocalVector& lv) const { return surface().toGlobal(lv); }
56 
58  LocalPoint toLocal(const GlobalPoint& gp) const { return surface().toLocal(gp); }
59 
61  LocalVector toLocal(const GlobalVector& gv) const { return surface().toLocal(gv); }
62 
64  DetId geographicalId() const { return m_detId; }
65 
67  virtual SubDetector subDetector() const;
68 
70  virtual bool isLeaf() const { return components().empty(); }
71 
73  virtual std::vector<const GeomDet*> components() const { return std::vector<const GeomDet*>(); }
74 
76  // FIXME: must become pure virtual
77  virtual const GeomDet* component(DetId /*id*/) const { return nullptr; }
78 
81 
82  // specific unit index in a given subdetector (such as Tracker)
83  int index() const { return m_index; }
84  void setIndex(int i) { m_index = i; }
85 
86  // specific geomDet index in a given subdetector (such as Tracker)
87  int gdetIndex() const { return m_gdetIndex; }
88  void setGdetIndex(int i) { m_gdetIndex = i; }
89 
90  virtual const Topology& topology() const;
91 
92  virtual const GeomDetType& type() const;
93 
96  virtual const SurfaceDeformation* surfaceDeformation() const { return nullptr; }
97 
98 protected:
99  void setDetId(DetId id) { m_detId = id; }
100 
101 private:
104  int m_index = -1;
105  int m_gdetIndex = -1;
107 
108 protected:
111  virtual bool setAlignmentPositionError(const AlignmentPositionError& ape);
112 
113 private:
115  friend class DetPositioner;
116 
119  void move(const GlobalVector& displacement);
120 
124 
128 
130 
131 private:
135  virtual void setSurfaceDeformation(const SurfaceDeformation* deformation);
136 };
137 
139 
140 #endif
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
int m_gdetIndex
Definition: GeomDet.h:105
uint16_t *__restrict__ id
virtual const GeomDetType & type() const
Definition: GeomDet.cc:69
ReferenceCountingPointer< Plane > thePlane
Definition: GeomDet.h:102
void setGdetIndex(int i)
Definition: GeomDet.h:88
int gdetIndex() const
Definition: GeomDet.h:87
const Surface::RotationType & rotation() const
The rotation defining the local R.F.
Definition: GeomDet.h:46
void setDetId(DetId id)
Definition: GeomDet.h:99
virtual const Topology & topology() const
Definition: GeomDet.cc:67
virtual ~GeomDet()
Definition: GeomDet.cc:5
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
LocalVector toLocal(const GlobalVector &gv) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:61
void setIndex(int i)
Definition: GeomDet.h:84
GeomDet(const ReferenceCountingPointer< Plane > &plane)
Definition: GeomDet.h:32
void setPosition(const Surface::PositionType &position, const Surface::RotationType &rotation)
Definition: GeomDet.cc:21
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:58
int m_index
Definition: GeomDet.h:104
virtual std::vector< const GeomDet * > components() const
Returns direct components, if any.
Definition: GeomDet.h:73
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
Definition: Plane.h:16
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
GlobalVector toGlobal(const LocalVector &lv) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:55
LocalPoint toLocal(const GlobalPoint &gp) const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
virtual bool isLeaf() const
is a Unit
Definition: GeomDet.h:70
void move(const GlobalVector &displacement)
Definition: GeomDet.cc:7
int index() const
Definition: GeomDet.h:83
AlignmentPositionError * theAlignmentPositionError
Definition: GeomDet.h:106
DetId m_detId
Definition: GeomDet.h:103
Definition: DetId.h:17
virtual bool setAlignmentPositionError(const AlignmentPositionError &ape)
Definition: GeomDet.cc:25
virtual void setSurfaceDeformation(const SurfaceDeformation *deformation)
Definition: GeomDet.cc:40
virtual const GeomDet * component(DetId) const
Returns a component GeomDet given its DetId, if existing.
Definition: GeomDet.h:77
virtual const SurfaceDeformation * surfaceDeformation() const
Definition: GeomDet.h:96
const RotationType & rotation() const
void rotate(const Surface::RotationType &rotation)
Definition: GeomDet.cc:14
GeomDet(Plane *plane)
Definition: GeomDet.h:31
virtual SubDetector subDetector() const
Which subdetector.
Definition: GeomDet.cc:38
const PositionType & position() const
GlobalPoint toGlobal(const Local3DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:52
GeomDetEnumerators::SubDetector SubDetector
Definition: GeomDet.h:29
AlignmentPositionError const * alignmentPositionError() const
Return pointer to alignment errors.
Definition: GeomDet.h:80
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
Definition: GeomDet.h:40