ATLAS Offline Software
Loading...
Searching...
No Matches
ElementModel.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONNSWASBUILT_ELEMENTMODEL_H
6#define MUONNSWASBUILT_ELEMENTMODEL_H
7
8#include <vector>
10
11namespace NswAsBuilt {
12
34 public:
35 using ipar_t = unsigned int;
36 using VectorSet = Eigen::Matrix<double, 3, Eigen::Dynamic, Eigen::ColMajor|Eigen::AutoAlign, 3, 5>;
37 using VectorSetRef = Eigen::Ref<VectorSet>;
38 virtual ~ElementModel() = default;
39
40 /* The ParameterVector: a wrapper around a std::vector<double> containing
41 * the actual model parameters.
42 * In addition, this struct may save the cache-able rigid component of the
43 * transformation represented by the parameter vector */
45 std::vector<double> parameters{};
46 Eigen::Affine3d transformCache{Eigen::Affine3d::Identity()};
48
49 // Contructed: provide the number of parameters
50 ParameterVector(size_t npars) : parameters(npars, 0.0) {}
51
52 // accessors
53 double operator[] (size_t ipar) const { return parameters.at(ipar); }
54 double& operator[] (size_t ipar) { return parameters.at(ipar); }
55 };
56
57 /* The number of parameters used */
58 virtual int nParameters() const = 0;
59
60 /* Transform a set of vectors expressed in local frame, stored in a matrix */
61 virtual void transform(const ParameterVector& parvec, VectorSetRef local) const = 0;
62
63 /* Cache the rigid component of this deformation model */
64 virtual void cacheTransform(ParameterVector& parvec) const = 0;
65
66 /* Helper methods to convert parameter index to string representation */
67 virtual ipar_t getParameterIndex(const std::string& parname) const = 0;
68 virtual std::string getParameterName(ipar_t ipar) const = 0;
69 };
70}
71
72#endif
73
Pure abstract class representing the deformation model of an Element.
virtual std::string getParameterName(ipar_t ipar) const =0
virtual ~ElementModel()=default
Eigen::Ref< VectorSet > VectorSetRef
Eigen::Matrix< double, 3, Eigen::Dynamic, Eigen::ColMajor|Eigen::AutoAlign, 3, 5 > VectorSet
virtual void transform(const ParameterVector &parvec, VectorSetRef local) const =0
virtual void cacheTransform(ParameterVector &parvec) const =0
virtual int nParameters() const =0
virtual ipar_t getParameterIndex(const std::string &parname) const =0
double operator[](size_t ipar) const