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) override
 
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...
 
Alignables components () 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 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 22 of file AlignableComposite.cc.

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

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

deleting its components

Definition at line 32 of file AlignableComposite.cc.

References mps_fire::i, and theComponents.

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

Constructor from GeomDet, only for use in AlignableDet.

Definition at line 14 of file AlignableComposite.cc.

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

14  :
15  Alignable( geomDet->geographicalId().rawId(), geomDet->surface() ),
17 {
19 }
Alignable()
private default ctr. to enforce usage of the specialised ones
Definition: Alignable.h:264
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
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:252
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:264
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 202 of file AlignableComposite.cc.

References AlCaHLTBitMon_QueryRunRegistry::comp, components(), and mps_fire::i.

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

204 {
205 
206  // Since no geomDet is attached, alignable composites do not have an APE
207  // The APE is, therefore, just propagated down
208  if (!propagateDown) return;
209 
210  Alignables comp = this->components();
211  for (Alignables::const_iterator i = comp.begin(); i != comp.end(); ++i) {
212  (*i)->addAlignmentPositionError(ape, propagateDown);
213  }
214 
215 }
std::vector< Alignable * > Alignables
Definition: Alignable.h:274
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 258 of file AlignableComposite.cc.

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

Referenced by components().

260 {
261  // if (!propagateDown) return; // No! Cannot yet jump out since
262  // addAlignmentPositionErrorFromRotation(..) below might be overwritten in derived
263  // classes to do something on 'this' (and in fact does so in AlignableDet).
264 
266  this->addAlignmentPositionErrorFromRotation(globalRot, propagateDown);
267 
268 }
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 222 of file AlignableComposite.cc.

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

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

224 {
225 
226  if (!propagateDown) return;
227 
228  Alignables comp = this->components();
229  PositionType myPosition=this->globalPosition();
230 
231  for ( Alignables::const_iterator i=comp.begin(); i!=comp.end(); ++i )
232  {
233 
234  // It is just similar to to the "movement" that results to the components
235  // when the composite is rotated.
236  // Local Position given in coordinates of the GLOBAL Frame
237  const GlobalVector localPositionVector = (**i).globalPosition()-myPosition;
238  const GlobalVector::BasicVectorType& lpvgf = localPositionVector.basicVector();
239 
240  // rotate with GLOBAL rotation matrix and subtract => moveVector in global coordinates
241  // apparently... you have to use the inverse of the rotation here
242  // (rotate the VECTOR rather than the frame)
243  GlobalVector moveVector( rotation.multiplyInverse(lpvgf) - lpvgf );
244 
245  AlignmentPositionError ape( moveVector.x(), moveVector.y(), moveVector.z() );
246  (*i)->addAlignmentPositionError( ape, propagateDown );
247  (*i)->addAlignmentPositionErrorFromRotation( rotation, propagateDown );
248 
249  }
250 
251 }
std::vector< Alignable * > Alignables
Definition: Alignable.h:274
const RotationType & rotation() const
Return change of orientation since the creation of the object.
Definition: Alignable.h:147
Alignables components() const override
Return vector of direct components.
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)
overridevirtual

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

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

Referenced by AlignableDet::AlignableDet(), AlignableDTChamber::AlignableDTChamber(), AlignableTrackerBuilder::buildPixelDetector(), and AlignableTrackerBuilder::buildStripDetector().

65 {
66  const Alignables& newComps = ali->deepComponents();
67 
68  theDeepComponents.insert( theDeepComponents.end(), newComps.begin(), newComps.end() );
69 
70  Scalar k = static_cast<Scalar>( newComps.size() ) / theDeepComponents.size();
71 
72  theSurface.move( ( ali->globalPosition() - globalPosition() ) * k );
73 
74  ali->setMother(this);
75  theComponents.push_back(ali);
76 }
std::vector< Alignable * > Alignables
Definition: Alignable.h:274
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:243
Alignables theDeepComponents
Definition: Alignable.h:254
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 285 of file AlignableComposite.cc.

References AlCaHLTBitMon_QueryRunRegistry::comp, components(), and mps_fire::i.

Referenced by components().

287 {
288  // Only DetUnits have surface deformations.
289  // The parameters are, therefore, just propagated down.
290  if (!propagateDown) return;
291 
292  Alignables comp(this->components());
293  for (Alignables::const_iterator i = comp.begin(); i != comp.end(); ++i) {
294  (*i)->addSurfaceDeformation(deformation, propagateDown);
295  }
296 }
std::vector< Alignable * > Alignables
Definition: Alignable.h:274
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 346 of file AlignableComposite.cc.

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

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

347 {
348 
349  // Recursively call alignmentsErrors, until we get to an AlignableDetUnit
350  Alignables comp = this->components();
351 
352  AlignmentErrorsExtended* m_alignmentErrors = new AlignmentErrorsExtended();
353 
354  // Add components recursively
355  for ( Alignables::iterator i=comp.begin(); i!=comp.end(); ++i )
356  {
357  AlignmentErrorsExtended* tmpAlignmentErrorsExtended = (*i)->alignmentErrors();
358  std::copy( tmpAlignmentErrorsExtended->m_alignError.begin(), tmpAlignmentErrorsExtended->m_alignError.end(),
359  std::back_inserter(m_alignmentErrors->m_alignError) );
360  delete tmpAlignmentErrorsExtended;
361  }
362 
363 
364  return m_alignmentErrors;
365 
366 }
std::vector< Alignable * > Alignables
Definition: Alignable.h:274
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 322 of file AlignableComposite.cc.

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

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

323 {
324 
325  // Recursively call alignments, until we get to an AlignableDetUnit
326  Alignables comp = this->components();
327 
328  Alignments* m_alignments = new Alignments();
329 
330  // Add components recursively
331  for ( Alignables::iterator i=comp.begin(); i!=comp.end(); ++i )
332  {
333  Alignments* tmpAlignments = (*i)->alignments();
334  std::copy( tmpAlignments->m_align.begin(), tmpAlignments->m_align.end(),
335  std::back_inserter(m_alignments->m_align) );
336  delete tmpAlignments;
337  }
338 
339 
340  return m_alignments;
341 
342 }
std::vector< Alignable * > Alignables
Definition: Alignable.h:274
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
Alignables components() const override
Return vector of direct components.
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 299 of file AlignableComposite.cc.

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

Referenced by alignableObjectId().

300 {
301 
302  // A simple printout method. Could be specialized in the implementation classes.
303 
304  Alignables comp = this->components();
305 
306  // Dump this
307  edm::LogInfo("AlignableDump")
308  << " Alignable of type " << this->alignableObjectId()
309  << " has " << comp.size() << " components" << std::endl
310  << " position = " << this->globalPosition() << ", orientation:" << std::endl
311  << this->globalRotation();
312 
313  // Dump components
314  for ( Alignables::iterator i=comp.begin(); i!=comp.end(); ++i )
315  (*i)->dump();
316 
317 }
std::vector< Alignable * > Alignables
Definition: Alignable.h:274
StructureType alignableObjectId() const override
Return the alignable type identifier.
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:141
Alignables components() const override
Return vector of direct components.
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 95 of file AlignableComposite.cc.

References Alignable::addDisplacement(), AlCaHLTBitMon_QueryRunRegistry::comp, 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().

96 {
97 
98  // Move components
99  Alignables comp = this->components();
100  for ( Alignables::iterator i=comp.begin(); i!=comp.end(); ++i )
101  (**i).move( displacement);
102 
103  // Move surface
104  this->addDisplacement( displacement );
105  theSurface.move( displacement );
106 
107 }
std::vector< Alignable * > Alignables
Definition: Alignable.h:274
void move(const GlobalVector &displacement)
Alignables components() const override
Return vector of direct components.
void addDisplacement(const GlobalVector &displacement)
Definition: Alignable.cc:248
AlignableSurface theSurface
Definition: Alignable.h:243
void AlignableComposite::moveComponentLocal ( const int  i,
const LocalVector localDisplacement 
)
virtual

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

Definition at line 119 of file AlignableComposite.cc.

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

Referenced by components().

120 {
121 
122  if (i >= size() )
123  throw cms::Exception("LogicError")
124  << "AlignableComposite index (" << i << ") out of range";
125 
126  Alignables comp = this->components();
127  comp[i]->move( this->surface().toGlobal( localDisplacement ) );
128 
129 }
std::vector< Alignable * > Alignables
Definition: Alignable.h:274
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 111 of file AlignableComposite.cc.

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

Referenced by components().

112 {
113 
114  this->move( this->surface().toGlobal(localDisplacement) );
115 
116 }
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
overridevirtual

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

Implements Alignable.

Definition at line 79 of file AlignableComposite.cc.

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

Referenced by components().

80 {
81 
84  && components.size() <= 1) { // Non-glued AlignableDets (still) contain themselves
85  return; // (would be better to implement AlignableDet::recursiveComponents!)
86  }
87  for (Alignables::const_iterator iter = components.begin();
88  iter != components.end(); ++iter) {
89  result.push_back(*iter); // could use std::copy(..), but here we build a real hierarchy
90  (*iter)->recursiveComponents(result);
91  }
92 }
std::vector< Alignable * > Alignables
Definition: Alignable.h:274
StructureType alignableObjectId() const override
Return the alignable type identifier.
Alignables components() const override
Return vector of direct components.
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 137 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().

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

References AlCaHLTBitMon_QueryRunRegistry::comp, components(), and mps_fire::i.

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

187 {
188 
189  // Since no geomDet is attached, alignable composites do not have an APE
190  // The APE is, therefore, just propagated down
191  if (!propagateDown) return;
192 
193  Alignables comp = this->components();
194  for (Alignables::const_iterator i = comp.begin(); i != comp.end(); ++i) {
195  (*i)->setAlignmentPositionError(ape, propagateDown);
196  }
197 }
std::vector< Alignable * > Alignables
Definition: Alignable.h:274
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 271 of file AlignableComposite.cc.

References AlCaHLTBitMon_QueryRunRegistry::comp, components(), and mps_fire::i.

Referenced by components().

273 {
274  // Only DetUnits have surface deformations.
275  // The parameters are, therefore, just propagated down.
276  if (!propagateDown) return;
277 
278  Alignables comp(this->components());
279  for (Alignables::const_iterator i = comp.begin(); i != comp.end(); ++i) {
280  (*i)->setSurfaceDeformation(deformation, propagateDown);
281  }
282 }
std::vector< Alignable * > Alignables
Definition: Alignable.h:274
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 370 of file AlignableComposite.cc.

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

Referenced by alignableObjectId().

371 {
372 
373  Alignables comp = this->components();
374 
375  int count = 0;
376 
377  // Add components recursively
378  for ( Alignables::iterator i=comp.begin(); i!=comp.end(); ++i) {
379  count += (*i)->surfaceDeformationIdPairs(result);
380  }
381 
382  return count;
383 
384 }
std::vector< Alignable * > Alignables
Definition: Alignable.h:274
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 50 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().

53 {
54  if (theStructureType != type) {
55  throw cms::Exception("Alignment")
56  << "@SUB=AlignableComposite::update\n"
57  << "Current alignable type does not match type of the update.";
58  }
59  // composite's position is already updated by components, i.e. it needs to be kept
61 }
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 38 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().

39 {
40  if (!geomDet) {
41  throw cms::Exception("Alignment")
42  << "@SUB=AlignableComposite::update\n"
43  << "Trying to update with GeomDet* pointing to 'nullptr'.";
44  }
45 
46  Alignable::update(geomDet->geographicalId().rawId(), geomDet->surface());
47 }
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