CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
Alignable Class Referenceabstract

#include <Alignable.h>

Inheritance diagram for Alignable:
AlignableBeamSpot AlignableComposite AlignableDetUnit AlignableCSCEndcap AlignableCSCRing AlignableCSCStation AlignableDet AlignableDTBarrel AlignableDTStation AlignableDTWheel AlignableMuon AlignableTracker

Public Types

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
 

Public Member Functions

virtual void addAlignmentPositionError (const AlignmentPositionError &ape, bool propagateDown)=0
 
virtual void addAlignmentPositionErrorFromLocalRotation (const RotationType &rotation, bool propagateDown)=0
 
virtual void addAlignmentPositionErrorFromRotation (const RotationType &rotation, bool propagateDown)=0
 
virtual void addComponent (Alignable *)=0
 
virtual void addSurfaceDeformation (const SurfaceDeformation *deformation, bool propagateDown)=0
 
 Alignable (align::ID, const AlignableSurface &)
 
 Alignable (align::ID, const RotationType &)
 
virtual StructureType alignableObjectId () const =0
 Return the alignable type identifier. More...
 
virtual AlignmentErrorsExtendedalignmentErrors () const =0
 Return vector of alignment errors. More...
 
AlignmentParametersalignmentParameters () const
 Get the AlignmentParameters. More...
 
virtual Alignmentsalignments () const =0
 Return vector of alignment data. More...
 
virtual void cacheTransformation ()
 cache the current position, rotation and other parameters (e.g. surface deformations), also for possible components More...
 
virtual void cacheTransformation (const align::RunNumber &)
 
virtual CompConstraintType compConstraintType () const
 Return the alignable type of contraints wrt. its components. More...
 
virtual const Alignablescomponents () const =0
 Return vector of all direct components. More...
 
const AlignablesdeepComponents () const
 
const GlobalVectordisplacement () const
 Return change of the global position since the creation of the object. More...
 
virtual void dump () const =0
 Recursive printout of alignable information. 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 move (const GlobalVector &displacement)=0
 Movement with respect to the global reference frame. More...
 
virtual void recenterSurface ()
 Recenter surface object without moving possible components. More...
 
virtual void recursiveComponents (Alignables &result) const =0
 
virtual void restoreCachedTransformation ()
 restore the previously cached transformation, also for possible components More...
 
virtual void restoreCachedTransformation (const align::RunNumber &)
 
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 rotateInGlobalFrame (const RotationType &rotation)=0
 
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...
 
virtual void setAlignmentPositionError (const AlignmentPositionError &ape, bool propagateDown)=0
 Set the alignment position error - if (!propagateDown) do not affect daughters. More...
 
void setMother (Alignable *mother)
 Assign mother to alignable. More...
 
virtual void setSurfaceDeformation (const SurfaceDeformation *deformation, bool propagateDown)=0
 Set the surface deformation parameters - if (!propagateDown) do not affect daughters. 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...
 
virtual int surfaceDeformationIdPairs (std::vector< std::pair< int, SurfaceDeformation * > > &) const =0
 
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...
 

Protected Types

template<class T >
using Cache = std::map< align::RunNumber, T >
 

Protected Member Functions

void addDisplacement (const GlobalVector &displacement)
 
void addRotation (const RotationType &rotation)
 
virtual void updateMother (const GlobalVector &shift)
 

Protected Attributes

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
 

Private Member Functions

 Alignable ()
 private default ctr. to enforce usage of the specialised ones More...
 

Private Attributes

AlignmentParameterstheAlignmentParameters
 
AlignabletheMother
 
const SurveyDettheSurvey
 

Detailed Description

Abstract base class for alignable entities. Any Alignable object can be moved and rotated. Also an alignment uncertainty can be set.

Definition at line 27 of file Alignable.h.

Member Typedef Documentation

◆ Alignables

Definition at line 34 of file Alignable.h.

◆ Cache

template<class T >
using Alignable::Cache = std::map<align::RunNumber, T>
protected

Definition at line 226 of file Alignable.h.

◆ GlobalVector

Definition at line 32 of file Alignable.h.

◆ LocalVector

Definition at line 33 of file Alignable.h.

◆ PositionType

Definition at line 30 of file Alignable.h.

◆ RotationType

Definition at line 31 of file Alignable.h.

◆ Scalar

Definition at line 29 of file Alignable.h.

◆ StructureType

Definition at line 35 of file Alignable.h.

Member Enumeration Documentation

◆ CompConstraintType

Enumerator
NONE 
POSITION 
POSITION_Z 

Definition at line 37 of file Alignable.h.

37 { NONE, POSITION, POSITION_Z };

Constructor & Destructor Documentation

◆ Alignable() [1/3]

Alignable::Alignable ( align::ID  id,
const AlignableSurface surf 
)

Constructor from id and surface, setting also geomDetId (AlignableNavigator relies on the fact that only AlignableDet/DetUnit have geomDetId!)

Definition at line 19 of file Alignable.cc.

20  : theDetId(id), // FIXME: inconsistent with other ctr., but needed for AlignableNavigator
21  theId(id), // (finally get rid of one of the IDs!)
22  theSurface(surf),
23  theCachedSurface(surf),
24  theAlignmentParameters(nullptr),
25  theMother(nullptr),
26  theSurvey(nullptr) {}

◆ Alignable() [2/3]

Alignable::Alignable ( align::ID  id,
const RotationType rot 
)

Constructor for a composite with given rotation. Position is found (later) from average of daughters' positions.

Definition at line 29 of file Alignable.cc.

30  : theDetId(), // FIXME: inconsistent with other ctr., cf. above
31  theId(id),
34  theAlignmentParameters(nullptr),
35  theMother(nullptr),
36  theSurvey(nullptr) {}

◆ ~Alignable()

Alignable::~Alignable ( )
virtual

Destructor.

Definition at line 39 of file Alignable.cc.

39  {
41  delete theSurvey;
42 }

References theAlignmentParameters, and theSurvey.

◆ Alignable() [3/3]

Alignable::Alignable ( )
inlineprivate

private default ctr. to enforce usage of the specialised ones

Definition at line 257 of file Alignable.h.

257 {};

Member Function Documentation

◆ addAlignmentPositionError()

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

◆ addAlignmentPositionErrorFromLocalRotation()

virtual void Alignable::addAlignmentPositionErrorFromLocalRotation ( const RotationType rotation,
bool  propagateDown 
)
pure virtual

add (or set if not already present) the AlignmentPositionError which would result from a rotation (given in the LOCAL frame of the Alignable) of the alignable object, but if (!propagateDown) do not affect daughters

Implemented in AlignableComposite, AlignableBeamSpot, and AlignableDetUnit.

Referenced by AlignableModifier::addAlignmentPositionErrorFromLocalRotation().

◆ addAlignmentPositionErrorFromRotation()

virtual void Alignable::addAlignmentPositionErrorFromRotation ( const RotationType rotation,
bool  propagateDown 
)
pure virtual

add (or set if not already present) the AlignmentPositionError which would result from a rotation (given in the GLOBAL frame of CMS) of the alignable object, but if (!propagateDown) do not affect daughters

Implemented in AlignableComposite, AlignableDetUnit, AlignableBeamSpot, and AlignableDet.

Referenced by AlignableModifier::addAlignmentPositionErrorFromRotation(), and AlignmentParameterStore::setAlignmentPositionError().

◆ addComponent()

virtual void Alignable::addComponent ( Alignable )
pure virtual

Add a component to alignable (GF: Should be interface in Composite, but needed in AlignableBuilder::build)

Implemented in AlignableBeamSpot, AlignableComposite, and AlignableDetUnit.

Referenced by SurveyInputBase::addComponent().

◆ addDisplacement()

void Alignable::addDisplacement ( const GlobalVector displacement)
protected

◆ addRotation()

void Alignable::addRotation ( const RotationType rotation)
protected

◆ addSurfaceDeformation()

virtual void Alignable::addSurfaceDeformation ( const SurfaceDeformation deformation,
bool  propagateDown 
)
pure virtual

◆ alignableObjectId()

virtual StructureType Alignable::alignableObjectId ( ) const
pure virtual

Return the alignable type identifier.

Implemented in AlignableComposite, AlignableDetUnit, and AlignableBeamSpot.

Referenced by AlignmentParameterBuilder::add(), SurveyInputTrackerFromDB::addSurveyInfo(), SurveyMisalignmentInput::addSurveyInfo(), TrackerGeometryCompare::addSurveyInfo(), AlignmentProducerBase::addSurveyInfo(), MuonAlignmentInputSurveyDB::addSurveyInfo_(), MomentumDependentPedeLabeler::alignableLabel(), PedeLabeler::alignableLabel(), RunRangeDependentPedeLabeler::alignableLabel(), MomentumDependentPedeLabeler::alignableLabelFromParamAndInstance(), RunRangeDependentPedeLabeler::alignableLabelFromParamAndInstance(), AlignmentParameterStore::applyAlignableAbsolutePositions(), AlignmentParameterStore::applyAlignableRelativePositions(), TrackerSystematicMisalignments::applySystematicMisalignment(), AlignmentMonitorGeneric::book(), TrackerOfflineValidation::bookDirHists(), TrackerOfflineValidation::bookHists(), TrackerOfflineValidation::bookSummaryHists(), PedeReader::checkAliParams(), PedeSteererWeakModeConstraints::checkMother(), PedeSteererWeakModeConstraints::checkSelectionShiftParameter(), TrackerGeometryCompare::compareGeometries(), PedeSteererWeakModeConstraints::constructConstraints(), align::createPoints(), AlignmentParameterSelector::detUnitDeselected(), align::diffAlignables(), TrackerGeometryCompare::diffCommonTrackerSystem(), MuonGeometryArrange::fillTree(), TrackerGeometryCompare::fillTree(), HIPAlignmentAlgorithm::findAlignableSpecs(), MuonAlignmentInputXML::getCSCnode(), MuonAlignmentInputXML::getDTnode(), PedeSteererWeakModeConstraints::getFile(), MillePedeFileReader::getHLS(), SurveyDBUploader::getSurveyInfo(), PedeSteerer::hierarchyConstraint(), HIPAlignableSpecificParameters::objId(), MomentumDependentPedeLabeler::parameterLabel(), RunRangeDependentPedeLabeler::parameterLabel(), TrackerOfflineValidation::prepareSummaryHists(), AlignableDataIORoot::readAbsRaw(), AlignmentParametersIORoot::readOne(), HIPUserVariablesIORoot::readOne(), MillePedeVariablesIORoot::readOne(), AlignableDataIORoot::readRelRaw(), AlignableNavigator::recursiveGetId(), CreateSurveyRcds::setGeometry(), CreateSurveyRcds::setSurveyErrors(), SurveyResidual::SurveyResidual(), AlignmentCorrelationsIORoot::write(), AlignableDataIO::writeAbsPos(), AlignmentParametersIORoot::writeOne(), HIPUserVariablesIORoot::writeOne(), MillePedeVariablesIORoot::writeOne(), AlignableDataIO::writeOrgPos(), and AlignableDataIO::writeRelPos().

◆ alignmentErrors()

virtual AlignmentErrorsExtended* Alignable::alignmentErrors ( ) const
pure virtual

◆ alignmentParameters()

AlignmentParameters* Alignable::alignmentParameters ( ) const
inline

Get the AlignmentParameters.

Definition at line 58 of file Alignable.h.

58 { return theAlignmentParameters; }

References theAlignmentParameters.

Referenced by AlignmentParameterStore::acquireRelativeParameters(), MillePedeAlignmentAlgorithm::addHitCount(), AlignmentParameterStore::alignableFromAlignableDet(), CSCAlignmentCorrections::applyAlignment(), AlignmentParameterStore::applyParameters(), HIPAlignmentAlgorithm::calcParameters(), PedeReader::checkAliParams(), PedeSteererWeakModeConstraints::checkSelectionShiftParameter(), PedeSteererWeakModeConstraints::constructConstraints(), PedeSteerer::defineCoordinates(), CompositeAlignmentParameters::derivativesLegacy(), AlignmentCorrelationsStore::fillCorrelationsTable(), AlignmentExtendedCorrelationsStore::fillCorrelationsTable(), PedeSteerer::fixParameter(), PedeSteererWeakModeConstraints::getDoubleSensorPosition(), MillePedeAlignmentAlgorithm::globalDerivativesHierarchy(), AlignmentParameterStore::hierarchyConstraints(), ParametersToParametersDerivatives::init2BowedRigid(), ParametersToParametersDerivatives::ParametersToParametersDerivatives(), HIPAlignmentAlgorithm::processHit1D(), HIPAlignmentAlgorithm::processHit2D(), CSCChamberFitter::radiusCorrection(), AlignmentParametersIORoot::readOne(), AlignmentParameterStore::resetParameters(), MuonMillepedeAlgorithm::run(), AlignmentParameterStore::selectParameters(), SurveyAlignment::shiftSensors(), HIPAlignmentAlgorithm::terminate(), AlignmentCorrelationsIORoot::write(), AlignableDataIO::writeAbsPos(), AlignmentParametersIORoot::writeOne(), HIPUserVariablesIORoot::writeOne(), MillePedeVariablesIORoot::writeOne(), AlignmentParametersIO::writeOneOrigRigidBody(), AlignableDataIO::writeOrgPos(), and AlignableDataIO::writeRelPos().

◆ alignments()

virtual Alignments* Alignable::alignments ( ) const
pure virtual

◆ cacheTransformation() [1/2]

void Alignable::cacheTransformation ( )
virtual

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

Reimplemented in AlignableDetUnit.

Definition at line 215 of file Alignable.cc.

215  {
216  // first treat itself
220 
221  // now treat components (a clean design would move that to AlignableComposite...)
222  for (const auto& it : this->components())
223  it->cacheTransformation();
224 }

References components(), theCachedDisplacement, theCachedRotation, theCachedSurface, theDisplacement, theRotation, and theSurface.

◆ cacheTransformation() [2/2]

void Alignable::cacheTransformation ( const align::RunNumber run)
virtual

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

Reimplemented in AlignableDetUnit.

Definition at line 226 of file Alignable.cc.

226  {
227  // first treat itself
231 
232  // now treat components (a clean design would move that to AlignableComposite...)
233  for (const auto& it : this->components())
234  it->cacheTransformation(run);
235 }

References components(), displacementsCache_, rotationsCache_, writedatasetfile::run, surfacesCache_, theDisplacement, theRotation, and theSurface.

◆ compConstraintType()

virtual CompConstraintType Alignable::compConstraintType ( ) const
inlinevirtual

Return the alignable type of contraints wrt. its components.

Definition at line 183 of file Alignable.h.

183 { return compConstraintType_; }

References compConstraintType_.

Referenced by updateMother().

◆ components()

virtual const Alignables& Alignable::components ( ) const
pure virtual

◆ deepComponents()

const Alignables& Alignable::deepComponents ( ) const
inline

Return the list of lowest daughters (non-composites) of Alignable. Contain itself if Alignable is a unit.

Definition at line 72 of file Alignable.h.

72 { return theDeepComponents; }

References theDeepComponents.

Referenced by AlignableComposite::addComponent(), TrackerGeometryCompare::createROOTGeometry(), SurveyResidual::findSisters(), HIPAlignableSpecificParameters::matchAlignable(), and updateMother().

◆ displacement()

const GlobalVector& Alignable::displacement ( ) const
inline

◆ dump()

virtual void Alignable::dump ( ) const
pure virtual

◆ firstCompsWithParams()

bool Alignable::firstCompsWithParams ( Alignables paramComps) const

Steps down hierarchy until components with AlignmentParameters are found and adds them to argument. True either if no such components are found or if all branches of components end with such components (i.e. 'consistent').

Definition at line 62 of file Alignable.cc.

62  {
63  bool isConsistent = true;
64  bool hasAliComp = false; // whether there are any (grand-) daughters with parameters
65  bool first = true;
66  const auto& comps = this->components();
67  for (const auto& iComp : comps) {
68  if (iComp->alignmentParameters()) { // component has parameters itself
69  paramComps.push_back(iComp);
70  if (!first && !hasAliComp)
71  isConsistent = false;
72  hasAliComp = true;
73  } else {
74  const unsigned int nCompBefore = paramComps.size();
75  if (!(iComp->firstCompsWithParams(paramComps))) {
76  isConsistent = false; // problem down in hierarchy
77  }
78  if (paramComps.size() != nCompBefore) {
79  if (!first && !hasAliComp)
80  isConsistent = false;
81  hasAliComp = true;
82  } else if (hasAliComp) { // no components with params, but previous component did have comps.
83  isConsistent = false;
84  }
85  }
86  first = false;
87  }
88 
89  return isConsistent;
90 }

References components(), and dqmdumpme::first.

Referenced by AlignmentParameters::hierarchyLevel().

◆ geomDetId()

const DetId& Alignable::geomDetId ( ) const
inline

◆ globalPosition()

const PositionType& Alignable::globalPosition ( ) const
inline

Return the global position of the object.

Definition at line 135 of file Alignable.h.

135 { return surface().position(); }

References GloballyPositioned< T >::position(), and surface().

Referenced by AlignableComposite::addAlignmentPositionErrorFromRotation(), AlignableComposite::addComponent(), AlignableDet::alignments(), AlignableBeamSpot::alignments(), AlignableDetUnit::alignments(), AlignmentParameterStore::applyAlignableAbsolutePositions(), TrackerSystematicMisalignments::applySystematicMisalignment(), SurveyResidual::calculate(), PedeSteererWeakModeConstraints::checkSelectionShiftParameter(), AlignableSiStripDet::consistifyAlignments(), PedeSteererWeakModeConstraints::constructConstraints(), align::diffAlignables(), TrackerGeometryCompare::diffCommonTrackerSystem(), MuonAlignmentInputXML::do_setposition(), AlignableBeamSpot::dump(), AlignableDetUnit::dump(), AlignableComposite::dump(), MillePedeMonitor::fillFrameToFrame(), MuonGeometryArrange::fillTree(), TrackerGeometryCompare::fillTree(), MuonResiduals6DOFrphiFitter::fit(), PedeSteerer::fixParameter(), FrameToFrameDerivative::frameToFrameDerivative(), PedeSteerer::hierarchyConstraint(), ParametersToParametersDerivatives::init2BowedRigid(), AlignmentParameterSelector::outsideGeometricalRanges(), recenterSurface(), MuonAlignment::recursiveCopySurveyToAlignment(), AlignableComposite::rotateInGlobalFrame(), MuonAlignmentInputXML::set_one_position(), TrackerGeometryCompare::setCommonTrackerSystem(), AlignableComposite::update(), AlignableDataIO::writeOrgPos(), and TwoBowedSurfacesAlignmentParameters::ySplitFromAlignable().

◆ globalRotation()

const RotationType& Alignable::globalRotation ( ) const
inline

◆ id()

align::ID Alignable::id ( ) const
inline

Return the ID of Alignable, i.e. DetId of 'first' component GeomDet(Unit).

Definition at line 180 of file Alignable.h.

180 { return theId; }

References theId.

Referenced by SurveyInputTrackerFromDB::addSurveyInfo(), SurveyMisalignmentInput::addSurveyInfo(), AlignmentProducerBase::addSurveyInfo(), MomentumDependentPedeLabeler::alignableLabel(), PedeLabeler::alignableLabel(), RunRangeDependentPedeLabeler::alignableLabel(), MomentumDependentPedeLabeler::alignableLabelFromParamAndInstance(), RunRangeDependentPedeLabeler::alignableLabelFromParamAndInstance(), AlignmentParameterStore::applyAlignableAbsolutePositions(), AlignmentParameterStore::applyAlignableRelativePositions(), AlignmentMonitorSurvey::book(), AlignmentMonitorGeneric::book(), TrackerOfflineValidation::bookHists(), TrackerOfflineValidation::bookSummaryHists(), HIPAlignmentAlgorithm::calcParameters(), MuonGeometryArrange::checkChosen(), PedeSteererWeakModeConstraints::checkMother(), TrackerGeometryCompare::compareGeometries(), align::createPoints(), align::diffAlignables(), MuonGeometryArrange::fillTree(), TrackerGeometryCompare::fillTree(), HIPAlignmentAlgorithm::findAlignableSpecs(), PedeSteerer::fixParameter(), PedeSteererWeakModeConstraints::getFile(), MillePedeFileReader::getHLS(), SurveyDBUploader::getSurveyInfo(), HIPAlignableSpecificParameters::id(), AlignmentParameterSelector::layerDeselected(), AlignmentParameterSelector::outsideDetIdRanges(), MomentumDependentPedeLabeler::parameterLabel(), RunRangeDependentPedeLabeler::parameterLabel(), AlignableDataIORoot::readAbsRaw(), AlignmentParametersIORoot::readOne(), HIPUserVariablesIORoot::readOne(), MillePedeVariablesIORoot::readOne(), AlignableDataIORoot::readRelRaw(), HIPAlignmentAlgorithm::run(), CreateSurveyRcds::setGeometry(), CreateSurveyRcds::setSurveyErrors(), HIPAlignmentAlgorithm::terminate(), AlignmentParameterStore::typeAndLayer(), AlignmentCorrelationsIORoot::write(), AlignableDataIO::writeAbsPos(), AlignmentParametersIORoot::writeOne(), HIPUserVariablesIORoot::writeOne(), MillePedeVariablesIORoot::writeOne(), AlignableDataIO::writeOrgPos(), and AlignableDataIO::writeRelPos().

◆ lastCompsWithParams()

bool Alignable::lastCompsWithParams ( Alignables paramComps) const

Steps down hierarchy to the lowest level of components with AlignmentParameters and adds them to argument. True either if no such components are found or if all branches of components end with such components (i.e. 'consistent').

Definition at line 93 of file Alignable.cc.

93  {
94  bool isConsistent = true;
95  bool hasAliComp = false;
96  bool first = true;
97  const auto& comps = this->components();
98  for (const auto& iComp : comps) {
99  const auto nCompsBefore = paramComps.size();
100  isConsistent = iComp->lastCompsWithParams(paramComps);
101  if (paramComps.size() == nCompsBefore) {
102  if (iComp->alignmentParameters()) {
103  paramComps.push_back(iComp);
104  if (!first && !hasAliComp)
105  isConsistent = false;
106  hasAliComp = true;
107  }
108  } else {
109  if (hasAliComp) {
110  isConsistent = false;
111  }
112  if (!first && !hasAliComp)
113  isConsistent = false;
114  hasAliComp = true;
115  }
116  first = false;
117  }
118 
119  return isConsistent;
120 }

References components(), and dqmdumpme::first.

◆ mother()

Alignable* Alignable::mother ( ) const
inline

◆ move()

virtual void Alignable::move ( const GlobalVector displacement)
pure virtual

◆ recenterSurface()

void Alignable::recenterSurface ( )
virtual

Recenter surface object without moving possible components.

Definition at line 295 of file Alignable.cc.

295  {
296  const auto& currentPosition = this->globalPosition();
297  theSurface.move(align::GlobalVector{-currentPosition.x(), -currentPosition.y(), -currentPosition.z()});
298 }

References globalPosition(), GloballyPositioned< T >::move(), theSurface, and PV3DBase< T, PVType, FrameType >::x().

◆ recursiveComponents()

virtual void Alignable::recursiveComponents ( Alignables result) const
pure virtual

Provide all components, subcomponents, subsub... etc. of Alignable down to AlignableDetUnit, except for 'single childs' like e.g. AlignableDetUnits of AlignableDets representing single sided SiStrip modules. (for performance reason by adding to argument)

Implemented in AlignableComposite, and AlignableDetUnit.

◆ restoreCachedTransformation() [1/2]

void Alignable::restoreCachedTransformation ( )
virtual

restore the previously cached transformation, also for possible components

Reimplemented in AlignableDetUnit.

Definition at line 237 of file Alignable.cc.

237  {
238  // first treat itself
242 
243  // now treat components (a clean design would move that to AlignableComposite...)
244  for (const auto& it : this->components())
245  it->restoreCachedTransformation();
246 }

References components(), theCachedDisplacement, theCachedRotation, theCachedSurface, theDisplacement, theRotation, and theSurface.

◆ restoreCachedTransformation() [2/2]

void Alignable::restoreCachedTransformation ( const align::RunNumber run)
virtual

restore for the given run the previously cached transformation, also for possible components

Reimplemented in AlignableDetUnit.

Definition at line 248 of file Alignable.cc.

248  {
249  if (surfacesCache_.find(run) == surfacesCache_.end()) {
250  throw cms::Exception("Alignment") << "@SUB=Alignable::restoreCachedTransformation\n"
251  << "Trying to restore cached transformation for a run (" << run
252  << ") that has not been cached.";
253  } else {
254  // first treat itself
258 
259  // now treat components (a clean design would move that to AlignableComposite...)
260  for (const auto& it : this->components())
261  it->restoreCachedTransformation();
262  }
263 }

References components(), displacementsCache_, Exception, rotationsCache_, writedatasetfile::run, surfacesCache_, theDisplacement, theRotation, and theSurface.

◆ rotateAroundGlobalAxis()

void Alignable::rotateAroundGlobalAxis ( const GlobalVector axis,
Scalar  radians 
)
virtual

Rotation around arbitratry global axis.

Definition at line 138 of file Alignable.cc.

138  {
139  rotateInGlobalFrame(RotationType(axis.basicVector(), radians));
140 }

References PV3DBase< T, PVType, FrameType >::basicVector(), and rotateInGlobalFrame().

Referenced by MuonAlignmentInputXML::do_rotateglobalaxis().

◆ rotateAroundGlobalX()

void Alignable::rotateAroundGlobalX ( Scalar  radians)
virtual

Rotation around global x-axis.

Definition at line 148 of file Alignable.cc.

148  {
149  RotationType rot(1., 0., 0., 0., std::cos(radians), std::sin(radians), 0., -std::sin(radians), std::cos(radians));
150 
152 }

References funct::cos(), makeMuonMisalignmentScenario::rot, rotateInGlobalFrame(), and funct::sin().

Referenced by MuonAlignment::moveAlignableGlobalCoord(), and AlignableModifier::rotateAlignable().

◆ rotateAroundGlobalY()

void Alignable::rotateAroundGlobalY ( Scalar  radians)
virtual

Rotation around global y-axis.

Definition at line 162 of file Alignable.cc.

162  {
163  RotationType rot(std::cos(radians), 0., -std::sin(radians), 0., 1., 0., std::sin(radians), 0., std::cos(radians));
164 
166 }

References funct::cos(), makeMuonMisalignmentScenario::rot, rotateInGlobalFrame(), and funct::sin().

Referenced by MuonAlignment::moveAlignableGlobalCoord(), and AlignableModifier::rotateAlignable().

◆ rotateAroundGlobalZ()

void Alignable::rotateAroundGlobalZ ( Scalar  radians)
virtual

Rotation around global z-axis.

Definition at line 176 of file Alignable.cc.

176  {
177  RotationType rot(std::cos(radians), std::sin(radians), 0., -std::sin(radians), std::cos(radians), 0., 0., 0., 1.);
178 
180 }

References funct::cos(), makeMuonMisalignmentScenario::rot, rotateInGlobalFrame(), and funct::sin().

Referenced by MuonAlignmentInputXML::do_rotatebeamline(), MuonAlignment::moveAlignableGlobalCoord(), and AlignableModifier::rotateAlignable().

◆ rotateAroundLocalAxis()

void Alignable::rotateAroundLocalAxis ( const LocalVector axis,
Scalar  radians 
)
virtual

Rotation around arbitratry local axis.

Definition at line 143 of file Alignable.cc.

143  {
144  rotateInLocalFrame(RotationType(axis.basicVector(), radians));
145 }

References PV3DBase< T, PVType, FrameType >::basicVector(), and rotateInLocalFrame().

Referenced by MuonAlignmentInputXML::do_rotatelocal().

◆ rotateAroundLocalX()

void Alignable::rotateAroundLocalX ( Scalar  radians)
virtual

Rotation around local x-axis.

Definition at line 155 of file Alignable.cc.

155  {
156  RotationType rot(1., 0., 0., 0., std::cos(radians), std::sin(radians), 0., -std::sin(radians), std::cos(radians));
157 
159 }

References funct::cos(), makeMuonMisalignmentScenario::rot, rotateInLocalFrame(), and funct::sin().

Referenced by SurveyInputCSCfromPins::analyze(), MuonAlignment::moveAlignableLocalCoord(), AlignableModifier::rotateAlignableLocal(), and CreateSurveyRcds::setGeometry().

◆ rotateAroundLocalY()

void Alignable::rotateAroundLocalY ( Scalar  radians)
virtual

Rotation around local y-axis.

Definition at line 169 of file Alignable.cc.

169  {
170  RotationType rot(std::cos(radians), 0., -std::sin(radians), 0., 1., 0., std::sin(radians), 0., std::cos(radians));
171 
173 }

References funct::cos(), makeMuonMisalignmentScenario::rot, rotateInLocalFrame(), and funct::sin().

Referenced by MuonAlignment::moveAlignableLocalCoord(), AlignableModifier::rotateAlignableLocal(), and CreateSurveyRcds::setGeometry().

◆ rotateAroundLocalZ()

void Alignable::rotateAroundLocalZ ( Scalar  radians)
virtual

Rotation around local z-axis.

Definition at line 183 of file Alignable.cc.

183  {
184  RotationType rot(std::cos(radians), std::sin(radians), 0., -std::sin(radians), std::cos(radians), 0., 0., 0., 1.);
185 
187 }

References funct::cos(), makeMuonMisalignmentScenario::rot, rotateInLocalFrame(), and funct::sin().

Referenced by SurveyInputCSCfromPins::analyze(), MuonAlignment::moveAlignableLocalCoord(), AlignableModifier::rotateAlignableLocal(), and CreateSurveyRcds::setGeometry().

◆ rotateInGlobalFrame()

virtual void Alignable::rotateInGlobalFrame ( const RotationType rotation)
pure virtual

◆ rotateInLocalFrame()

void Alignable::rotateInLocalFrame ( const RotationType rotation)
virtual

Rotation intepreted in the local reference frame.

Definition at line 129 of file Alignable.cc.

129  {
130  // This is done by simply transforming the rotation from
131  // the local system O to the global one O^-1 * Rot * O
132  // and then applying the global rotation O * Rot
133 
134  rotateInGlobalFrame(surface().toGlobal(rotation));
135 }

References rotateInGlobalFrame(), rotation(), and surface().

Referenced by SurveyInputTrackerFromDB::addSurveyInfo(), rotateAroundLocalAxis(), rotateAroundLocalX(), rotateAroundLocalY(), and rotateAroundLocalZ().

◆ rotation()

const RotationType& Alignable::rotation ( ) const
inline

◆ setAlignmentParameters()

void Alignable::setAlignmentParameters ( AlignmentParameters dap)

◆ setAlignmentPositionError()

virtual void Alignable::setAlignmentPositionError ( const AlignmentPositionError ape,
bool  propagateDown 
)
pure virtual

Set the alignment position error - if (!propagateDown) do not affect daughters.

Implemented in AlignableDetUnit, AlignableComposite, AlignableBeamSpot, and AlignableDet.

Referenced by MuonAlignment::recursiveCopySurveyToAlignment(), and AlignmentParameterStore::setAlignmentPositionError().

◆ setMother()

void Alignable::setMother ( Alignable mother)
inline

◆ setSurfaceDeformation()

virtual void Alignable::setSurfaceDeformation ( const SurfaceDeformation deformation,
bool  propagateDown 
)
pure virtual

Set the surface deformation parameters - if (!propagateDown) do not affect daughters.

Implemented in AlignableDetUnit, AlignableComposite, and AlignableBeamSpot.

◆ setSurvey()

void Alignable::setSurvey ( const SurveyDet survey)

◆ size()

int Alignable::size ( ) const
inline

◆ surface()

const AlignableSurface& Alignable::surface ( ) const
inline

Return the Surface (global position and orientation) of the object.

Definition at line 132 of file Alignable.h.

132 { return theSurface; }

References theSurface.

Referenced by AlignmentParameterStore::acquireRelativeParameters(), AlignableDet::addAlignmentPositionErrorFromRotation(), AlignableDetUnit::addAlignmentPositionErrorFromRotation(), MillePedeAlignmentAlgorithm::addPxbSurvey(), MuonDT2ChamberResidual::addResidual(), MuonCSCChamberResidual::addResidual(), MuonDT13ChamberResidual::addResidual(), SurveyInputTrackerFromDB::addSurveyInfo(), SurveyMisalignmentInput::addSurveyInfo(), TrackerGeometryCompare::addSurveyInfo(), AlignmentProducerBase::addSurveyInfo(), MuonAlignmentInputSurveyDB::addSurveyInfo_(), SurveyInputCSCfromPins::analyze(), BeamSpotAlignmentParameters::apply(), RigidBodyAlignmentParameters::apply(), BowedSurfaceAlignmentParameters::apply(), TwoBowedSurfacesAlignmentParameters::apply(), CSCAlignmentCorrections::applyAlignment(), SurveyResidual::calculate(), PedeSteererWeakModeConstraints::constructConstraints(), MuonAlignment::copyAlignmentToSurvey(), align::createPoints(), BowedSurfaceAlignmentParameters::derivatives(), TwoBowedSurfacesAlignmentParameters::derivatives(), align::diffAlignables(), RigidBodyAlignmentParameters::displacementFromAlignable(), MuonAlignmentInputXML::do_moveglobal(), MuonAlignmentInputXML::do_movelocal(), MuonAlignmentInputXML::do_rotatebeamline(), MuonAlignmentInputXML::do_rotateglobalaxis(), MuonAlignmentInputXML::do_rotatelocal(), MuonAlignmentInputXML::do_setsurveyerr(), SurveyInputCSCfromPins::fillAllRecords(), MuonGeometryArrange::fillTree(), TrackerGeometryCompare::fillTree(), PedeSteererWeakModeConstraints::getDoubleSensorPosition(), MuonChamberResidual::global_stubpos(), MuonChamberResidual::global_trackpos(), BeamSpotAlignmentParameters::globalParameters(), RigidBodyAlignmentParameters::globalParameters(), globalPosition(), globalRotation(), ParametersToParametersDerivatives::init2BowedRigid(), ParametersToParametersDerivatives::initBowedRigid(), AlignableModifier::moveAlignableLocal(), MuonAlignment::moveAlignableLocalCoord(), AlignableComposite::moveComponentLocal(), AlignableComposite::moveComponentsLocal(), MuonResiduals6DOFrphiFitter::plot(), MuonResiduals5DOFFitter::plot(), MuonResiduals6DOFFitter::plot(), AlignmentMonitorSegmentDifferences::processMuonResidualsFromTrack(), rotateInLocalFrame(), BowedSurfaceAlignmentParameters::rotation(), MuonAlignmentInputXML::set_one_position(), CreateSurveyRcds::setGeometry(), CreateSurveyRcds::setSurveyErrors(), SurveyAlignment::shiftSensors(), HIPAlignmentAlgorithm::terminate(), AlignableDataIO::writeAbsPos(), and AlignableDetUnit::~AlignableDetUnit().

◆ surfaceDeformationIdPairs()

virtual int Alignable::surfaceDeformationIdPairs ( std::vector< std::pair< int, SurfaceDeformation * > > &  ) const
pure virtual

◆ surfaceDeformations()

AlignmentSurfaceDeformations * Alignable::surfaceDeformations ( void  ) const

Return surface deformations, sorted by DetId.

Definition at line 196 of file Alignable.cc.

196  {
197  typedef std::pair<int, SurfaceDeformation*> IdSurfaceDeformationPtrPair;
198 
199  std::vector<IdSurfaceDeformationPtrPair> result;
201  std::sort(result.begin(), result.end(), [](auto& a, auto& b) { return a.first < b.first; });
202 
203  AlignmentSurfaceDeformations* allSurfaceDeformations = new AlignmentSurfaceDeformations();
204 
205  for (std::vector<IdSurfaceDeformationPtrPair>::const_iterator iPair = result.begin(); iPair != result.end();
206  ++iPair) {
207  // should we check for 'empty' parameters here (all zeros) and skip ?
208  // may be add 'empty' method to SurfaceDeformation
209  allSurfaceDeformations->add((*iPair).first, (*iPair).second->type(), (*iPair).second->parameters());
210  }
211 
212  return allSurfaceDeformations;
213 }

References a, b, mps_fire::result, and surfaceDeformationIdPairs().

◆ survey()

const SurveyDet* Alignable::survey ( ) const
inline

◆ update()

void Alignable::update ( align::ID  id,
const AlignableSurface surf 
)

Updater using id and surface. The given id has to match the current id.

Definition at line 45 of file Alignable.cc.

45  {
46  if (theId != id) {
47  throw cms::Exception("Alignment") << "@SUB=Alignable::update\n"
48  << "Current alignable ID does not match ID of the update.";
49  }
50  const auto shift = surf.position() - theSurface.position();
51  theSurface = surf;
52 
53  // reset displacement and rotations after update
56 
57  // recalculate containing composite's position
59 }

References Exception, GloballyPositioned< T >::position(), edm::shift, theDisplacement, theId, theRotation, theSurface, and updateMother().

Referenced by progressbar.ProgressBar::__next__(), MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), dqm-mbProfile.Profile::finish(), progressbar.ProgressBar::finish(), MatrixUtil.Steps::overwrite(), AlignableBeamSpot::reset(), AlignableDetUnit::update(), and AlignableComposite::update().

◆ updateMother()

void Alignable::updateMother ( const GlobalVector shift)
protectedvirtual

Definition at line 272 of file Alignable.cc.

272  {
273  if (!theMother)
274  return;
275 
276  const auto thisComps = this->deepComponents().size();
277  const auto motherComps = theMother->deepComponents().size();
278  const auto motherShift = shift * static_cast<Scalar>(thisComps) / motherComps;
279 
280  switch (theMother->compConstraintType()) {
282  break;
284  theMother->theSurface.move(GlobalVector(0, 0, motherShift.z()));
285  theMother->updateMother(GlobalVector(0, 0, motherShift.z()));
286  break;
288  theMother->theSurface.move(motherShift);
289  theMother->updateMother(motherShift);
290  break;
291  }
292 }

References compConstraintType(), deepComponents(), GloballyPositioned< T >::move(), NONE, POSITION, POSITION_Z, edm::shift, theMother, theSurface, and updateMother().

Referenced by update(), and updateMother().

Member Data Documentation

◆ compConstraintType_

CompConstraintType Alignable::compConstraintType_ {CompConstraintType::NONE}
protected

◆ displacementsCache_

Cache<GlobalVector> Alignable::displacementsCache_
protected

◆ rotationsCache_

Cache<RotationType> Alignable::rotationsCache_
protected

◆ surfacesCache_

Cache<AlignableSurface> Alignable::surfacesCache_
protected

◆ theAlignmentParameters

AlignmentParameters* Alignable::theAlignmentParameters
private

Definition at line 257 of file Alignable.h.

Referenced by alignmentParameters(), setAlignmentParameters(), and ~Alignable().

◆ theCachedDisplacement

GlobalVector Alignable::theCachedDisplacement
protected

◆ theCachedRotation

RotationType Alignable::theCachedRotation
protected

◆ theCachedSurface

AlignableSurface Alignable::theCachedSurface
protected

◆ theDeepComponents

Alignables Alignable::theDeepComponents
protected

◆ theDetId

DetId Alignable::theDetId
protected

Definition at line 232 of file Alignable.h.

Referenced by geomDetId().

◆ theDisplacement

GlobalVector Alignable::theDisplacement
protected

◆ theId

align::ID Alignable::theId
protected

◆ theMother

Alignable* Alignable::theMother
private

Definition at line 261 of file Alignable.h.

Referenced by mother(), setMother(), and updateMother().

◆ theRotation

RotationType Alignable::theRotation
protected

◆ theSurface

AlignableSurface Alignable::theSurface
protected

◆ theSurvey

const SurveyDet* Alignable::theSurvey
private

Definition at line 263 of file Alignable.h.

Referenced by setSurvey(), survey(), and ~Alignable().

Vector3DBase< Scalar, GlobalTag >
Alignable::theDisplacement
GlobalVector theDisplacement
Definition: Alignable.h:239
Alignable::theDeepComponents
Alignables theDeepComponents
Definition: Alignable.h:248
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
Alignable::theCachedSurface
AlignableSurface theCachedSurface
Definition: Alignable.h:242
Alignable::rotateInGlobalFrame
virtual void rotateInGlobalFrame(const RotationType &rotation)=0
Alignable::surfaceDeformationIdPairs
virtual int surfaceDeformationIdPairs(std::vector< std::pair< int, SurfaceDeformation * > > &) const =0
Alignable::CompConstraintType::POSITION_Z
Alignable::GlobalVector
align::GlobalVector GlobalVector
Definition: Alignable.h:32
dqmdumpme.first
first
Definition: dqmdumpme.py:55
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Alignable::surfacesCache_
Cache< AlignableSurface > surfacesCache_
Definition: Alignable.h:251
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Alignable::theDetId
DetId theDetId
Definition: Alignable.h:232
Alignable::PositionType
align::PositionType PositionType
Definition: Alignable.h:30
Alignable::compConstraintType_
CompConstraintType compConstraintType_
Definition: Alignable.h:246
Alignable::surface
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:132
Alignable::displacement
const GlobalVector & displacement() const
Return change of the global position since the creation of the object.
Definition: Alignable.h:141
b
double b
Definition: hdecay.h:118
Alignable::theSurvey
const SurveyDet * theSurvey
Definition: Alignable.h:263
Alignable::theAlignmentParameters
AlignmentParameters * theAlignmentParameters
Definition: Alignable.h:257
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
a
double a
Definition: hdecay.h:119
Alignable::RotationType
align::RotationType RotationType
Definition: Alignable.h:31
Alignable::rotateInLocalFrame
virtual void rotateInLocalFrame(const RotationType &rotation)
Rotation intepreted in the local reference frame.
Definition: Alignable.cc:129
Alignable::CompConstraintType::NONE
GloballyPositioned::move
void move(const GlobalVector &displacement)
Definition: GloballyPositioned.h:128
AlignmentSurfaceDeformations
Definition: AlignmentSurfaceDeformations.h:20
Alignable::theSurface
AlignableSurface theSurface
Definition: Alignable.h:237
Alignable::theCachedRotation
RotationType theCachedRotation
Definition: Alignable.h:244
Alignable::theMother
Alignable * theMother
Definition: Alignable.h:261
PV3DBase::basicVector
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
GloballyPositioned::position
const PositionType & position() const
Definition: GloballyPositioned.h:36
writedatasetfile.run
run
Definition: writedatasetfile.py:27
edm::shift
static unsigned const int shift
Definition: LuminosityBlockID.cc:7
Alignable::rotationsCache_
Cache< RotationType > rotationsCache_
Definition: Alignable.h:253
Alignable::deepComponents
const Alignables & deepComponents() const
Definition: Alignable.h:72
Exception
Definition: hltDiff.cc:246
Alignable::theCachedDisplacement
GlobalVector theCachedDisplacement
Definition: Alignable.h:243
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
Alignable::theId
align::ID theId
Definition: Alignable.h:235
Alignable::theRotation
RotationType theRotation
Definition: Alignable.h:240
NONE
Definition: TkAlStyle.cc:47
mps_fire.result
result
Definition: mps_fire.py:311
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::components
virtual const Alignables & components() const =0
Return vector of all direct components.
Alignable::survey
const SurveyDet * survey() const
Return survey info.
Definition: Alignable.h:216
Alignable::CompConstraintType::POSITION
Alignable::mother
Alignable * mother() const
Return pointer to container alignable (if any)
Definition: Alignable.h:91
Alignable::compConstraintType
virtual CompConstraintType compConstraintType() const
Return the alignable type of contraints wrt. its components.
Definition: Alignable.h:183