CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GeomDet.h
Go to the documentation of this file.
1 #ifndef CommonDet_GeomDet_H
2 #define CommonDet_GeomDet_H
3 
12 
19 
20 #include <vector>
21 
23 
24 class Topology;
25 class GeomDetType;
26 class SurfaceDeformation;
27 
28 
29 class GeomDet {
30 public:
32 
33 
34  explicit GeomDet( Plane* plane): thePlane(plane) {}
35  explicit GeomDet( const ReferenceCountingPointer<Plane>& plane) : thePlane(plane) {}
36 
37 
38 
39  virtual ~GeomDet();
40 
42  const Plane& surface() const {return *thePlane;}
43 
45  const Plane& specificSurface() const {return *thePlane;}
46 
48  const Surface::PositionType& position() const {return surface().position();}
49 
51  const Surface::RotationType& rotation() const { return surface().rotation();}
52 
54  GlobalPoint toGlobal(const Local2DPoint& lp) const {
55  return surface().toGlobal( lp);
56  }
57 
59  GlobalPoint toGlobal(const Local3DPoint& lp) const {
60  return surface().toGlobal( lp);
61  }
62 
64  GlobalVector toGlobal(const LocalVector& lv) const {
65  return surface().toGlobal( lv);
66  }
67 
69  LocalPoint toLocal(const GlobalPoint& gp) const {
70  return surface().toLocal( gp);
71  }
72 
74  LocalVector toLocal(const GlobalVector& gv) const {
75  return surface().toLocal( gv);
76  }
77 
79  DetId geographicalId() const { return m_detId; }
80 
82  virtual SubDetector subDetector() const;
83 
85  virtual bool isLeaf() const { return components().empty();}
86 
88  virtual std::vector< const GeomDet*> components() const { return std::vector< const GeomDet*>(); }
89 
91  // FIXME: must become pure virtual
92  virtual const GeomDet* component(DetId /*id*/) const {return nullptr;}
93 
96 
97 
98  // specific unit index in a given subdetector (such as Tracker)
99  int index() const { return m_index;}
100  void setIndex(int i) { m_index=i;}
101 
102  // specific geomDet index in a given subdetector (such as Tracker)
103  int gdetIndex() const { return m_gdetIndex;}
104  void setGdetIndex(int i) { m_gdetIndex=i;}
105 
106 
107  virtual const Topology& topology() const;
108 
109  virtual const GeomDetType& type() const;
110 
111 
114  virtual const SurfaceDeformation* surfaceDeformation() const { return nullptr; }
115 
116 
117 
118  protected:
119 
120  void setDetId(DetId id) {
121  m_detId = id;
122  }
123 
124 private:
125 
128  int m_index=-1;
129  int m_gdetIndex=-1;
130 protected:
132 
133 private:
134 
136  friend class DetPositioner;
137 
140  void move( const GlobalVector& displacement);
141 
144  void rotate( const Surface::RotationType& rotation);
145 
149 
152 
155 
156  virtual bool setAlignmentPositionError (const AlignmentPositionError& ape);
157 
158 private:
159 
160 
164  virtual void setSurfaceDeformation(const SurfaceDeformation * deformation);
165 
166 };
167 
169 
170 #endif
171 
172 
173 
174 
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
int i
Definition: DBlmapReader.cc:9
int m_gdetIndex
Definition: GeomDet.h:129
virtual const GeomDetType & type() const
Definition: GeomDet.cc:85
ReferenceCountingPointer< Plane > thePlane
Definition: GeomDet.h:126
void setGdetIndex(int i)
Definition: GeomDet.h:104
int gdetIndex() const
Definition: GeomDet.h:103
const Surface::RotationType & rotation() const
The rotation defining the local R.F.
Definition: GeomDet.h:51
void setDetId(DetId id)
Definition: GeomDet.h:120
virtual const Topology & topology() const
Definition: GeomDet.cc:81
virtual ~GeomDet()
Definition: GeomDet.cc:6
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
LocalVector toLocal(const GlobalVector &gv) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:74
void setIndex(int i)
Definition: GeomDet.h:100
GeomDet(const ReferenceCountingPointer< Plane > &plane)
Definition: GeomDet.h:35
void setPosition(const Surface::PositionType &position, const Surface::RotationType &rotation)
Definition: GeomDet.cc:24
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:69
int m_index
Definition: GeomDet.h:128
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
Definition: Plane.h:17
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:48
GlobalVector toGlobal(const LocalVector &lv) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:64
LocalPoint toLocal(const GlobalPoint &gp) const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
virtual bool isLeaf() const
is a Unit
Definition: GeomDet.h:85
void move(const GlobalVector &displacement)
Definition: GeomDet.cc:8
int index() const
Definition: GeomDet.h:99
AlignmentPositionError * theAlignmentPositionError
Definition: GeomDet.h:131
DetId m_detId
Definition: GeomDet.h:127
virtual std::vector< const GeomDet * > components() const
Returns direct components, if any.
Definition: GeomDet.h:88
Definition: DetId.h:18
virtual bool setAlignmentPositionError(const AlignmentPositionError &ape)
Definition: GeomDet.cc:31
virtual void setSurfaceDeformation(const SurfaceDeformation *deformation)
Definition: GeomDet.cc:48
virtual const GeomDet * component(DetId) const
Returns a component GeomDet given its DetId, if existing.
Definition: GeomDet.h:92
virtual const SurfaceDeformation * surfaceDeformation() const
Definition: GeomDet.h:114
const RotationType & rotation() const
void rotate(const Surface::RotationType &rotation)
Definition: GeomDet.cc:16
GeomDet(Plane *plane)
Definition: GeomDet.h:34
virtual SubDetector subDetector() const
Which subdetector.
Definition: GeomDet.cc:44
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:59
GeomDetEnumerators::SubDetector SubDetector
Definition: GeomDet.h:31
AlignmentPositionError const * alignmentPositionError() const
Return pointer to alignment errors.
Definition: GeomDet.h:95
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
Definition: GeomDet.h:45