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 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())
 
 ~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)
 
template<class T >
void update (T)=delete
 
- 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::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 24 of file AlignableComposite.cc.

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

26  :
27  Alignable(id, rot),
29 {
31 }
type
Definition: HCALResponse.h:21
Alignable()
private default ctr. to enforce usage of the specialised ones
Definition: Alignable.h:267
StructureType theStructureType
CompConstraintType compConstraintType_
Definition: Alignable.h:255
AlignableComposite::~AlignableComposite ( )
override

deleting its components

Definition at line 34 of file AlignableComposite.cc.

References mps_fire::i, and theComponents.

35 {
36  for (unsigned int i = 0; i < theComponents.size(); ++i) delete theComponents[i];
37 }
AlignableComposite::AlignableComposite ( const GeomDet geomDet)
explicitprotected

Constructor from GeomDet, only for use in AlignableDet.

Definition at line 16 of file AlignableComposite.cc.

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

16  :
17  Alignable( geomDet->geographicalId().rawId(), geomDet->surface() ),
19 {
21 }
Alignable()
private default ctr. to enforce usage of the specialised ones
Definition: Alignable.h:267
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
StructureType theStructureType
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
CompConstraintType compConstraintType_
Definition: Alignable.h:255
AlignableComposite::AlignableComposite ( )
inlineprivate

default constructor hidden

Definition at line 123 of file AlignableComposite.h.

Referenced by alignableObjectId().

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

Member Function Documentation

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 200 of file AlignableComposite.cc.

References components(), and mps_fire::i.

Referenced by AlignableDet::addAlignmentPositionError(), and components().

202 {
203 
204  // Since no geomDet is attached, alignable composites do not have an APE
205  // The APE is, therefore, just propagated down
206  if (!propagateDown) return;
207 
208  for (const auto& i: this->components()) {
209  i->addAlignmentPositionError(ape, propagateDown);
210  }
211 }
const Alignables & components() const override
Return vector of direct components.
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 248 of file AlignableComposite.cc.

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

Referenced by components().

250 {
251  // if (!propagateDown) return; // No! Cannot yet jump out since
252  // addAlignmentPositionErrorFromRotation(..) below might be overwritten in derived
253  // classes to do something on 'this' (and in fact does so in AlignableDet).
254 
256  this->addAlignmentPositionErrorFromRotation(globalRot, propagateDown);
257 
258 }
void addAlignmentPositionErrorFromRotation(const RotationType &rotation, bool propagateDown) override
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:141
align::RotationType RotationType
Definition: Alignable.h:34
Basic3DVector< T > multiplyInverse(const Basic3DVector< T > &v) const
void 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 218 of file AlignableComposite.cc.

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

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

220 {
221  if (!propagateDown) return;
222 
223  PositionType myPosition=this->globalPosition();
224 
225  for (const auto& i: this->components()) {
226  // It is just similar to to the "movement" that results to the components
227  // when the composite is rotated.
228  // Local Position given in coordinates of the GLOBAL Frame
229  const GlobalVector localPositionVector = i->globalPosition()-myPosition;
230  const GlobalVector::BasicVectorType& lpvgf = localPositionVector.basicVector();
231 
232  // rotate with GLOBAL rotation matrix and subtract => moveVector in global coordinates
233  // apparently... you have to use the inverse of the rotation here
234  // (rotate the VECTOR rather than the frame)
235  GlobalVector moveVector( rotation.multiplyInverse(lpvgf) - lpvgf );
236 
237  AlignmentPositionError ape( moveVector.x(), moveVector.y(), moveVector.z() );
238  i->addAlignmentPositionError( ape, propagateDown );
239  i->addAlignmentPositionErrorFromRotation( rotation, propagateDown );
240  }
241 }
const Alignables & components() const override
Return vector of direct components.
const RotationType & rotation() const
Return change of orientation since the creation of the object.
Definition: Alignable.h:147
align::PositionType PositionType
Definition: Alignable.h:33
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:138
Basic3DVector< T > multiplyInverse(const Basic3DVector< T > &v) const
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
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 66 of file AlignableComposite.cc.

References Alignable::deepComponents(), Alignable::globalPosition(), gen::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(), AlignableTrackerBuilder::buildPixelDetector(), and AlignableTrackerBuilder::buildStripDetector().

67 {
68  const auto& newComps = ali->deepComponents();
69 
70  theDeepComponents.insert( theDeepComponents.end(), newComps.begin(), newComps.end() );
71 
72  Scalar k = static_cast<Scalar>( newComps.size() ) / theDeepComponents.size();
73 
74  theSurface.move( ( ali->globalPosition() - globalPosition() ) * k );
75 
76  ali->setMother(this);
77  theComponents.push_back(ali);
78 }
void move(const GlobalVector &displacement)
int k[5][pyjets_maxn]
align::Scalar Scalar
Definition: Alignable.h:32
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:138
AlignableSurface theSurface
Definition: Alignable.h:246
Alignables theDeepComponents
Definition: Alignable.h:257
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 274 of file AlignableComposite.cc.

References components(), and mps_fire::i.

Referenced by components().

276 {
277  // Only DetUnits have surface deformations.
278  // The parameters are, therefore, just propagated down.
279  if (!propagateDown) return;
280 
281  for (const auto& i: this->components()) {
282  i->addSurfaceDeformation(deformation, propagateDown);
283  }
284 }
const Alignables & components() const override
Return vector of direct components.
StructureType AlignableComposite::alignableObjectId ( ) const
inlineoverridevirtual

Return the alignable type identifier.

Implements Alignable.

Definition at line 92 of file AlignableComposite.h.

References AlignableComposite(), alignmentErrors(), alignments(), dump(), surfaceDeformationIdPairs(), theStructureType, and update().

Referenced by dump(), and recursiveComponents().

92 { return theStructureType; }
StructureType theStructureType
AlignmentErrorsExtended * AlignableComposite::alignmentErrors ( void  ) const
overridevirtual

Return vector of alignment errors.

Implements Alignable.

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

Definition at line 326 of file AlignableComposite.cc.

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

Referenced by alignableObjectId(), and AlignableDet::alignmentErrors().

327 {
328  // Recursively call alignmentsErrors, until we get to an AlignableDetUnit
329 
330  AlignmentErrorsExtended* m_alignmentErrors = new AlignmentErrorsExtended();
331 
332  // Add components recursively
333  for (const auto& i: this->components()) {
334  std::unique_ptr<AlignmentErrorsExtended> tmpAlignmentErrorsExtended{i->alignmentErrors()};
335  std::copy(tmpAlignmentErrorsExtended->m_alignError.begin(), tmpAlignmentErrorsExtended->m_alignError.end(),
336  std::back_inserter(m_alignmentErrors->m_alignError));
337  }
338 
339  return m_alignmentErrors;
340 }
const Alignables & components() const override
Return vector of direct components.
std::vector< AlignTransformErrorExtended > m_alignError
Alignments * AlignableComposite::alignments ( void  ) const
overridevirtual

Return alignment data.

Implements Alignable.

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

Definition at line 308 of file AlignableComposite.cc.

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

Referenced by alignableObjectId(), and AlignableDet::alignments().

309 {
310  // Recursively call alignments, until we get to an AlignableDetUnit
311 
312  Alignments* m_alignments = new Alignments();
313 
314  // Add components recursively
315  for (const auto& i: this->components()) {
316  std::unique_ptr<Alignments> tmpAlignments{i->alignments()};
317  std::copy(tmpAlignments->m_align.begin(), tmpAlignments->m_align.end(),
318  std::back_inserter(m_alignments->m_align));
319  }
320 
321  return m_alignments;
322 }
const Alignables & components() const override
Return vector of direct components.
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
const Alignables& AlignableComposite::components ( ) const
inlineoverridevirtual
void AlignableComposite::dump ( void  ) const
overridevirtual

Recursive printout of alignable structure.

Implements Alignable.

Reimplemented in AlignableCSCRing, AlignableCSCStation, AlignableCSCEndcap, AlignableDTBarrel, AlignableDTStation, and AlignableDTWheel.

Definition at line 287 of file AlignableComposite.cc.

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

Referenced by alignableObjectId().

288 {
289 
290  // A simple printout method. Could be specialized in the implementation classes.
291 
292  const auto& comp = this->components();
293 
294  // Dump this
295  edm::LogInfo("AlignableDump")
296  << " Alignable of type " << this->alignableObjectId()
297  << " has " << comp.size() << " components" << std::endl
298  << " position = " << this->globalPosition() << ", orientation:" << std::endl
299  << this->globalRotation();
300 
301  // Dump components
302  for (const auto& i: comp) i->dump();
303 }
const Alignables & components() const override
Return vector of direct components.
StructureType alignableObjectId() const override
Return the alignable type identifier.
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:141
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:138
void AlignableComposite::move ( const GlobalVector displacement)
overridevirtual

Move with respect to the global reference frame.

Implements Alignable.

Definition at line 96 of file AlignableComposite.cc.

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

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

97 {
98 
99  // Move components
100  for (const auto& i: this->components()) i->move(displacement);
101 
102  // Move surface
103  this->addDisplacement( displacement );
104  theSurface.move( displacement );
105 
106 }
const Alignables & components() const override
Return vector of direct components.
void move(const GlobalVector &displacement)
void addDisplacement(const GlobalVector &displacement)
Definition: Alignable.cc:247
AlignableSurface theSurface
Definition: Alignable.h:246
void AlignableComposite::moveComponentLocal ( const int  i,
const LocalVector localDisplacement 
)
virtual

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

Definition at line 118 of file AlignableComposite.cc.

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

Referenced by components().

119 {
120 
121  if (i >= size() )
122  throw cms::Exception("LogicError")
123  << "AlignableComposite index (" << i << ") out of range";
124 
125  const auto& comp = this->components();
126  comp[i]->move( this->surface().toGlobal( localDisplacement ) );
127 
128 }
const Alignables & components() const override
Return vector of direct components.
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:135
int size() const
Return number of direct components.
Definition: Alignable.h:71
void AlignableComposite::moveComponentsLocal ( const LocalVector localDisplacement)
virtual

Move with respect to the local reference frame.

Definition at line 110 of file AlignableComposite.cc.

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

Referenced by components().

111 {
112 
113  this->move( this->surface().toGlobal(localDisplacement) );
114 
115 }
void move(const GlobalVector &displacement) override
Move with respect to the global reference frame.
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:135
void AlignableComposite::recursiveComponents ( Alignables result) const
override

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

Definition at line 81 of file AlignableComposite.cc.

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

Referenced by components().

82 {
83 
84  const auto& components = this->components();
86  && components.size() <= 1) { // Non-glued AlignableDets (still) contain themselves
87  return; // (would be better to implement AlignableDet::recursiveComponents!)
88  }
89  for (const auto& iter: components) {
90  result.push_back(iter); // could use std::copy(..), but here we build a real hierarchy
91  iter->recursiveComponents(result);
92  }
93 }
const Alignables & components() const override
Return vector of direct components.
StructureType alignableObjectId() const override
Return the alignable type identifier.
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 136 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(), and Alignable::theSurface.

Referenced by components().

137 {
138 
139  const auto& comp = this->components();
140 
141  PositionType myPosition = this->globalPosition();
142 
143  for (const auto& i: comp)
144  {
145 
146  // It is much simpler to calculate the local position given in coordinates
147  // of the GLOBAL frame and then just apply the rotation matrix given in the
148  // GLOBAL frame as well. ONLY this is somewhat tricky... as Teddy's frames
149  // don't like this kind of mixing...
150 
151  // Rotations are defined for "Basic3DVector" types, without any FrameTAG,
152  // because Rotations usually switch between different frames. You get
153  // this by using the method .basicVector()
154 
155  // localPosition = globalPosition (Component) - globalPosition(Composite)
156  // moveVector = rotated localPosition - original localposition
157  // LocalVector localPositionVector = (**i).globalPosition()-myPosition;
158 
159 
160  // Local Position given in coordinates of the GLOBAL Frame
161  const GlobalVector localPositionVector = i->globalPosition() - myPosition;
162  const GlobalVector::BasicVectorType& lpvgf = localPositionVector.basicVector();
163 
164  // rotate with GLOBAL rotation matrix and subtract => moveVector in
165  // global Coordinates
166  // apparently... you have to use the inverse of the rotation here
167  // (rotate the VECTOR rather than the frame)
168  GlobalVector moveVector( rotation.multiplyInverse(lpvgf) - lpvgf );
169 
170 
171  i->move(moveVector);
172  i->rotateInGlobalFrame(rotation);
173 
174  }
175 
176  this->addRotation( rotation );
177 
179 
180 }
const Alignables & components() const override
Return vector of direct components.
const RotationType & rotation() const
Return change of orientation since the creation of the object.
Definition: Alignable.h:147
void addRotation(const RotationType &rotation)
Definition: Alignable.cc:255
align::PositionType PositionType
Definition: Alignable.h:33
void rotate(const RotationType &rotation)
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:138
Basic3DVector< T > multiplyInverse(const Basic3DVector< T > &v) const
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
AlignableSurface theSurface
Definition: Alignable.h:246
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 184 of file AlignableComposite.cc.

References components(), and mps_fire::i.

Referenced by components(), and AlignableDet::setAlignmentPositionError().

186 {
187 
188  // Since no geomDet is attached, alignable composites do not have an APE
189  // The APE is, therefore, just propagated down
190  if (!propagateDown) return;
191 
192  for (const auto& i: this->components()) {
193  i->setAlignmentPositionError(ape, propagateDown);
194  }
195 }
const Alignables & components() const override
Return vector of direct components.
void AlignableComposite::setSurface ( const AlignableSurface s)
inlineprotected
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 261 of file AlignableComposite.cc.

References components(), and mps_fire::i.

Referenced by components().

263 {
264  // Only DetUnits have surface deformations.
265  // The parameters are, therefore, just propagated down.
266  if (!propagateDown) return;
267 
268  for (const auto& i: this->components()) {
269  i->setSurfaceDeformation(deformation, propagateDown);
270  }
271 }
const Alignables & components() const override
Return vector of direct components.
int AlignableComposite::surfaceDeformationIdPairs ( std::vector< std::pair< int, SurfaceDeformation * > > &  result) const
overridevirtual

Return surface deformations.

Implements Alignable.

Definition at line 344 of file AlignableComposite.cc.

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

Referenced by alignableObjectId().

345 {
346  int count = 0;
347 
348  // Add components recursively
349  for (const auto& i: this->components()) {
350  count += i->surfaceDeformationIdPairs(result);
351  }
352 
353  return count;
354 }
const Alignables & components() const override
Return vector of direct components.
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 52 of file AlignableComposite.cc.

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

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

55 {
56  if (theStructureType != type) {
57  throw cms::Exception("Alignment")
58  << "@SUB=AlignableComposite::update\n"
59  << "Current alignable type does not match type of the update.";
60  }
61  // composite's position is already updated by components, i.e. it needs to be kept
63 }
type
Definition: HCALResponse.h:21
void update(align::ID, const AlignableSurface &)
Definition: Alignable.cc:50
StructureType theStructureType
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:138
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 40 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__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), dqm-mbProfile.Profile::finish(), progressbar.ProgressBar::finish(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

41 {
42  if (!geomDet) {
43  throw cms::Exception("Alignment")
44  << "@SUB=AlignableComposite::update\n"
45  << "Trying to update with GeomDet* pointing to 'nullptr'.";
46  }
47 
48  Alignable::update(geomDet->geographicalId().rawId(), geomDet->surface());
49 }
void update(align::ID, const AlignableSurface &)
Definition: Alignable.cc:50
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
template<class T >
void AlignableComposite::update ( T  )
protecteddelete

Member Data Documentation

Alignables AlignableComposite::theComponents
private

Definition at line 123 of file AlignableComposite.h.

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

StructureType AlignableComposite::theStructureType
protected