CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
AlignableDetUnit Class Reference

#include <AlignableDetUnit.h>

Inheritance diagram for AlignableDetUnit:
Alignable

Public Member Functions

virtual void addAlignmentPositionError (const AlignmentPositionError &ape, bool)
 
virtual void addAlignmentPositionErrorFromLocalRotation (const RotationType &rot, bool)
 
virtual void addAlignmentPositionErrorFromRotation (const RotationType &rot, bool)
 
virtual void addComponent (Alignable *)
 No components here => exception! More...
 
virtual void addSurfaceDeformation (const SurfaceDeformation *deformation, bool)
 Add surface deformation parameters to the existing ones (2nd argument without effect) More...
 
 AlignableDetUnit (const GeomDetUnit *geomDetUnit)
 Constructor from GeomDetUnit - must not be NULL pointer! More...
 
virtual StructureType alignableObjectId () const
 Return the alignable type identifier. More...
 
virtual AlignmentErrorsalignmentErrors () const
 Return vector of alignment errors. More...
 
const AlignmentPositionErroralignmentPositionError () const
 alignment position error - for checking only, otherwise use alignmentErrors() above! More...
 
virtual Alignmentsalignments () const
 Return vector of alignment data. More...
 
virtual Alignables components () const
 Returns a null vector (no components here) More...
 
virtual void dump () const
 Printout information about GeomDet. More...
 
virtual void move (const GlobalVector &displacement)
 Move with respect to the global reference frame. More...
 
virtual void recursiveComponents (Alignables &result) const
 Do nothing (no components here, so no subcomponents either...) More...
 
virtual void rotateInGlobalFrame (const RotationType &rotation)
 Rotation with respect to the global reference frame. More...
 
virtual void setAlignmentPositionError (const AlignmentPositionError &ape, bool)
 Set the AlignmentPositionError (no components => second argument ignored) More...
 
virtual void setSurfaceDeformation (const SurfaceDeformation *deformation, bool)
 Set surface deformation parameters (2nd argument without effect) More...
 
virtual int surfaceDeformationIdPairs (std::vector< std::pair< int, SurfaceDeformation * > > &) const
 Return surface deformations. More...
 
virtual ~AlignableDetUnit ()
 Destructor. More...
 
- Public Member Functions inherited from Alignable
 Alignable (align::ID, const AlignableSurface &)
 
 Alignable (align::ID, const RotationType &)
 
AlignmentParametersalignmentParameters () const
 Get the AlignmentParameters. 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 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...
 
const 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...
 

Private Attributes

AlignmentPositionErrortheAlignmentPositionError
 
SurfaceDeformationtheSurfaceDeformation
 

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
 
- Protected Member Functions inherited from Alignable
void addDisplacement (const GlobalVector &displacement)
 
void addRotation (const RotationType &rotation)
 
- Protected Attributes inherited from Alignable
Alignables theDeepComponents
 
DetId theDetId
 
GlobalVector theDisplacement
 
align::ID theId
 
RotationType theRotation
 
AlignableSurface theSurface
 

Detailed Description

A concrete class that allows to (mis)align a DetUnit.

Typically all AlignableComposites have (directly or indirectly) this one as the ultimate component.

Definition at line 13 of file AlignableDetUnit.h.

Constructor & Destructor Documentation

AlignableDetUnit::AlignableDetUnit ( const GeomDetUnit geomDetUnit)

Constructor from GeomDetUnit - must not be NULL pointer!

Definition at line 15 of file AlignableDetUnit.cc.

References GeomDet::alignmentPositionError(), setAlignmentPositionError(), setSurfaceDeformation(), GeomDetUnit::surfaceDeformation(), and Alignable::theDeepComponents.

15  : // rely on non-NULL pointer!
16  Alignable(geomDetUnit->geographicalId().rawId(), geomDetUnit->surface()),
19 {
20  if (geomDetUnit->alignmentPositionError()) { // take over APE from geometry
21  // 2nd argument w/o effect:
22  this->setAlignmentPositionError(*(geomDetUnit->alignmentPositionError()), false);
23  }
24 
25  if (geomDetUnit->surfaceDeformation()) { // take over surface modification
26  // 2nd argument w/o effect:
27  this->setSurfaceDeformation(geomDetUnit->surfaceDeformation(), false);
28  }
29 
30  theDeepComponents.push_back(this);
31 
32 }
virtual AlignmentPositionError * alignmentPositionError() const
Definition: GeomDet.h:81
Alignable()
private default ctr. to enforce usage of the specialised ones
Definition: Alignable.h:226
virtual const SurfaceDeformation * surfaceDeformation() const
Definition: GeomDetUnit.h:37
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
virtual void setSurfaceDeformation(const SurfaceDeformation *deformation, bool)
Set surface deformation parameters (2nd argument without effect)
virtual void setAlignmentPositionError(const AlignmentPositionError &ape, bool)
Set the AlignmentPositionError (no components =&gt; second argument ignored)
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:74
AlignmentPositionError * theAlignmentPositionError
SurfaceDeformation * theSurfaceDeformation
virtual const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:37
Alignables theDeepComponents
Definition: Alignable.h:221
AlignableDetUnit::~AlignableDetUnit ( )
virtual

Destructor.

Definition at line 35 of file AlignableDetUnit.cc.

References theAlignmentPositionError, and theSurfaceDeformation.

36 {
38  delete theSurfaceDeformation;
39 }
AlignmentPositionError * theAlignmentPositionError
SurfaceDeformation * theSurfaceDeformation

Member Function Documentation

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

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

Implements Alignable.

Definition at line 82 of file AlignableDetUnit.cc.

References setAlignmentPositionError(), and theAlignmentPositionError.

Referenced by addAlignmentPositionErrorFromRotation().

84 {
85 
87  this->setAlignmentPositionError( ape, propagateDown ); // 2nd argument w/o effect
88  else
90 }
virtual void setAlignmentPositionError(const AlignmentPositionError &ape, bool)
Set the AlignmentPositionError (no components =&gt; second argument ignored)
AlignmentPositionError * theAlignmentPositionError
void AlignableDetUnit::addAlignmentPositionErrorFromLocalRotation ( const RotationType rot,
bool  propagateDown 
)
virtual

Add (or set if it does not exist yet) the AlignmentPositionError resulting from a rotation in the local reference frame (no components => second argument without effect)

Implements Alignable.

Definition at line 114 of file AlignableDetUnit.cc.

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

116 {
117 
119  this->addAlignmentPositionErrorFromRotation(globalRot, propagateDown); // 2nd argument w/o effect
120 
121 }
virtual void addAlignmentPositionErrorFromRotation(const RotationType &rot, bool)
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:132
align::RotationType RotationType
Definition: Alignable.h:36
Basic3DVector< T > multiplyInverse(const Basic3DVector< T > &v) const
void AlignableDetUnit::addAlignmentPositionErrorFromRotation ( const RotationType rot,
bool  propagateDown 
)
virtual

Add (or set if it does not exist yet) the AlignmentPositionError resulting from a rotation in the global reference frame (no components => second argument without effect)

Implements Alignable.

Definition at line 94 of file AlignableDetUnit.cc.

References addAlignmentPositionError(), PV3DBase< T, PVType, FrameType >::basicVector(), TkRotation< T >::multiplyInverse(), Alignable::surface(), AlignableSurface::toGlobal(), and tablePrinter::width.

Referenced by addAlignmentPositionErrorFromLocalRotation().

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

No components here => exception!

Implements Alignable.

Definition at line 42 of file AlignableDetUnit.cc.

References edm::hlt::Exception.

43 {
44  throw cms::Exception("LogicError")
45  << "AlignableDetUnit cannot have components, but try to add one!";
46 }
void AlignableDetUnit::addSurfaceDeformation ( const SurfaceDeformation deformation,
bool  propagateDown 
)
virtual

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

Implements Alignable.

Definition at line 136 of file AlignableDetUnit.cc.

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

138 {
139  if (!deformation) {
140  // nothing to do
141  } else if (!theSurfaceDeformation) {
142  this->setSurfaceDeformation(deformation, propagateDown); // fine since no components
143  } else if (!theSurfaceDeformation->add(*deformation)) {
144  edm::LogError("Alignment") << "@SUB=AlignableDetUnit::addSurfaceDeformation"
145  << "Cannot add deformation type " << deformation->type()
146  << " to type " << theSurfaceDeformation->type()
147  << ", so erase deformation information.";
148  delete theSurfaceDeformation;
150  }
151 }
virtual void setSurfaceDeformation(const SurfaceDeformation *deformation, bool)
Set surface deformation parameters (2nd argument without effect)
virtual int type() const =0
specific type, i.e. SurfaceDeformationFactory::Type
virtual bool add(const SurfaceDeformation &other)=0
SurfaceDeformation * theSurfaceDeformation
virtual StructureType AlignableDetUnit::alignableObjectId ( ) const
inlinevirtual

Return the alignable type identifier.

Implements Alignable.

Definition at line 62 of file AlignableDetUnit.h.

References align::AlignableDetUnit.

AlignmentErrors * AlignableDetUnit::alignmentErrors ( void  ) const
virtual

Return vector of alignment errors.

Implements Alignable.

Definition at line 191 of file AlignableDetUnit.cc.

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

192 {
193 
194  AlignmentErrors* m_alignmentErrors = new AlignmentErrors();
195 
196  uint32_t detId = this->geomDetId().rawId();
197 
198  CLHEP::HepSymMatrix clhepSymMatrix(3,0);
199  if ( theAlignmentPositionError ) // Might not be set
200  clhepSymMatrix = theAlignmentPositionError->globalError().matrix();
201 
202  AlignTransformError transformError( clhepSymMatrix, detId );
203 
204  m_alignmentErrors->m_alignError.push_back( transformError );
205 
206  return m_alignmentErrors;
207 
208 }
std::vector< AlignTransformError > m_alignError
AlgebraicSymMatrix matrix() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
const GlobalError & globalError() const
AlignmentPositionError * theAlignmentPositionError
const DetId & geomDetId() const
Definition: Alignable.h:177
const AlignmentPositionError* AlignableDetUnit::alignmentPositionError ( ) const
inline

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

Definition at line 77 of file AlignableDetUnit.h.

References theAlignmentPositionError.

Referenced by AlignableDetOrUnitPtr::alignmentPositionError().

AlignmentPositionError * theAlignmentPositionError
Alignments * AlignableDetUnit::alignments ( void  ) const
virtual

Return vector of alignment data.

Implements Alignable.

Definition at line 167 of file AlignableDetUnit.cc.

References Alignable::geomDetId(), Alignable::globalPosition(), Alignable::globalRotation(), Alignments::m_align, DetId::rawId(), x, TkRotation< T >::xx(), TkRotation< T >::xy(), TkRotation< T >::xz(), detailsBasic3DVector::y, TkRotation< T >::yx(), TkRotation< T >::yy(), TkRotation< T >::yz(), detailsBasic3DVector::z, TkRotation< T >::zx(), TkRotation< T >::zy(), and TkRotation< T >::zz().

168 {
169 
170  Alignments* m_alignments = new Alignments();
171  RotationType rot( this->globalRotation() );
172 
173  // Get alignments (position, rotation, detId)
174  CLHEP::Hep3Vector clhepVector( globalPosition().x(), globalPosition().y(), globalPosition().z() );
175  CLHEP::HepRotation clhepRotation( CLHEP::HepRep3x3( rot.xx(), rot.xy(), rot.xz(),
176  rot.yx(), rot.yy(), rot.yz(),
177  rot.zx(), rot.zy(), rot.zz() ) );
178  uint32_t detId = this->geomDetId().rawId();
179 
180  AlignTransform transform( clhepVector, clhepRotation, detId );
181 
182  // Add to alignments container
183  m_alignments->m_align.push_back( transform );
184 
185  return m_alignments;
186 
187 }
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:132
std::vector< AlignTransform > m_align
Definition: Alignments.h:14
double double double z
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
align::RotationType RotationType
Definition: Alignable.h:36
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:129
Definition: DDAxes.h:10
const DetId & geomDetId() const
Definition: Alignable.h:177
virtual Alignables AlignableDetUnit::components ( ) const
inlinevirtual

Returns a null vector (no components here)

Implements Alignable.

Definition at line 28 of file AlignableDetUnit.h.

28 { return Alignables(); }
align::Alignables Alignables
Definition: Alignable.h:39
void AlignableDetUnit::dump ( void  ) const
virtual

Printout information about GeomDet.

Implements Alignable.

Definition at line 154 of file AlignableDetUnit.cc.

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

155 {
156 
157  edm::LogInfo("AlignableDump")
158  << " AlignableDetUnit has position = " << this->globalPosition()
159  << ", orientation:" << std::endl << this->globalRotation() << std::endl
160  << " total displacement and rotation: " << this->displacement() << std::endl
161  << this->rotation();
162 
163 }
const GlobalVector & displacement() const
Return change of the global position since the creation of the object.
Definition: Alignable.h:135
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:132
const RotationType & rotation() const
Return change of orientation since the creation of the object.
Definition: Alignable.h:138
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:129
void AlignableDetUnit::move ( const GlobalVector displacement)
virtual

Move with respect to the global reference frame.

Implements Alignable.

Definition at line 49 of file AlignableDetUnit.cc.

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

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

50 {
51 
52  theSurface.move( displacement );
53  this->addDisplacement( displacement );
54 
55 }
void move(const GlobalVector &displacement)
void addDisplacement(const GlobalVector &displacement)
Definition: Alignable.cc:198
AlignableSurface theSurface
Definition: Alignable.h:216
virtual void AlignableDetUnit::recursiveComponents ( Alignables result) const
inlinevirtual

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

Implements Alignable.

Definition at line 31 of file AlignableDetUnit.h.

31 {}
void AlignableDetUnit::rotateInGlobalFrame ( const RotationType rotation)
virtual

Rotation with respect to the global reference frame.

Implements Alignable.

Definition at line 59 of file AlignableDetUnit.cc.

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

60 {
61 
63  this->addRotation( rotation );
64 
65 }
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:206
void rotate(const RotationType &rotation)
AlignableSurface theSurface
Definition: Alignable.h:216
void AlignableDetUnit::setAlignmentPositionError ( const AlignmentPositionError ape,
bool   
)
virtual

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

Implements Alignable.

Definition at line 69 of file AlignableDetUnit.cc.

References theAlignmentPositionError.

Referenced by addAlignmentPositionError(), and AlignableDetUnit().

71 {
72 
75  else
77 
78 }
AlignmentPositionError * theAlignmentPositionError
void AlignableDetUnit::setSurfaceDeformation ( const SurfaceDeformation deformation,
bool   
)
virtual

Set surface deformation parameters (2nd argument without effect)

Implements Alignable.

Definition at line 124 of file AlignableDetUnit.cc.

References SurfaceDeformation::clone(), and theSurfaceDeformation.

Referenced by addSurfaceDeformation(), and AlignableDetUnit().

126 {
127  delete theSurfaceDeformation; // OK for zero pointers
128  if (deformation) {
129  theSurfaceDeformation = deformation->clone();
130  } else {
132  }
133 }
virtual SurfaceDeformation * clone() const =0
SurfaceDeformation * theSurfaceDeformation
int AlignableDetUnit::surfaceDeformationIdPairs ( std::vector< std::pair< int, SurfaceDeformation * > > &  result) const
virtual

Return surface deformations.

Implements Alignable.

Definition at line 212 of file AlignableDetUnit.cc.

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

213 {
214  if ( theSurfaceDeformation ) {
215  result.push_back( std::pair<int,SurfaceDeformation*>(this->geomDetId().rawId(),theSurfaceDeformation) );
216  return 1;
217  }
218 
219  return 0;
220 }
tuple result
Definition: query.py:137
SurfaceDeformation * theSurfaceDeformation
const DetId & geomDetId() const
Definition: Alignable.h:177

Member Data Documentation

AlignmentPositionError* AlignableDetUnit::theAlignmentPositionError
private
SurfaceDeformation* AlignableDetUnit::theSurfaceDeformation
private