CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

virtual void addAlignmentPositionError (const AlignmentPositionError &ape, bool propagateDown)
 
virtual void addAlignmentPositionErrorFromLocalRotation (const RotationType &rotation, bool propagateDown)
 
virtual void addAlignmentPositionErrorFromRotation (const RotationType &rotation, bool propagateDown)
 
virtual void addComponent (Alignable *component)
 
virtual void addSurfaceDeformation (const SurfaceDeformation *deformation, bool propagateDown)
 
 AlignableComposite (align::ID id, StructureType aType, const RotationType &rot=RotationType())
 
virtual StructureType alignableObjectId () const
 Return the alignable type identifier. More...
 
virtual AlignmentErrorsExtendedalignmentErrors () const
 Return vector of alignment errors. More...
 
virtual Alignmentsalignments () const
 Return alignment data. More...
 
virtual Alignables components () const
 Return vector of direct components. More...
 
virtual void dump () const
 Recursive printout of alignable structure. More...
 
virtual void move (const GlobalVector &displacement)
 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...
 
virtual void recursiveComponents (Alignables &result) const
 Provide all components, subcomponents etc. (cf. description in base class) More...
 
virtual void rotateInGlobalFrame (const RotationType &rotation)
 Rotation interpreted in global reference frame. More...
 
virtual void setAlignmentPositionError (const AlignmentPositionError &ape, bool propagateDown)
 
virtual void setSurfaceDeformation (const SurfaceDeformation *deformation, bool propagateDown)
 Set the surface deformation parameters - if (!propagateDown) do not affect daughters. More...
 
virtual int surfaceDeformationIdPairs (std::vector< std::pair< int, SurfaceDeformation * > > &) const
 Return surface deformations. More...
 
virtual ~AlignableComposite ()
 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...
 
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...
 
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 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...
 
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)
 
- Protected Member Functions inherited from Alignable
void addDisplacement (const GlobalVector &displacement)
 
void addRotation (const RotationType &rotation)
 

Protected Attributes

StructureType theStructureType
 
- Protected Attributes inherited from Alignable
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
 
typedef align::GlobalVector GlobalVector
 
typedef align::LocalVector LocalVector
 
typedef align::PositionType PositionType
 
typedef align::RotationType RotationType
 
typedef align::Scalar Scalar
 
typedef align::StructureType StructureType
 

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

22  :
23  Alignable(id, rot),
25 {
26 }
type
Definition: HCALResponse.h:21
Alignable()
private default ctr. to enforce usage of the specialised ones
Definition: Alignable.h:236
StructureType theStructureType
AlignableComposite::~AlignableComposite ( )
virtual

deleting its components

Definition at line 28 of file AlignableComposite.cc.

References i, and theComponents.

29 {
30  for (unsigned int i = 0; i < theComponents.size(); ++i) delete theComponents[i];
31 }
int i
Definition: DBlmapReader.cc:9
AlignableComposite::AlignableComposite ( const GeomDet geomDet)
explicitprotected

Constructor from GeomDet, only for use in AlignableDet.

Definition at line 14 of file AlignableComposite.cc.

14  :
15  Alignable( geomDet->geographicalId().rawId(), geomDet->surface() ),
17 {
18 }
Alignable()
private default ctr. to enforce usage of the specialised ones
Definition: Alignable.h:236
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:40
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:77
AlignableComposite::AlignableComposite ( )
inlineprivate

default constructor hidden

Definition at line 110 of file AlignableComposite.h.

Referenced by AlignableTracker::buildBarrel(), and AlignableTracker::buildTRK().

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

Member Function Documentation

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

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

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

Referenced by AlignableDet::addAlignmentPositionError().

173 {
174 
175  // Since no geomDet is attached, alignable composites do not have an APE
176  // The APE is, therefore, just propagated down
177  if (!propagateDown) return;
178 
179  Alignables comp = this->components();
180  for (Alignables::const_iterator i = comp.begin(); i != comp.end(); ++i) {
181  (*i)->addAlignmentPositionError(ape, propagateDown);
182  }
183 
184 }
int i
Definition: DBlmapReader.cc:9
std::vector< Alignable * > Alignables
Definition: Alignable.h:246
virtual Alignables components() const
Return vector of direct components.
void AlignableComposite::addAlignmentPositionErrorFromLocalRotation ( const RotationType rot,
bool  propagateDown 
)
virtual

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

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

229 {
230  // if (!propagateDown) return; // No! Cannot yet jump out since
231  // addAlignmentPositionErrorFromRotation(..) below might be overwritten in derived
232  // classes to do something on 'this' (and in fact does so in AlignableDet).
233 
235  this->addAlignmentPositionErrorFromRotation(globalRot, propagateDown);
236 
237 }
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:132
align::RotationType RotationType
Definition: Alignable.h:36
virtual void addAlignmentPositionErrorFromRotation(const RotationType &rotation, bool propagateDown)
Basic3DVector< T > multiplyInverse(const Basic3DVector< T > &v) const
void AlignableComposite::addAlignmentPositionErrorFromRotation ( const RotationType rotation,
bool  propagateDown 
)
virtual

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

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

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

193 {
194 
195  if (!propagateDown) return;
196 
197  Alignables comp = this->components();
198  PositionType myPosition=this->globalPosition();
199 
200  for ( Alignables::const_iterator i=comp.begin(); i!=comp.end(); i++ )
201  {
202 
203  // It is just similar to to the "movement" that results to the components
204  // when the composite is rotated.
205  // Local Position given in coordinates of the GLOBAL Frame
206  const GlobalVector localPositionVector = (**i).globalPosition()-myPosition;
207  GlobalVector::BasicVectorType lpvgf = localPositionVector.basicVector();
208 
209  // rotate with GLOBAL rotation matrix and subtract => moveVector in global coordinates
210  // apparently... you have to use the inverse of the rotation here
211  // (rotate the VECTOR rather than the frame)
212  GlobalVector moveVector( rotation.multiplyInverse(lpvgf) - lpvgf );
213 
214  AlignmentPositionError ape( moveVector.x(), moveVector.y(), moveVector.z() );
215  (*i)->addAlignmentPositionError( ape, propagateDown );
216  (*i)->addAlignmentPositionErrorFromRotation( rotation, propagateDown );
217 
218  }
219 
220 }
int i
Definition: DBlmapReader.cc:9
std::vector< Alignable * > Alignables
Definition: Alignable.h:246
const RotationType & rotation() const
Return change of orientation since the creation of the object.
Definition: Alignable.h:138
align::PositionType PositionType
Definition: Alignable.h:35
virtual Alignables components() const
Return vector of direct components.
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:129
Basic3DVector< T > multiplyInverse(const Basic3DVector< T > &v) const
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
void AlignableComposite::addComponent ( Alignable component)
virtual

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

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

Referenced by AlignableDet::AlignableDet(), AlignableDTChamber::AlignableDTChamber(), and AlignableTracker::buildTRK().

34 {
35  const Alignables& newComps = ali->deepComponents();
36 
37  theDeepComponents.insert( theDeepComponents.end(), newComps.begin(), newComps.end() );
38 
39  Scalar k = static_cast<Scalar>( newComps.size() ) / theDeepComponents.size();
40 
41  theSurface.move( ( ali->globalPosition() - globalPosition() ) * k );
42 
43  ali->setMother(this);
44  theComponents.push_back(ali);
45 }
std::vector< Alignable * > Alignables
Definition: Alignable.h:246
void move(const GlobalVector &displacement)
align::Scalar Scalar
Definition: Alignable.h:34
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:129
AlignableSurface theSurface
Definition: Alignable.h:222
Alignables theDeepComponents
Definition: Alignable.h:231
void AlignableComposite::addSurfaceDeformation ( const SurfaceDeformation deformation,
bool  propagateDown 
)
virtual

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

Implements Alignable.

Definition at line 254 of file AlignableComposite.cc.

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

256 {
257  // Only DetUnits have surface deformations.
258  // The parameters are, therefore, just propagated down.
259  if (!propagateDown) return;
260 
261  Alignables comp(this->components());
262  for (Alignables::const_iterator i = comp.begin(); i != comp.end(); ++i) {
263  (*i)->addSurfaceDeformation(deformation, propagateDown);
264  }
265 }
int i
Definition: DBlmapReader.cc:9
std::vector< Alignable * > Alignables
Definition: Alignable.h:246
virtual Alignables components() const
Return vector of direct components.
virtual StructureType AlignableComposite::alignableObjectId ( ) const
inlinevirtual

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
AlignmentErrorsExtended * AlignableComposite::alignmentErrors ( void  ) const
virtual

Return vector of alignment errors.

Implements Alignable.

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

Definition at line 315 of file AlignableComposite.cc.

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

Referenced by AlignableDet::alignmentErrors().

316 {
317 
318  // Recursively call alignmentsErrors, until we get to an AlignableDetUnit
319  Alignables comp = this->components();
320 
321  AlignmentErrorsExtended* m_alignmentErrors = new AlignmentErrorsExtended();
322 
323  // Add components recursively
324  for ( Alignables::iterator i=comp.begin(); i!=comp.end(); i++ )
325  {
326  AlignmentErrorsExtended* tmpAlignmentErrorsExtended = (*i)->alignmentErrors();
327  std::copy( tmpAlignmentErrorsExtended->m_alignError.begin(), tmpAlignmentErrorsExtended->m_alignError.end(),
328  std::back_inserter(m_alignmentErrors->m_alignError) );
329  delete tmpAlignmentErrorsExtended;
330  }
331 
332 
333  return m_alignmentErrors;
334 
335 }
int i
Definition: DBlmapReader.cc:9
std::vector< Alignable * > Alignables
Definition: Alignable.h:246
std::vector< AlignTransformErrorExtended > m_alignError
virtual Alignables components() const
Return vector of direct components.
Alignments * AlignableComposite::alignments ( void  ) const
virtual

Return alignment data.

Implements Alignable.

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

Definition at line 291 of file AlignableComposite.cc.

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

Referenced by AlignableDet::alignments().

292 {
293 
294  // Recursively call alignments, until we get to an AlignableDetUnit
295  Alignables comp = this->components();
296 
297  Alignments* m_alignments = new Alignments();
298 
299  // Add components recursively
300  for ( Alignables::iterator i=comp.begin(); i!=comp.end(); i++ )
301  {
302  Alignments* tmpAlignments = (*i)->alignments();
303  std::copy( tmpAlignments->m_align.begin(), tmpAlignments->m_align.end(),
304  std::back_inserter(m_alignments->m_align) );
305  delete tmpAlignments;
306  }
307 
308 
309  return m_alignments;
310 
311 }
int i
Definition: DBlmapReader.cc:9
std::vector< Alignable * > Alignables
Definition: Alignable.h:246
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
virtual Alignables components() const
Return vector of direct components.
virtual Alignables AlignableComposite::components ( ) const
inlinevirtual
void AlignableComposite::dump ( void  ) const
virtual

Recursive printout of alignable structure.

Implements Alignable.

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

Definition at line 268 of file AlignableComposite.cc.

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

269 {
270 
271  // A simple printout method. Could be specialized in the implementation classes.
272 
273  Alignables comp = this->components();
274 
275  // Dump this
276  edm::LogInfo("AlignableDump")
277  << " Alignable of type " << this->alignableObjectId()
278  << " has " << comp.size() << " components" << std::endl
279  << " position = " << this->globalPosition() << ", orientation:" << std::endl
280  << this->globalRotation();
281 
282  // Dump components
283  for ( Alignables::iterator i=comp.begin(); i!=comp.end(); i++ )
284  (*i)->dump();
285 
286 }
int i
Definition: DBlmapReader.cc:9
std::vector< Alignable * > Alignables
Definition: Alignable.h:246
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:132
virtual StructureType alignableObjectId() const
Return the alignable type identifier.
virtual Alignables components() const
Return vector of direct components.
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:129
void AlignableComposite::move ( const GlobalVector displacement)
virtual

Move with respect to the global reference frame.

Implements Alignable.

Definition at line 64 of file AlignableComposite.cc.

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

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

65 {
66 
67  // Move components
68  Alignables comp = this->components();
69  for ( Alignables::iterator i=comp.begin(); i!=comp.end(); i++ )
70  (**i).move( displacement);
71 
72  // Move surface
73  this->addDisplacement( displacement );
74  theSurface.move( displacement );
75 
76 }
int i
Definition: DBlmapReader.cc:9
std::vector< Alignable * > Alignables
Definition: Alignable.h:246
void move(const GlobalVector &displacement)
void addDisplacement(const GlobalVector &displacement)
Definition: Alignable.cc:200
virtual Alignables components() const
Return vector of direct components.
AlignableSurface theSurface
Definition: Alignable.h:222
void AlignableComposite::moveComponentLocal ( const int  i,
const LocalVector localDisplacement 
)
virtual

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

Definition at line 88 of file AlignableComposite.cc.

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

89 {
90 
91  if (i >= size() )
92  throw cms::Exception("LogicError")
93  << "AlignableComposite index (" << i << ") out of range";
94 
95  Alignables comp = this->components();
96  comp[i]->move( this->surface().toGlobal( localDisplacement ) );
97 
98 }
int i
Definition: DBlmapReader.cc:9
std::vector< Alignable * > Alignables
Definition: Alignable.h:246
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:126
virtual Alignables components() const
Return vector of direct components.
int size() const
Return number of direct components.
Definition: Alignable.h:67
void AlignableComposite::moveComponentsLocal ( const LocalVector localDisplacement)
virtual

Move with respect to the local reference frame.

Definition at line 80 of file AlignableComposite.cc.

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

81 {
82 
83  this->move( this->surface().toGlobal(localDisplacement) );
84 
85 }
virtual void move(const GlobalVector &displacement)
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:126
void AlignableComposite::recursiveComponents ( Alignables result) const
virtual

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

Implements Alignable.

Definition at line 48 of file AlignableComposite.cc.

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

49 {
50 
53  && components.size() <= 1) { // Non-glued AlignableDets (still) contain themselves
54  return; // (would be better to implement AlignableDet::recursiveComponents!)
55  }
56  for (Alignables::const_iterator iter = components.begin();
57  iter != components.end(); ++iter) {
58  result.push_back(*iter); // could use std::copy(..), but here we build a real hierarchy
59  (*iter)->recursiveComponents(result);
60  }
61 }
std::vector< Alignable * > Alignables
Definition: Alignable.h:246
tuple result
Definition: query.py:137
virtual StructureType alignableObjectId() const
Return the alignable type identifier.
virtual Alignables components() const
Return vector of direct components.
void AlignableComposite::rotateInGlobalFrame ( const RotationType rotation)
virtual

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

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

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

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

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

Referenced by AlignableDet::setAlignmentPositionError(), and KalmanAlignmentAlgorithm::setAPEToZero().

156 {
157 
158  // Since no geomDet is attached, alignable composites do not have an APE
159  // The APE is, therefore, just propagated down
160  if (!propagateDown) return;
161 
162  Alignables comp = this->components();
163  for (Alignables::const_iterator i = comp.begin(); i != comp.end(); ++i) {
164  (*i)->setAlignmentPositionError(ape, propagateDown);
165  }
166 }
int i
Definition: DBlmapReader.cc:9
std::vector< Alignable * > Alignables
Definition: Alignable.h:246
virtual Alignables components() const
Return vector of direct components.
void AlignableComposite::setSurface ( const AlignableSurface s)
inlineprotected
void AlignableComposite::setSurfaceDeformation ( const SurfaceDeformation deformation,
bool  propagateDown 
)
virtual

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

Implements Alignable.

Definition at line 240 of file AlignableComposite.cc.

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

242 {
243  // Only DetUnits have surface deformations.
244  // The parameters are, therefore, just propagated down.
245  if (!propagateDown) return;
246 
247  Alignables comp(this->components());
248  for (Alignables::const_iterator i = comp.begin(); i != comp.end(); ++i) {
249  (*i)->setSurfaceDeformation(deformation, propagateDown);
250  }
251 }
int i
Definition: DBlmapReader.cc:9
std::vector< Alignable * > Alignables
Definition: Alignable.h:246
virtual Alignables components() const
Return vector of direct components.
int AlignableComposite::surfaceDeformationIdPairs ( std::vector< std::pair< int, SurfaceDeformation * > > &  result) const
virtual

Return surface deformations.

Implements Alignable.

Definition at line 339 of file AlignableComposite.cc.

References AlCaHLTBitMon_QueryRunRegistry::comp, components(), prof2calltree::count, i, and query::result.

340 {
341 
342  Alignables comp = this->components();
343 
344  int count = 0;
345 
346  // Add components recursively
347  for ( Alignables::iterator i=comp.begin(); i!=comp.end(); ++i) {
348  count += (*i)->surfaceDeformationIdPairs(result);
349  }
350 
351  return count;
352 
353 }
int i
Definition: DBlmapReader.cc:9
std::vector< Alignable * > Alignables
Definition: Alignable.h:246
tuple result
Definition: query.py:137
virtual Alignables components() const
Return vector of direct components.

Member Data Documentation

Alignables AlignableComposite::theComponents
private

Definition at line 110 of file AlignableComposite.h.

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

StructureType AlignableComposite::theStructureType
protected