CMS 3D CMS Logo

Alignable.h
Go to the documentation of this file.
1 #ifndef Alignment_CommonAlignment_Alignable_H
2 #define Alignment_CommonAlignment_Alignable_H
3 
8 
12 class Alignments;
14 class SurfaceDeformation;
15 
25 class SurveyDet;
26 
27 class Alignable {
28 public:
36 
38 
42 
46 
48  virtual ~Alignable();
49 
52  void update(align::ID, const AlignableSurface&);
53 
56 
59 
62  virtual void addComponent(Alignable*) = 0;
63 
65  virtual const Alignables& components() const = 0;
66 
68  int size() const { return components().size(); }
69 
72  const Alignables& deepComponents() const { return theDeepComponents; }
73 
78  virtual void recursiveComponents(Alignables& result) const = 0;
79 
83  bool firstCompsWithParams(Alignables& paramComps) const;
84 
88  bool lastCompsWithParams(Alignables& paramComps) const;
89 
91  Alignable* mother() const { return theMother; }
92 
95 
97  virtual void move(const GlobalVector& displacement) = 0;
98 
102  virtual void rotateInGlobalFrame(const RotationType& rotation) = 0;
103 
105  virtual void rotateInLocalFrame(const RotationType& rotation);
106 
108  virtual void rotateAroundGlobalAxis(const GlobalVector& axis, Scalar radians);
109 
111  virtual void rotateAroundLocalAxis(const LocalVector& axis, Scalar radians);
112 
114  virtual void rotateAroundGlobalX(Scalar radians);
115 
117  virtual void rotateAroundLocalX(Scalar radians);
118 
120  virtual void rotateAroundGlobalY(Scalar radians);
121 
123  virtual void rotateAroundLocalY(Scalar radians);
124 
126  virtual void rotateAroundGlobalZ(Scalar radians);
127 
129  virtual void rotateAroundLocalZ(Scalar radians);
130 
132  const AlignableSurface& surface() const { return theSurface; }
133 
135  const PositionType& globalPosition() const { return surface().position(); }
136 
138  const RotationType& globalRotation() const { return surface().rotation(); }
139 
141  const GlobalVector& displacement() const { return theDisplacement; }
142 
144  const RotationType& rotation() const { return theRotation; }
145 
147  virtual void setAlignmentPositionError(const AlignmentPositionError& ape, bool propagateDown) = 0;
148 
151  virtual void addAlignmentPositionError(const AlignmentPositionError& ape, bool propagateDown) = 0;
152 
157  virtual void addAlignmentPositionErrorFromRotation(const RotationType& rotation, bool propagateDown) = 0;
158 
163  virtual void addAlignmentPositionErrorFromLocalRotation(const RotationType& rotation, bool propagateDown) = 0;
164 
166  virtual void setSurfaceDeformation(const SurfaceDeformation* deformation, bool propagateDown) = 0;
167 
170  virtual void 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 
184 
186  virtual void dump() const = 0;
187 
189  virtual Alignments* alignments() const = 0;
190 
192  virtual AlignmentErrorsExtended* alignmentErrors() const = 0;
193 
196 
199  virtual int surfaceDeformationIdPairs(std::vector<std::pair<int, SurfaceDeformation*> >&) const = 0;
200 
202  virtual void cacheTransformation();
203 
206  virtual void cacheTransformation(const align::RunNumber&);
207 
209  virtual void restoreCachedTransformation();
210 
213  virtual void restoreCachedTransformation(const align::RunNumber&);
214 
216  const SurveyDet* survey() const { return theSurvey; }
217 
219  void setSurvey(const SurveyDet*);
220 
222  virtual void recenterSurface();
223 
224 protected:
225  template <class T>
226  using Cache = std::map<align::RunNumber, T>;
227 
229  void addRotation(const RotationType& rotation);
230  virtual void updateMother(const GlobalVector& shift);
231 
232  DetId theDetId; // used to check if Alignable is associated to a GeomDet
233  // ugly way to keep AlignableNavigator happy for now
234 
235  align::ID theId; // real ID as int, above DetId should be removed
236 
237  AlignableSurface theSurface; // Global position and orientation of surface
238 
239  GlobalVector theDisplacement; // total linear displacement
240  RotationType theRotation; // total angular displacement
241 
245 
247 
248  Alignables theDeepComponents; // list of lowest daughters
249  // contain itself if Alignable is a unit
250 
254 
255 private:
258 
260 
261  Alignable* theMother; // Pointer to container
262 
263  const SurveyDet* theSurvey; // Pointer to survey info; owned by class
264 };
265 
266 #endif
Vector3DBase
Definition: Vector3DBase.h:8
Alignable::theDisplacement
GlobalVector theDisplacement
Definition: Alignable.h:239
Alignable::addAlignmentPositionErrorFromLocalRotation
virtual void addAlignmentPositionErrorFromLocalRotation(const RotationType &rotation, bool propagateDown)=0
TkRotation
Definition: extTkRotation.h:13
Alignable::firstCompsWithParams
bool firstCompsWithParams(Alignables &paramComps) const
Definition: Alignable.cc:62
Alignable::theDeepComponents
Alignables theDeepComponents
Definition: Alignable.h:248
Alignable::Alignables
align::Alignables Alignables
Definition: Alignable.h:34
Alignable::setAlignmentParameters
void setAlignmentParameters(AlignmentParameters *dap)
Set the AlignmentParameters.
Definition: Alignable.cc:123
StructureType.h
Alignable::setAlignmentPositionError
virtual void setAlignmentPositionError(const AlignmentPositionError &ape, bool propagateDown)=0
Set the alignment position error - if (!propagateDown) do not affect daughters.
Alignable::theCachedSurface
AlignableSurface theCachedSurface
Definition: Alignable.h:242
Alignable::dump
virtual void dump() const =0
Recursive printout of alignable information.
Alignable::rotateInGlobalFrame
virtual void rotateInGlobalFrame(const RotationType &rotation)=0
align::RunNumber
cond::RealTimeType< cond::runnumber >::type RunNumber
Definition: Utilities.h:37
Alignable
Definition: Alignable.h:27
Alignable::rotateAroundGlobalX
virtual void rotateAroundGlobalX(Scalar radians)
Rotation around global x-axis.
Definition: Alignable.cc:148
Alignable::surfaceDeformationIdPairs
virtual int surfaceDeformationIdPairs(std::vector< std::pair< int, SurfaceDeformation * > > &) const =0
Alignable::restoreCachedTransformation
virtual void restoreCachedTransformation()
restore the previously cached transformation, also for possible components
Definition: Alignable.cc:237
Alignable::rotateAroundLocalAxis
virtual void rotateAroundLocalAxis(const LocalVector &axis, Scalar radians)
Rotation around arbitratry local axis.
Definition: Alignable.cc:143
Alignable::alignments
virtual Alignments * alignments() const =0
Return vector of alignment data.
Alignable::CompConstraintType::POSITION_Z
Alignable::Alignable
Alignable()
private default ctr. to enforce usage of the specialised ones
Definition: Alignable.h:257
Alignable::GlobalVector
align::GlobalVector GlobalVector
Definition: Alignable.h:32
Alignable::StructureType
align::StructureType StructureType
Definition: Alignable.h:35
SurfaceDeformation
Definition: SurfaceDeformation.h:18
Alignable::rotateAroundGlobalZ
virtual void rotateAroundGlobalZ(Scalar radians)
Rotation around global z-axis.
Definition: Alignable.cc:176
AlignmentParameters
Definition: AlignmentParameters.h:35
Alignable::surfaceDeformations
AlignmentSurfaceDeformations * surfaceDeformations() const
Return surface deformations, sorted by DetId.
Definition: Alignable.cc:196
align::Scalar
double Scalar
Definition: Definitions.h:25
Alignable::surfacesCache_
Cache< AlignableSurface > surfacesCache_
Definition: Alignable.h:251
SurveyDet
Definition: SurveyDet.h:15
DetId
Definition: DetId.h:17
Alignable::setSurvey
void setSurvey(const SurveyDet *)
Set survey info.
Definition: Alignable.cc:266
Alignable::theDetId
DetId theDetId
Definition: Alignable.h:232
Alignable::setSurfaceDeformation
virtual void setSurfaceDeformation(const SurfaceDeformation *deformation, bool propagateDown)=0
Set the surface deformation parameters - if (!propagateDown) do not affect daughters.
Alignable::alignableObjectId
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
Alignable::PositionType
align::PositionType PositionType
Definition: Alignable.h:30
Alignable::compConstraintType_
CompConstraintType compConstraintType_
Definition: Alignable.h:246
Alignable::update
void update(align::ID, const AlignableSurface &)
Definition: Alignable.cc:45
Alignable::addAlignmentPositionError
virtual void addAlignmentPositionError(const AlignmentPositionError &ape, bool propagateDown)=0
Alignable::~Alignable
virtual ~Alignable()
Destructor.
Definition: Alignable.cc:39
Alignable::addRotation
void addRotation(const RotationType &rotation)
Definition: Alignable.cc:193
Alignable::surface
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:132
Point3DBase< Scalar, GlobalTag >
Alignable::lastCompsWithParams
bool lastCompsWithParams(Alignables &paramComps) const
Definition: Alignable.cc:93
Alignable::displacement
const GlobalVector & displacement() const
Return change of the global position since the creation of the object.
Definition: Alignable.h:141
Alignable::rotateAroundGlobalY
virtual void rotateAroundGlobalY(Scalar radians)
Rotation around global y-axis.
Definition: Alignable.cc:162
Alignable::Scalar
align::Scalar Scalar
Definition: Alignable.h:29
AlignableSurface.h
Alignable::theSurvey
const SurveyDet * theSurvey
Definition: Alignable.h:263
Alignable::theAlignmentParameters
AlignmentParameters * theAlignmentParameters
Definition: Alignable.h:257
align::StructureType
StructureType
Definition: StructureType.h:16
Alignable::addAlignmentPositionErrorFromRotation
virtual void addAlignmentPositionErrorFromRotation(const RotationType &rotation, bool propagateDown)=0
Alignable::displacementsCache_
Cache< GlobalVector > displacementsCache_
Definition: Alignable.h:252
Alignable::updateMother
virtual void updateMother(const GlobalVector &shift)
Definition: Alignable.cc:272
Alignable::rotation
const RotationType & rotation() const
Return change of orientation since the creation of the object.
Definition: Alignable.h:144
align::ID
uint32_t ID
Definition: Definitions.h:24
Alignable::rotateAroundGlobalAxis
virtual void rotateAroundGlobalAxis(const GlobalVector &axis, Scalar radians)
Rotation around arbitratry global axis.
Definition: Alignable.cc:138
Alignable::id
align::ID id() const
Return the ID of Alignable, i.e. DetId of 'first' component GeomDet(Unit).
Definition: Alignable.h:180
Alignable::addComponent
virtual void addComponent(Alignable *)=0
Alignable::RotationType
align::RotationType RotationType
Definition: Alignable.h:31
Alignable::rotateAroundLocalZ
virtual void rotateAroundLocalZ(Scalar radians)
Rotation around local z-axis.
Definition: Alignable.cc:183
Alignable::rotateInLocalFrame
virtual void rotateInLocalFrame(const RotationType &rotation)
Rotation intepreted in the local reference frame.
Definition: Alignable.cc:129
Alignable::CompConstraintType::NONE
Alignable::geomDetId
const DetId & geomDetId() const
Definition: Alignable.h:177
AlignmentSurfaceDeformations
Definition: AlignmentSurfaceDeformations.h:20
Utilities.h
Alignable::theSurface
AlignableSurface theSurface
Definition: Alignable.h:237
Alignable::theCachedRotation
RotationType theCachedRotation
Definition: Alignable.h:244
AlignmentErrorsExtended
Definition: AlignmentErrorsExtended.h:10
Alignable::rotateAroundLocalX
virtual void rotateAroundLocalX(Scalar radians)
Rotation around local x-axis.
Definition: Alignable.cc:155
Alignable::theMother
Alignable * theMother
Definition: Alignable.h:261
Alignable::move
virtual void move(const GlobalVector &displacement)=0
Movement with respect to the global reference frame.
Alignable::setMother
void setMother(Alignable *mother)
Assign mother to alignable.
Definition: Alignable.h:94
GloballyPositioned::position
const PositionType & position() const
Definition: GloballyPositioned.h:36
align::Alignables
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
edm::shift
static unsigned const int shift
Definition: LuminosityBlockID.cc:7
AlignableSurface
Definition: AlignableSurface.h:20
DetId.h
Alignable::rotationsCache_
Cache< RotationType > rotationsCache_
Definition: Alignable.h:253
Alignable::deepComponents
const Alignables & deepComponents() const
Definition: Alignable.h:72
Alignable::rotateAroundLocalY
virtual void rotateAroundLocalY(Scalar radians)
Rotation around local y-axis.
Definition: Alignable.cc:169
Alignable::theCachedDisplacement
GlobalVector theCachedDisplacement
Definition: Alignable.h:243
Alignable::addDisplacement
void addDisplacement(const GlobalVector &displacement)
Definition: Alignable.cc:190
Alignable::CompConstraintType
CompConstraintType
Definition: Alignable.h:37
Alignable::alignmentErrors
virtual AlignmentErrorsExtended * alignmentErrors() const =0
Return vector of alignment errors.
Alignable::theId
align::ID theId
Definition: Alignable.h:235
Alignable::theRotation
RotationType theRotation
Definition: Alignable.h:240
Alignable::cacheTransformation
virtual void cacheTransformation()
cache the current position, rotation and other parameters (e.g. surface deformations),...
Definition: Alignable.cc:215
mps_fire.result
result
Definition: mps_fire.py:303
GloballyPositioned::rotation
const RotationType & rotation() const
Definition: GloballyPositioned.h:38
Alignable::globalPosition
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:135
Alignable::recursiveComponents
virtual void recursiveComponents(Alignables &result) const =0
AlignmentPositionError
Definition: AlignmentPositionError.h:10
Alignable::components
virtual const Alignables & components() const =0
Return vector of all direct components.
Alignable::alignmentParameters
AlignmentParameters * alignmentParameters() const
Get the AlignmentParameters.
Definition: Alignable.h:58
Alignments
Definition: Alignments.h:10
Alignable::LocalVector
align::LocalVector LocalVector
Definition: Alignable.h:33
Alignable::Cache
std::map< align::RunNumber, T > Cache
Definition: Alignable.h:226
Alignable::survey
const SurveyDet * survey() const
Return survey info.
Definition: Alignable.h:216
Alignable::recenterSurface
virtual void recenterSurface()
Recenter surface object without moving possible components.
Definition: Alignable.cc:295
Alignable::addSurfaceDeformation
virtual void addSurfaceDeformation(const SurfaceDeformation *deformation, bool propagateDown)=0
Alignable::CompConstraintType::POSITION
Alignable::globalRotation
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:138
Alignable::mother
Alignable * mother() const
Return pointer to container alignable (if any)
Definition: Alignable.h:91
Alignable::size
int size() const
Return number of direct components.
Definition: Alignable.h:68
Alignable::compConstraintType
virtual CompConstraintType compConstraintType() const
Return the alignable type of contraints wrt. its components.
Definition: Alignable.h:183