CMS 3D CMS Logo

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

#include <AlignableDetUnit.h>

Inheritance diagram for AlignableDetUnit:
Alignable

Public Member Functions

void addAlignmentPositionError (const AlignmentPositionError &ape, bool) final
 
void addAlignmentPositionErrorFromLocalRotation (const RotationType &rot, bool) final
 
void addAlignmentPositionErrorFromRotation (const RotationType &rot, bool) final
 
void addComponent (Alignable *) final
 No components here => exception! More...
 
void addSurfaceDeformation (const SurfaceDeformation *deformation, bool) final
 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...
 
StructureType alignableObjectId () const override
 Return the alignable type identifier. More...
 
AlignmentErrorsExtendedalignmentErrors () const override
 Return vector of alignment errors. More...
 
const AlignmentPositionErroralignmentPositionError () const
 alignment position error - for checking only, otherwise use alignmentErrors() above! More...
 
Alignmentsalignments () const override
 Return vector of alignment data. More...
 
void cacheTransformation () override
 cache the current position, rotation and other parameters (e.g. surface deformations) More...
 
void cacheTransformation (const align::RunNumber &) override
 cache for the given run the current position, rotation and other parameters (e.g. surface deformations) More...
 
const Alignablescomponents () const override
 Returns a null vector (no components here) More...
 
void dump () const override
 Printout information about GeomDet. More...
 
void move (const GlobalVector &displacement) override
 Move with respect to the global reference frame. More...
 
void recursiveComponents (Alignables &result) const override
 Do nothing (no components here, so no subcomponents either...) More...
 
void restoreCachedTransformation () override
 restore the previously cached transformation More...
 
void restoreCachedTransformation (const align::RunNumber &) override
 restore for the given run the previously cached transformation More...
 
void rotateInGlobalFrame (const RotationType &rotation) override
 Rotation with respect to the global reference frame. More...
 
void setAlignmentPositionError (const AlignmentPositionError &ape, bool) final
 Set the AlignmentPositionError (no components => second argument ignored) More...
 
void setSurfaceDeformation (const SurfaceDeformation *deformation, bool) final
 Set surface deformation parameters (2nd argument without effect) More...
 
int surfaceDeformationIdPairs (std::vector< std::pair< int, SurfaceDeformation *> > &) const override
 Return surface deformations. More...
 
void update (const GeomDetUnit *geomDetUnit)
 
 ~AlignableDetUnit () override
 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 recenterSurface ()
 Recenter surface object without moving possible components. 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
 

Static Private Attributes

static const Alignables emptyComponents_ {}
 

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 12 of file AlignableDetUnit.h.

Constructor & Destructor Documentation

◆ AlignableDetUnit()

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.

16  : // rely on non-NULL pointer!
17  Alignable(geomDetUnit->geographicalId().rawId(), geomDetUnit->surface()),
19  theSurfaceDeformation(nullptr),
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 }
Alignable()
private default ctr. to enforce usage of the specialised ones
Definition: Alignable.h:257
void setSurfaceDeformation(const SurfaceDeformation *deformation, bool) final
Set surface deformation parameters (2nd argument without effect)
SurfaceDeformation * theCachedSurfaceDeformation
AlignmentPositionError const * alignmentPositionError() const
Return pointer to alignment errors.
Definition: GeomDet.h:80
void setAlignmentPositionError(const AlignmentPositionError &ape, bool) final
Set the AlignmentPositionError (no components => second argument ignored)
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
AlignmentPositionError * theAlignmentPositionError
virtual const SurfaceDeformation * surfaceDeformation() const
Definition: GeomDet.h:96
SurfaceDeformation * theSurfaceDeformation
Alignables theDeepComponents
Definition: Alignable.h:248

◆ ~AlignableDetUnit()

AlignableDetUnit::~AlignableDetUnit ( )
override

Destructor.

Definition at line 35 of file AlignableDetUnit.cc.

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

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

Member Function Documentation

◆ addAlignmentPositionError()

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

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

Implements Alignable.

Definition at line 89 of file AlignableDetUnit.cc.

References setAlignmentPositionError(), and theAlignmentPositionError.

Referenced by addAlignmentPositionErrorFromRotation().

89  {
91  this->setAlignmentPositionError(ape, propagateDown); // 2nd argument w/o effect
92  else
94 }
void setAlignmentPositionError(const AlignmentPositionError &ape, bool) final
Set the AlignmentPositionError (no components => second argument ignored)
AlignmentPositionError * theAlignmentPositionError

◆ addAlignmentPositionErrorFromLocalRotation()

void AlignableDetUnit::addAlignmentPositionErrorFromLocalRotation ( const RotationType rot,
bool  propagateDown 
)
finalvirtual

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 111 of file AlignableDetUnit.cc.

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

111  {
113  this->addAlignmentPositionErrorFromRotation(globalRot, propagateDown); // 2nd argument w/o effect
114 }
Basic3DVector< T > multiplyInverse(const Basic3DVector< T > &v) const
align::RotationType RotationType
Definition: Alignable.h:31
void addAlignmentPositionErrorFromRotation(const RotationType &rot, bool) final
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:138

◆ addAlignmentPositionErrorFromRotation()

void AlignableDetUnit::addAlignmentPositionErrorFromRotation ( const RotationType rot,
bool  propagateDown 
)
finalvirtual

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 97 of file AlignableDetUnit.cc.

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

Referenced by addAlignmentPositionErrorFromLocalRotation().

97  {
98  // average error calculated by movement of a local point at
99  // (xWidth/2,yLength/2,0) caused by the rotation rot
100  GlobalVector localPositionVector =
101  surface().toGlobal(LocalVector(.5 * surface().width(), .5 * surface().length(), 0.));
102 
103  const LocalVector::BasicVectorType& lpvgf = localPositionVector.basicVector();
104  GlobalVector gv(rot.multiplyInverse(lpvgf) - lpvgf);
105 
106  AlignmentPositionError ape(gv.x(), gv.y(), gv.z());
107  this->addAlignmentPositionError(ape, propagateDown); // 2nd argument w/o effect
108 }
align::GlobalPoints toGlobal(const align::LocalPoints &) const
Return in global coord given a set of local points.
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:132
align::LocalVector LocalVector
Definition: Alignable.h:33
void addAlignmentPositionError(const AlignmentPositionError &ape, bool) final
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53

◆ addComponent()

void AlignableDetUnit::addComponent ( Alignable )
finalvirtual

No components here => exception!

Implements Alignable.

Definition at line 64 of file AlignableDetUnit.cc.

References Exception.

64  {
65  throw cms::Exception("LogicError") << "AlignableDetUnit cannot have components, but try to add one!";
66 }

◆ addSurfaceDeformation()

void AlignableDetUnit::addSurfaceDeformation ( const SurfaceDeformation deformation,
bool  propagateDown 
)
finalvirtual

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

Implements Alignable.

Definition at line 127 of file AlignableDetUnit.cc.

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

127  {
128  if (!deformation) {
129  // nothing to do
130  } else if (!theSurfaceDeformation) {
131  this->setSurfaceDeformation(deformation, propagateDown); // fine since no components
132  } else if (!theSurfaceDeformation->add(*deformation)) {
133  edm::LogError("Alignment") << "@SUB=AlignableDetUnit::addSurfaceDeformation"
134  << "Cannot add deformation type " << deformation->type() << " to type "
135  << theSurfaceDeformation->type() << ", so erase deformation information.";
136  delete theSurfaceDeformation;
137  theSurfaceDeformation = nullptr;
138  }
139 }
void setSurfaceDeformation(const SurfaceDeformation *deformation, bool) final
Set surface deformation parameters (2nd argument without effect)
Log< level::Error, false > LogError
virtual int type() const =0
specific type, i.e. SurfaceDeformationFactory::Type
virtual bool add(const SurfaceDeformation &other)=0
SurfaceDeformation * theSurfaceDeformation

◆ alignableObjectId()

StructureType AlignableDetUnit::alignableObjectId ( ) const
inlineoverridevirtual

Return the alignable type identifier.

Implements Alignable.

Definition at line 62 of file AlignableDetUnit.h.

References align::AlignableDetUnit.

◆ alignmentErrors()

AlignmentErrorsExtended * AlignableDetUnit::alignmentErrors ( void  ) const
overridevirtual

Return vector of alignment errors.

Implements Alignable.

Definition at line 181 of file AlignableDetUnit.cc.

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

181  {
182  AlignmentErrorsExtended* m_alignmentErrors = new AlignmentErrorsExtended();
183 
184  uint32_t detId = this->geomDetId().rawId();
185 
186  CLHEP::HepSymMatrix clhepSymMatrix(6, 0);
187  if (theAlignmentPositionError) // Might not be set
189 
190  AlignTransformErrorExtended transformError(clhepSymMatrix, detId);
191 
192  m_alignmentErrors->m_alignError.push_back(transformError);
193 
194  return m_alignmentErrors;
195 }
const AlgebraicSymMatrix66 & matrix() const
CLHEP::HepMatrix asHepMatrix(const ROOT::Math::SMatrix< double, N1, N2, typename ROOT::Math::MatRepStd< double, N1, N2 > > &rm)
Definition: Migration.h:60
std::vector< AlignTransformErrorExtended > m_alignError
const DetId & geomDetId() const
Definition: Alignable.h:177
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const GlobalErrorExtended & globalError() const
AlignmentPositionError * theAlignmentPositionError

◆ alignmentPositionError()

const AlignmentPositionError* AlignableDetUnit::alignmentPositionError ( ) const
inline

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

Definition at line 89 of file AlignableDetUnit.h.

References theAlignmentPositionError.

Referenced by AlignableDetOrUnitPtr::alignmentPositionError().

89 { return theAlignmentPositionError; }
AlignmentPositionError * theAlignmentPositionError

◆ alignments()

Alignments * AlignableDetUnit::alignments ( void  ) const
overridevirtual

Return vector of alignment data.

Implements Alignable.

Definition at line 162 of file AlignableDetUnit.cc.

References Alignable::geomDetId(), Alignable::globalPosition(), Alignable::globalRotation(), Alignments::m_align, DetId::rawId(), makeMuonMisalignmentScenario::rot, HcalDetIdTransform::transform(), x, y, and z.

162  {
163  Alignments* m_alignments = new Alignments();
165 
166  // Get alignments (position, rotation, detId)
167  CLHEP::Hep3Vector clhepVector(globalPosition().x(), globalPosition().y(), globalPosition().z());
168  CLHEP::HepRotation clhepRotation(
169  CLHEP::HepRep3x3(rot.xx(), rot.xy(), rot.xz(), rot.yx(), rot.yy(), rot.yz(), rot.zx(), rot.zy(), rot.zz()));
170  uint32_t detId = this->geomDetId().rawId();
171 
172  AlignTransform transform(clhepVector, clhepRotation, detId);
173 
174  // Add to alignments container
175  m_alignments->m_align.push_back(transform);
176 
177  return m_alignments;
178 }
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:135
const DetId & geomDetId() const
Definition: Alignable.h:177
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
align::RotationType RotationType
Definition: Alignable.h:31
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:138
unsigned transform(const HcalDetId &id, unsigned transformCode)

◆ cacheTransformation() [1/2]

void AlignableDetUnit::cacheTransformation ( )
overridevirtual

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

Reimplemented from Alignable.

Definition at line 208 of file AlignableDetUnit.cc.

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

208  {
212 
215  theCachedSurfaceDeformation = nullptr;
216  }
217 
220 }
RotationType theCachedRotation
Definition: Alignable.h:244
RotationType theRotation
Definition: Alignable.h:240
GlobalVector theDisplacement
Definition: Alignable.h:239
SurfaceDeformation * theCachedSurfaceDeformation
AlignableSurface theCachedSurface
Definition: Alignable.h:242
virtual SurfaceDeformation * clone() const =0
GlobalVector theCachedDisplacement
Definition: Alignable.h:243
SurfaceDeformation * theSurfaceDeformation
AlignableSurface theSurface
Definition: Alignable.h:237

◆ cacheTransformation() [2/2]

void AlignableDetUnit::cacheTransformation ( const align::RunNumber run)
overridevirtual

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

Reimplemented from Alignable.

Definition at line 223 of file AlignableDetUnit.cc.

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

223  {
227 
228  auto existingCache = surfaceDeformationsCache_.find(run);
229  if (existingCache != surfaceDeformationsCache_.end()) {
230  delete existingCache->second;
231  existingCache->second = nullptr;
232  }
233 
234  if (theSurfaceDeformation) {
236  }
237 }
RotationType theRotation
Definition: Alignable.h:240
Cache< SurfaceDeformation * > surfaceDeformationsCache_
Cache< GlobalVector > displacementsCache_
Definition: Alignable.h:252
Cache< AlignableSurface > surfacesCache_
Definition: Alignable.h:251
Cache< RotationType > rotationsCache_
Definition: Alignable.h:253
GlobalVector theDisplacement
Definition: Alignable.h:239
virtual SurfaceDeformation * clone() const =0
SurfaceDeformation * theSurfaceDeformation
AlignableSurface theSurface
Definition: Alignable.h:237

◆ components()

const Alignables& AlignableDetUnit::components ( ) const
inlineoverridevirtual

Returns a null vector (no components here)

Implements Alignable.

Definition at line 28 of file AlignableDetUnit.h.

References emptyComponents_.

28 { return emptyComponents_; }
static const Alignables emptyComponents_

◆ dump()

void AlignableDetUnit::dump ( void  ) const
overridevirtual

Printout information about GeomDet.

Implements Alignable.

Definition at line 142 of file AlignableDetUnit.cc.

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

142  {
143  std::ostringstream parameters;
144  if (theSurfaceDeformation) {
145  parameters << " surface deformation parameters:";
146  for (const auto& param : theSurfaceDeformation->parameters()) {
147  parameters << " " << param;
148  }
149  } else {
150  parameters << " no surface deformation parameters";
151  }
152 
153  edm::LogInfo("AlignableDump") << " AlignableDetUnit has position = " << this->globalPosition()
154  << ", orientation:" << std::endl
155  << this->globalRotation() << std::endl
156  << " total displacement and rotation: " << this->displacement() << std::endl
157  << this->rotation() << "\n"
158  << parameters.str();
159 }
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:135
virtual std::vector< double > parameters() const =0
parameters - interpretation left to the concrete implementation
Log< level::Info, false > LogInfo
const GlobalVector & displacement() const
Return change of the global position since the creation of the object.
Definition: Alignable.h:141
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:138
SurfaceDeformation * theSurfaceDeformation
const RotationType & rotation() const
Return change of orientation since the creation of the object.
Definition: Alignable.h:144

◆ move()

void AlignableDetUnit::move ( const GlobalVector displacement)
overridevirtual

Move with respect to the global reference frame.

Implements Alignable.

Definition at line 69 of file AlignableDetUnit.cc.

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

69  {
71  this->addDisplacement(displacement);
72 }
void move(const GlobalVector &displacement)
const GlobalVector & displacement() const
Return change of the global position since the creation of the object.
Definition: Alignable.h:141
void addDisplacement(const GlobalVector &displacement)
Definition: Alignable.cc:190
AlignableSurface theSurface
Definition: Alignable.h:237

◆ recursiveComponents()

void AlignableDetUnit::recursiveComponents ( Alignables result) const
inlineoverridevirtual

Do nothing (no components here, so no subcomponents either...)

Implements Alignable.

Definition at line 31 of file AlignableDetUnit.h.

31 {}

◆ restoreCachedTransformation() [1/2]

void AlignableDetUnit::restoreCachedTransformation ( )
overridevirtual

restore the previously cached transformation

Reimplemented from Alignable.

Definition at line 240 of file AlignableDetUnit.cc.

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

240  {
244 
245  if (theSurfaceDeformation) {
246  delete theSurfaceDeformation;
247  theSurfaceDeformation = nullptr;
248  }
249 
252  }
253 }
RotationType theCachedRotation
Definition: Alignable.h:244
RotationType theRotation
Definition: Alignable.h:240
void setSurfaceDeformation(const SurfaceDeformation *deformation, bool) final
Set surface deformation parameters (2nd argument without effect)
GlobalVector theDisplacement
Definition: Alignable.h:239
SurfaceDeformation * theCachedSurfaceDeformation
AlignableSurface theCachedSurface
Definition: Alignable.h:242
GlobalVector theCachedDisplacement
Definition: Alignable.h:243
SurfaceDeformation * theSurfaceDeformation
AlignableSurface theSurface
Definition: Alignable.h:237

◆ restoreCachedTransformation() [2/2]

void AlignableDetUnit::restoreCachedTransformation ( const align::RunNumber run)
overridevirtual

restore for the given run the previously cached transformation

Reimplemented from Alignable.

Definition at line 256 of file AlignableDetUnit.cc.

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

256  {
257  if (surfacesCache_.find(run) == surfacesCache_.end()) {
258  throw cms::Exception("Alignment") << "@SUB=Alignable::restoreCachedTransformation\n"
259  << "Trying to restore cached transformation for a run (" << run
260  << ") that has not been cached.";
261  } else {
265 
266  if (theSurfaceDeformation) {
267  delete theSurfaceDeformation;
268  theSurfaceDeformation = nullptr;
269  }
270 
273  }
274  }
275 }
RotationType theRotation
Definition: Alignable.h:240
Cache< SurfaceDeformation * > surfaceDeformationsCache_
Cache< GlobalVector > displacementsCache_
Definition: Alignable.h:252
void setSurfaceDeformation(const SurfaceDeformation *deformation, bool) final
Set surface deformation parameters (2nd argument without effect)
Cache< AlignableSurface > surfacesCache_
Definition: Alignable.h:251
Cache< RotationType > rotationsCache_
Definition: Alignable.h:253
GlobalVector theDisplacement
Definition: Alignable.h:239
SurfaceDeformation * theSurfaceDeformation
AlignableSurface theSurface
Definition: Alignable.h:237

◆ rotateInGlobalFrame()

void AlignableDetUnit::rotateInGlobalFrame ( const RotationType rotation)
overridevirtual

Rotation with respect to the global reference frame.

Implements Alignable.

Definition at line 75 of file AlignableDetUnit.cc.

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

75  {
77  this->addRotation(rotation);
78 }
void addRotation(const RotationType &rotation)
Definition: Alignable.cc:193
void rotate(const RotationType &rotation)
AlignableSurface theSurface
Definition: Alignable.h:237
const RotationType & rotation() const
Return change of orientation since the creation of the object.
Definition: Alignable.h:144

◆ setAlignmentPositionError()

void AlignableDetUnit::setAlignmentPositionError ( const AlignmentPositionError ape,
bool   
)
finalvirtual

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

Implements Alignable.

Definition at line 81 of file AlignableDetUnit.cc.

References theAlignmentPositionError.

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

81  {
84  else
86 }
AlignmentPositionError * theAlignmentPositionError

◆ setSurfaceDeformation()

void AlignableDetUnit::setSurfaceDeformation ( const SurfaceDeformation deformation,
bool   
)
finalvirtual

Set surface deformation parameters (2nd argument without effect)

Implements Alignable.

Definition at line 117 of file AlignableDetUnit.cc.

References SurfaceDeformation::clone(), and theSurfaceDeformation.

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

117  {
118  delete theSurfaceDeformation; // OK for zero pointers
119  if (deformation) {
120  theSurfaceDeformation = deformation->clone();
121  } else {
122  theSurfaceDeformation = nullptr;
123  }
124 }
virtual SurfaceDeformation * clone() const =0
SurfaceDeformation * theSurfaceDeformation

◆ surfaceDeformationIdPairs()

int AlignableDetUnit::surfaceDeformationIdPairs ( std::vector< std::pair< int, SurfaceDeformation *> > &  result) const
overridevirtual

Return surface deformations.

Implements Alignable.

Definition at line 198 of file AlignableDetUnit.cc.

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

198  {
199  if (theSurfaceDeformation) {
200  result.push_back(std::pair<int, SurfaceDeformation*>(this->geomDetId().rawId(), theSurfaceDeformation));
201  return 1;
202  }
203 
204  return 0;
205 }
const DetId & geomDetId() const
Definition: Alignable.h:177
SurfaceDeformation * theSurfaceDeformation

◆ update()

void AlignableDetUnit::update ( const GeomDetUnit geomDetUnit)

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

Definition at line 44 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__(), AlignableTrackerBuilder::buildPixelDetectorAlignable(), dqm-mbProfile.Profile::finish(), progressbar.ProgressBar::finish(), MatrixUtil.Steps::overwrite(), and AlignableDet::update().

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

Member Data Documentation

◆ emptyComponents_

const align::Alignables AlignableDetUnit::emptyComponents_ {}
staticprivate

Definition at line 92 of file AlignableDetUnit.h.

Referenced by components().

◆ surfaceDeformationsCache_

Cache<SurfaceDeformation*> AlignableDetUnit::surfaceDeformationsCache_
private

◆ theAlignmentPositionError

AlignmentPositionError* AlignableDetUnit::theAlignmentPositionError
private

◆ theCachedSurfaceDeformation

SurfaceDeformation* AlignableDetUnit::theCachedSurfaceDeformation
private

◆ theSurfaceDeformation

SurfaceDeformation* AlignableDetUnit::theSurfaceDeformation
private