CMS 3D CMS Logo

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

#include <AlignableBeamSpot.h>

Inheritance diagram for AlignableBeamSpot:
Alignable

Public Member Functions

void addAlignmentPositionError (const AlignmentPositionError &ape, bool propagateDown) override
 
void addAlignmentPositionErrorFromLocalRotation (const RotationType &rotation, bool propagateDown) override
 
void addAlignmentPositionErrorFromRotation (const RotationType &rot, bool propagateDown) override
 
void addComponent (Alignable *component) override
 
void addSurfaceDeformation (const SurfaceDeformation *, bool) override
 do no use, for compatibility only More...
 
 AlignableBeamSpot ()
 
StructureType alignableObjectId () const override
 Return the alignable type identifier. More...
 
AlignmentErrorsExtendedalignmentErrors () const override
 Return vector of alignment errors. More...
 
const AlignmentPositionErroralignmentPositionError () const
 alignment position error - for checking only, otherwise use alignmentErrors() above! More...
 
Alignmentsalignments () const override
 Return vector of alignment data. More...
 
const Alignablescomponents () const override
 Return vector of direct components. More...
 
void dump () const override
 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...
 
void move (const GlobalVector &displacement) override
 Move with respect to the global reference frame. More...
 
void recursiveComponents (Alignables &result) const override
 Provide all components, subcomponents etc. (cf. description in base class) More...
 
void reset ()
 reset beam spot to the uninitialized state More...
 
void rotateInGlobalFrame (const RotationType &rotation) override
 Rotation interpreted in global reference frame. More...
 
void setAlignmentPositionError (const AlignmentPositionError &ape, bool propagateDown) override
 Set the AlignmentPositionError and, if (propagateDown), to all components. More...
 
void setSurfaceDeformation (const SurfaceDeformation *, bool) override
 do no use, for compatibility only More...
 
int surfaceDeformationIdPairs (std::vector< std::pair< int, SurfaceDeformation * > > &) const override
 Return surface deformations. More...
 
 ~AlignableBeamSpot () override
 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 recenterSurface ()
 Recenter surface object without moving possible components. 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
 

Static Private Attributes

static const Alignables emptyComponents_ {}
 

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::AlignableBeamSpot ( )

Definition at line 21 of file AlignableBeamSpot.cc.

◆ ~AlignableBeamSpot()

AlignableBeamSpot::~AlignableBeamSpot ( )
override

Destructor.

Definition at line 27 of file AlignableBeamSpot.cc.

27 { delete theAlignmentPositionError; }

References theAlignmentPositionError.

Member Function Documentation

◆ addAlignmentPositionError()

void AlignableBeamSpot::addAlignmentPositionError ( const AlignmentPositionError ape,
bool  propagateDown 
)
overridevirtual

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

Implements Alignable.

Definition at line 50 of file AlignableBeamSpot.cc.

50  {
53  } else {
55  }
56 }

References theAlignmentPositionError.

◆ addAlignmentPositionErrorFromLocalRotation()

void AlignableBeamSpot::addAlignmentPositionErrorFromLocalRotation ( const RotationType rot,
bool  propagateDown 
)
overridevirtual

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 65 of file AlignableBeamSpot.cc.

65 {}

◆ addAlignmentPositionErrorFromRotation()

void AlignableBeamSpot::addAlignmentPositionErrorFromRotation ( const RotationType rot,
bool  propagateDown 
)
overridevirtual

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 59 of file AlignableBeamSpot.cc.

59 {}

◆ addComponent()

void AlignableBeamSpot::addComponent ( Alignable component)
inlineoverridevirtual

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

29 {}

◆ addSurfaceDeformation()

void AlignableBeamSpot::addSurfaceDeformation ( const SurfaceDeformation ,
bool   
)
overridevirtual

do no use, for compatibility only

Implements Alignable.

Definition at line 74 of file AlignableBeamSpot.cc.

74  {
75  edm::LogInfo("Alignment") << "@SUB=AlignableBeamSpot::addSurfaceDeformation"
76  << "Useless method for beam spot, do nothing.";
77 }

◆ alignableObjectId()

StructureType AlignableBeamSpot::alignableObjectId ( ) const
inlineoverridevirtual

Return the alignable type identifier.

Implements Alignable.

Definition at line 60 of file AlignableBeamSpot.h.

60 { return align::BeamSpot; }

References align::BeamSpot.

Referenced by dump().

◆ alignmentErrors()

AlignmentErrorsExtended * AlignableBeamSpot::alignmentErrors ( void  ) const
overridevirtual

Return vector of alignment errors.

Implements Alignable.

Definition at line 114 of file AlignableBeamSpot.cc.

114  {
115  AlignmentErrorsExtended* m_alignmentErrors = new AlignmentErrorsExtended();
116 
117  // Add associated alignment position error
118  uint32_t detId = theId;
119  CLHEP::HepSymMatrix clhepSymMatrix(6, 0);
120  if (theAlignmentPositionError) // Might not be set
122  AlignTransformErrorExtended transformError(clhepSymMatrix, detId);
123  m_alignmentErrors->m_alignError.push_back(transformError);
124 
125  return m_alignmentErrors;
126 }

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

◆ alignmentPositionError()

const AlignmentPositionError* AlignableBeamSpot::alignmentPositionError ( ) const
inline

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

Definition at line 72 of file AlignableBeamSpot.h.

72 { return theAlignmentPositionError; }

References theAlignmentPositionError.

Referenced by AlignableDetOrUnitPtr::alignmentPositionError().

◆ alignments()

Alignments * AlignableBeamSpot::alignments ( void  ) const
overridevirtual

Return vector of alignment data.

Implements Alignable.

Definition at line 95 of file AlignableBeamSpot.cc.

95  {
96  Alignments* m_alignments = new Alignments();
98 
99  // Get position, rotation, detId
100  CLHEP::Hep3Vector clhepVector(globalPosition().x(), globalPosition().y(), globalPosition().z());
101  CLHEP::HepRotation clhepRotation(
102  CLHEP::HepRep3x3(rot.xx(), rot.xy(), rot.xz(), rot.yx(), rot.yy(), rot.yz(), rot.zx(), rot.zy(), rot.zz()));
103  uint32_t detId = theId;
104 
105  AlignTransform transform(clhepVector, clhepRotation, detId);
106 
107  // Add to alignments container
108  m_alignments->m_align.push_back(transform);
109 
110  return m_alignments;
111 }

References detId(), Alignable::globalPosition(), Alignable::globalRotation(), Alignments::m_align, makeMuonMisalignmentScenario::rot, Alignable::theId, HcalDetIdTransform::transform(), x, y, and z.

◆ components()

const Alignables& AlignableBeamSpot::components ( ) const
inlineoverridevirtual

Return vector of direct components.

Implements Alignable.

Definition at line 32 of file AlignableBeamSpot.h.

32 { return emptyComponents_; }

References emptyComponents_.

◆ detId()

static const DetId AlignableBeamSpot::detId ( )
inlinestatic

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

Definition at line 90 of file AlignableBeamSpot.h.

90 { return DetId((DetId::Tracker << DetId::kDetOffset) + 0x1ffffff); }

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

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

◆ dump()

void AlignableBeamSpot::dump ( void  ) const
overridevirtual

Recursive printout of alignable structure.

Implements Alignable.

Definition at line 80 of file AlignableBeamSpot.cc.

80  {
81  // Dump this
82 
83  LocalVector lv(0.0, 0.0, 1.0);
85 
86  edm::LogInfo("AlignableDump") << " Alignable of type " << this->alignableObjectId() << " has 0 components"
87  << std::endl
88  << " position = " << this->globalPosition() << ", orientation:" << std::endl
89  << std::flush << this->globalRotation() << std::endl
90  << std::flush << " dxdz = " << gv.x() / gv.z() << " dydz = " << gv.y() / gv.z()
91  << std::endl;
92 }

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 initialize().

◆ initialize()

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 129 of file AlignableBeamSpot.cc.

129  {
130  if (theInitializedFlag)
131  return;
132 
133  GlobalVector gv(x, y, z);
134  theSurface.move(gv);
135 
136  double angleY = std::atan(dxdz);
137  double angleX = -std::atan(dydz);
138 
139  align::RotationType rotY(std::cos(angleY), 0., -std::sin(angleY), 0., 1., 0., std::sin(angleY), 0., std::cos(angleY));
140 
141  align::RotationType rotX(1., 0., 0., 0., std::cos(angleX), std::sin(angleX), 0., -std::sin(angleX), std::cos(angleX));
142 
143  theSurface.rotate(rotY * rotX);
144 
145  this->dump();
146 
147  theInitializedFlag = true;
148 }

References funct::cos(), dump(), BeamSpotFakeParameters_cfi::dxdz, BeamSpotFakeParameters_cfi::dydz, GloballyPositioned< T >::move(), GloballyPositioned< T >::rotate(), funct::sin(), theInitializedFlag, Alignable::theSurface, x, y, and z.

Referenced by AlignableExtras::initializeBeamSpot().

◆ move()

void AlignableBeamSpot::move ( const GlobalVector displacement)
overridevirtual

Move with respect to the global reference frame.

Implements Alignable.

Definition at line 30 of file AlignableBeamSpot.cc.

30  {
31  theSurface.move(displacement);
32  this->addDisplacement(displacement);
33 }

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

◆ recursiveComponents()

void AlignableBeamSpot::recursiveComponents ( Alignables result) const
inlineoverridevirtual

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

Implements Alignable.

Definition at line 35 of file AlignableBeamSpot.h.

35 {}

◆ reset()

void AlignableBeamSpot::reset ( )

◆ rotateInGlobalFrame()

void AlignableBeamSpot::rotateInGlobalFrame ( const RotationType rotation)
overridevirtual

Rotation interpreted in global reference frame.

Implements Alignable.

Definition at line 36 of file AlignableBeamSpot.cc.

36  {
38  this->addRotation(rotation);
39 }

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

◆ setAlignmentPositionError()

void AlignableBeamSpot::setAlignmentPositionError ( const AlignmentPositionError ape,
bool  propagateDown 
)
overridevirtual

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

Implements Alignable.

Definition at line 42 of file AlignableBeamSpot.cc.

42  {
45  else
47 }

References theAlignmentPositionError.

◆ setSurfaceDeformation()

void AlignableBeamSpot::setSurfaceDeformation ( const SurfaceDeformation ,
bool   
)
overridevirtual

do no use, for compatibility only

Implements Alignable.

Definition at line 68 of file AlignableBeamSpot.cc.

68  {
69  edm::LogInfo("Alignment") << "@SUB=AlignableBeamSpot::setSurfaceDeformation"
70  << "Useless method for beam spot, do nothing.";
71 }

◆ surfaceDeformationIdPairs()

int AlignableBeamSpot::surfaceDeformationIdPairs ( std::vector< std::pair< int, SurfaceDeformation * > > &  ) const
inlineoverridevirtual

Return surface deformations.

Implements Alignable.

Definition at line 75 of file AlignableBeamSpot.h.

75 { return 0; }

Member Data Documentation

◆ emptyComponents_

const align::Alignables AlignableBeamSpot::emptyComponents_ {}
staticprivate

Definition at line 93 of file AlignableBeamSpot.h.

Referenced by components().

◆ theAlignmentPositionError

AlignmentPositionError* AlignableBeamSpot::theAlignmentPositionError
private

◆ theInitializedFlag

bool AlignableBeamSpot::theInitializedFlag
private

Definition at line 96 of file AlignableBeamSpot.h.

Referenced by initialize(), and reset().

Vector3DBase< float, LocalTag >
TkRotation< Scalar >
DDAxes::y
BeamSpotFakeParameters_cfi.dxdz
dxdz
Definition: BeamSpotFakeParameters_cfi.py:12
GloballyPositioned::rotate
void rotate(const RotationType &rotation)
Definition: GloballyPositioned.h:136
align::BeamSpot
Definition: StructureType.h:89
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
edm::LogInfo
Definition: MessageLogger.h:254
Alignable::Alignable
Alignable()
private default ctr. to enforce usage of the specialised ones
Definition: Alignable.h:257
DDAxes::x
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
DetId
Definition: DetId.h:17
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
AlignmentPositionError::globalError
const GlobalErrorExtended & globalError() const
Definition: AlignmentPositionError.h:24
Alignable::update
void update(align::ID, const AlignableSurface &)
Definition: Alignable.cc:45
DDAxes::z
HcalDetIdTransform::transform
unsigned transform(const HcalDetId &id, unsigned transformCode)
Definition: HcalDetIdTransform.cc:7
AlignableSurface::toGlobal
align::GlobalPoints toGlobal(const align::LocalPoints &) const
Return in global coord given a set of local points.
Definition: AlignableSurface.cc:15
Alignable::addRotation
void addRotation(const RotationType &rotation)
Definition: Alignable.cc:193
AlignableBeamSpot::theInitializedFlag
bool theInitializedFlag
Definition: AlignableBeamSpot.h:96
AlignTransform
Definition: AlignTransform.h:15
AlignableBeamSpot::alignableObjectId
StructureType alignableObjectId() const override
Return the alignable type identifier.
Definition: AlignableBeamSpot.h:60
AlignableBeamSpot::detId
static const DetId detId()
Definition: AlignableBeamSpot.h:90
Alignable::rotation
const RotationType & rotation() const
Return change of orientation since the creation of the object.
Definition: Alignable.h:144
DetId::Tracker
Definition: DetId.h:25
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
Alignable::RotationType
align::RotationType RotationType
Definition: Alignable.h:31
AlignableBeamSpot::dump
void dump() const override
Recursive printout of alignable structure.
Definition: AlignableBeamSpot.cc:80
GloballyPositioned::move
void move(const GlobalVector &displacement)
Definition: GloballyPositioned.h:128
Alignable::theSurface
AlignableSurface theSurface
Definition: Alignable.h:237
AlignmentErrorsExtended
Definition: AlignmentErrorsExtended.h:10
BeamSpotFakeParameters_cfi.dydz
dydz
Definition: BeamSpotFakeParameters_cfi.py:13
DetId::kDetOffset
static const int kDetOffset
Definition: DetId.h:21
AlignableSurface
Definition: AlignableSurface.h:20
Alignable::addDisplacement
void addDisplacement(const GlobalVector &displacement)
Definition: Alignable.cc:190
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
Alignable::theId
align::ID theId
Definition: Alignable.h:235
AlignTransformErrorExtended
Definition: AlignTransformErrorExtended.h:13
GlobalErrorBaseExtended::matrix
const AlgebraicSymMatrix66 & matrix() const
Definition: GlobalErrorBaseExtended.h:153
Alignments::m_align
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
AlignmentErrorsExtended::m_alignError
std::vector< AlignTransformErrorExtended > m_alignError
Definition: AlignmentErrorsExtended.h:19
AlignableBeamSpot::emptyComponents_
static const Alignables emptyComponents_
Definition: AlignableBeamSpot.h:93
AlignableBeamSpot::theAlignmentPositionError
AlignmentPositionError * theAlignmentPositionError
Definition: AlignableBeamSpot.h:94
Alignable::globalPosition
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:135
AlignmentPositionError
Definition: AlignmentPositionError.h:10
asHepMatrix
CLHEP::HepMatrix asHepMatrix(const ROOT::Math::SMatrix< double, N1, N2, typename ROOT::Math::MatRepStd< double, N1, N2 > > &rm)
Definition: Migration.h:59
Alignments
Definition: Alignments.h:10
Alignable::globalRotation
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:138