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 
87  bool lastCompsWithParams(Alignables& paramComps) const;
88 
90  Alignable* mother() const { return theMother; }
91 
94 
96  virtual void move( const GlobalVector& displacement) = 0;
97 
101  virtual void rotateInGlobalFrame( const RotationType& rotation) = 0;
102 
104  virtual void rotateInLocalFrame( const RotationType& rotation);
105 
107  virtual void rotateAroundGlobalAxis( const GlobalVector& axis, Scalar radians );
108 
110  virtual void rotateAroundLocalAxis( const LocalVector& axis, Scalar radians );
111 
113  virtual void rotateAroundGlobalX( Scalar radians );
114 
116  virtual void rotateAroundLocalX( Scalar radians );
117 
119  virtual void rotateAroundGlobalY( Scalar radians );
120 
122  virtual void rotateAroundLocalY( Scalar radians );
123 
125  virtual void rotateAroundGlobalZ( Scalar radians );
126 
128  virtual void rotateAroundLocalZ( Scalar radians);
129 
131  const AlignableSurface& surface() const { return theSurface; }
132 
134  const PositionType& globalPosition() const { return surface().position(); }
135 
137  const RotationType& globalRotation() const { return surface().rotation(); }
138 
140  const GlobalVector& displacement() const { return theDisplacement; }
141 
143  const RotationType& rotation() const { return theRotation; }
144 
146  virtual void
147  setAlignmentPositionError( const AlignmentPositionError& ape, bool propagateDown) = 0;
148 
151  virtual void
152  addAlignmentPositionError( const AlignmentPositionError& ape, bool propagateDown ) = 0;
153 
158  virtual void
159  addAlignmentPositionErrorFromRotation( const RotationType& rotation, bool propagateDown ) = 0;
160 
165  virtual void
166  addAlignmentPositionErrorFromLocalRotation( const RotationType& rotation, bool propagateDown ) = 0;
167 
169  virtual void
170  setSurfaceDeformation(const SurfaceDeformation *deformation, bool propagateDown) = 0;
171 
174  virtual void
175  addSurfaceDeformation(const SurfaceDeformation *deformation, bool propagateDown) = 0;
176 
178  virtual StructureType alignableObjectId() const = 0;
179 
182  const DetId& geomDetId() const { return theDetId; }
183 
185  align::ID id() const { return theId; }
186 
188  virtual void dump() const = 0;
189 
191  virtual Alignments* alignments() const = 0;
192 
194  virtual AlignmentErrorsExtended* alignmentErrors() const = 0;
195 
198 
201  virtual int surfaceDeformationIdPairs(std::vector<std::pair<int,SurfaceDeformation*> > &) const = 0;
202 
204  virtual void cacheTransformation();
205 
207  virtual void restoreCachedTransformation();
208 
210  const SurveyDet* survey() const { return theSurvey; }
211 
213  void setSurvey( const SurveyDet* );
214 
215 protected:
216 
218  void addRotation( const RotationType& rotation );
219 
220 protected:
221 
222  DetId theDetId; // used to check if Alignable is associated to a GeomDet
223  // ugly way to keep AlignableNavigator happy for now
224 
225  align::ID theId; // real ID as int, above DetId should be removed
226 
227  AlignableSurface theSurface; // Global position and orientation of surface
228 
229  GlobalVector theDisplacement; // total linear displacement
230  RotationType theRotation; // total angular displacement
231 
235 
236  Alignables theDeepComponents; // list of lowest daughters
237  // contain itself if Alignable is a unit
238 
239 private:
241  Alignable() {};
242 
244 
245  Alignable* theMother; // Pointer to container
246 
247  const SurveyDet* theSurvey; // Pointer to survey info; owned by class
248 
249 };
250 
251 typedef std::vector<Alignable*> Alignables;
252 
253 #endif
RotationType theCachedRotation
Definition: Alignable.h:234
align::ID id() const
Return the ID of Alignable, i.e. DetId of &#39;first&#39; component GeomDet(Unit).
Definition: Alignable.h:185
virtual void rotateInLocalFrame(const RotationType &rotation)
Rotation intepreted in the local reference frame.
Definition: Alignable.cc:120
DetId theDetId
Definition: Alignable.h:222
virtual AlignmentErrorsExtended * alignmentErrors() const =0
Return vector of alignment errors.
RotationType theRotation
Definition: Alignable.h:230
std::vector< Alignable * > Alignables
Definition: Alignable.h:251
virtual void rotateAroundLocalZ(Scalar radians)
Rotation around local z-axis.
Definition: Alignable.cc:216
double Scalar
Definition: Definitions.h:27
virtual void rotateAroundLocalAxis(const LocalVector &axis, Scalar radians)
Rotation around arbitratry local axis.
Definition: Alignable.cc:142
virtual void addAlignmentPositionErrorFromRotation(const RotationType &rotation, bool propagateDown)=0
Alignable()
private default ctr. to enforce usage of the specialised ones
Definition: Alignable.h:241
uint32_t ID
Definition: Definitions.h:26
const SurveyDet * survey() const
Return survey info.
Definition: Alignable.h:210
Alignable * theMother
Definition: Alignable.h:245
const GlobalVector & displacement() const
Return change of the global position since the creation of the object.
Definition: Alignable.h:140
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:137
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:133
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:229
tuple result
Definition: mps_fire.py:84
virtual void rotateAroundGlobalZ(Scalar radians)
Rotation around global z-axis.
Definition: Alignable.cc:203
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:143
AlignmentParameters * theAlignmentParameters
Definition: Alignable.h:241
virtual int surfaceDeformationIdPairs(std::vector< std::pair< int, SurfaceDeformation * > > &) const =0
void setAlignmentParameters(AlignmentParameters *dap)
Set the AlignmentParameters.
Definition: Alignable.cc:110
virtual void addSurfaceDeformation(const SurfaceDeformation *deformation, bool propagateDown)=0
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:245
virtual void restoreCachedTransformation()
restore the previously cached transformation, also for possible components
Definition: Alignable.cc:289
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:131
void setMother(Alignable *mother)
Assign mother to alignable.
Definition: Alignable.h:93
AlignableSurface theCachedSurface
Definition: Alignable.h:232
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:151
virtual void rotateInGlobalFrame(const RotationType &rotation)=0
void setSurvey(const SurveyDet *)
Set survey info.
Definition: Alignable.cc:306
void addRotation(const RotationType &rotation)
Definition: Alignable.cc:237
align::RotationType RotationType
Definition: Alignable.h:36
GlobalVector theCachedDisplacement
Definition: Alignable.h:233
virtual void rotateAroundLocalY(Scalar radians)
Rotation around local y-axis.
Definition: Alignable.cc:190
virtual void rotateAroundGlobalY(Scalar radians)
Rotation around global y-axis.
Definition: Alignable.cc:177
void addDisplacement(const GlobalVector &displacement)
Definition: Alignable.cc:229
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), also for possible components
Definition: Alignable.cc:273
virtual void rotateAroundLocalX(Scalar radians)
Rotation around local x-axis.
Definition: Alignable.cc:164
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:134
align::GlobalVector GlobalVector
Definition: Alignable.h:37
align::ID theId
Definition: Alignable.h:225
const PositionType & position() const
virtual ~Alignable()
Destructor.
Definition: Alignable.cc:43
const SurveyDet * theSurvey
Definition: Alignable.h:247
Alignable * mother() const
Return pointer to container alignable (if any)
Definition: Alignable.h:90
const DetId & geomDetId() const
Definition: Alignable.h:182
align::Alignables Alignables
Definition: Alignable.h:39
virtual Alignments * alignments() const =0
Return vector of alignment data.
AlignableSurface theSurface
Definition: Alignable.h:227
int size() const
Return number of direct components.
Definition: Alignable.h:67
Alignables theDeepComponents
Definition: Alignable.h:236
bool lastCompsWithParams(Alignables &paramComps) const
Definition: Alignable.cc:81
align::StructureType StructureType
Definition: Alignable.h:40