ATLAS Offline Software
AlignableTransform.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef DETDESCRCOND_ALIGNTRANS_H
6 #define DETDESCRCOND_ALIGNTRANS_H
7 // AlignableTransform.h - simple class to hold Identifier and transform for
8 // alignment information
9 // Richard Hawkings, started 23/9/03
10 //
11 // AlignableTransform consists of a vector of AlignTransMember objects,
12 // each of which is contains an Identifier and a HepGeom::Transform3D
13 // It is designed to reside in the detector store and be kept in the
14 // conditionsDB. The AlignTransTool AlgTool (in DetDescrTools) provides
15 // a user interface to manage these objects
16 
17 #include <vector>
18 #include <algorithm>
19 #include "Identifier/Identifier.h"
20 #include "CLHEP/Geometry/Transform3D.h"
21 #include "AthenaKernel/CLASS_DEF.h"
22 #include "boost/range/iterator_range.hpp"
23 
25  public:
27  AlignableTransform(const std::string& tag);
28  virtual ~AlignableTransform();
29 
30  // embedded class AlignTransMember holds the information for one module
31  // i.e. module identifier and associated transform
33  public:
36  const Identifier& identify() const;
37  const HepGeom::Transform3D& transform() const;
38  void setTransform(const HepGeom::Transform3D& trans);
39 
40  private:
43  };
44 
45  // const and non-const iterator definitions
46  typedef std::vector<AlignTransMember>::const_iterator AlignTransMem_citr;
47  typedef boost::iterator_range<AlignTransMem_citr> AlignTransMem_crange;
48  AlignTransMem_citr begin() const;
49  AlignTransMem_citr end() const;
52  typedef boost::iterator_range<AlignTransMem_itr> AlignTransMem_range;
56  // return pointer to particular module
59  // return tag name for AlignableTransform
60  const std::string& tag() const;
61  size_t size() const;
62 
63  // add a new member to the AlignableTransform
64  void add(const Identifier& ident,const HepGeom::Transform3D& trans);
65  // reset the specified transform
66  bool update(const Identifier& ident,const HepGeom::Transform3D& trans);
67  // tweak, i.e. combine new transform with that already existing
68  bool tweak(const Identifier& ident,const HepGeom::Transform3D& trans);
69  void print() const;
70  void print2() const;
71  // sort transform vector, to be called after adding new transforms
72  void sortv();
73 
74  private:
76  std::string m_tag;
77  std::vector<AlignTransMember> m_vec;
78 };
79 
80 CLASS_DEF(AlignableTransform,158187411,1)
81 
82 inline const Identifier&
84 { return m_ident;}
85 
86 inline const HepGeom::Transform3D&
88 { return m_trans;}
89 
91  const HepGeom::Transform3D& trans) { m_trans=trans;}
92 
95  return (lhs.identify() < rhs.identify());
96 }
97 
99  : m_tag ("null")
100 {}
102 
104  AlignableTransform::begin() const { return m_vec.begin();}
106  AlignableTransform::end() const { return m_vec.end();}
109 
111  AlignableTransform::mbegin() { return m_vec.begin();}
113  AlignableTransform::mend() { return m_vec.end();}
116 
120  AlignableTransform::AlignTransMem_citr rc=std::lower_bound(m_vec.begin(),m_vec.end(),obj);
121  if (rc!=m_vec.end() && rc->identify()!=ident) rc=m_vec.end();
122  return rc;
123 }
124 
125 // same as previous but non-const
129  AlignableTransform::AlignTransMem_itr rc=std::lower_bound(m_vec.begin(),m_vec.end(),obj);
130  if (rc!=m_vec.end() && rc->identify()!=ident) rc=m_vec.end();
131  return rc;
132 }
133 
134 inline const std::string& AlignableTransform::tag() const {return m_tag;}
135 
136 inline size_t AlignableTransform::size() const {return m_vec.size();}
137 
139  sort(m_vec.begin(),m_vec.end()); }
140 
141 #endif // DETDESCRCOND_ALIGNTRANS_H
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
AlignableTransform::AlignTransMember::transform
const HepGeom::Transform3D & transform() const
Definition: AlignableTransform.h:87
AlignableTransform::sortv
void sortv()
Definition: AlignableTransform.h:138
AlignableTransform::AlignTransMember::identify
const Identifier & identify() const
Definition: AlignableTransform.h:83
AlignableTransform::AlignTransMem_citr
std::vector< AlignTransMember >::const_iterator AlignTransMem_citr
Definition: AlignableTransform.h:46
AlignableTransform::update
bool update(const Identifier &ident, const HepGeom::Transform3D &trans)
Definition: AlignableTransform.cxx:39
AlignableTransform::AlignTransMember::setTransform
void setTransform(const HepGeom::Transform3D &trans)
Definition: AlignableTransform.h:90
AlignableTransform::AlignTransMember::AlignTransMember
AlignTransMember()
Definition: AlignableTransform.cxx:58
AlignableTransform::~AlignableTransform
virtual ~AlignableTransform()
Definition: AlignableTransform.h:101
xAOD::identify
Identifier identify(const UncalibratedMeasurement *meas)
Returns the associated identifier.
Definition: MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/Root/UtilFunctions.cxx:61
AlignableTransform::AlignableTransform
AlignableTransform()
Definition: AlignableTransform.h:98
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
AlignableTransform::AlignTransMember::m_ident
Identifier m_ident
Definition: AlignableTransform.h:41
AlignableTransform::tag
const std::string & tag() const
Definition: AlignableTransform.h:134
AlignableTransform::m_tag
std::string m_tag
Definition: AlignableTransform.h:76
AlignableTransform::size
size_t size() const
Definition: AlignableTransform.h:136
AlignableTransform::end
AlignTransMem_citr end() const
Definition: AlignableTransform.h:106
AlignableTransform::AlignTransMember::m_trans
HepGeom::Transform3D m_trans
Definition: AlignableTransform.h:42
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
operator<
bool operator<(const AlignableTransform::AlignTransMember &lhs, const AlignableTransform::AlignTransMember &rhs)
Definition: AlignableTransform.h:93
AlignableTransform::add
void add(const Identifier &ident, const HepGeom::Transform3D &trans)
Definition: AlignableTransform.cxx:16
AlignableTransform::print
void print() const
Definition: AlignableTransform.cxx:22
AlignableTransform::print2
void print2() const
Definition: AlignableTransform.cxx:27
AlignableTransform
Definition: AlignableTransform.h:24
AlignableTransform::range
AlignTransMem_crange range() const
Definition: AlignableTransform.h:108
AlignableTransform::AlignTransMem_itr
std::vector< AlignTransMember >::iterator AlignTransMem_itr
Definition: AlignableTransform.h:51
TRT::Hit::ident
@ ident
Definition: HitInfo.h:77
AlignableTransform::mrange
AlignTransMem_range mrange()
Definition: AlignableTransform.h:115
AlignableTransform::findIdent
AlignTransMem_citr findIdent(const Identifier &ident) const
Definition: AlignableTransform.h:118
AlignableTransform::AlignTransMember
Definition: AlignableTransform.h:32
AlignableTransform::AlignTransMem_crange
boost::iterator_range< AlignTransMem_citr > AlignTransMem_crange
Definition: AlignableTransform.h:47
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
AlignableTransform::mend
AlignTransMem_itr mend()
Definition: AlignableTransform.h:113
AlignableTransform::AlignTransMem_range
boost::iterator_range< AlignTransMem_itr > AlignTransMem_range
Definition: AlignableTransform.h:52
AlignableTransform::begin
AlignTransMem_citr begin() const
Definition: AlignableTransform.h:104
python.PyAthena.obj
obj
Definition: PyAthena.py:132
CLASS_DEF.h
macros to associate a CLID to a type
AlignableTransformCnv_p1
Definition: AlignableTransformCnv_p1.h:13
AlignableTransform::m_vec
std::vector< AlignTransMember > m_vec
Definition: AlignableTransform.h:77
AlignableTransform::tweak
bool tweak(const Identifier &ident, const HepGeom::Transform3D &trans)
Definition: AlignableTransform.cxx:48
Identifier
Definition: IdentifierFieldParser.cxx:14
AlignableTransform::mbegin
AlignTransMem_itr mbegin()
Definition: AlignableTransform.h:111