CMS 3D CMS Logo

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

#include <AlignableBeamSpot.h>

Inheritance diagram for AlignableBeamSpot:
Alignable

Public Member Functions

virtual void addAlignmentPositionError (const AlignmentPositionError &ape, bool propagateDown)
 
virtual void addAlignmentPositionErrorFromLocalRotation (const RotationType &rotation, bool propagateDown)
 
virtual void addAlignmentPositionErrorFromRotation (const RotationType &rot, bool propagateDown)
 
virtual void addComponent (Alignable *component)
 
virtual void addSurfaceDeformation (const SurfaceDeformation *, bool)
 do no use, for compatibility only More...
 
 AlignableBeamSpot ()
 
virtual StructureType alignableObjectId () const
 Return the alignable type identifier. More...
 
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 Alignables components () const
 Return vector of direct components. More...
 
virtual void dump () const
 Recursive printout of alignable structure. More...
 
void initialize (double x, double y, double z, double dxdz, double dydz)
 initialize the alignable with the passed beam spot parameters More...
 
virtual void move (const GlobalVector &displacement)
 Move with respect to the global reference frame. More...
 
virtual void recursiveComponents (Alignables &result) const
 Provide all components, subcomponents etc. (cf. description in base class) More...
 
void reset ()
 reset beam spot to the uninitialized state More...
 
virtual void rotateInGlobalFrame (const RotationType &rotation)
 Rotation interpreted in global reference frame. More...
 
virtual void setAlignmentPositionError (const AlignmentPositionError &ape, bool propagateDown)
 Set the AlignmentPositionError and, if (propagateDown), to all components. More...
 
virtual void setSurfaceDeformation (const SurfaceDeformation *, bool)
 do no use, for compatibility only More...
 
virtual int surfaceDeformationIdPairs (std::vector< std::pair< int, SurfaceDeformation * > > &) const
 Return surface deformations. More...
 
virtual ~AlignableBeamSpot ()
 Destructor. 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...
 

Static Public Member Functions

static const DetId detId ()
 

Private Attributes

AlignmentPositionErrortheAlignmentPositionError
 
bool theInitializedFlag
 

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 Alignable
void addDisplacement (const GlobalVector &displacement)
 
void addRotation (const RotationType &rotation)
 
virtual void updateMother (const GlobalVector &shift)
 
- 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 the beam spot

Original author: Andreas Mussgiller, August 2010

Date
2010/10/26 19:53:53
Revision
1.2

(last update by

Author
flucke

)

Definition at line 19 of file AlignableBeamSpot.h.

Constructor & Destructor Documentation

AlignableBeamSpot::AlignableBeamSpot ( )

Definition at line 24 of file AlignableBeamSpot.cc.

24  :
27  theInitializedFlag(false)
28 {
29 
30 }
Alignable()
private default ctr. to enforce usage of the specialised ones
Definition: Alignable.h:264
static const DetId detId()
AlignmentPositionError * theAlignmentPositionError
AlignableBeamSpot::~AlignableBeamSpot ( )
virtual

Destructor.

Definition at line 33 of file AlignableBeamSpot.cc.

References theAlignmentPositionError.

34 {
36 }
AlignmentPositionError * theAlignmentPositionError

Member Function Documentation

void AlignableBeamSpot::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

Implements Alignable.

Definition at line 62 of file AlignableBeamSpot.cc.

References theAlignmentPositionError.

Referenced by recursiveComponents().

63 {
66  } else {
68  }
69 }
AlignmentPositionError * theAlignmentPositionError
void AlignableBeamSpot::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 82 of file AlignableBeamSpot.cc.

Referenced by recursiveComponents().

84 {
85 
86 }
void AlignableBeamSpot::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

Implements Alignable.

Definition at line 72 of file AlignableBeamSpot.cc.

Referenced by recursiveComponents().

74 {
75 
76 }
virtual void AlignableBeamSpot::addComponent ( Alignable component)
inlinevirtual

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 32 of file AlignableBeamSpot.h.

32 {}
void AlignableBeamSpot::addSurfaceDeformation ( const SurfaceDeformation ,
bool   
)
virtual

do no use, for compatibility only

Implements Alignable.

Definition at line 96 of file AlignableBeamSpot.cc.

Referenced by surfaceDeformationIdPairs().

97 {
98  edm::LogInfo("Alignment") << "@SUB=AlignableBeamSpot::addSurfaceDeformation"
99  << "Useless method for beam spot, do nothing.";
100 }
virtual StructureType AlignableBeamSpot::alignableObjectId ( ) const
inlinevirtual

Return the alignable type identifier.

Implements Alignable.

Definition at line 64 of file AlignableBeamSpot.h.

References alignmentErrors(), alignments(), align::BeamSpot, and dump().

Referenced by dump().

AlignmentErrorsExtended * AlignableBeamSpot::alignmentErrors ( void  ) const
virtual

Return vector of alignment errors.

Implements Alignable.

Definition at line 140 of file AlignableBeamSpot.cc.

References asHepMatrix(), detId(), AlignmentPositionError::globalError(), AlignmentErrorsExtended::m_alignError, GlobalErrorBaseExtended< T, ErrorWeightType >::matrix(), theAlignmentPositionError, and Alignable::theId.

Referenced by alignableObjectId().

141 {
142  AlignmentErrorsExtended* m_alignmentErrors = new AlignmentErrorsExtended();
143 
144  // Add associated alignment position error
145  uint32_t detId = theId;
146  CLHEP::HepSymMatrix clhepSymMatrix(6,0);
147  if ( theAlignmentPositionError ) // Might not be set
149  AlignTransformErrorExtended transformError( clhepSymMatrix, detId );
150  m_alignmentErrors->m_alignError.push_back( transformError );
151 
152  return m_alignmentErrors;
153 }
CLHEP::HepMatrix asHepMatrix(const ROOT::Math::SMatrix< double, N1, N2, typename ROOT::Math::MatRepStd< double, N1, N2 > > &rm)
Definition: Migration.h:54
const GlobalErrorExtended & globalError() const
const AlgebraicSymMatrix66 & matrix() const
static const DetId detId()
std::vector< AlignTransformErrorExtended > m_alignError
AlignmentPositionError * theAlignmentPositionError
align::ID theId
Definition: Alignable.h:241
const AlignmentPositionError* AlignableBeamSpot::alignmentPositionError ( ) const
inline

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

Definition at line 76 of file AlignableBeamSpot.h.

References theAlignmentPositionError.

Referenced by AlignableDetOrUnitPtr::alignmentPositionError().

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

Return vector of alignment data.

Implements Alignable.

Definition at line 119 of file AlignableBeamSpot.cc.

References detId(), Alignable::globalPosition(), Alignable::globalRotation(), Alignments::m_align, makeMuonMisalignmentScenario::rot, Alignable::theId, 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 alignableObjectId().

120 {
121  Alignments* m_alignments = new Alignments();
122  RotationType rot( this->globalRotation() );
123 
124  // Get position, rotation, detId
125  CLHEP::Hep3Vector clhepVector( globalPosition().x(), globalPosition().y(), globalPosition().z() );
126  CLHEP::HepRotation clhepRotation( CLHEP::HepRep3x3( rot.xx(), rot.xy(), rot.xz(),
127  rot.yx(), rot.yy(), rot.yz(),
128  rot.zx(), rot.zy(), rot.zz() ) );
129  uint32_t detId = theId;
130 
131  AlignTransform transform( clhepVector, clhepRotation, detId );
132 
133  // Add to alignments container
134  m_alignments->m_align.push_back( transform );
135 
136  return m_alignments;
137 }
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:141
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
static const DetId detId()
align::RotationType RotationType
Definition: Alignable.h:34
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:138
align::ID theId
Definition: Alignable.h:241
virtual Alignables AlignableBeamSpot::components ( ) const
inlinevirtual

Return vector of direct components.

Implements Alignable.

Definition at line 35 of file AlignableBeamSpot.h.

35 { return std::vector<Alignable*>(); }
static const DetId AlignableBeamSpot::detId ( )
inlinestatic

returns the DetId corresponding to the alignable beam spot. Also used by BeamSpotGeomDet and BeamSpotTransientTrackingRecHit

Definition at line 95 of file AlignableBeamSpot.h.

References DetId::kDetOffset, and DetId::Tracker.

Referenced by alignmentErrors(), alignments(), BeamSpotGeomDet::BeamSpotGeomDet(), MillePedeMonitor::fillCorrelations2D(), and MillePedeMonitor::fillResiduals().

95 { return DetId((DetId::Tracker<<DetId::kDetOffset)+0x1ffffff); }
Definition: DetId.h:18
static const int kDetOffset
Definition: DetId.h:20
void AlignableBeamSpot::dump ( void  ) const
virtual

Recursive printout of alignable structure.

Implements Alignable.

Definition at line 103 of file AlignableBeamSpot.cc.

References alignableObjectId(), Alignable::globalPosition(), Alignable::globalRotation(), Alignable::theSurface, AlignableSurface::toGlobal(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by alignableObjectId(), and initialize().

104 {
105  // Dump this
106 
107  LocalVector lv(0.0, 0.0, 1.0);
109 
110  edm::LogInfo("AlignableDump")
111  << " Alignable of type " << this->alignableObjectId()
112  << " has 0 components" << std::endl
113  << " position = " << this->globalPosition() << ", orientation:" << std::endl << std::flush
114  << this->globalRotation() << std::endl << std::flush
115  << " dxdz = " << gv.x()/gv.z() << " dydz = " << gv.y()/gv.z() << std::endl;
116 }
T y() const
Definition: PV3DBase.h:63
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:141
virtual StructureType alignableObjectId() const
Return the alignable type identifier.
T z() const
Definition: PV3DBase.h:64
align::GlobalPoints toGlobal(const align::LocalPoints &) const
Return in global coord given a set of local points.
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:138
T x() const
Definition: PV3DBase.h:62
AlignableSurface theSurface
Definition: Alignable.h:243
void AlignableBeamSpot::initialize ( double  x,
double  y,
double  z,
double  dxdz,
double  dydz 
)

initialize the alignable with the passed beam spot parameters

Definition at line 156 of file AlignableBeamSpot.cc.

References funct::cos(), dump(), GloballyPositioned< T >::move(), GloballyPositioned< T >::rotate(), funct::sin(), theInitializedFlag, and Alignable::theSurface.

Referenced by AlignableExtras::initializeBeamSpot(), and surfaceDeformationIdPairs().

158 {
159  if (theInitializedFlag) return;
160 
161  GlobalVector gv(x, y, z);
162  theSurface.move(gv);
163 
164  double angleY = std::atan(dxdz);
165  double angleX = -std::atan(dydz);
166 
167  align::RotationType rotY( std::cos(angleY), 0., -std::sin(angleY),
168  0., 1., 0.,
169  std::sin(angleY), 0., std::cos(angleY) );
170 
171  align::RotationType rotX( 1., 0., 0.,
172  0., std::cos(angleX), std::sin(angleX),
173  0., -std::sin(angleX), std::cos(angleX) );
174 
175  theSurface.rotate(rotY * rotX);
176 
177  this->dump();
178 
179  theInitializedFlag = true;
180 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
void move(const GlobalVector &displacement)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
void rotate(const RotationType &rotation)
virtual void dump() const
Recursive printout of alignable structure.
AlignableSurface theSurface
Definition: Alignable.h:243
void AlignableBeamSpot::move ( const GlobalVector displacement)
virtual

Move with respect to the global reference frame.

Implements Alignable.

Definition at line 39 of file AlignableBeamSpot.cc.

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

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

40 {
41  theSurface.move( displacement );
42  this->addDisplacement( displacement );
43 }
void move(const GlobalVector &displacement)
void addDisplacement(const GlobalVector &displacement)
Definition: Alignable.cc:248
AlignableSurface theSurface
Definition: Alignable.h:243
virtual void AlignableBeamSpot::recursiveComponents ( Alignables result) const
inlinevirtual
void AlignableBeamSpot::reset ( )

reset beam spot to the uninitialized state

Definition at line 183 of file AlignableBeamSpot.cc.

References theAlignmentPositionError, theInitializedFlag, and Alignable::update().

Referenced by MatrixReader.MatrixReader::__init__(), data_sources.json_list::next(), AlignableExtras::resetBeamSpot(), MatrixReader.MatrixReader::showRaw(), and surfaceDeformationIdPairs().

184 {
185  Alignable::update(this->id(), AlignableSurface());
187  theAlignmentPositionError = nullptr;
188  theInitializedFlag = false;
189 }
void update(align::ID, const AlignableSurface &)
Definition: Alignable.cc:50
AlignmentPositionError * theAlignmentPositionError
void AlignableBeamSpot::rotateInGlobalFrame ( const RotationType rotation)
virtual

Rotation interpreted in global reference frame.

Implements Alignable.

Definition at line 46 of file AlignableBeamSpot.cc.

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

Referenced by recursiveComponents().

47 {
49  this->addRotation( rotation );
50 }
const RotationType & rotation() const
Return change of orientation since the creation of the object.
Definition: Alignable.h:147
void addRotation(const RotationType &rotation)
Definition: Alignable.cc:256
void rotate(const RotationType &rotation)
AlignableSurface theSurface
Definition: Alignable.h:243
void AlignableBeamSpot::setAlignmentPositionError ( const AlignmentPositionError ape,
bool  propagateDown 
)
virtual

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

Implements Alignable.

Definition at line 53 of file AlignableBeamSpot.cc.

References theAlignmentPositionError.

Referenced by recursiveComponents().

54 {
57  else
59 }
AlignmentPositionError * theAlignmentPositionError
void AlignableBeamSpot::setSurfaceDeformation ( const SurfaceDeformation ,
bool   
)
virtual

do no use, for compatibility only

Implements Alignable.

Definition at line 89 of file AlignableBeamSpot.cc.

Referenced by surfaceDeformationIdPairs().

90 {
91  edm::LogInfo("Alignment") << "@SUB=AlignableBeamSpot::setSurfaceDeformation"
92  << "Useless method for beam spot, do nothing.";
93 }
virtual int AlignableBeamSpot::surfaceDeformationIdPairs ( std::vector< std::pair< int, SurfaceDeformation * > > &  ) const
inlinevirtual

Return surface deformations.

Implements Alignable.

Definition at line 79 of file AlignableBeamSpot.h.

References addSurfaceDeformation(), BeamSpotFakeParameters_cfi::dxdz, BeamSpotFakeParameters_cfi::dydz, initialize(), reset(), setSurfaceDeformation(), x, y, and z.

79 { return 0; }

Member Data Documentation

AlignmentPositionError* AlignableBeamSpot::theAlignmentPositionError
private
bool AlignableBeamSpot::theInitializedFlag
private

Definition at line 101 of file AlignableBeamSpot.h.

Referenced by initialize(), and reset().