R3BROOT
R3B analysis software
Loading...
Searching...
No Matches
R3BEventHeader.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright (C) 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH *
3 * Copyright (C) 2019-2025 Members of R3B Collaboration *
4 * *
5 * This software is distributed under the terms of the *
6 * GNU General Public Licence (GPL) version 3, *
7 * copied verbatim in the file "LICENSE". *
8 * *
9 * In applying this license GSI does not waive the privileges and immunities *
10 * granted to it by virtue of its status as an Intergovernmental Organization *
11 * or submit itself to any jurisdiction. *
12 ******************************************************************************/
13
14#pragma once
15
16#include <FairEventHeader.h>
17#include <stdexcept>
18
19class R3BEventHeader : public FairEventHeader
20{
21 public:
22 R3BEventHeader() = default;
23
24 ~R3BEventHeader() override = default;
25
26 inline void SetExpId(const int expid) { fExpId = expid; }
27 inline void SetEventno(const uint64_t eventno) { fEventno = eventno; }
28 inline void SetTrigger(const int trigger) { fTrigger = trigger; }
29 inline void SetTimeStamp(const uint64_t timeStamp) { fTimeStamp = timeStamp; }
30 inline void SetTpat(const int tpat) { fTpat = tpat; }
31 inline void SetTStart(const double tStart) { fTStart = tStart; }
32 inline void SetTStartSimple(const double tStart) { fTStartSimple = tStart; }
33 inline void SetTprev(const double tPrev) { fTprev = tPrev; }
34 inline void SetTnext(const double tNext) { fTnext = tNext; }
35
36 [[nodiscard]] inline int GetExpId() const { return fExpId; }
37 [[nodiscard]] inline uint64_t GetEventno() const { return fEventno; }
38 [[nodiscard]] inline int GetTrigger() const { return fTrigger; }
39 [[nodiscard]] inline uint64_t GetTimeStamp() const { return fTimeStamp; }
40 [[nodiscard]] inline int GetTpat() const { return fTpat; }
41
42 static constexpr uint32_t MakeTpatBit(uint8_t trigNo)
43 {
44 return (1 <= trigNo && trigNo <= 16) ? (1 << (trigNo - 1)) : throw std::runtime_error("Bad trigNo.");
45 }
46
47 bool HasTpatTrig(int trigNo) const { return fTpat & MakeTpatBit(trigNo); }
48
49 [[nodiscard]] inline double GetTStart() const { return fTStart; }
50
51 [[nodiscard]] inline double GetTStartSimple() const { return fTStartSimple; }
52
53 [[nodiscard]] inline double GetTprev() const { return fTprev; }
54
55 [[nodiscard]] inline double GetTnext() const { return fTnext; }
56
57 // void Register(bool Persistance = true) override{};
58
59 private:
60 int fExpId{};
61 uint64_t fEventno{};
62 int fTrigger{};
63 uint64_t fTimeStamp{};
64 int fTpat{};
65 double fTStart{};
66 double fTStartSimple{};
67 double fTprev{};
68 double fTnext{};
69
70 public:
71 ClassDefOverride(R3BEventHeader, 10)
72};
void SetTrigger(const int trigger)
double GetTnext() const
uint64_t GetEventno() const
bool HasTpatTrig(int trigNo) const
void SetEventno(const uint64_t eventno)
void SetTpat(const int tpat)
void SetTStartSimple(const double tStart)
static constexpr uint32_t MakeTpatBit(uint8_t trigNo)
uint64_t GetTimeStamp() const
void SetTimeStamp(const uint64_t timeStamp)
~R3BEventHeader() override=default
double GetTprev() const
double GetTStartSimple() const
R3BEventHeader()=default
void SetExpId(const int expid)
int GetTrigger() const
void SetTStart(const double tStart)
int GetTpat() const
double GetTStart() const
void SetTprev(const double tPrev)
void SetTnext(const double tNext)
int GetExpId() const