21 Hit(
const Hit& otherHit) =
default;
22 Hit(
Hit&& otherHit) =
default;
23 Hit& operator=(
Hit&&) =
default;
24 Hit& operator=(
const Hit& part) =
default;
29 friend bool operator==(
const Hit& that,
const Hit& other);
31 void SetPosition(
const TVector3& position) {
37 void SetPosition(Double_t x, Double_t y, Double_t z) {
43 void SetSignal(Double_t signal) {
47 ANALYSISTREE_ATTR_NODISCARD TVector3 GetPosition()
const {
return TVector3(x_, y_, z_); }
48 ANALYSISTREE_ATTR_NODISCARD Floating_t GetSignal()
const {
return signal_; }
49 ANALYSISTREE_ATTR_NODISCARD Floating_t GetX()
const {
return x_; }
50 ANALYSISTREE_ATTR_NODISCARD Floating_t GetY()
const {
return y_; }
51 ANALYSISTREE_ATTR_NODISCARD Floating_t GetZ()
const {
return z_; }
52 ANALYSISTREE_ATTR_NODISCARD Floating_t GetPhi()
const;
55 ANALYSISTREE_ATTR_NODISCARD T GetField(Integer_t iField)
const {
57 return Container::GetField<T>(iField);
60 case HitFields::kX:
return GetX();
61 case HitFields::kY:
return GetY();
62 case HitFields::kZ:
return GetZ();
63 case HitFields::kPhi:
return GetPhi();
64 case HitFields::kSignal:
return GetSignal();
65 case HitFields::kId:
return GetId();
66 default:
throw std::out_of_range(
"Hit::GetField - Index " + std::to_string(iField) +
" is not found");
72 void SetField(T value, Int_t field_id) {
74 Container::SetField(value, field_id);
77 case HitFields::kX: x_ = value;
break;
78 case HitFields::kY: y_ = value;
break;
79 case HitFields::kZ: z_ = value;
break;
80 case HitFields::kSignal: signal_ = value;
break;
81 case HitFields::kId:
break;
82 case HitFields::kPhi:
break;
83 default:
throw std::runtime_error(
"Unknown field");
88 void Print()
const noexcept override;
91 Floating_t x_{UndefValueFloat};
92 Floating_t y_{UndefValueFloat};
93 Floating_t z_{UndefValueFloat};
94 Floating_t signal_{UndefValueFloat};
96 ClassDefOverride(
Hit, 2)