CMS 3D CMS Logo

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
Vector3DBase
Definition: Vector3DBase.h:8
GeomDet::position
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:43
GeomDet::setDetId
void setDetId(DetId id)
Definition: GeomDet.h:99
Point2DBase< float, LocalTag >
GeomDetEnumerators::SubDetector
SubDetector
Definition: GeomDetEnumerators.h:10
mps_fire.i
i
Definition: mps_fire.py:428
GeomDet::component
virtual const GeomDet * component(DetId) const
Returns a component GeomDet given its DetId, if existing.
Definition: GeomDet.h:77
GeomDet
Definition: GeomDet.h:27
GeomDet::GeomDet
GeomDet(const ReferenceCountingPointer< Plane > &plane)
Definition: GeomDet.h:32
GeomDet::setPosition
void setPosition(const Surface::PositionType &position, const Surface::RotationType &rotation)
Definition: GeomDet.cc:21
GeomDet::m_detId
DetId m_detId
Definition: GeomDet.h:103
GeomDet::type
virtual const GeomDetType & type() const
Definition: GeomDet.cc:69
GeomDet::toGlobal
GlobalVector toGlobal(const LocalVector &lv) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:55
GeomDet::GeomDet
GeomDet(Plane *plane)
Definition: GeomDet.h:31
GeomDetType
Definition: GeomDetType.h:9
GeomDet::m_index
int m_index
Definition: GeomDet.h:104
GeomDet::topology
virtual const Topology & topology() const
Definition: GeomDet.cc:67
GeomDet::index
int index() const
Definition: GeomDet.h:83
GeomDet::components
virtual std::vector< const GeomDet * > components() const
Returns direct components, if any.
Definition: GeomDet.h:73
ReferenceCountingPointer< Plane >
SurfaceDeformation
Definition: SurfaceDeformation.h:18
GloballyPositioned< float >::RotationType
TkRotation< float > RotationType
Definition: GloballyPositioned.h:22
GeomDet::thePlane
ReferenceCountingPointer< Plane > thePlane
Definition: GeomDet.h:102
DetId
Definition: DetId.h:17
Plane.h
GeomDet::surface
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
GeomDet::setGdetIndex
void setGdetIndex(int i)
Definition: GeomDet.h:88
GeomDet::rotate
void rotate(const Surface::RotationType &rotation)
Definition: GeomDet.cc:14
GeomDet::surfaceDeformation
virtual const SurfaceDeformation * surfaceDeformation() const
Definition: GeomDet.h:96
LocalError.h
GeomDet::SubDetector
GeomDetEnumerators::SubDetector SubDetector
Definition: GeomDet.h:29
Surface::toGlobal
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
GeomDet::theAlignmentPositionError
AlignmentPositionError * theAlignmentPositionError
Definition: GeomDet.h:106
Point3DBase< float, GlobalTag >
DetPositioner
Definition: DetPositioner.h:12
GeomDet::toLocal
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:58
GeomDet::toGlobal
GlobalPoint toGlobal(const Local3DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:52
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
GeomDet::toLocal
LocalVector toLocal(const GlobalVector &gv) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:61
GeomDet::geographicalId
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
GeomDet::alignmentPositionError
AlignmentPositionError const * alignmentPositionError() const
Return pointer to alignment errors.
Definition: GeomDet.h:80
GeomDet::toGlobal
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
GeomDet::move
void move(const GlobalVector &displacement)
Definition: GeomDet.cc:7
GeomDet::setAlignmentPositionError
virtual bool setAlignmentPositionError(const AlignmentPositionError &ape)
Definition: GeomDet.cc:25
GeomDet::specificSurface
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
Definition: GeomDet.h:40
GeomDet::~GeomDet
virtual ~GeomDet()
Definition: GeomDet.cc:5
GeomDet::gdetIndex
int gdetIndex() const
Definition: GeomDet.h:87
GloballyPositioned::position
const PositionType & position() const
Definition: GloballyPositioned.h:36
GeomDet::m_gdetIndex
int m_gdetIndex
Definition: GeomDet.h:105
GeomDet::setIndex
void setIndex(int i)
Definition: GeomDet.h:84
GeomDetEnumerators.h
GloballyPositioned< float >::PositionType
Point3DBase< float, GlobalTag > PositionType
Definition: GloballyPositioned.h:21
DetId.h
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
LocalPoint.h
GloballyPositioned::toLocal
LocalPoint toLocal(const GlobalPoint &gp) const
Definition: GloballyPositioned.h:98
Plane
Definition: Plane.h:16
GeomDet::setSurfaceDeformation
virtual void setSurfaceDeformation(const SurfaceDeformation *deformation)
Definition: GeomDet.cc:40
GlobalVector.h
Topology
Definition: Topology.h:39
GloballyPositioned::rotation
const RotationType & rotation() const
Definition: GloballyPositioned.h:38
AlignmentPositionError
Definition: AlignmentPositionError.h:10
LocalVector.h
GlobalPoint.h
GeomDet::rotation
const Surface::RotationType & rotation() const
The rotation defining the local R.F.
Definition: GeomDet.h:46
GeomDet::isLeaf
virtual bool isLeaf() const
is a Unit
Definition: GeomDet.h:70
GeomDet::subDetector
virtual SubDetector subDetector() const
Which subdetector.
Definition: GeomDet.cc:38