ATLAS Offline Software
Public Types | Public Member Functions | List of all members
NswAsBuilt::ElementModelRigid Class Reference

An element model without deformations, i.e. More...

#include <ElementModelRigid.h>

Inheritance diagram for NswAsBuilt::ElementModelRigid:
Collaboration diagram for NswAsBuilt::ElementModelRigid:

Public Types

enum  parameter_t {
  X =0, Y =1, Z =2, THX =3,
  THY =4, THZ =5
}
 
using ipar_t = unsigned int
 
using VectorSet = Eigen::Matrix< double, 3, Eigen::Dynamic, Eigen::ColMajor|Eigen::AutoAlign, 3, 5 >
 
using VectorSetRef = Eigen::Ref< VectorSet >
 

Public Member Functions

virtual int nParameters () const override
 
virtual void transform (const ParameterVector &parvec, VectorSetRef local) const override
 
virtual void cacheTransform (ParameterVector &parvec) const override
 
virtual ipar_t getParameterIndex (const std::string &parname) const override
 
virtual std::string getParameterName (ipar_t ipar) const override
 

Detailed Description

An element model without deformations, i.e.

with only a (3D) translation and a (3D) rotation

Definition at line 16 of file ElementModelRigid.h.

Member Typedef Documentation

◆ ipar_t

using NswAsBuilt::ElementModel::ipar_t = unsigned int
inherited

Definition at line 35 of file ElementModel.h.

◆ VectorSet

using NswAsBuilt::ElementModel::VectorSet = Eigen::Matrix<double, 3, Eigen::Dynamic, Eigen::ColMajor|Eigen::AutoAlign, 3, 5>
inherited

Definition at line 36 of file ElementModel.h.

◆ VectorSetRef

using NswAsBuilt::ElementModel::VectorSetRef = Eigen::Ref<VectorSet>
inherited

Definition at line 37 of file ElementModel.h.

Member Enumeration Documentation

◆ parameter_t

Enumerator
THX 
THY 
THZ 

Definition at line 18 of file ElementModelRigid.h.

18 { X=0, Y=1, Z=2, THX=3, THY=4, THZ=5 };

Member Function Documentation

◆ cacheTransform()

void ElementModelRigid::cacheTransform ( ParameterVector parvec) const
overridevirtual

Implements NswAsBuilt::ElementModel.

Definition at line 22 of file ElementModelRigid.cxx.

23 {
24  const auto& pars = parvec.parameters;
25  parvec.transformCache
26  = Eigen::Translation3d(pars[X], pars[Y], pars[Z])
27  * Eigen::AngleAxisd(pars[THZ], Eigen::Vector3d::UnitZ())
28  * Eigen::AngleAxisd(pars[THY], Eigen::Vector3d::UnitY())
29  * Eigen::AngleAxisd(pars[THX], Eigen::Vector3d::UnitX());
30  parvec.transformCacheValid = true;
31 }

◆ getParameterIndex()

ElementModelRigid::ipar_t ElementModelRigid::getParameterIndex ( const std::string &  parname) const
overridevirtual

Implements NswAsBuilt::ElementModel.

Definition at line 35 of file ElementModelRigid.cxx.

36 {
37  if (parname == "x") return parameter_t::X;
38  if (parname == "y") return parameter_t::Y;
39  if (parname == "z") return parameter_t::Z;
40  if (parname == "thx") return parameter_t::THX;
41  if (parname == "thy") return parameter_t::THY;
42  if (parname == "thz") return parameter_t::THZ;
43  throw std::runtime_error("Invalid parameter name "+parname);
44 }

◆ getParameterName()

std::string ElementModelRigid::getParameterName ( ipar_t  ipar) const
overridevirtual

Implements NswAsBuilt::ElementModel.

Definition at line 48 of file ElementModelRigid.cxx.

49 {
50  switch (ipar) {
51  case X: return "x";
52  case Y: return "y";
53  case Z: return "z";
54  case THX: return "thx";
55  case THY: return "thy";
56  case THZ: return "thz";
57  default: throw std::runtime_error("Invalid parameter");
58  }
59 }

◆ nParameters()

virtual int NswAsBuilt::ElementModelRigid::nParameters ( ) const
inlineoverridevirtual

Implements NswAsBuilt::ElementModel.

Definition at line 21 of file ElementModelRigid.h.

21 { return 6; }

◆ transform()

void ElementModelRigid::transform ( const ParameterVector parvec,
VectorSetRef  local 
) const
overridevirtual

Implements NswAsBuilt::ElementModel.

Definition at line 12 of file ElementModelRigid.cxx.

13 {
14  if (!parvec.transformCacheValid) {
15  throw std::runtime_error("Should call Element::cacheTransforms() first");
16  }
17  local = (parvec.transformCache * local).eval(); // Needs eval to avoid aliasing (?)
18 }

The documentation for this class was generated from the following files:
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
NswAsBuilt::ElementModelRigid::Z
@ Z
Definition: ElementModelRigid.h:18
Monitored::Z
@ Z
Definition: HistogramFillerUtils.h:24
python.CreateTierZeroArgdict.parname
parname
Definition: CreateTierZeroArgdict.py:194
NswAsBuilt::ElementModelRigid::Y
@ Y
Definition: ElementModelRigid.h:18
NswAsBuilt::ElementModelRigid::THY
@ THY
Definition: ElementModelRigid.h:18
Monitored::X
@ X
Definition: HistogramFillerUtils.h:24
NswAsBuilt::ElementModelRigid::X
@ X
Definition: ElementModelRigid.h:18
InDetDD::local
@ local
Definition: InDetDD_Defs.h:16
Monitored::Y
@ Y
Definition: HistogramFillerUtils.h:24
NswAsBuilt::ElementModelRigid::THX
@ THX
Definition: ElementModelRigid.h:18
NswAsBuilt::ElementModelRigid::THZ
@ THZ
Definition: ElementModelRigid.h:18