CMS 3D CMS Logo

AlignTransform.h
Go to the documentation of this file.
1 #ifndef AlignTransform_H
2 #define AlignTransform_H
4 
5 #include "CLHEP/Vector/EulerAngles.h"
6 #include "CLHEP/Vector/Rotation.h"
7 #include "CLHEP/Vector/ThreeVector.h"
8 #include "CLHEP/Geometry/Transform3D.h"
9 
11 
16 {
17 public:
18  typedef CLHEP::HepEulerAngles EulerAngles;
19  typedef CLHEP::Hep3Vector Translation;
20  typedef CLHEP::HepRotation Rotation;
21  typedef HepGeom::Transform3D Transform;
22 
25 
27  AlignTransform( const Translation & itranslation,
28  const EulerAngles & ieulerAngles,
29  align::ID irawId ) :
30  m_translation(itranslation),
31  m_eulerAngles(ieulerAngles),
32  m_rawId(irawId) {}
33 
35  AlignTransform( const Translation & itranslation,
36  const Rotation & irotation,
37  align::ID irawId ) :
38  m_translation(itranslation),
39  m_eulerAngles(irotation.eulerAngles()),
40  m_rawId(irawId) {}
41 
42  const Translation & translation() const { return m_translation; }
44  // const EulerAngles & eulerAngles() const { return m_eulerAngles; }
45  align::ID rawId() const { return m_rawId; }
46 
47  Rotation rotation() const
48  { //std::cout<<"Inside aligntransform::rotation() with id="<<std::hex<<m_rawId<<std::dec<<std::endl ;
49  //std::cout<<" for e.a.="<<m_eulerAngles<<std::endl;
50  return Rotation(m_eulerAngles); }
51 
52  Transform transform() const { return Transform( rotation(), translation() ) ; }
53 
54  // Implemented so this can be sorted by rawId
55  const bool operator < ( const AlignTransform & other ) const
56  {
57  return ( m_rawId < other.rawId() );
58  }
59 
60  private:
61 
62  Translation m_translation;
63  EulerAngles m_eulerAngles;
65 
66 
67 
69 };
70 #endif //AlignTransform_H
HepGeom::Transform3D Transform
AlignTransform(const Translation &itranslation, const EulerAngles &ieulerAngles, align::ID irawId)
Constructor from Euler angles.
uint32_t ID
Definition: Definitions.h:26
CLHEP::Hep3Vector Translation
CLHEP::HepEulerAngles EulerAngles
const bool operator<(const AlignTransform &other) const
AlignTransform(const Translation &itranslation, const Rotation &irotation, align::ID irawId)
Constructor from Rotation.
const Translation & translation() const
EulerAngles m_eulerAngles
align::ID m_rawId
AlignTransform()
Default constructor.
Transform transform() const
#define COND_SERIALIZABLE
Definition: Serializable.h:38
Translation m_translation
Rotation rotation() const
align::ID rawId() const
Do not expose Euler angles since we may change its type later.
CLHEP::HepRotation Rotation