CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Alignable.h
Go to the documentation of this file.
1 #ifndef Alignment_CommonAlignment_Alignable_H
2 #define Alignment_CommonAlignment_Alignable_H
3 
7 
11 class Alignments;
13 class SurfaceDeformation;
14 
27 class SurveyDet;
28 
29 class Alignable
30 {
31 
32 public:
33 
41 
45 
48  Alignable( align::ID, const RotationType& );
49 
51  virtual ~Alignable();
52 
55 
58 
61  virtual void addComponent( Alignable* ) = 0;
62 
64  virtual Alignables components() const = 0;
65 
67  int size() const { return components().size(); }
68 
71  const Alignables& deepComponents() const { return theDeepComponents; }
72 
77  virtual void recursiveComponents(Alignables &result) const = 0;
78 
82  bool firstCompsWithParams(Alignables &paramComps) const;
83 
85  Alignable* mother() const { return theMother; }
86 
89 
91  virtual void move( const GlobalVector& displacement) = 0;
92 
96  virtual void rotateInGlobalFrame( const RotationType& rotation) = 0;
97 
99  virtual void rotateInLocalFrame( const RotationType& rotation);
100 
102  virtual void rotateAroundGlobalAxis( const GlobalVector& axis, Scalar radians );
103 
105  virtual void rotateAroundLocalAxis( const LocalVector& axis, Scalar radians );
106 
108  virtual void rotateAroundGlobalX( Scalar radians );
109 
111  virtual void rotateAroundLocalX( Scalar radians );
112 
114  virtual void rotateAroundGlobalY( Scalar radians );
115 
117  virtual void rotateAroundLocalY( Scalar radians );
118 
120  virtual void rotateAroundGlobalZ( Scalar radians );
121 
123  virtual void rotateAroundLocalZ( Scalar radians);
124 
126  const AlignableSurface& surface() const { return theSurface; }
127 
129  const PositionType& globalPosition() const { return surface().position(); }
130 
132  const RotationType& globalRotation() const { return surface().rotation(); }
133 
135  const GlobalVector& displacement() const { return theDisplacement; }
136 
138  const RotationType& rotation() const { return theRotation; }
139 
141  virtual void
142  setAlignmentPositionError( const AlignmentPositionError& ape, bool propagateDown) = 0;
143 
146  virtual void
147  addAlignmentPositionError( const AlignmentPositionError& ape, bool propagateDown ) = 0;
148 
153  virtual void
154  addAlignmentPositionErrorFromRotation( const RotationType& rotation, bool propagateDown ) = 0;
155 
160  virtual void
161  addAlignmentPositionErrorFromLocalRotation( const RotationType& rotation, bool propagateDown ) = 0;
162 
164  virtual void
165  setSurfaceDeformation(const SurfaceDeformation *deformation, bool propagateDown) = 0;
166 
169  virtual void
170  addSurfaceDeformation(const SurfaceDeformation *deformation, bool propagateDown) = 0;
171 
173  virtual StructureType alignableObjectId() const = 0;
174 
177  const DetId& geomDetId() const { return theDetId; }
178 
180  align::ID id() const { return theId; }
181 
183  virtual void dump() const = 0;
184 
186  virtual Alignments* alignments() const = 0;
187 
189  virtual AlignmentErrorsExtended* alignmentErrors() const = 0;
190 
193 
196  virtual int surfaceDeformationIdPairs(std::vector<std::pair<int,SurfaceDeformation*> > &) const = 0;
197 
199  virtual void cacheTransformation();
200 
202  virtual void restoreCachedTransformation();
203 
205  const SurveyDet* survey() const { return theSurvey; }
206 
208  void setSurvey( const SurveyDet* );
209 
210 protected:
211 
213  void addRotation( const RotationType& rotation );
214 
215 protected:
216 
217  DetId theDetId; // used to check if Alignable is associated to a GeomDet
218  // ugly way to keep AlignableNavigator happy for now
219 
220  align::ID theId; // real ID as int, above DetId should be removed
221 
222  AlignableSurface theSurface; // Global position and orientation of surface
223 
224  GlobalVector theDisplacement; // total linear displacement
225  RotationType theRotation; // total angular displacement
226 
230 
231  Alignables theDeepComponents; // list of lowest daughters
232  // contain itself if Alignable is a unit
233 
234 private:
236  Alignable() {};
237 
239 
240  Alignable* theMother; // Pointer to container
241 
242  const SurveyDet* theSurvey; // Pointer to survey info; owned by class
243 
244 };
245 
246 #endif
RotationType theCachedRotation
Definition: Alignable.h:229
align::ID id() const
Return the ID of Alignable, i.e. DetId of &#39;first&#39; component GeomDet(Unit).
Definition: Alignable.h:180
virtual void rotateInLocalFrame(const RotationType &rotation)
Rotation intepreted in the local reference frame.
Definition: Alignable.cc:91
DetId theDetId
Definition: Alignable.h:217
virtual AlignmentErrorsExtended * alignmentErrors() const =0
Return vector of alignment errors.
RotationType theRotation
Definition: Alignable.h:225
virtual void rotateAroundLocalZ(Scalar radians)
Rotation around local z-axis.
Definition: Alignable.cc:187
double Scalar
Definition: Definitions.h:27
virtual void rotateAroundLocalAxis(const LocalVector &axis, Scalar radians)
Rotation around arbitratry local axis.
Definition: Alignable.cc:113
virtual void addAlignmentPositionErrorFromRotation(const RotationType &rotation, bool propagateDown)=0
Alignable()
private default ctr. to enforce usage of the specialised ones
Definition: Alignable.h:236
uint32_t ID
Definition: Definitions.h:26
const SurveyDet * survey() const
Return survey info.
Definition: Alignable.h:205
Alignable * theMother
Definition: Alignable.h:240
const GlobalVector & displacement() const
Return change of the global position since the creation of the object.
Definition: Alignable.h:135
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:132
virtual void move(const GlobalVector &displacement)=0
Movement with respect to the global reference frame.
virtual void setSurfaceDeformation(const SurfaceDeformation *deformation, bool propagateDown)=0
Set the surface deformation parameters - if (!propagateDown) do not affect daughters.
virtual void addAlignmentPositionError(const AlignmentPositionError &ape, bool propagateDown)=0
virtual void rotateAroundGlobalAxis(const GlobalVector &axis, Scalar radians)
Rotation around arbitratry global axis.
Definition: Alignable.cc:104
virtual Alignables components() const =0
Return vector of all direct components.
align::LocalVector LocalVector
Definition: Alignable.h:38
AlignmentParameters * alignmentParameters() const
Get the AlignmentParameters.
Definition: Alignable.h:57
GlobalVector theDisplacement
Definition: Alignable.h:224
virtual void rotateAroundGlobalZ(Scalar radians)
Rotation around global z-axis.
Definition: Alignable.cc:174
virtual void addAlignmentPositionErrorFromLocalRotation(const RotationType &rotation, bool propagateDown)=0
virtual void dump() const =0
Recursive printout of alignable information.
virtual void recursiveComponents(Alignables &result) const =0
const RotationType & rotation() const
Return change of orientation since the creation of the object.
Definition: Alignable.h:138
AlignmentParameters * theAlignmentParameters
Definition: Alignable.h:236
virtual int surfaceDeformationIdPairs(std::vector< std::pair< int, SurfaceDeformation * > > &) const =0
void setAlignmentParameters(AlignmentParameters *dap)
Set the AlignmentParameters.
Definition: Alignable.cc:81
virtual void addSurfaceDeformation(const SurfaceDeformation *deformation, bool propagateDown)=0
tuple result
Definition: query.py:137
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
bool firstCompsWithParams(Alignables &paramComps) const
Definition: Alignable.cc:50
virtual void addComponent(Alignable *)=0
AlignmentSurfaceDeformations * surfaceDeformations() const
Return surface deformations, sorted by DetId.
Definition: Alignable.cc:216
virtual void restoreCachedTransformation()
restore the previously cached transformation, also for possible components
Definition: Alignable.cc:251
virtual void setAlignmentPositionError(const AlignmentPositionError &ape, bool propagateDown)=0
Set the alignment position error - if (!propagateDown) do not affect daughters.
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:126
void setMother(Alignable *mother)
Assign mother to alignable.
Definition: Alignable.h:88
AlignableSurface theCachedSurface
Definition: Alignable.h:227
Definition: DetId.h:18
const Alignables & deepComponents() const
Definition: Alignable.h:71
virtual void rotateAroundGlobalX(Scalar radians)
Rotation around global x-axis.
Definition: Alignable.cc:122
virtual void rotateInGlobalFrame(const RotationType &rotation)=0
void setSurvey(const SurveyDet *)
Set survey info.
Definition: Alignable.cc:268
void addRotation(const RotationType &rotation)
Definition: Alignable.cc:208
align::RotationType RotationType
Definition: Alignable.h:36
GlobalVector theCachedDisplacement
Definition: Alignable.h:228
virtual void rotateAroundLocalY(Scalar radians)
Rotation around local y-axis.
Definition: Alignable.cc:161
virtual void rotateAroundGlobalY(Scalar radians)
Rotation around global y-axis.
Definition: Alignable.cc:148
void addDisplacement(const GlobalVector &displacement)
Definition: Alignable.cc:200
align::PositionType PositionType
Definition: Alignable.h:35
std::vector< Alignable * > Alignables
Definition: Utilities.h:28
virtual void cacheTransformation()
cache the current position, rotation and other parameters (e.g. surface deformations) ...
Definition: Alignable.cc:244
virtual void rotateAroundLocalX(Scalar radians)
Rotation around local x-axis.
Definition: Alignable.cc:135
align::Scalar Scalar
Definition: Alignable.h:34
const RotationType & rotation() const
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:129
align::GlobalVector GlobalVector
Definition: Alignable.h:37
align::ID theId
Definition: Alignable.h:220
const PositionType & position() const
virtual ~Alignable()
Destructor.
Definition: Alignable.cc:43
const SurveyDet * theSurvey
Definition: Alignable.h:242
Alignable * mother() const
Return pointer to container alignable (if any)
Definition: Alignable.h:85
const DetId & geomDetId() const
Definition: Alignable.h:177
align::Alignables Alignables
Definition: Alignable.h:39
virtual Alignments * alignments() const =0
Return vector of alignment data.
AlignableSurface theSurface
Definition: Alignable.h:222
int size() const
Return number of direct components.
Definition: Alignable.h:67
Alignables theDeepComponents
Definition: Alignable.h:231
align::StructureType StructureType
Definition: Alignable.h:40