CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
AlignableDetUnit Class Reference

#include <AlignableDetUnit.h>

Inheritance diagram for AlignableDetUnit:
Alignable

Public Member Functions

virtual void addAlignmentPositionError (const AlignmentPositionError &ape, bool)
 
virtual void addAlignmentPositionErrorFromLocalRotation (const RotationType &rot, bool)
 
virtual void addAlignmentPositionErrorFromRotation (const RotationType &rot, bool)
 
virtual void addComponent (Alignable *)
 No components here => exception! More...
 
virtual void addSurfaceDeformation (const SurfaceDeformation *deformation, bool)
 Add surface deformation parameters to the existing ones (2nd argument without effect) More...
 
 AlignableDetUnit (const GeomDetUnit *geomDetUnit)
 Constructor from GeomDetUnit - must not be NULL pointer! More...
 
virtual StructureType alignableObjectId () const
 Return the alignable type identifier. More...
 
virtual AlignmentErrorsExtendedalignmentErrors () const
 Return vector of alignment errors. More...
 
const AlignmentPositionErroralignmentPositionError () const
 alignment position error - for checking only, otherwise use alignmentErrors() above! More...
 
virtual Alignmentsalignments () const
 Return vector of alignment data. More...
 
virtual void cacheTransformation ()
 cache the current position, rotation and other parameters (e.g. surface deformations) More...
 
virtual void cacheTransformation (const align::RunNumber &)
 cache for the given run the current position, rotation and other parameters (e.g. surface deformations) More...
 
virtual Alignables components () const
 Returns a null vector (no components here) More...
 
virtual void dump () const
 Printout information about GeomDet. More...
 
virtual void move (const GlobalVector &displacement)
 Move with respect to the global reference frame. More...
 
virtual void recursiveComponents (Alignables &result) const
 Do nothing (no components here, so no subcomponents either...) More...
 
virtual void restoreCachedTransformation ()
 restore the previously cached transformation More...
 
virtual void restoreCachedTransformation (const align::RunNumber &)
 restore for the given run the previously cached transformation More...
 
virtual void rotateInGlobalFrame (const RotationType &rotation)
 Rotation with respect to the global reference frame. More...
 
virtual void setAlignmentPositionError (const AlignmentPositionError &ape, bool)
 Set the AlignmentPositionError (no components => second argument ignored) More...
 
virtual void setSurfaceDeformation (const SurfaceDeformation *deformation, bool)
 Set surface deformation parameters (2nd argument without effect) More...
 
virtual int surfaceDeformationIdPairs (std::vector< std::pair< int, SurfaceDeformation * > > &) const
 Return surface deformations. More...
 
void update (const GeomDetUnit *geomDetUnit)
 
virtual ~AlignableDetUnit ()
 Destructor. More...
 
- Public Member Functions inherited from Alignable
 Alignable (align::ID, const AlignableSurface &)
 
 Alignable (align::ID, const RotationType &)
 
AlignmentParametersalignmentParameters () const
 Get the AlignmentParameters. More...
 
virtual CompConstraintType compConstraintType () const
 Return the alignable type of contraints wrt. its components. More...
 
const AlignablesdeepComponents () const
 
const GlobalVectordisplacement () const
 Return change of the global position since the creation of the object. More...
 
bool firstCompsWithParams (Alignables &paramComps) const
 
const DetIdgeomDetId () const
 
const PositionTypeglobalPosition () const
 Return the global position of the object. More...
 
const RotationTypeglobalRotation () const
 Return the global orientation of the object. More...
 
align::ID id () const
 Return the ID of Alignable, i.e. DetId of 'first' component GeomDet(Unit). More...
 
bool lastCompsWithParams (Alignables &paramComps) const
 
Alignablemother () const
 Return pointer to container alignable (if any) More...
 
virtual void rotateAroundGlobalAxis (const GlobalVector &axis, Scalar radians)
 Rotation around arbitratry global axis. More...
 
virtual void rotateAroundGlobalX (Scalar radians)
 Rotation around global x-axis. More...
 
virtual void rotateAroundGlobalY (Scalar radians)
 Rotation around global y-axis. More...
 
virtual void rotateAroundGlobalZ (Scalar radians)
 Rotation around global z-axis. More...
 
virtual void rotateAroundLocalAxis (const LocalVector &axis, Scalar radians)
 Rotation around arbitratry local axis. More...
 
virtual void rotateAroundLocalX (Scalar radians)
 Rotation around local x-axis. More...
 
virtual void rotateAroundLocalY (Scalar radians)
 Rotation around local y-axis. More...
 
virtual void rotateAroundLocalZ (Scalar radians)
 Rotation around local z-axis. More...
 
virtual void rotateInLocalFrame (const RotationType &rotation)
 Rotation intepreted in the local reference frame. More...
 
const RotationTyperotation () const
 Return change of orientation since the creation of the object. More...
 
void setAlignmentParameters (AlignmentParameters *dap)
 Set the AlignmentParameters. More...
 
void setMother (Alignable *mother)
 Assign mother to alignable. More...
 
void setSurvey (const SurveyDet *)
 Set survey info. More...
 
int size () const
 Return number of direct components. More...
 
const AlignableSurfacesurface () const
 Return the Surface (global position and orientation) of the object. More...
 
AlignmentSurfaceDeformationssurfaceDeformations () const
 Return surface deformations, sorted by DetId. More...
 
const SurveyDetsurvey () const
 Return survey info. More...
 
void update (align::ID, const AlignableSurface &)
 
virtual ~Alignable ()
 Destructor. More...
 

Private Attributes

Cache< SurfaceDeformation * > surfaceDeformationsCache_
 
AlignmentPositionErrortheAlignmentPositionError
 
SurfaceDeformationtheCachedSurfaceDeformation
 
SurfaceDeformationtheSurfaceDeformation
 

Additional Inherited Members

- Public Types inherited from Alignable
typedef align::Alignables Alignables
 
enum  CompConstraintType { CompConstraintType::NONE, CompConstraintType::POSITION, CompConstraintType::POSITION_Z }
 
typedef align::GlobalVector GlobalVector
 
typedef align::LocalVector LocalVector
 
typedef align::PositionType PositionType
 
typedef align::RotationType RotationType
 
typedef align::Scalar Scalar
 
typedef align::StructureType StructureType
 
- Protected Types inherited from Alignable
template<class T >
using Cache = std::map< align::RunNumber, T >
 
- Protected Member Functions inherited from Alignable
void addDisplacement (const GlobalVector &displacement)
 
void addRotation (const RotationType &rotation)
 
virtual void updateMother (const GlobalVector &shift)
 
- Protected Attributes inherited from Alignable
CompConstraintType compConstraintType_ {CompConstraintType::NONE}
 
Cache< GlobalVectordisplacementsCache_
 
Cache< RotationTyperotationsCache_
 
Cache< AlignableSurfacesurfacesCache_
 
GlobalVector theCachedDisplacement
 
RotationType theCachedRotation
 
AlignableSurface theCachedSurface
 
Alignables theDeepComponents
 
DetId theDetId
 
GlobalVector theDisplacement
 
align::ID theId
 
RotationType theRotation
 
AlignableSurface theSurface
 

Detailed Description

A concrete class that allows to (mis)align a DetUnit.

Typically all AlignableComposites have (directly or indirectly) this one as the ultimate component.

Definition at line 13 of file AlignableDetUnit.h.

Constructor & Destructor Documentation

AlignableDetUnit::AlignableDetUnit ( const GeomDetUnit geomDetUnit)

Constructor from GeomDetUnit - must not be NULL pointer!

Definition at line 15 of file AlignableDetUnit.cc.

References GeomDet::alignmentPositionError(), setAlignmentPositionError(), setSurfaceDeformation(), GeomDet::surfaceDeformation(), and Alignable::theDeepComponents.

15  : // rely on non-NULL pointer!
16  Alignable(geomDetUnit->geographicalId().rawId(), geomDetUnit->surface()),
20 {
21  if (geomDetUnit->alignmentPositionError()) { // take over APE from geometry
22  // 2nd argument w/o effect:
23  this->setAlignmentPositionError(*(geomDetUnit->alignmentPositionError()), false);
24  }
25 
26  if (geomDetUnit->surfaceDeformation()) { // take over surface modification
27  // 2nd argument w/o effect:
28  this->setSurfaceDeformation(geomDetUnit->surfaceDeformation(), false);
29  }
30 
31  theDeepComponents.push_back(this);
32 
33 }
Alignable()
private default ctr. to enforce usage of the specialised ones
Definition: Alignable.h:264
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
SurfaceDeformation * theCachedSurfaceDeformation
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
virtual void setSurfaceDeformation(const SurfaceDeformation *deformation, bool)
Set surface deformation parameters (2nd argument without effect)
virtual void setAlignmentPositionError(const AlignmentPositionError &ape, bool)
Set the AlignmentPositionError (no components => second argument ignored)
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
virtual const SurfaceDeformation * surfaceDeformation() const
Definition: GeomDet.h:114
AlignmentPositionError * theAlignmentPositionError
SurfaceDeformation * theSurfaceDeformation
AlignmentPositionError const * alignmentPositionError() const
Return pointer to alignment errors.
Definition: GeomDet.h:95
Alignables theDeepComponents
Definition: Alignable.h:254
AlignableDetUnit::~AlignableDetUnit ( )
virtual

Destructor.

Definition at line 36 of file AlignableDetUnit.cc.

References Alignable::surface(), surfaceDeformationsCache_, theAlignmentPositionError, theCachedSurfaceDeformation, and theSurfaceDeformation.

37 {
39  delete theSurfaceDeformation;
41  for (auto surface: surfaceDeformationsCache_) delete surface.second;
42 }
Cache< SurfaceDeformation * > surfaceDeformationsCache_
SurfaceDeformation * theCachedSurfaceDeformation
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:135
AlignmentPositionError * theAlignmentPositionError
SurfaceDeformation * theSurfaceDeformation

Member Function Documentation

void AlignableDetUnit::addAlignmentPositionError ( const AlignmentPositionError ape,
bool  propagateDown 
)
virtual

Add (or set if it does not exist yet) the AlignmentPositionError (no components => second argument without effect)

Implements Alignable.

Definition at line 107 of file AlignableDetUnit.cc.

References setAlignmentPositionError(), and theAlignmentPositionError.

Referenced by addAlignmentPositionErrorFromRotation(), and recursiveComponents().

109 {
110 
112  this->setAlignmentPositionError( ape, propagateDown ); // 2nd argument w/o effect
113  else
115 }
virtual void setAlignmentPositionError(const AlignmentPositionError &ape, bool)
Set the AlignmentPositionError (no components => second argument ignored)
AlignmentPositionError * theAlignmentPositionError
void AlignableDetUnit::addAlignmentPositionErrorFromLocalRotation ( const RotationType rot,
bool  propagateDown 
)
virtual

Add (or set if it does not exist yet) the AlignmentPositionError resulting from a rotation in the local reference frame (no components => second argument without effect)

Implements Alignable.

Definition at line 139 of file AlignableDetUnit.cc.

References addAlignmentPositionErrorFromRotation(), Alignable::globalRotation(), and TkRotation< T >::multiplyInverse().

Referenced by recursiveComponents().

141 {
142 
144  this->addAlignmentPositionErrorFromRotation(globalRot, propagateDown); // 2nd argument w/o effect
145 
146 }
virtual void addAlignmentPositionErrorFromRotation(const RotationType &rot, bool)
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:141
align::RotationType RotationType
Definition: Alignable.h:34
Basic3DVector< T > multiplyInverse(const Basic3DVector< T > &v) const
void AlignableDetUnit::addAlignmentPositionErrorFromRotation ( const RotationType rot,
bool  propagateDown 
)
virtual

Add (or set if it does not exist yet) the AlignmentPositionError resulting from a rotation in the global reference frame (no components => second argument without effect)

Implements Alignable.

Definition at line 119 of file AlignableDetUnit.cc.

References addAlignmentPositionError(), PV3DBase< T, PVType, FrameType >::basicVector(), TkRotation< T >::multiplyInverse(), Alignable::surface(), AlignableSurface::toGlobal(), and ApeEstimator_cff::width.

Referenced by addAlignmentPositionErrorFromLocalRotation(), and recursiveComponents().

121 {
122 
123  // average error calculated by movement of a local point at
124  // (xWidth/2,yLength/2,0) caused by the rotation rot
125  GlobalVector localPositionVector = surface().toGlobal( LocalVector(.5 * surface().width(),
126  .5 * surface().length(),
127  0.) );
128 
129  LocalVector::BasicVectorType lpvgf = localPositionVector.basicVector();
130  GlobalVector gv( rot.multiplyInverse(lpvgf) - lpvgf );
131 
132  AlignmentPositionError ape( gv.x(),gv.y(),gv.z() );
133  this->addAlignmentPositionError( ape, propagateDown ); // 2nd argument w/o effect
134 
135 }
virtual void addAlignmentPositionError(const AlignmentPositionError &ape, bool)
align::LocalVector LocalVector
Definition: Alignable.h:36
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:135
align::GlobalPoints toGlobal(const align::LocalPoints &) const
Return in global coord given a set of local points.
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
void AlignableDetUnit::addComponent ( Alignable )
virtual

No components here => exception!

Implements Alignable.

Definition at line 67 of file AlignableDetUnit.cc.

References Exception.

68 {
69  throw cms::Exception("LogicError")
70  << "AlignableDetUnit cannot have components, but try to add one!";
71 }
void AlignableDetUnit::addSurfaceDeformation ( const SurfaceDeformation deformation,
bool  propagateDown 
)
virtual

Add surface deformation parameters to the existing ones (2nd argument without effect)

Implements Alignable.

Definition at line 161 of file AlignableDetUnit.cc.

References SurfaceDeformation::add(), setSurfaceDeformation(), theSurfaceDeformation, and SurfaceDeformation::type().

Referenced by recursiveComponents().

163 {
164  if (!deformation) {
165  // nothing to do
166  } else if (!theSurfaceDeformation) {
167  this->setSurfaceDeformation(deformation, propagateDown); // fine since no components
168  } else if (!theSurfaceDeformation->add(*deformation)) {
169  edm::LogError("Alignment") << "@SUB=AlignableDetUnit::addSurfaceDeformation"
170  << "Cannot add deformation type " << deformation->type()
171  << " to type " << theSurfaceDeformation->type()
172  << ", so erase deformation information.";
173  delete theSurfaceDeformation;
175  }
176 }
virtual int type() const =0
specific type, i.e. SurfaceDeformationFactory::Type
virtual void setSurfaceDeformation(const SurfaceDeformation *deformation, bool)
Set surface deformation parameters (2nd argument without effect)
virtual bool add(const SurfaceDeformation &other)=0
SurfaceDeformation * theSurfaceDeformation
virtual StructureType AlignableDetUnit::alignableObjectId ( ) const
inlinevirtual
AlignmentErrorsExtended * AlignableDetUnit::alignmentErrors ( void  ) const
virtual

Return vector of alignment errors.

Implements Alignable.

Definition at line 224 of file AlignableDetUnit.cc.

References asHepMatrix(), Alignable::geomDetId(), AlignmentPositionError::globalError(), AlignmentErrorsExtended::m_alignError, GlobalErrorBaseExtended< T, ErrorWeightType >::matrix(), DetId::rawId(), and theAlignmentPositionError.

Referenced by alignableObjectId().

225 {
226 
227  AlignmentErrorsExtended* m_alignmentErrors = new AlignmentErrorsExtended();
228 
229  uint32_t detId = this->geomDetId().rawId();
230 
231  CLHEP::HepSymMatrix clhepSymMatrix(6,0);
232  if ( theAlignmentPositionError ) // Might not be set
234 
235  AlignTransformErrorExtended transformError( clhepSymMatrix, detId );
236 
237  m_alignmentErrors->m_alignError.push_back( transformError );
238 
239  return m_alignmentErrors;
240 
241 }
CLHEP::HepMatrix asHepMatrix(const ROOT::Math::SMatrix< double, N1, N2, typename ROOT::Math::MatRepStd< double, N1, N2 > > &rm)
Definition: Migration.h:54
const GlobalErrorExtended & globalError() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
const AlgebraicSymMatrix66 & matrix() const
std::vector< AlignTransformErrorExtended > m_alignError
AlignmentPositionError * theAlignmentPositionError
const DetId & geomDetId() const
Definition: Alignable.h:186
const AlignmentPositionError* AlignableDetUnit::alignmentPositionError ( ) const
inline

alignment position error - for checking only, otherwise use alignmentErrors() above!

Definition at line 93 of file AlignableDetUnit.h.

References theAlignmentPositionError.

Referenced by AlignableDetOrUnitPtr::alignmentPositionError().

AlignmentPositionError * theAlignmentPositionError
Alignments * AlignableDetUnit::alignments ( void  ) const
virtual

Return vector of alignment data.

Implements Alignable.

Definition at line 201 of file AlignableDetUnit.cc.

References Alignable::geomDetId(), Alignable::globalPosition(), Alignable::globalRotation(), Alignments::m_align, DetId::rawId(), makeMuonMisalignmentScenario::rot, create_public_lumi_plots::transform, x, TkRotation< T >::xx(), TkRotation< T >::xy(), TkRotation< T >::xz(), y, TkRotation< T >::yx(), TkRotation< T >::yy(), TkRotation< T >::yz(), z, TkRotation< T >::zx(), TkRotation< T >::zy(), and TkRotation< T >::zz().

Referenced by alignableObjectId().

202 {
203  Alignments* m_alignments = new Alignments();
204  RotationType rot( this->globalRotation() );
205 
206  // Get alignments (position, rotation, detId)
207  CLHEP::Hep3Vector clhepVector( globalPosition().x(), globalPosition().y(), globalPosition().z() );
208  CLHEP::HepRotation clhepRotation( CLHEP::HepRep3x3( rot.xx(), rot.xy(), rot.xz(),
209  rot.yx(), rot.yy(), rot.yz(),
210  rot.zx(), rot.zy(), rot.zz() ) );
211  uint32_t detId = this->geomDetId().rawId();
212 
213  AlignTransform transform( clhepVector, clhepRotation, detId );
214 
215  // Add to alignments container
216  m_alignments->m_align.push_back( transform );
217 
218  return m_alignments;
219 
220 }
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:141
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
align::RotationType RotationType
Definition: Alignable.h:34
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:138
const DetId & geomDetId() const
Definition: Alignable.h:186
void AlignableDetUnit::cacheTransformation ( )
virtual

cache the current position, rotation and other parameters (e.g. surface deformations)

Reimplemented from Alignable.

Definition at line 256 of file AlignableDetUnit.cc.

References SurfaceDeformation::clone(), Alignable::theCachedDisplacement, Alignable::theCachedRotation, Alignable::theCachedSurface, theCachedSurfaceDeformation, Alignable::theDisplacement, Alignable::theRotation, Alignable::theSurface, and theSurfaceDeformation.

Referenced by alignableObjectId().

257 {
261 
265  }
266 
269 }
RotationType theCachedRotation
Definition: Alignable.h:250
RotationType theRotation
Definition: Alignable.h:246
GlobalVector theDisplacement
Definition: Alignable.h:245
SurfaceDeformation * theCachedSurfaceDeformation
AlignableSurface theCachedSurface
Definition: Alignable.h:248
GlobalVector theCachedDisplacement
Definition: Alignable.h:249
SurfaceDeformation * theSurfaceDeformation
AlignableSurface theSurface
Definition: Alignable.h:243
virtual SurfaceDeformation * clone() const =0
void AlignableDetUnit::cacheTransformation ( const align::RunNumber run)
virtual

cache for the given run the current position, rotation and other parameters (e.g. surface deformations)

Reimplemented from Alignable.

Definition at line 272 of file AlignableDetUnit.cc.

References SurfaceDeformation::clone(), Alignable::displacementsCache_, Alignable::rotationsCache_, findQualityFiles::run, surfaceDeformationsCache_, Alignable::surfacesCache_, Alignable::theDisplacement, Alignable::theRotation, Alignable::theSurface, and theSurfaceDeformation.

273 {
277 
278  auto existingCache = surfaceDeformationsCache_.find(run);
279  if (existingCache != surfaceDeformationsCache_.end()) {
280  delete existingCache->second;
281  existingCache->second = 0;
282  }
283 
284  if (theSurfaceDeformation) {
286  }
287 }
RotationType theRotation
Definition: Alignable.h:246
Cache< SurfaceDeformation * > surfaceDeformationsCache_
Cache< GlobalVector > displacementsCache_
Definition: Alignable.h:258
Cache< AlignableSurface > surfacesCache_
Definition: Alignable.h:257
Cache< RotationType > rotationsCache_
Definition: Alignable.h:259
GlobalVector theDisplacement
Definition: Alignable.h:245
SurfaceDeformation * theSurfaceDeformation
AlignableSurface theSurface
Definition: Alignable.h:243
virtual SurfaceDeformation * clone() const =0
virtual Alignables AlignableDetUnit::components ( ) const
inlinevirtual

Returns a null vector (no components here)

Implements Alignable.

Definition at line 32 of file AlignableDetUnit.h.

32 { return Alignables(); }
align::Alignables Alignables
Definition: Alignable.h:37
void AlignableDetUnit::dump ( void  ) const
virtual

Printout information about GeomDet.

Implements Alignable.

Definition at line 179 of file AlignableDetUnit.cc.

References Alignable::displacement(), Alignable::globalPosition(), Alignable::globalRotation(), SurfaceDeformation::parameters(), metProducer_cfi::parameters, Alignable::rotation(), and theSurfaceDeformation.

Referenced by alignableObjectId().

180 {
181  std::ostringstream parameters;
182  if (theSurfaceDeformation) {
183  parameters << " surface deformation parameters:";
184  for (const auto& param: theSurfaceDeformation->parameters()) {
185  parameters << " " << param;
186  }
187  } else {
188  parameters << " no surface deformation parameters";
189  }
190 
191  edm::LogInfo("AlignableDump")
192  << " AlignableDetUnit has position = " << this->globalPosition()
193  << ", orientation:" << std::endl << this->globalRotation() << std::endl
194  << " total displacement and rotation: " << this->displacement() << std::endl
195  << this->rotation() << "\n"
196  << parameters.str();
197 }
virtual std::vector< double > parameters() const =0
parameters - interpretation left to the concrete implementation
const GlobalVector & displacement() const
Return change of the global position since the creation of the object.
Definition: Alignable.h:144
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:141
const RotationType & rotation() const
Return change of orientation since the creation of the object.
Definition: Alignable.h:147
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:138
SurfaceDeformation * theSurfaceDeformation
void AlignableDetUnit::move ( const GlobalVector displacement)
virtual

Move with respect to the global reference frame.

Implements Alignable.

Definition at line 74 of file AlignableDetUnit.cc.

References Alignable::addDisplacement(), GloballyPositioned< T >::move(), and Alignable::theSurface.

Referenced by Vispa.Gui.WidgetContainer.WidgetContainer::autosize(), Vispa.Gui.VispaWidget.VispaWidget::dragWidget(), recursiveComponents(), Vispa.Gui.VispaWidget.VispaWidget::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

75 {
76 
77  theSurface.move( displacement );
78  this->addDisplacement( displacement );
79 
80 }
void move(const GlobalVector &displacement)
void addDisplacement(const GlobalVector &displacement)
Definition: Alignable.cc:248
AlignableSurface theSurface
Definition: Alignable.h:243
virtual void AlignableDetUnit::recursiveComponents ( Alignables result) const
inlinevirtual
void AlignableDetUnit::restoreCachedTransformation ( )
virtual

restore the previously cached transformation

Reimplemented from Alignable.

Definition at line 290 of file AlignableDetUnit.cc.

References setSurfaceDeformation(), Alignable::theCachedDisplacement, Alignable::theCachedRotation, Alignable::theCachedSurface, theCachedSurfaceDeformation, Alignable::theDisplacement, Alignable::theRotation, Alignable::theSurface, and theSurfaceDeformation.

Referenced by alignableObjectId().

291 {
295 
296  if (theSurfaceDeformation) {
297  delete theSurfaceDeformation;
299  }
300 
303  }
304 }
RotationType theCachedRotation
Definition: Alignable.h:250
RotationType theRotation
Definition: Alignable.h:246
GlobalVector theDisplacement
Definition: Alignable.h:245
SurfaceDeformation * theCachedSurfaceDeformation
virtual void setSurfaceDeformation(const SurfaceDeformation *deformation, bool)
Set surface deformation parameters (2nd argument without effect)
AlignableSurface theCachedSurface
Definition: Alignable.h:248
GlobalVector theCachedDisplacement
Definition: Alignable.h:249
SurfaceDeformation * theSurfaceDeformation
AlignableSurface theSurface
Definition: Alignable.h:243
void AlignableDetUnit::restoreCachedTransformation ( const align::RunNumber run)
virtual

restore for the given run the previously cached transformation

Reimplemented from Alignable.

Definition at line 307 of file AlignableDetUnit.cc.

References Alignable::displacementsCache_, Exception, Alignable::rotationsCache_, findQualityFiles::run, setSurfaceDeformation(), surfaceDeformationsCache_, Alignable::surfacesCache_, Alignable::theDisplacement, Alignable::theRotation, Alignable::theSurface, and theSurfaceDeformation.

308 {
309  if (surfacesCache_.find(run) == surfacesCache_.end()) {
310  throw cms::Exception("Alignment")
311  << "@SUB=Alignable::restoreCachedTransformation\n"
312  << "Trying to restore cached transformation for a run (" << run
313  << ") that has not been cached.";
314  } else {
318 
319  if (theSurfaceDeformation) {
320  delete theSurfaceDeformation;
322  }
323 
326  }
327  }
328 }
RotationType theRotation
Definition: Alignable.h:246
Cache< SurfaceDeformation * > surfaceDeformationsCache_
Cache< GlobalVector > displacementsCache_
Definition: Alignable.h:258
Cache< AlignableSurface > surfacesCache_
Definition: Alignable.h:257
Cache< RotationType > rotationsCache_
Definition: Alignable.h:259
GlobalVector theDisplacement
Definition: Alignable.h:245
virtual void setSurfaceDeformation(const SurfaceDeformation *deformation, bool)
Set surface deformation parameters (2nd argument without effect)
SurfaceDeformation * theSurfaceDeformation
AlignableSurface theSurface
Definition: Alignable.h:243
void AlignableDetUnit::rotateInGlobalFrame ( const RotationType rotation)
virtual

Rotation with respect to the global reference frame.

Implements Alignable.

Definition at line 84 of file AlignableDetUnit.cc.

References Alignable::addRotation(), GloballyPositioned< T >::rotate(), and Alignable::theSurface.

Referenced by recursiveComponents().

85 {
86 
88  this->addRotation( rotation );
89 
90 }
const RotationType & rotation() const
Return change of orientation since the creation of the object.
Definition: Alignable.h:147
void addRotation(const RotationType &rotation)
Definition: Alignable.cc:256
void rotate(const RotationType &rotation)
AlignableSurface theSurface
Definition: Alignable.h:243
void AlignableDetUnit::setAlignmentPositionError ( const AlignmentPositionError ape,
bool   
)
virtual

Set the AlignmentPositionError (no components => second argument ignored)

Implements Alignable.

Definition at line 94 of file AlignableDetUnit.cc.

References theAlignmentPositionError.

Referenced by addAlignmentPositionError(), AlignableDetUnit(), recursiveComponents(), and update().

96 {
97 
100  else
102 
103 }
AlignmentPositionError * theAlignmentPositionError
void AlignableDetUnit::setSurfaceDeformation ( const SurfaceDeformation deformation,
bool   
)
virtual

Set surface deformation parameters (2nd argument without effect)

Implements Alignable.

Definition at line 149 of file AlignableDetUnit.cc.

References SurfaceDeformation::clone(), and theSurfaceDeformation.

Referenced by addSurfaceDeformation(), AlignableDetUnit(), recursiveComponents(), restoreCachedTransformation(), and update().

151 {
152  delete theSurfaceDeformation; // OK for zero pointers
153  if (deformation) {
154  theSurfaceDeformation = deformation->clone();
155  } else {
157  }
158 }
SurfaceDeformation * theSurfaceDeformation
virtual SurfaceDeformation * clone() const =0
int AlignableDetUnit::surfaceDeformationIdPairs ( std::vector< std::pair< int, SurfaceDeformation * > > &  result) const
virtual

Return surface deformations.

Implements Alignable.

Definition at line 245 of file AlignableDetUnit.cc.

References Alignable::geomDetId(), mps_fire::result, and theSurfaceDeformation.

Referenced by alignableObjectId().

246 {
247  if ( theSurfaceDeformation ) {
248  result.push_back( std::pair<int,SurfaceDeformation*>(this->geomDetId().rawId(),theSurfaceDeformation) );
249  return 1;
250  }
251 
252  return 0;
253 }
SurfaceDeformation * theSurfaceDeformation
const DetId & geomDetId() const
Definition: Alignable.h:186
void AlignableDetUnit::update ( const GeomDetUnit geomDetUnit)

Updater from GeomDetUnit The given GeomDetUnit id has to match the current id.

Definition at line 45 of file AlignableDetUnit.cc.

References GeomDet::alignmentPositionError(), Exception, GeomDet::geographicalId(), DetId::rawId(), setAlignmentPositionError(), setSurfaceDeformation(), GeomDet::surface(), GeomDet::surfaceDeformation(), and Alignable::update().

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), AlignableTrackerBuilder::buildPixelDetectorAlignable(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), dqm-mbProfile.Profile::finish(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), AlignableDet::update(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

46 {
47  if (!geomDetUnit) {
48  throw cms::Exception("Alignment")
49  << "@SUB=AlignableDetUnit::update\n"
50  << "Trying to update with GeomDetUnit* pointing to 'nullptr'.";
51  }
52 
53  Alignable::update(geomDetUnit->geographicalId().rawId(), geomDetUnit->surface());
54 
55  if (geomDetUnit->alignmentPositionError()) { // take over APE from geometry
56  // 2nd argument w/o effect:
57  this->setAlignmentPositionError(*(geomDetUnit->alignmentPositionError()), false);
58  }
59 
60  if (geomDetUnit->surfaceDeformation()) { // take over surface modification
61  // 2nd argument w/o effect:
62  this->setSurfaceDeformation(geomDetUnit->surfaceDeformation(), false);
63  }
64 }
void update(align::ID, const AlignableSurface &)
Definition: Alignable.cc:50
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
virtual void setSurfaceDeformation(const SurfaceDeformation *deformation, bool)
Set surface deformation parameters (2nd argument without effect)
virtual void setAlignmentPositionError(const AlignmentPositionError &ape, bool)
Set the AlignmentPositionError (no components => second argument ignored)
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
virtual const SurfaceDeformation * surfaceDeformation() const
Definition: GeomDet.h:114
AlignmentPositionError const * alignmentPositionError() const
Return pointer to alignment errors.
Definition: GeomDet.h:95

Member Data Documentation

Cache<SurfaceDeformation*> AlignableDetUnit::surfaceDeformationsCache_
private
AlignmentPositionError* AlignableDetUnit::theAlignmentPositionError
private
SurfaceDeformation* AlignableDetUnit::theCachedSurfaceDeformation
private
SurfaceDeformation* AlignableDetUnit::theSurfaceDeformation
private