35 void SetVertexPosition3(
const TVector3& pos);
38 T GetField(Integer_t iField)
const {
40 return Container::GetField<T>(iField);
43 case EventHeaderFields::kVertexX:
return GetVertexX();
44 case EventHeaderFields::kVertexY:
return GetVertexY();
45 case EventHeaderFields::kVertexZ:
return GetVertexZ();
46 case EventHeaderFields::kId:
return GetId();
47 default:
throw std::out_of_range(
"EventHeader::GetField - Index " + std::to_string(iField) +
" is not found");
53 void SetField(T value, Integer_t field_id) {
54 using AnalysisTree::EventHeaderFields::EventHeaderFields;
56 Container::SetField(value, field_id);
59 case EventHeaderFields::kVertexX: vtx_pos_[Exyz::kX] = value;
break;
60 case EventHeaderFields::kVertexY: vtx_pos_[Exyz::kY] = value;
break;
61 case EventHeaderFields::kVertexZ: vtx_pos_[Exyz::kZ] = value;
break;
62 case EventHeaderFields::kId:
break;
63 default:
throw std::runtime_error(
"Invalid field id");
68 ANALYSISTREE_ATTR_NODISCARD
inline Floating_t GetVertexX()
const {
return vtx_pos_[Exyz::kX]; }
69 ANALYSISTREE_ATTR_NODISCARD
inline Floating_t GetVertexY()
const {
return vtx_pos_[Exyz::kY]; }
70 ANALYSISTREE_ATTR_NODISCARD
inline Floating_t GetVertexZ()
const {
return vtx_pos_[Exyz::kZ]; }
72 static constexpr size_t GetNumberOfChannels() {
return 1; }
78 ANALYSISTREE_ATTR_NODISCARD
const EventHeader& GetChannel(
size_t i)
const;
79 ANALYSISTREE_ATTR_NODISCARD
EventHeader& Channel(
size_t i);
80 static void ClearChannels() {
throw std::runtime_error(
"Not available for EventHeader"); }
81 static EventHeader* AddChannel() {
throw std::runtime_error(
"Not available for EventHeader"); }
83 void Print()
const noexcept override;
86 std::array<Floating_t, 3> vtx_pos_{{UndefValueFloat, UndefValueFloat, UndefValueFloat}};