YODA::Transformation< N, Args > Class Template Reference
Detailed Descriptiontemplate<size_t N, typename... Args> class YODA::Transformation< N, Args > Generalised transformation The tranformation uses a functor that acts on a double (possibly with additional arguments) and returns a double. The generalisation is in the number of dimensions in which the trf can be applied. Definition at line 29 of file Transformation.h. Member Typedef Documentation◆ Breakdown
template<size_t N, typename... Args>
Definition at line 36 of file Transformation.h. ◆ NdVal
template<size_t N, typename... Args>
Definition at line 34 of file Transformation.h. ◆ NdValPair
template<size_t N, typename... Args>
Definition at line 35 of file Transformation.h. ◆ Pair
template<size_t N, typename... Args>
Convenient aliases. Definition at line 33 of file Transformation.h. Constructor & Destructor Documentation◆ Transformation() [1/3]
template<size_t N, typename... Args>
No nullary constructor since a trf method should always be supplied ◆ Transformation() [2/3]
template<size_t N, typename... Args>
Default constructor setting the trf method. Definition at line 47 of file Transformation.h. 47: _Fn(fn) { }
◆ Transformation() [3/3]
template<size_t N, typename... Args>
Default constructor setting the trf method. Definition at line 50 of file Transformation.h. 50: _Fn(std::move(fn)) { }
Member Function Documentation◆ operator()()
template<size_t N, typename... Args>
Operator calling the functor. Definition at line 54 of file Transformation.h. 54{ return _Fn(v, std::forward<Args>(args)...); }
◆ transform() [1/5]
template<size_t N, typename... Args>
Transform value val. Definition at line 63 of file Transformation.h. 63{ val = _Fn(val, std::forward<Args>(args)...); }
Referenced by YODA::PointBase< N >::scale(), YODA::Estimate::scale(), YODA::PointBase< N >::scale(), YODA::Transformation< N, Args >::transform(), YODA::Transformation< N, Args >::transform(), YODA::Transformation< N, Args >::transform(), and YODA::Transformation< N, Args >::transform(). ◆ transform() [2/5]
template<size_t N, typename... Args>
Transform value val and breakdown of signed error pairs signed_errs. Definition at line 75 of file Transformation.h. 75 {
76 // keep track of original central value
77 const double oldval = val;
78 // transform central value
79 transform(val, std::forward<Args>(args)...);
80 // transform errors
81 for (auto& item : signed_errs) {
82 item.second.first = _Fn(oldval + item.second.first, std::forward<Args>(args)...) - val;
83 item.second.second = _Fn(oldval + item.second.second, std::forward<Args>(args)...) - val;
84 }
85 }
void transform(double &val, Args &&... args) const Transform value val. Definition Transformation.h:63 References YODA::Transformation< N, Args >::transform(). ◆ transform() [3/5]
template<size_t N, typename... Args>
Transform value val and error pair errs. Definition at line 88 of file Transformation.h. 88 {
89 // transform errors
90 const double trf_min = _Fn(val - errs.first, std::forward<Args>(args)...);
91 const double trf_max = _Fn(val + errs.second, std::forward<Args>(args)...);
92 // transform central value
93 transform(val, std::forward<Args>(args)...);
94 // Deal with possible inversions of min/max ordering under the transformation
95 const double new_min = std::min(trf_min, trf_max);
96 const double new_max = std::max(trf_min, trf_max);
97 errs = std::make_pair(val - new_min, new_max - val);
98 }
References YODA::Transformation< N, Args >::transform(). ◆ transform() [4/5]
template<size_t N, typename... Args>
Transform values vals. Definition at line 66 of file Transformation.h. References YODA::Transformation< N, Args >::transform(). ◆ transform() [5/5]
template<size_t N, typename... Args>
Transform values vals and error pairs errs. Definition at line 101 of file Transformation.h. 101 {
102 for (size_t i = 0; i < N; ++i) {
103 transform(vals[i], errs[i], std::forward<Args>(args)...);
104 }
105 }
References YODA::Transformation< N, Args >::transform(). The documentation for this class was generated from the following file:
Generated on Fri Mar 7 2025 09:06:41 for YODA - Yet more Objects for Data Analysis by |