CMS 3D CMS Logo

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

#include <AlignableComposite.h>

Inheritance diagram for AlignableComposite:
Alignable AlignableCSCEndcap AlignableCSCRing AlignableCSCStation AlignableDet AlignableDTBarrel AlignableDTStation AlignableDTWheel AlignableGEMEndcap AlignableGEMRing AlignableGEMStation AlignableMuon AlignableTracker

Public Member Functions

void addAlignmentPositionError (const AlignmentPositionError &ape, bool propagateDown) override
 
void addAlignmentPositionErrorFromLocalRotation (const RotationType &rotation, bool propagateDown) override
 
void addAlignmentPositionErrorFromRotation (const RotationType &rotation, bool propagateDown) override
 
void addComponent (Alignable *component) final
 
void addSurfaceDeformation (const SurfaceDeformation *deformation, bool propagateDown) override
 
 AlignableComposite (align::ID id, StructureType aType, const RotationType &rot=RotationType())
 
StructureType alignableObjectId () const override
 Return the alignable type identifier. More...
 
AlignmentErrorsExtendedalignmentErrors () const override
 Return vector of alignment errors. More...
 
Alignmentsalignments () const override
 Return alignment data. More...
 
const Alignablescomponents () const override
 Return vector of direct components. More...
 
void dump () const override
 Recursive printout of alignable structure. More...
 
void move (const GlobalVector &displacement) override
 Move with respect to the global reference frame. More...
 
virtual void moveComponentLocal (const int i, const LocalVector &localDisplacement)
 Move a single component with respect to the local reference frame. More...
 
virtual void moveComponentsLocal (const LocalVector &localDisplacement)
 Move with respect to the local reference frame. More...
 
void recursiveComponents (Alignables &result) const override
 Provide all components, subcomponents etc. (cf. description in base class) More...
 
void rotateInGlobalFrame (const RotationType &rotation) override
 Rotation interpreted in global reference frame. More...
 
void setAlignmentPositionError (const AlignmentPositionError &ape, bool propagateDown) override
 
void setSurfaceDeformation (const SurfaceDeformation *deformation, bool propagateDown) override
 Set the surface deformation parameters - if (!propagateDown) do not affect daughters. More...
 
int surfaceDeformationIdPairs (std::vector< std::pair< int, SurfaceDeformation *> > &) const override
 Return surface deformations. More...
 
void update (align::ID, StructureType aType, const RotationType &rot=RotationType())
 
template<class T >
void update (T)=delete
 
 ~AlignableComposite () override
 deleting its components More...
 
- Public Member Functions inherited from Alignable
 Alignable (align::ID, const AlignableSurface &)
 
 Alignable (align::ID, const RotationType &)
 
AlignmentParametersalignmentParameters () const
 Get the AlignmentParameters. 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...
 
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 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 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...
 

Protected Member Functions

 AlignableComposite (const GeomDet *geomDet)
 Constructor from GeomDet, only for use in AlignableDet. More...
 
void setSurface (const AlignableSurface &s)
 
void update (const GeomDet *geomDet)
 
- Protected Member Functions inherited from Alignable
void addDisplacement (const GlobalVector &displacement)
 
void addRotation (const RotationType &rotation)
 
virtual void updateMother (const GlobalVector &shift)
 

Protected Attributes

StructureType theStructureType
 
- 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
 

Private Member Functions

 AlignableComposite ()
 default constructor hidden More...
 

Private Attributes

Alignables theComponents
 

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 >
 

Detailed Description

Definition at line 25 of file AlignableComposite.h.

Constructor & Destructor Documentation

◆ AlignableComposite() [1/3]

AlignableComposite::AlignableComposite ( align::ID  id,
StructureType  aType,
const RotationType rot = RotationType() 
)

Constructor for a composite with given rotation. Position can be found from average of daughters' positions later, using addComponent(Alignable*).

Definition at line 21 of file AlignableComposite.cc.

References Alignable::compConstraintType_, and Alignable::POSITION.

24 }
Alignable()
private default ctr. to enforce usage of the specialised ones
Definition: Alignable.h:257
StructureType theStructureType
CompConstraintType compConstraintType_
Definition: Alignable.h:246

◆ ~AlignableComposite()

AlignableComposite::~AlignableComposite ( )
override

deleting its components

Definition at line 27 of file AlignableComposite.cc.

References mps_fire::i, and theComponents.

27  {
28  for (unsigned int i = 0; i < theComponents.size(); ++i)
29  delete theComponents[i];
30 }

◆ AlignableComposite() [2/3]

AlignableComposite::AlignableComposite ( const GeomDet geomDet)
explicitprotected

Constructor from GeomDet, only for use in AlignableDet.

Definition at line 15 of file AlignableComposite.cc.

References Alignable::compConstraintType_, and Alignable::POSITION.

18 }
Alignable()
private default ctr. to enforce usage of the specialised ones
Definition: Alignable.h:257
StructureType theStructureType
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
CompConstraintType compConstraintType_
Definition: Alignable.h:246

◆ AlignableComposite() [3/3]

AlignableComposite::AlignableComposite ( )
inlineprivate

default constructor hidden

Definition at line 118 of file AlignableComposite.h.

118 : Alignable(0, RotationType()){};
Alignable()
private default ctr. to enforce usage of the specialised ones
Definition: Alignable.h:257
align::RotationType RotationType
Definition: Alignable.h:31

Member Function Documentation

◆ addAlignmentPositionError()

void AlignableComposite::addAlignmentPositionError ( const AlignmentPositionError ape,
bool  propagateDown 
)
overridevirtual

Add the AlignmentPositionError (if this Alignable is a Det) and, if (propagateDown), add to all the components of the composite

Implements Alignable.

Reimplemented in AlignableDet.

Definition at line 160 of file AlignableComposite.cc.

References components(), and mps_fire::i.

Referenced by AlignableDet::addAlignmentPositionError().

160  {
161  // Since no geomDet is attached, alignable composites do not have an APE
162  // The APE is, therefore, just propagated down
163  if (!propagateDown)
164  return;
165 
166  for (const auto& i : this->components()) {
167  i->addAlignmentPositionError(ape, propagateDown);
168  }
169 }
const Alignables & components() const override
Return vector of direct components.

◆ addAlignmentPositionErrorFromLocalRotation()

void AlignableComposite::addAlignmentPositionErrorFromLocalRotation ( const RotationType rot,
bool  propagateDown 
)
overridevirtual

Add the AlignmentPositionError resulting from local rotation (if this Alignable is a Det) and, if (propagateDown), add to all the components of the composite

Adds the AlignmentPositionError (in x,y,z coordinates) that would result on the various components from a possible Rotation of a composite the rotation matrix is in interpreted in LOCAL coordinates of the composite

Implements Alignable.

Definition at line 203 of file AlignableComposite.cc.

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

203  {
204  // if (!propagateDown) return; // No! Cannot yet jump out since
205  // addAlignmentPositionErrorFromRotation(..) below might be overwritten in derived
206  // classes to do something on 'this' (and in fact does so in AlignableDet).
207 
209  this->addAlignmentPositionErrorFromRotation(globalRot, propagateDown);
210 }
void addAlignmentPositionErrorFromRotation(const RotationType &rotation, bool propagateDown) override
Basic3DVector< T > multiplyInverse(const Basic3DVector< T > &v) const
align::RotationType RotationType
Definition: Alignable.h:31
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:138

◆ addAlignmentPositionErrorFromRotation()

void AlignableComposite::addAlignmentPositionErrorFromRotation ( const RotationType rotation,
bool  propagateDown 
)
overridevirtual

Add the AlignmentPositionError resulting from global rotation (if this Alignable is a Det) and, if (propagateDown), add to all the components of the composite

Adds the AlignmentPositionError (in x,y,z coordinates) that would result on the various components from a possible Rotation of a composite the rotation matrix is in interpreted in GLOBAL coordinates

Implements Alignable.

Reimplemented in AlignableDet.

Definition at line 175 of file AlignableComposite.cc.

References PV3DBase< T, PVType, FrameType >::basicVector(), components(), Alignable::globalPosition(), mps_fire::i, TkRotation< T >::multiplyInverse(), and Alignable::rotation().

Referenced by addAlignmentPositionErrorFromLocalRotation(), and AlignableDet::addAlignmentPositionErrorFromRotation().

175  {
176  if (!propagateDown)
177  return;
178 
179  PositionType myPosition = this->globalPosition();
180 
181  for (const auto& i : this->components()) {
182  // It is just similar to to the "movement" that results to the components
183  // when the composite is rotated.
184  // Local Position given in coordinates of the GLOBAL Frame
185  const GlobalVector localPositionVector = i->globalPosition() - myPosition;
186  const GlobalVector::BasicVectorType& lpvgf = localPositionVector.basicVector();
187 
188  // rotate with GLOBAL rotation matrix and subtract => moveVector in global coordinates
189  // apparently... you have to use the inverse of the rotation here
190  // (rotate the VECTOR rather than the frame)
191  GlobalVector moveVector(rotation.multiplyInverse(lpvgf) - lpvgf);
192 
193  AlignmentPositionError ape(moveVector.x(), moveVector.y(), moveVector.z());
194  i->addAlignmentPositionError(ape, propagateDown);
195  i->addAlignmentPositionErrorFromRotation(rotation, propagateDown);
196  }
197 }
const Alignables & components() const override
Return vector of direct components.
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:135
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
Basic3DVector< T > multiplyInverse(const Basic3DVector< T > &v) const
align::PositionType PositionType
Definition: Alignable.h:30
const RotationType & rotation() const
Return change of orientation since the creation of the object.
Definition: Alignable.h:144

◆ addComponent()

void AlignableComposite::addComponent ( Alignable component)
finalvirtual

Add a component and set its mother to this alignable. (Note: The component will be adopted, e.g. later deleted.) Also find average position of this composite from its modules' positions.

Implements Alignable.

Definition at line 53 of file AlignableComposite.cc.

References Alignable::deepComponents(), Alignable::globalPosition(), dqmdumpme::k, GloballyPositioned< T >::move(), Alignable::setMother(), theComponents, Alignable::theDeepComponents, and Alignable::theSurface.

Referenced by AlignableCSCEndcap::AlignableCSCEndcap(), AlignableCSCRing::AlignableCSCRing(), AlignableCSCStation::AlignableCSCStation(), AlignableDet::AlignableDet(), AlignableDTBarrel::AlignableDTBarrel(), AlignableDTChamber::AlignableDTChamber(), AlignableDTStation::AlignableDTStation(), AlignableDTWheel::AlignableDTWheel(), AlignableGEMEndcap::AlignableGEMEndcap(), AlignableGEMRing::AlignableGEMRing(), AlignableGEMStation::AlignableGEMStation(), AlignableGEMSuperChamber::AlignableGEMSuperChamber(), AlignableTrackerBuilder::buildPixelDetector(), and AlignableTrackerBuilder::buildStripDetector().

53  {
54  const auto& newComps = ali->deepComponents();
55 
56  theDeepComponents.insert(theDeepComponents.end(), newComps.begin(), newComps.end());
57 
58  Scalar k = static_cast<Scalar>(newComps.size()) / theDeepComponents.size();
59 
60  theSurface.move((ali->globalPosition() - globalPosition()) * k);
61 
62  ali->setMother(this);
63  theComponents.push_back(ali);
64 }
void move(const GlobalVector &displacement)
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:135
align::Scalar Scalar
Definition: Alignable.h:29
AlignableSurface theSurface
Definition: Alignable.h:237
Alignables theDeepComponents
Definition: Alignable.h:248

◆ addSurfaceDeformation()

void AlignableComposite::addSurfaceDeformation ( const SurfaceDeformation deformation,
bool  propagateDown 
)
overridevirtual

Add the surface deformation parameters to the existing ones, if (!propagateDown) do not affect daughters.

Implements Alignable.

Definition at line 225 of file AlignableComposite.cc.

References components(), and mps_fire::i.

225  {
226  // Only DetUnits have surface deformations.
227  // The parameters are, therefore, just propagated down.
228  if (!propagateDown)
229  return;
230 
231  for (const auto& i : this->components()) {
232  i->addSurfaceDeformation(deformation, propagateDown);
233  }
234 }
const Alignables & components() const override
Return vector of direct components.

◆ alignableObjectId()

StructureType AlignableComposite::alignableObjectId ( ) const
inlineoverridevirtual

Return the alignable type identifier.

Implements Alignable.

Definition at line 86 of file AlignableComposite.h.

References theStructureType.

Referenced by dump(), and recursiveComponents().

86 { return theStructureType; }
StructureType theStructureType

◆ alignmentErrors()

AlignmentErrorsExtended * AlignableComposite::alignmentErrors ( void  ) const
overridevirtual

Return vector of alignment errors.

Implements Alignable.

Reimplemented in AlignableMuon, AlignableTracker, AlignableCSCEndcap, AlignableDTBarrel, AlignableDet, and AlignableGEMEndcap.

Definition at line 269 of file AlignableComposite.cc.

References components(), filterCSVwithJSON::copy, mps_fire::i, and AlignmentErrorsExtended::m_alignError.

Referenced by AlignableDet::alignmentErrors().

269  {
270  // Recursively call alignmentsErrors, until we get to an AlignableDetUnit
271 
272  AlignmentErrorsExtended* m_alignmentErrors = new AlignmentErrorsExtended();
273 
274  // Add components recursively
275  for (const auto& i : this->components()) {
276  std::unique_ptr<AlignmentErrorsExtended> tmpAlignmentErrorsExtended{i->alignmentErrors()};
277  std::copy(tmpAlignmentErrorsExtended->m_alignError.begin(),
278  tmpAlignmentErrorsExtended->m_alignError.end(),
279  std::back_inserter(m_alignmentErrors->m_alignError));
280  }
281 
282  return m_alignmentErrors;
283 }
const Alignables & components() const override
Return vector of direct components.
std::vector< AlignTransformErrorExtended > m_alignError

◆ alignments()

Alignments * AlignableComposite::alignments ( void  ) const
overridevirtual

Return alignment data.

Implements Alignable.

Reimplemented in AlignableMuon, AlignableTracker, AlignableCSCEndcap, AlignableDTBarrel, AlignableDet, AlignableGEMEndcap, and AlignableSiStripDet.

Definition at line 254 of file AlignableComposite.cc.

References components(), filterCSVwithJSON::copy, mps_fire::i, and Alignments::m_align.

Referenced by AlignableDet::alignments().

254  {
255  // Recursively call alignments, until we get to an AlignableDetUnit
256 
257  Alignments* m_alignments = new Alignments();
258 
259  // Add components recursively
260  for (const auto& i : this->components()) {
261  std::unique_ptr<Alignments> tmpAlignments{i->alignments()};
262  std::copy(tmpAlignments->m_align.begin(), tmpAlignments->m_align.end(), std::back_inserter(m_alignments->m_align));
263  }
264 
265  return m_alignments;
266 }
const Alignables & components() const override
Return vector of direct components.
std::vector< AlignTransform > m_align
Definition: Alignments.h:19

◆ components()

const Alignables& AlignableComposite::components ( ) const
inlineoverridevirtual

◆ dump()

void AlignableComposite::dump ( void  ) const
overridevirtual

Recursive printout of alignable structure.

Implements Alignable.

Reimplemented in AlignableCSCRing, AlignableCSCStation, AlignableCSCEndcap, AlignableDTBarrel, AlignableDTStation, AlignableDTWheel, AlignableGEMStation, AlignableGEMEndcap, and AlignableGEMRing.

Definition at line 237 of file AlignableComposite.cc.

References alignableObjectId(), AlCaHLTBitMon_QueryRunRegistry::comp, components(), Alignable::globalPosition(), Alignable::globalRotation(), and mps_fire::i.

237  {
238  // A simple printout method. Could be specialized in the implementation classes.
239 
240  const auto& comp = this->components();
241 
242  // Dump this
243  edm::LogInfo("AlignableDump") << " Alignable of type " << this->alignableObjectId() << " has " << comp.size()
244  << " components" << std::endl
245  << " position = " << this->globalPosition() << ", orientation:" << std::endl
246  << this->globalRotation();
247 
248  // Dump components
249  for (const auto& i : comp)
250  i->dump();
251 }
StructureType alignableObjectId() const override
Return the alignable type identifier.
const Alignables & components() const override
Return vector of direct components.
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:135
Log< level::Info, false > LogInfo
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:138

◆ move()

void AlignableComposite::move ( const GlobalVector displacement)
overridevirtual

Move with respect to the global reference frame.

Implements Alignable.

Definition at line 80 of file AlignableComposite.cc.

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

Referenced by moveComponentsLocal().

80  {
81  // Move components
82  for (const auto& i : this->components())
83  i->move(displacement);
84 
85  // Move surface
86  this->addDisplacement(displacement);
88 }
const Alignables & components() const override
Return vector of direct components.
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

◆ moveComponentLocal()

void AlignableComposite::moveComponentLocal ( const int  i,
const LocalVector localDisplacement 
)
virtual

Move a single component with respect to the local reference frame.

Definition at line 96 of file AlignableComposite.cc.

References AlCaHLTBitMon_QueryRunRegistry::comp, components(), Exception, mps_fire::i, Alignable::size(), and Alignable::surface().

96  {
97  if (i >= size())
98  throw cms::Exception("LogicError") << "AlignableComposite index (" << i << ") out of range";
99 
100  const auto& comp = this->components();
101  comp[i]->move(this->surface().toGlobal(localDisplacement));
102 }
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:132
const Alignables & components() const override
Return vector of direct components.
int size() const
Return number of direct components.
Definition: Alignable.h:68

◆ moveComponentsLocal()

void AlignableComposite::moveComponentsLocal ( const LocalVector localDisplacement)
virtual

Move with respect to the local reference frame.

Definition at line 91 of file AlignableComposite.cc.

References move(), and Alignable::surface().

91  {
92  this->move(this->surface().toGlobal(localDisplacement));
93 }
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:132
void move(const GlobalVector &displacement) override
Move with respect to the global reference frame.

◆ recursiveComponents()

void AlignableComposite::recursiveComponents ( Alignables result) const
override

Provide all components, subcomponents etc. (cf. description in base class)

Definition at line 67 of file AlignableComposite.cc.

References align::AlignableDet, alignableObjectId(), components(), and mps_fire::result.

67  {
68  const auto& components = this->components();
69  if (this->alignableObjectId() == align::AlignableDet &&
70  components.size() <= 1) { // Non-glued AlignableDets (still) contain themselves
71  return; // (would be better to implement AlignableDet::recursiveComponents!)
72  }
73  for (const auto& iter : components) {
74  result.push_back(iter); // could use std::copy(..), but here we build a real hierarchy
75  iter->recursiveComponents(result);
76  }
77 }
StructureType alignableObjectId() const override
Return the alignable type identifier.
const Alignables & components() const override
Return vector of direct components.

◆ rotateInGlobalFrame()

void AlignableComposite::rotateInGlobalFrame ( const RotationType rotation)
overridevirtual

Rotation interpreted in global reference frame.

Rotation intepreted such, that the orientation of the rotation axis is w.r.t. to the global coordinate system. This, however, does NOT mean the center of the rotation. This is simply taken as the center of the Alignable-object

Implements Alignable.

Definition at line 109 of file AlignableComposite.cc.

References Alignable::addRotation(), PV3DBase< T, PVType, FrameType >::basicVector(), AlCaHLTBitMon_QueryRunRegistry::comp, components(), Alignable::globalPosition(), mps_fire::i, TkRotation< T >::multiplyInverse(), GloballyPositioned< T >::rotate(), Alignable::rotation(), and Alignable::theSurface.

109  {
110  const auto& comp = this->components();
111 
112  PositionType myPosition = this->globalPosition();
113 
114  for (const auto& i : comp) {
115  // It is much simpler to calculate the local position given in coordinates
116  // of the GLOBAL frame and then just apply the rotation matrix given in the
117  // GLOBAL frame as well. ONLY this is somewhat tricky... as Teddy's frames
118  // don't like this kind of mixing...
119 
120  // Rotations are defined for "Basic3DVector" types, without any FrameTAG,
121  // because Rotations usually switch between different frames. You get
122  // this by using the method .basicVector()
123 
124  // localPosition = globalPosition (Component) - globalPosition(Composite)
125  // moveVector = rotated localPosition - original localposition
126  // LocalVector localPositionVector = (**i).globalPosition()-myPosition;
127 
128  // Local Position given in coordinates of the GLOBAL Frame
129  const GlobalVector localPositionVector = i->globalPosition() - myPosition;
130  const GlobalVector::BasicVectorType& lpvgf = localPositionVector.basicVector();
131 
132  // rotate with GLOBAL rotation matrix and subtract => moveVector in
133  // global Coordinates
134  // apparently... you have to use the inverse of the rotation here
135  // (rotate the VECTOR rather than the frame)
136  GlobalVector moveVector(rotation.multiplyInverse(lpvgf) - lpvgf);
137 
138  i->move(moveVector);
139  i->rotateInGlobalFrame(rotation);
140  }
141 
142  this->addRotation(rotation);
143 
145 }
const Alignables & components() const override
Return vector of direct components.
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:135
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
Basic3DVector< T > multiplyInverse(const Basic3DVector< T > &v) const
void addRotation(const RotationType &rotation)
Definition: Alignable.cc:193
align::PositionType PositionType
Definition: Alignable.h:30
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 AlignableComposite::setAlignmentPositionError ( const AlignmentPositionError ape,
bool  propagateDown 
)
overridevirtual

Set the AlignmentPositionError (if this Alignable is a Det) and, if (propagateDown), to all the components of the composite

Implements Alignable.

Reimplemented in AlignableDet.

Definition at line 148 of file AlignableComposite.cc.

References components(), and mps_fire::i.

Referenced by AlignableDet::setAlignmentPositionError().

148  {
149  // Since no geomDet is attached, alignable composites do not have an APE
150  // The APE is, therefore, just propagated down
151  if (!propagateDown)
152  return;
153 
154  for (const auto& i : this->components()) {
155  i->setAlignmentPositionError(ape, propagateDown);
156  }
157 }
const Alignables & components() const override
Return vector of direct components.

◆ setSurface()

void AlignableComposite::setSurface ( const AlignableSurface s)
inlineprotected

◆ setSurfaceDeformation()

void AlignableComposite::setSurfaceDeformation ( const SurfaceDeformation deformation,
bool  propagateDown 
)
overridevirtual

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

Implements Alignable.

Definition at line 213 of file AlignableComposite.cc.

References components(), and mps_fire::i.

213  {
214  // Only DetUnits have surface deformations.
215  // The parameters are, therefore, just propagated down.
216  if (!propagateDown)
217  return;
218 
219  for (const auto& i : this->components()) {
220  i->setSurfaceDeformation(deformation, propagateDown);
221  }
222 }
const Alignables & components() const override
Return vector of direct components.

◆ surfaceDeformationIdPairs()

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

Return surface deformations.

Implements Alignable.

Definition at line 286 of file AlignableComposite.cc.

References components(), submitPVResolutionJobs::count, mps_fire::i, and mps_fire::result.

286  {
287  int count = 0;
288 
289  // Add components recursively
290  for (const auto& i : this->components()) {
291  count += i->surfaceDeformationIdPairs(result);
292  }
293 
294  return count;
295 }
const Alignables & components() const override
Return vector of direct components.

◆ update() [1/3]

void AlignableComposite::update ( align::ID  id,
StructureType  aType,
const RotationType rot = RotationType() 
)

Updater for a composite with given rotation. The given id and structure type have to match the current ones.

Definition at line 43 of file AlignableComposite.cc.

References Exception, Alignable::globalPosition(), theStructureType, and Alignable::update().

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

43  {
44  if (theStructureType != type) {
45  throw cms::Exception("Alignment") << "@SUB=AlignableComposite::update\n"
46  << "Current alignable type does not match type of the update.";
47  }
48  // composite's position is already updated by components, i.e. it needs to be kept
50 }
void update(align::ID, const AlignableSurface &)
Definition: Alignable.cc:45
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:135
StructureType theStructureType

◆ update() [2/3]

template<class T >
void AlignableComposite::update ( T  )
delete

◆ update() [3/3]

void AlignableComposite::update ( const GeomDet geomDet)
protected

Updater from GeomDet, only for use in AlignableDet The given GeomDetUnit id has to match the current id.

Definition at line 33 of file AlignableComposite.cc.

References Exception, GeomDet::geographicalId(), DetId::rawId(), GeomDet::surface(), and Alignable::update().

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

33  {
34  if (!geomDet) {
35  throw cms::Exception("Alignment") << "@SUB=AlignableComposite::update\n"
36  << "Trying to update with GeomDet* pointing to 'nullptr'.";
37  }
38 
39  Alignable::update(geomDet->geographicalId().rawId(), geomDet->surface());
40 }
void update(align::ID, const AlignableSurface &)
Definition: Alignable.cc:45
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

Member Data Documentation

◆ theComponents

Alignables AlignableComposite::theComponents
private

Definition at line 118 of file AlignableComposite.h.

Referenced by addComponent(), components(), and ~AlignableComposite().

◆ theStructureType

StructureType AlignableComposite::theStructureType
protected