2 #include <CLHEP/Units/PhysicalConstants.h>
11 enum class ParamStatus { INACTIVE = 0, ACTIVE = 1, FIXED = 2 };
16 double lower_bound = std::numeric_limits<double>::lowest();
17 double upper_bound = std::numeric_limits<double>::max();
19 ParamStatus status = ParamStatus::INACTIVE;
20 bool fit_valid =
false;
22 bool is_active()
const {
return status == ParamStatus::ACTIVE; }
23 bool is_fixed()
const {
return status == ParamStatus::FIXED; }
24 bool is_used()
const {
return status != ParamStatus::INACTIVE; }
28 std::vector<ParamComponent> components;
29 std::vector<double> active_values()
const;
30 std::vector<double> used_values()
const;
31 std::vector<double> active_lower_bounds()
const;
32 std::vector<double> active_upper_bounds()
const;
33 void set_all_lower_bounds(
double value);
34 void set_all_upper_bounds(
double value);
35 void set_all_status(ParamStatus status);
36 void set_all_fit_valid(
bool valid);
37 void set_status(std::vector<ParamStatus> status_vector);
38 void set_values(
const double* values,
size_t n);
39 void set_values(std::vector<double> values);
40 void set_lower_bounds(
const double* lower_bounds,
size_t n);
41 void set_lower_bounds(std::vector<double> lower_bounds);
42 void set_upper_bounds(
const double* upper_bouonds,
size_t n);
43 void set_upper_bounds(std::vector<double> upper_bounds);
44 bool are_all_used()
const {
45 return std::all_of(components.begin(), components.end(), [](
const ParamComponent& comp) { return comp.is_used(); });
47 bool are_all_active()
const {
48 return std::all_of(components.begin(), components.end(),
51 bool are_all_fit_valid()
const {
52 return std::all_of(components.begin(), components.end(), [](
const ParamComponent& comp) { return comp.fit_valid; });
57 ParamField position_time = {.components = {{.name =
"x", .value = 0.0},
58 {.name =
"y", .value = 0.0},
59 {.name =
"z", .value = 0.0},
60 {.name =
"t", .value = 0.0}}};
62 .components = {{.name =
"u", .value = 0.0}, {.name =
"v", .value = 0.0}, {.name =
"w", .value = 0.0}}};
63 ParamField energy = {.components = {{.name =
"energy", .value = 1.0, .lower_bound = 0.0}}};
65 std::vector<double> to_active_vector()
const;
66 std::vector<ParamComponent> to_active_components()
const;
67 void update_active(
const std::vector<double>& values);
68 void update_active(
const double* values,
size_t n);
69 void set_active_fit_valid(
bool valid);
70 ParamSet from_active_vector(
const std::vector<double>& values)
const;
72 TVector3 GetPosition()
const;
73 TVector3 GetDirection()
const;
74 double GetTime()
const;
75 double GetEnergy()
const;
Definition: ParamSet.hh:13
Definition: ParamSet.hh:27
Definition: ParamSet.hh:56