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  explicit GeomDet(Plane* plane);
34 
35  explicit GeomDet(const ReferenceCountingPointer<Plane>& plane);
36 
37  virtual ~GeomDet();
38 
40  const Plane& surface() const {return *thePlane;}
41 
43  const Plane& specificSurface() const {return *thePlane;}
44 
46  const Surface::PositionType& position() const {return surface().position();}
47 
49  const Surface::RotationType& rotation() const { return surface().rotation();}
50 
52  GlobalPoint toGlobal(const Local2DPoint& lp) const {
53  return surface().toGlobal( lp);
54  }
55 
57  GlobalPoint toGlobal(const Local3DPoint& lp) const {
58  return surface().toGlobal( lp);
59  }
60 
62  GlobalVector toGlobal(const LocalVector& lv) const {
63  return surface().toGlobal( lv);
64  }
65 
67  LocalPoint toLocal(const GlobalPoint& gp) const {
68  return surface().toLocal( gp);
69  }
70 
72  LocalVector toLocal(const GlobalVector& gv) const {
73  return surface().toLocal( gv);
74  }
75 
77  DetId geographicalId() const { return m_detId; }
78 
80  virtual SubDetector subDetector() const;;
81 
83  virtual bool isLeaf() const { return components().empty();}
84 
86  virtual std::vector< const GeomDet*> components() const { return std::vector< const GeomDet*>(); }
87 
89  // FIXME: must become pure virtual
90  virtual const GeomDet* component(DetId /*id*/) const {return nullptr;}
91 
94 
95 
96  // specific unix index in a given subdetector (such as Tracker)
97  int index() const { return m_index;}
98  void setIndex(int i) { m_index=i;}
99 
100 
101  virtual const Topology& topology() const;
102 
103  virtual const GeomDetType& type() const;
104 
105 
108  virtual const SurfaceDeformation* surfaceDeformation() const { return 0; }
109 
110 
111 
112  protected:
113 
114  void setDetId(DetId id) {
115  m_detId = id;
116  }
117 
118 private:
119 
122  int m_index;
123 protected:
125 
126 private:
127 
129  friend class DetPositioner;
130 
133  void move( const GlobalVector& displacement);
134 
137  void rotate( const Surface::RotationType& rotation);
138 
142 
145 
148 
149  virtual bool setAlignmentPositionError (const AlignmentPositionError& ape);
150 
151 private:
152 
153 
157  virtual void setSurfaceDeformation(const SurfaceDeformation * deformation);
158 
159 };
160 
162 
163 #endif
164 
165 
166 
167 
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:114
int i
Definition: DBlmapReader.cc:9
virtual const GeomDetType & type() const
Definition: GeomDet.cc:90
ReferenceCountingPointer< Plane > thePlane
Definition: GeomDet.h:120
const Surface::RotationType & rotation() const
The rotation defining the local R.F.
Definition: GeomDet.h:49
void setDetId(DetId id)
Definition: GeomDet.h:114
virtual const Topology & topology() const
Definition: GeomDet.cc:86
virtual ~GeomDet()
Definition: GeomDet.cc:11
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:52
LocalVector toLocal(const GlobalVector &gv) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:72
void setIndex(int i)
Definition: GeomDet.h:98
void setPosition(const Surface::PositionType &position, const Surface::RotationType &rotation)
Definition: GeomDet.cc:29
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:67
int m_index
Definition: GeomDet.h:122
GeomDet GeomDetUnit
Definition: GeomDet.h:161
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
Definition: Plane.h:17
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:46
GlobalVector toGlobal(const LocalVector &lv) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:62
LocalPoint toLocal(const GlobalPoint &gp) const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:77
virtual bool isLeaf() const
is a Unit
Definition: GeomDet.h:83
void move(const GlobalVector &displacement)
Definition: GeomDet.cc:13
int index() const
Definition: GeomDet.h:97
AlignmentPositionError * theAlignmentPositionError
Definition: GeomDet.h:124
DetId m_detId
Definition: GeomDet.h:121
virtual std::vector< const GeomDet * > components() const
Returns direct components, if any.
Definition: GeomDet.h:86
Definition: DetId.h:18
virtual bool setAlignmentPositionError(const AlignmentPositionError &ape)
Definition: GeomDet.cc:36
virtual void setSurfaceDeformation(const SurfaceDeformation *deformation)
Definition: GeomDet.cc:53
virtual const GeomDet * component(DetId) const
Returns a component GeomDet given its DetId, if existing.
Definition: GeomDet.h:90
virtual const SurfaceDeformation * surfaceDeformation() const
Definition: GeomDet.h:108
const RotationType & rotation() const
GeomDetEnumerators::SubDetector SubDetector
Definition: GeomDet.h:31
void rotate(const Surface::RotationType &rotation)
Definition: GeomDet.cc:21
GeomDet(Plane *plane)
Definition: GeomDet.cc:5
virtual SubDetector subDetector() const
Which subdetector.
Definition: GeomDet.cc:49
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:57
AlignmentPositionError const * alignmentPositionError() const
Return pointer to alignment errors.
Definition: GeomDet.h:93
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
Definition: GeomDet.h:43