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
AlignableDet Class Reference

#include <AlignableDet.h>

Inheritance diagram for AlignableDet:
AlignableComposite Alignable AlignableCSCChamber AlignableDTChamber AlignableDTSuperLayer AlignableSiStripDet

Public Member Functions

virtual void addAlignmentPositionError (const AlignmentPositionError &ape, bool propagateDown)
 
virtual void addAlignmentPositionErrorFromRotation (const RotationType &rot, bool propagateDown)
 
 AlignableDet (const GeomDet *geomDet, bool addComponents=true)
 
virtual AlignmentErrorsExtendedalignmentErrors () 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 void setAlignmentPositionError (const AlignmentPositionError &ape, bool propagateDown)
 Set the AlignmentPositionError and, if (propagateDown), to all components. More...
 
virtual ~AlignableDet ()
 Destructor. More...
 
- Public Member Functions inherited from AlignableComposite
virtual void addAlignmentPositionErrorFromLocalRotation (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 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 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...
 

Private Attributes

AlignmentPositionErrortheAlignmentPositionError
 

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 AlignableComposite
 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 inherited from AlignableComposite
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
 

Detailed Description

An AlignableComposite corresponding to a composite GeomDet direct components are AlignableDetUnits or AlignableDets.

Definition at line 8 of file AlignableDet.h.

Constructor & Destructor Documentation

AlignableDet::AlignableDet ( const GeomDet geomDet,
bool  addComponents = true 
)

Constructor: If addComponents = true, creates components for geomDet's components, assuming they are GeomDetUnits

Definition at line 16 of file AlignableDet.cc.

References AlignableComposite::addComponent(), align::AlignableDetUnit, GeomDet::alignmentPositionError(), GeomDet::components(), Exception, GeomDet::geographicalId(), DetId::rawId(), setAlignmentPositionError(), GeomDet::surface(), Alignable::theSurface, and csvLumiCalc::unit.

16  :
17  AlignableComposite( geomDet ),
19 {
20  if (geomDet->alignmentPositionError()) {
21  // false: do not propagate APE to (anyway not yet existing) daughters
22  this->setAlignmentPositionError(*(geomDet->alignmentPositionError()), false);
23  }
24 
25  if (addComponents) {
26  if ( geomDet->components().size() == 0 ) { // Is a DetUnit
27  throw cms::Exception("BadHierarchy") << "[AlignableDet] GeomDet with DetId "
28  << geomDet->geographicalId().rawId()
29  << " has no components, use AlignableDetUnit.\n";
30  } else { // Push back all components
31  const std::vector<const GeomDet*>& geomDets = geomDet->components();
32  for (std::vector<const GeomDet*>::const_iterator idet = geomDets.begin();
33  idet != geomDets.end(); ++idet) {
34  const GeomDetUnit *unit = dynamic_cast<const GeomDetUnit*>(*idet);
35  if (!unit) {
36  throw cms::Exception("BadHierarchy")
37  << "[AlignableDet] component not GeomDetUnit, call with addComponents==false"
38  << " and build hierarchy yourself.\n"; // e.g. AlignableDTChamber
39  }
40  this->addComponent(new AlignableDetUnit(unit));
41  }
42  }
43  // Ensure that the surface is not screwed up by addComponent, it must stay the GeomDet's one:
44  theSurface = AlignableSurface(geomDet->surface());
45  } // end addComponents
46 }
AlignableComposite()
default constructor hidden
AlignmentPositionError * theAlignmentPositionError
Definition: AlignableDet.h:47
virtual void setAlignmentPositionError(const AlignmentPositionError &ape, bool propagateDown)
Set the AlignmentPositionError and, if (propagateDown), to all components.
Definition: AlignableDet.cc:59
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
string unit
Definition: csvLumiCalc.py:46
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:77
virtual std::vector< const GeomDet * > components() const
Returns direct components, if any.
Definition: GeomDet.h:86
AlignmentPositionError const * alignmentPositionError() const
Return pointer to alignment errors.
Definition: GeomDet.h:93
AlignableSurface theSurface
Definition: Alignable.h:222
virtual void addComponent(Alignable *component)
AlignableDet::~AlignableDet ( )
virtual

Destructor.

Definition at line 50 of file AlignableDet.cc.

References theAlignmentPositionError.

51 {
52 
54 
55 }
AlignmentPositionError * theAlignmentPositionError
Definition: AlignableDet.h:47

Member Function Documentation

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

Add (or set if it does not exist yet) the AlignmentPositionError, if (propagateDown), add also to all components

Reimplemented from AlignableComposite.

Definition at line 73 of file AlignableDet.cc.

References AlignableComposite::addAlignmentPositionError(), and theAlignmentPositionError.

Referenced by addAlignmentPositionErrorFromRotation().

74 {
75 
78  } else {
80  }
81 
82  this->AlignableComposite::addAlignmentPositionError( ape, propagateDown );
83 
84 }
AlignmentPositionError * theAlignmentPositionError
Definition: AlignableDet.h:47
virtual void addAlignmentPositionError(const AlignmentPositionError &ape, bool propagateDown)
void AlignableDet::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, if (propagateDown), add also to all components

Reimplemented from AlignableComposite.

Definition at line 87 of file AlignableDet.cc.

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

89 {
90 
91  // average error calculated by movement of a local point at
92  // (xWidth/2,yLength/2,0) caused by the rotation rot
93  GlobalVector localPositionVector = surface().toGlobal( LocalVector(.5 * surface().width(), .5 * surface().length(), 0.) );
94 
95  LocalVector::BasicVectorType lpvgf = localPositionVector.basicVector();
96  GlobalVector gv( rot.multiplyInverse(lpvgf) - lpvgf );
97 
98  AlignmentPositionError ape( gv.x(),gv.y(),gv.z() );
99  this->addAlignmentPositionError( ape, propagateDown );
100 
102 
103 }
align::LocalVector LocalVector
Definition: Alignable.h:38
virtual void addAlignmentPositionError(const AlignmentPositionError &ape, bool propagateDown)
Definition: AlignableDet.cc:73
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.
virtual void addAlignmentPositionErrorFromRotation(const RotationType &rotation, bool propagateDown)
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
AlignmentErrorsExtended * AlignableDet::alignmentErrors ( void  ) const
virtual

Return vector of alignment errors.

Reimplemented from AlignableComposite.

Definition at line 135 of file AlignableDet.cc.

References AlignableComposite::alignmentErrors(), asHepMatrix(), filterCSVwithJSON::copy, Alignable::geomDetId(), AlignmentPositionError::globalError(), AlignmentErrorsExtended::m_alignError, GlobalErrorBaseExtended< T, ErrorWeightType >::matrix(), DetId::rawId(), and theAlignmentPositionError.

136 {
137 
138  AlignmentErrorsExtended* m_alignmentErrors = new AlignmentErrorsExtended();
139 
140  // Add associated alignment position error
141  uint32_t detId = this->geomDetId().rawId();
142  CLHEP::HepSymMatrix clhepSymMatrix(6,0);
143  if ( theAlignmentPositionError ) // Might not be set
145  AlignTransformErrorExtended transformError( clhepSymMatrix, detId );
146  m_alignmentErrors->m_alignError.push_back( transformError );
147 
148  // Add those from components
150  std::copy(compAlignmentErrs->m_alignError.begin(), compAlignmentErrs->m_alignError.end(),
151  std::back_inserter(m_alignmentErrors->m_alignError));
152  delete compAlignmentErrs;
153 
154 
155  return m_alignmentErrors;
156 }
CLHEP::HepMatrix asHepMatrix(const ROOT::Math::SMatrix< double, N1, N2, typename ROOT::Math::MatRepStd< double, N1, N2 > > &rm)
Definition: Migration.h:49
AlignmentPositionError * theAlignmentPositionError
Definition: AlignableDet.h:47
const GlobalErrorExtended & globalError() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
const AlgebraicSymMatrix66 & matrix() const
std::vector< AlignTransformErrorExtended > m_alignError
const DetId & geomDetId() const
Definition: Alignable.h:177
virtual AlignmentErrorsExtended * alignmentErrors() const
Return vector of alignment errors.
const AlignmentPositionError* AlignableDet::alignmentPositionError ( ) const
inline

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

Definition at line 43 of file AlignableDet.h.

References theAlignmentPositionError.

Referenced by AlignableDetOrUnitPtr::alignmentPositionError().

AlignmentPositionError * theAlignmentPositionError
Definition: AlignableDet.h:47
Alignments * AlignableDet::alignments ( void  ) const
virtual

Return vector of alignment data.

Reimplemented from AlignableComposite.

Reimplemented in AlignableSiStripDet.

Definition at line 106 of file AlignableDet.cc.

References AlignableComposite::alignments(), filterCSVwithJSON::copy, Alignable::geomDetId(), Alignable::globalPosition(), Alignable::globalRotation(), Alignments::m_align, DetId::rawId(), makeMuonMisalignmentScenario::rot, create_public_lumi_plots::transform, x, TkRotation< T >::xx(), TkRotation< T >::xy(), TkRotation< T >::xz(), y, TkRotation< T >::yx(), TkRotation< T >::yy(), TkRotation< T >::yz(), z, TkRotation< T >::zx(), TkRotation< T >::zy(), and TkRotation< T >::zz().

Referenced by AlignableSiStripDet::alignments().

107 {
108 
109  Alignments* m_alignments = new Alignments();
110  RotationType rot( this->globalRotation() );
111 
112  // Get position, rotation, detId
113  CLHEP::Hep3Vector clhepVector( globalPosition().x(), globalPosition().y(), globalPosition().z() );
114  CLHEP::HepRotation clhepRotation( CLHEP::HepRep3x3( rot.xx(), rot.xy(), rot.xz(),
115  rot.yx(), rot.yy(), rot.yz(),
116  rot.zx(), rot.zy(), rot.zz() ) );
117  uint32_t detId = this->geomDetId().rawId();
118 
119  AlignTransform transform( clhepVector, clhepRotation, detId );
120 
121  // Add to alignments container
122  m_alignments->m_align.push_back( transform );
123 
124  // Add those from components
125  Alignments *compAlignments = this->AlignableComposite::alignments();
126  std::copy(compAlignments->m_align.begin(), compAlignments->m_align.end(),
127  std::back_inserter(m_alignments->m_align));
128  delete compAlignments;
129 
130 
131  return m_alignments;
132 }
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:132
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
virtual Alignments * alignments() const
Return alignment data.
align::RotationType RotationType
Definition: Alignable.h:36
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:129
const DetId & geomDetId() const
Definition: Alignable.h:177
void AlignableDet::setAlignmentPositionError ( const AlignmentPositionError ape,
bool  propagateDown 
)
virtual

Set the AlignmentPositionError and, if (propagateDown), to all components.

Reimplemented from AlignableComposite.

Definition at line 59 of file AlignableDet.cc.

References AlignableComposite::setAlignmentPositionError(), and theAlignmentPositionError.

Referenced by AlignableDet().

60 {
61 
64  else
66 
67  this->AlignableComposite::setAlignmentPositionError( ape, propagateDown );
68 
69 }
AlignmentPositionError * theAlignmentPositionError
Definition: AlignableDet.h:47
virtual void setAlignmentPositionError(const AlignmentPositionError &ape, bool propagateDown)

Member Data Documentation

AlignmentPositionError* AlignableDet::theAlignmentPositionError
private