15#include <Math/GenVector/Cartesian3D.h>
16#include <Math/GenVector/CoordinateSystemTags.h>
17#include <Math/GenVector/DisplacementVector3D.h>
25#include <nlohmann/json.hpp>
26#include <nlohmann/json_fwd.hpp>
27#ifndef HAS_CPP_STANDARD_17
35#ifndef HAS_CPP_STANDARD_17
40 template <
typename DataType>
71#ifndef HAS_CPP_STANDARD_17
74 template <
typename OtherType,
typename = std::enable_if_t<std::is_arithmetic_v<OtherType>>>
81#ifndef HAS_CPP_STANDARD_17
84 template <
typename OtherType,
typename = std::enable_if_t<std::is_arithmetic_v<OtherType>>>
91#ifndef HAS_CPP_STANDARD_17
94 template <
typename OtherType,
typename = std::enable_if_t<std::is_arithmetic_v<OtherType>>>
101#ifndef HAS_CPP_STANDARD_17
104 template <
typename OtherType,
typename = std::enable_if_t<std::is_arithmetic_v<OtherType>>>
111#ifndef HAS_CPP_STANDARD_17
114 template <
typename OtherType,
typename = std::enable_if_t<std::is_arithmetic_v<OtherType>>>
121#ifndef HAS_CPP_STANDARD_17
124 template <
typename OtherType,
typename = std::enable_if_t<std::is_arithmetic_v<OtherType>>>
131#ifndef HAS_CPP_STANDARD_17
134 template <
typename OtherType,
typename = std::enable_if_t<std::is_arithmetic_v<OtherType>>>
149 ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<ValueErrorD>, ROOT::Math::DefaultCoordinateSystemTag>;
151 template <
typename DataType>
154 auto new_value =
left.value *
right.value;
157 return { new_value, new_error };
160 template <
typename DataType>
163 auto new_value = numerator.value / denominator.value;
164 auto new_error = std::sqrt(numerator.error * numerator.error +
165 denominator.error * denominator.error * new_value * new_value) /
167 return { new_value, std::abs(new_error) };
170 template <
typename DataType>
173 auto new_value =
left.value +
right.value;
176 return { new_value, new_err };
179 template <
typename DataType>
182 auto new_value =
left.value -
right.value;
185 return { new_value, new_err };
188 template <
typename DataType>
195 template <
typename DataType>
202 template <
typename DataType>
208 template <
typename DataType>
214 template <
typename DataType>
217 json_obj = nlohmann::ordered_json{
218 {
"value", value.
value },
219 {
"error", value.
error },
223 template <
typename DataType>
226 json_obj.at(
"value").get_to(value.
value);
227 json_obj.at(
"error").get_to(value.
error);
232template <
typename DataType>
233class fmt::formatter<
R3B::ValueError<DataType>>
237 static constexpr auto parse(format_parse_context& ctx) {
return ctx.end(); }
238 template <
typename FmtContent>
241 return fmt::format_to(ctn.out(),
"{}+/-{}", value_error.
value, value_error.
error);
246class fmt::formatter<
R3B::XYZVectorValueErrorD>
249 static constexpr auto parse(fmt::format_parse_context& ctx) {
return ctx.end(); }
250 template <
typename FmtContent>
253 return fmt::format_to(ctn.out(),
"[x: {}, y: {}, z: {}]", hit.X(), hit.Y(), hit.Z());
auto operator*(ValueError< DataType > left, ValueError< DataType > right) -> ValueError< DataType >
auto operator+(ValueError< DataType > left, ValueError< DataType > right) -> ValueError< DataType >
auto operator>(ValueError< DataType > &left, const ValueError< DataType > &right) -> bool
ValueError< float > ValueErrorF
void from_json(const nlohmann::ordered_json &json_obj, MinMaxValue< DataType > &value)
auto operator<(ValueError< DataType > &left, const ValueError< DataType > &right) -> bool
auto operator/(ValueError< DataType > numerator, ValueError< DataType > denominator) -> ValueError< DataType >
auto operator-=(ValueError< DataType > &left, const ValueError< DataType > &right) -> ValueError< DataType > &
ValueError< int > ValueErrorI
void to_json(nlohmann::ordered_json &json_obj, const MinMaxValue< DataType > &value)
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< ValueErrorD >, ROOT::Math::DefaultCoordinateSystemTag > XYZVectorValueErrorD
auto operator+=(ValueError< DataType > &left, const ValueError< DataType > &right) -> ValueError< DataType > &
auto operator-(ValueError< DataType > left, ValueError< DataType > right) -> ValueError< DataType >
ValueError< double > ValueErrorD
auto operator>(Arithmetic auto val) -> bool
void operator-=(Arithmetic auto val)
auto operator/(Arithmetic auto other) const -> ValueError< DataType >
auto operator-() const -> ValueError< DataType >
ClassDefNV(ValueError, 1)
auto operator+(Arithmetic auto other) const -> ValueError< DataType >
auto operator-(Arithmetic auto val) const -> ValueError< DataType >
auto operator<(Arithmetic auto val) -> bool
constexpr ValueError(DataType val)
constexpr ValueError(DataType val, DataType err)
auto operator*(Arithmetic auto other) const -> ValueError< DataType >