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>
70#ifndef HAS_CPP_STANDARD_17
73 template <
typename OtherType,
typename = std::enable_if_t<std::is_arithmetic_v<OtherType>>>
80#ifndef HAS_CPP_STANDARD_17
83 template <
typename OtherType,
typename = std::enable_if_t<std::is_arithmetic_v<OtherType>>>
90#ifndef HAS_CPP_STANDARD_17
93 template <
typename OtherType,
typename = std::enable_if_t<std::is_arithmetic_v<OtherType>>>
100#ifndef HAS_CPP_STANDARD_17
103 template <
typename OtherType,
typename = std::enable_if_t<std::is_arithmetic_v<OtherType>>>
110#ifndef HAS_CPP_STANDARD_17
113 template <
typename OtherType,
typename = std::enable_if_t<std::is_arithmetic_v<OtherType>>>
120#ifndef HAS_CPP_STANDARD_17
123 template <
typename OtherType,
typename = std::enable_if_t<std::is_arithmetic_v<OtherType>>>
130#ifndef HAS_CPP_STANDARD_17
133 template <
typename OtherType,
typename = std::enable_if_t<std::is_arithmetic_v<OtherType>>>
148 ROOT::Math::DisplacementVector3D<ROOT::Math::Cartesian3D<ValueErrorD>, ROOT::Math::DefaultCoordinateSystemTag>;
150 template <
typename DataType>
153 auto new_value =
left.value *
right.value;
156 return { new_value, new_error };
159 template <
typename DataType>
162 auto new_value = numerator.value / denominator.value;
163 auto new_error = std::sqrt(numerator.error * numerator.error +
164 denominator.error * denominator.error * new_value * new_value) /
166 return { new_value, std::abs(new_error) };
169 template <
typename DataType>
172 auto new_value =
left.value +
right.value;
175 return { new_value, new_err };
178 template <
typename DataType>
181 auto new_value =
left.value -
right.value;
184 return { new_value, new_err };
187 template <
typename DataType>
194 template <
typename DataType>
201 template <
typename DataType>
207 template <
typename DataType>
213 template <
typename DataType>
216 json_obj = nlohmann::ordered_json{
217 {
"value", value.
value },
218 {
"error", value.
error },
222 template <
typename DataType>
225 json_obj.at(
"value").get_to(value.
value);
226 json_obj.at(
"error").get_to(value.
error);
231template <
typename DataType>
232class fmt::formatter<
R3B::ValueError<DataType>>
236 static constexpr auto parse(format_parse_context& ctx) {
return ctx.end(); }
237 template <
typename FmtContent>
240 return fmt::format_to(ctn.out(),
"{}+/-{}", value_error.
value, value_error.
error);
245class fmt::formatter<
R3B::XYZVectorValueErrorD>
248 static constexpr auto parse(fmt::format_parse_context& ctx) {
return ctx.end(); }
249 template <
typename FmtContent>
252 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 >