CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Attributes

AlignableBeamSpot Class Reference

#include <AlignableBeamSpot.h>

Inheritance diagram for AlignableBeamSpot:
Alignable

List of all members.

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
 AlignableBeamSpot ()
virtual StructureType alignableObjectId () const
 Return the alignable type identifier.
virtual AlignmentErrorsalignmentErrors () const
 Return vector of alignment errors.
const AlignmentPositionErroralignmentPositionError () const
 alignment position error - for checking only, otherwise use alignmentErrors() above!
virtual Alignmentsalignments () const
 Return vector of alignment data.
virtual Alignables components () const
 Return vector of direct components.
virtual void dump () const
 Recursive printout of alignable structure.
void initialize (double x, double y, double z, double dxdz, double dydz)
 initialize the alignable with the passed beam spot parameters
virtual void move (const GlobalVector &displacement)
 Move with respect to the global reference frame.
virtual void recursiveComponents (Alignables &result) const
 Provide all components, subcomponents etc. (cf. description in base class)
virtual void rotateInGlobalFrame (const RotationType &rotation)
 Rotation interpreted in global reference frame.
virtual void setAlignmentPositionError (const AlignmentPositionError &ape, bool propagateDown)
 Set the AlignmentPositionError and, if (propagateDown), to all components.
virtual void setSurfaceDeformation (const SurfaceDeformation *, bool)
 do no use, for compatibility only
virtual int surfaceDeformationIdPairs (std::vector< std::pair< int, SurfaceDeformation * > > &) const
 Return surface deformations.
virtual ~AlignableBeamSpot ()
 Destructor.

Static Public Member Functions

static const DetId detId ()

Private Attributes

AlignmentPositionErrortheAlignmentPositionError
bool theInitializedFlag

Detailed Description

An Alignable for the beam spot

Original author: Andreas Mussgiller, August 2010

Date:
2010/10/29 12:16:28
Revision:
1.3

(last update by

Author:
mussgill

)

Definition at line 19 of file AlignableBeamSpot.h.


Constructor & Destructor Documentation

AlignableBeamSpot::AlignableBeamSpot ( )
AlignableBeamSpot::~AlignableBeamSpot ( ) [virtual]

Destructor.

Definition at line 33 of file AlignableBeamSpot.cc.

References 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.

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.

{

}
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.

{

}
virtual void AlignableBeamSpot::addComponent ( Alignable component) [inline, virtual]

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.

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

do no use, for compatibility only

Implements Alignable.

Definition at line 96 of file AlignableBeamSpot.cc.

{
  edm::LogInfo("Alignment") << "@SUB=AlignableBeamSpot::addSurfaceDeformation"
                            << "Useless method for beam spot, do nothing.";
}
virtual StructureType AlignableBeamSpot::alignableObjectId ( ) const [inline, virtual]

Return the alignable type identifier.

Implements Alignable.

Definition at line 64 of file AlignableBeamSpot.h.

References align::BeamSpot.

Referenced by dump().

{ return align::BeamSpot; }
AlignmentErrors * 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(), AlignmentErrors::m_alignError, GlobalErrorBase< T, ErrorWeightType >::matrix(), theAlignmentPositionError, and Alignable::theId.

{
  AlignmentErrors* m_alignmentErrors = new AlignmentErrors();

  // Add associated alignment position error
  uint32_t detId = theId;
  CLHEP::HepSymMatrix clhepSymMatrix(3,0);
  if ( theAlignmentPositionError ) // Might not be set
    clhepSymMatrix = asHepMatrix(theAlignmentPositionError->globalError().matrix());
  AlignTransformError transformError( clhepSymMatrix, detId );
  m_alignmentErrors->m_alignError.push_back( transformError );
  
  return m_alignmentErrors;
}
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().

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_pileup_plots::transform, x, TkRotation< T >::xx(), TkRotation< T >::xy(), TkRotation< T >::xz(), detailsBasic3DVector::y, TkRotation< T >::yx(), TkRotation< T >::yy(), TkRotation< T >::yz(), z, TkRotation< T >::zx(), TkRotation< T >::zy(), and TkRotation< T >::zz().

{
  Alignments* m_alignments = new Alignments();
  RotationType rot( this->globalRotation() );

  // Get position, rotation, detId
  CLHEP::Hep3Vector clhepVector( globalPosition().x(), globalPosition().y(), globalPosition().z() );
  CLHEP::HepRotation clhepRotation( CLHEP::HepRep3x3( rot.xx(), rot.xy(), rot.xz(),
                                                      rot.yx(), rot.yy(), rot.yz(),
                                                      rot.zx(), rot.zy(), rot.zz() ) );
  uint32_t detId = theId;
  
  AlignTransform transform( clhepVector, clhepRotation, detId );
  
  // Add to alignments container
  m_alignments->m_align.push_back( transform );

  return m_alignments;
}
virtual Alignables AlignableBeamSpot::components ( ) const [inline, virtual]

Return vector of direct components.

Implements Alignable.

Definition at line 35 of file AlignableBeamSpot.h.

{ return std::vector<Alignable*>(); }
static const DetId AlignableBeamSpot::detId ( ) [inline, static]
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 initialize().

{
  // Dump this

  LocalVector lv(0.0, 0.0, 1.0);
  GlobalVector gv = theSurface.toGlobal(lv);

  edm::LogInfo("AlignableDump") 
    << " Alignable of type " << this->alignableObjectId() 
    << " has 0 components" << std::endl
    << " position = " << this->globalPosition() << ", orientation:" << std::endl << std::flush
    << this->globalRotation() << std::endl << std::flush
    << " dxdz = " << gv.x()/gv.z() << " dydz = " << gv.y()/gv.z() << std::endl;
}
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 155 of file AlignableBeamSpot.cc.

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

Referenced by AlignableExtras::initializeBeamSpot().

{
  if (theInitializedFlag) return;

  GlobalVector gv(x, y, z);
  theSurface.move(gv);

  double angleY = std::atan(dxdz);
  double angleX = -std::atan(dydz);

  align::RotationType rotY( std::cos(angleY),  0., -std::sin(angleY), 
                            0.,                1.,  0.,
                            std::sin(angleY),  0.,  std::cos(angleY) );

  align::RotationType rotX( 1.,  0.,                0.,
                            0.,  std::cos(angleX),  std::sin(angleX),
                            0., -std::sin(angleX),  std::cos(angleX) );  

  theSurface.rotate(rotY * rotX);

  this->dump();
  
  theInitializedFlag = true;
}
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.

{
  theSurface.move( displacement );
  this->addDisplacement( displacement );
}
virtual void AlignableBeamSpot::recursiveComponents ( Alignables result) const [inline, virtual]

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

Implements Alignable.

Definition at line 38 of file AlignableBeamSpot.h.

{ }
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.

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.

void AlignableBeamSpot::setSurfaceDeformation ( const SurfaceDeformation ,
bool   
) [virtual]

do no use, for compatibility only

Implements Alignable.

Definition at line 89 of file AlignableBeamSpot.cc.

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

Return surface deformations.

Implements Alignable.

Definition at line 79 of file AlignableBeamSpot.h.

{ return 0; }

Member Data Documentation

Definition at line 98 of file AlignableBeamSpot.h.

Referenced by initialize().