CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
AlignableSiStripDet Class Reference

#include <AlignableSiStripDet.h>

Inheritance diagram for AlignableSiStripDet:
AlignableDet AlignableComposite Alignable

Public Member Functions

 AlignableSiStripDet (const GluedGeomDet *geomDet)
 Constructor. More...
 
Alignmentsalignments () const override
 first consistify with component detunits, then call method from AlignableDet More...
 
 ~AlignableSiStripDet () override
 reduntantly make destructor virtual More...
 
- Public Member Functions inherited from AlignableDet
void addAlignmentPositionError (const AlignmentPositionError &ape, bool propagateDown) override
 
void addAlignmentPositionErrorFromRotation (const RotationType &rot, bool propagateDown) override
 
 AlignableDet (const GeomDet *geomDet, bool addComponents=true)
 
AlignmentErrorsExtendedalignmentErrors () const override
 Return vector of alignment errors. More...
 
const AlignmentPositionErroralignmentPositionError () const
 alignment position error - for checking only, otherwise use alignmentErrors() above! More...
 
void setAlignmentPositionError (const AlignmentPositionError &ape, bool propagateDown) override
 Set the AlignmentPositionError and, if (propagateDown), to all components. More...
 
void update (const GeomDet *geomDet, bool updateComponents=true)
 
 ~AlignableDet () override
 Destructor. More...
 
- Public Member Functions inherited from AlignableComposite
void addAlignmentPositionErrorFromLocalRotation (const RotationType &rotation, bool propagateDown) override
 
void addComponent (Alignable *component) final
 
void addSurfaceDeformation (const SurfaceDeformation *deformation, bool propagateDown) override
 
 AlignableComposite (align::ID id, StructureType aType, const RotationType &rot=RotationType())
 
StructureType alignableObjectId () const override
 Return the alignable type identifier. More...
 
const Alignablescomponents () const override
 Return vector of direct components. More...
 
void dump () const override
 Recursive printout of alignable structure. More...
 
void move (const GlobalVector &displacement) override
 Move with respect to the global reference frame. More...
 
virtual void moveComponentLocal (const int i, const LocalVector &localDisplacement)
 Move a single component with respect to the local reference frame. More...
 
virtual void moveComponentsLocal (const LocalVector &localDisplacement)
 Move with respect to the local reference frame. More...
 
void recursiveComponents (Alignables &result) const override
 Provide all components, subcomponents etc. (cf. description in base class) More...
 
void rotateInGlobalFrame (const RotationType &rotation) override
 Rotation interpreted in global reference frame. More...
 
void 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())
 
template<class T >
void update (T)=delete
 
 ~AlignableComposite () override
 deleting its components More...
 
- Public Member Functions inherited from Alignable
 Alignable (align::ID, const AlignableSurface &)
 
 Alignable (align::ID, const RotationType &)
 
AlignmentParametersalignmentParameters () const
 Get the AlignmentParameters. More...
 
virtual void cacheTransformation ()
 cache the current position, rotation and other parameters (e.g. surface deformations), also for possible components More...
 
virtual void cacheTransformation (const align::RunNumber &)
 
virtual CompConstraintType compConstraintType () const
 Return the alignable type of contraints wrt. its components. More...
 
const AlignablesdeepComponents () const
 
const GlobalVectordisplacement () const
 Return change of the global position since the creation of the object. More...
 
bool firstCompsWithParams (Alignables &paramComps) const
 
const DetIdgeomDetId () const
 
const PositionTypeglobalPosition () const
 Return the global position of the object. More...
 
const RotationTypeglobalRotation () const
 Return the global orientation of the object. More...
 
align::ID id () const
 Return the ID of Alignable, i.e. DetId of 'first' component GeomDet(Unit). More...
 
bool lastCompsWithParams (Alignables &paramComps) const
 
Alignablemother () const
 Return pointer to container alignable (if any) More...
 
virtual void recenterSurface ()
 Recenter surface object without moving possible components. More...
 
virtual void recursiveComponents (Alignables &result) const =0
 
virtual void restoreCachedTransformation ()
 restore the previously cached transformation, also for possible components More...
 
virtual void restoreCachedTransformation (const align::RunNumber &)
 
virtual void rotateAroundGlobalAxis (const GlobalVector &axis, Scalar radians)
 Rotation around arbitratry global axis. More...
 
virtual void rotateAroundGlobalX (Scalar radians)
 Rotation around global x-axis. More...
 
virtual void rotateAroundGlobalY (Scalar radians)
 Rotation around global y-axis. More...
 
virtual void rotateAroundGlobalZ (Scalar radians)
 Rotation around global z-axis. More...
 
virtual void rotateAroundLocalAxis (const LocalVector &axis, Scalar radians)
 Rotation around arbitratry local axis. More...
 
virtual void rotateAroundLocalX (Scalar radians)
 Rotation around local x-axis. More...
 
virtual void rotateAroundLocalY (Scalar radians)
 Rotation around local y-axis. More...
 
virtual void rotateAroundLocalZ (Scalar radians)
 Rotation around local z-axis. More...
 
virtual void rotateInLocalFrame (const RotationType &rotation)
 Rotation intepreted in the local reference frame. More...
 
const RotationTyperotation () const
 Return change of orientation since the creation of the object. More...
 
void setAlignmentParameters (AlignmentParameters *dap)
 Set the AlignmentParameters. More...
 
void setMother (Alignable *mother)
 Assign mother to alignable. More...
 
void setSurvey (const SurveyDet *)
 Set survey info. More...
 
int size () const
 Return number of direct components. More...
 
const AlignableSurfacesurface () const
 Return the Surface (global position and orientation) of the object. More...
 
AlignmentSurfaceDeformationssurfaceDeformations () const
 Return surface deformations, sorted by DetId. More...
 
const SurveyDetsurvey () const
 Return survey info. More...
 
void update (align::ID, const AlignableSurface &)
 
virtual ~Alignable ()
 Destructor. More...
 

Private Member Functions

void consistifyAlignments ()
 make alignments consistent with daughters More...
 

Private Attributes

const BoundstheMonoBounds
 
const StripGeomDetTypetheMonoType
 
const BoundstheStereoBounds
 
const StripGeomDetTypetheStereoType
 

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 >
 
- Protected Member Functions inherited from AlignableComposite
 AlignableComposite (const GeomDet *geomDet)
 Constructor from GeomDet, only for use in AlignableDet. More...
 
void setSurface (const AlignableSurface &s)
 
void update (const GeomDet *geomDet)
 
- Protected Member Functions inherited from Alignable
void addDisplacement (const GlobalVector &displacement)
 
void addRotation (const RotationType &rotation)
 
virtual void updateMother (const GlobalVector &shift)
 
- Protected Attributes inherited from AlignableComposite
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
 

Detailed Description

An alignable for GluedDets in Strip tracker, taking care of consistency with AlignableDet components.

First implementation April/May 2008

Author
Gero Flucke, Hamburg University
Date
2008/07/13 12:26:41
Revision
1.4

Definition at line 23 of file AlignableSiStripDet.h.

Constructor & Destructor Documentation

◆ AlignableSiStripDet()

AlignableSiStripDet::AlignableSiStripDet ( const GluedGeomDet geomDet)

Constructor.

Definition at line 26 of file AlignableSiStripDet.cc.

References AlignableComposite::components(), Exception, GeomDet::geographicalId(), GluedGeomDet::monoDet(), GluedGeomDet::stereoDet(), and units().

27  : AlignableDet(gluedDet, true), // true: adding DetUnits
28  theMonoBounds(gluedDet->monoDet()->surface().bounds().clone()),
29  theStereoBounds(gluedDet->stereoDet()->surface().bounds().clone()),
30  theMonoType(static_cast<const StripGeomDetUnit*>(gluedDet->monoDet())->specificType()),
31  theStereoType(static_cast<const StripGeomDetUnit*>(gluedDet->stereoDet())->specificType()) {
32  // It is not allowed to store a pointer to GeomDet within objects with a life time
33  // longer than an Event:
34  // GeomDet comes from TrackerGeometry that is created from GeometricDet that depends on
35  // IdealGeometryRecord from EventSetup, so it could change in next event!
36  // ==> Need to store directly what I need from it.
37  // Unfortunately the current way with references for the type does not solve that,
38  // either. But currently no way out, see header file.
39 
40  // check order mono/stereo
41  const Alignables units(this->components());
42  if (units.size() != 2 || gluedDet->monoDet()->geographicalId() != units[0]->geomDetId() ||
43  gluedDet->stereoDet()->geographicalId() != units[1]->geomDetId()) {
44  throw cms::Exception("LogicError") << "[AlignableSiStripDet] "
45  << "Either != 2 components or "
46  << "mono/stereo in wrong order for consistifyAlignments.";
47  }
48 }
const StripGeomDetType & theStereoType
const StripGeomDetType & theMonoType
const Alignables & components() const override
Return vector of direct components.
const Bounds * theStereoBounds
TString units(TString variable, Char_t axis)
AlignableDet(const GeomDet *geomDet, bool addComponents=true)
Definition: AlignableDet.cc:14
align::Alignables Alignables
Definition: Alignable.h:34
const Bounds * theMonoBounds

◆ ~AlignableSiStripDet()

AlignableSiStripDet::~AlignableSiStripDet ( )
override

reduntantly make destructor virtual

Definition at line 51 of file AlignableSiStripDet.cc.

References theMonoBounds, and theStereoBounds.

51  {
52  delete theMonoBounds;
53  delete theStereoBounds;
54 }
const Bounds * theStereoBounds
const Bounds * theMonoBounds

Member Function Documentation

◆ alignments()

Alignments * AlignableSiStripDet::alignments ( void  ) const
overridevirtual

first consistify with component detunits, then call method from AlignableDet

Reimplemented from AlignableDet.

Definition at line 57 of file AlignableSiStripDet.cc.

References AlignableDet::alignments(), and consistifyAlignments().

57  {
58  const_cast<AlignableSiStripDet*>(this)->consistifyAlignments();
59 
60  return this->AlignableDet::alignments();
61 }
Alignments * alignments() const override
Return vector of alignment data.
void consistifyAlignments()
make alignments consistent with daughters

◆ consistifyAlignments()

void AlignableSiStripDet::consistifyAlignments ( )
private

make alignments consistent with daughters

Definition at line 64 of file AlignableSiStripDet.cc.

References Alignable::addDisplacement(), Alignable::addRotation(), PV3DBase< T, PVType, FrameType >::basicVector(), newFWLiteAna::build, Bounds::clone(), AlignableComposite::components(), Alignable::globalPosition(), Alignable::globalRotation(), GloballyPositioned< T >::position(), GloballyPositioned< T >::rotation(), Alignable::rotation(), theMonoBounds, theMonoType, theStereoBounds, theStereoType, and Alignable::theSurface.

Referenced by alignments().

64  {
65  // make alignments consistent with daughters, calling method from geometry
66 
67  // The aim of all this gymnastics is to have the alignments calculated by
68  // PlaneBuilderForGluedDet::plane(const std::vector<const GeomDetUnit*> &detComps);
69  //
70  // So we take the (new) position and orientation from the AligableDetUnits,
71  // but bounds and GeomDetType from original GeomDetUnits to create new GeomDetUnits
72  // that are passed to that routine.
73 
74  const Alignables aliUnits(this->components()); // order mono==0, stereo==1 checked in ctr.
75 
77  BoundPlane::build(aliUnits[0]->globalPosition(), aliUnits[0]->globalRotation(), theMonoBounds->clone());
78  // Fortunately we do not seem to need a GeometricDet pointer and can use 0:
79  const StripGeomDetUnit monoDet(&(*monoPlane), &theMonoType, 0);
80 
81  BoundPlane::BoundPlanePointer stereoPlane =
82  BoundPlane::build(aliUnits[1]->globalPosition(), aliUnits[1]->globalRotation(), theStereoBounds->clone());
83  // Fortunately we do not seem to need a GeometricDet pointer and can use 0:
84  const StripGeomDetUnit stereoDet(&(*stereoPlane), &theStereoType, 0);
85 
86  std::vector<const GeomDetUnit*> detComps;
87  detComps.push_back(&monoDet); // order mono first, stereo second should be as in...
88  detComps.push_back(&stereoDet); // ...TrackerGeomBuilderFromGeometricDet::buildGeomDet
89 
90  // Now we have all to calculate new position and rotation via PlaneBuilderForGluedDet.
91  const PositionType oldPos(theSurface.position()); // From old surface for keeping...
92  const RotationType oldRot(theSurface.rotation()); // ...track of changes.
93 
94  PlaneBuilderForGluedDet planeBuilder;
95  theSurface = AlignableSurface(*planeBuilder.plane(detComps));
96 
97  // But do not forget to keep track of movements/rotations:
98  const GlobalVector movement(theSurface.position().basicVector() - oldPos.basicVector());
99  // Seems to be correct down to delta angles 4.*1e-8:
100  const RotationType rotation(oldRot.multiplyInverse(theSurface.rotation()));
101  this->addDisplacement(movement);
102  this->addRotation(rotation);
103 
104  // this->dumpCompareEuler(oldRot, theSurface.rotation());
105 
106  // if (movement.mag2()) { // > 1.e-10) {
107  // edm::LogWarning("Alignment") << "@SUB=consistifyAlignments"
108  // << "Delta: " << movement.x() << " " << movement.y() << " " << movement.z()
109  // << "\nPos: " << oldPos.perp() << " " << oldPos.phi() << " " << oldPos.z();
110  // }
111 }
const StripGeomDetType & theStereoType
const StripGeomDetType & theMonoType
const Alignables & components() const override
Return vector of direct components.
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:135
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
const PositionType & position() const
void addRotation(const RotationType &rotation)
Definition: Alignable.cc:193
align::RotationType RotationType
Definition: Alignable.h:31
void addDisplacement(const GlobalVector &displacement)
Definition: Alignable.cc:190
const Bounds * theStereoBounds
align::PositionType PositionType
Definition: Alignable.h:30
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:138
const RotationType & rotation() const
virtual Bounds * clone() const =0
align::Alignables Alignables
Definition: Alignable.h:34
AlignableSurface theSurface
Definition: Alignable.h:237
const Bounds * theMonoBounds
const RotationType & rotation() const
Return change of orientation since the creation of the object.
Definition: Alignable.h:144

Member Data Documentation

◆ theMonoBounds

const Bounds* AlignableSiStripDet::theMonoBounds
private

The following four members are needed to recalculate the surface in consistifyAlignments, to get rid of a GluedDet* which is disregarded since it could become an invalid pointer in the next event (theoretically...). But this solution is not better, the references for the types would become invalid together with the GeomDets they are taken from. StripGeomDetType has neither clone() and nor a decent copy constructor, so I cannot go the the same way as for the bounds. Sigh!

Definition at line 45 of file AlignableSiStripDet.h.

Referenced by consistifyAlignments(), and ~AlignableSiStripDet().

◆ theMonoType

const StripGeomDetType& AlignableSiStripDet::theMonoType
private

Definition at line 47 of file AlignableSiStripDet.h.

Referenced by consistifyAlignments().

◆ theStereoBounds

const Bounds* AlignableSiStripDet::theStereoBounds
private

Definition at line 46 of file AlignableSiStripDet.h.

Referenced by consistifyAlignments(), and ~AlignableSiStripDet().

◆ theStereoType

const StripGeomDetType& AlignableSiStripDet::theStereoType
private

Definition at line 48 of file AlignableSiStripDet.h.

Referenced by consistifyAlignments().