ARTEMIS-CRIB
 
Loading...
Searching...
No Matches
TMUXData.h
Go to the documentation of this file.
1/**
2 * @file TMUXData.h
3 * @brief Header file for the TMUXData class.
4 * @author Kodai Okawa<okawa@cns.s.u-tokyo.ac.jp>
5 * @date 2022-07-30 09:48:52
6 * @note last modified: 2025-01-08 10:31:32
7 * @details
8 */
9
10#ifndef CRIB_TMUXDATA_H
11#define CRIB_TMUXDATA_H
12
13#include "TDataObject.h"
14
15namespace art::crib {
16/**
17 * @class TMUXData
18 * @brief Represents data from the MUX module (E1, E2, P1, P2, T).
19 *
20 * The TMUXData class is used to store and manipulate energy, position,
21 * and timing values from the MUX module. It is derived from TDataObject
22 * and can be stored in ROOT files as part of a TTree.
23 */
24
25class TMUXData : public TDataObject {
26 public:
27 /**
28 * @brief Constructor.
29 *
30 * Initializes all member variables to default values.
31 */
32 TMUXData();
33
34 /**
35 * @brief Destructor.
36 */
37 ~TMUXData() override;
38
39 /**
40 * @brief Copy constructor.
41 * @param rhs The object to copy from.
42 */
43 TMUXData(const TMUXData &rhs);
44
45 /**
46 * @brief Copy assignment operator.
47 * @param rhs The object to assign from.
48 * @return A reference to the assigned object.
49 */
50 TMUXData &operator=(const TMUXData &rhs);
51
52 /// @name Energy Accessors
53 /// @{
54 Double_t GetE1() const { return fE1; } ///< Get the first energy value.
55 void SetE1(Double_t value) { fE1 = value; } ///< Set the first energy value.
56
57 Double_t GetE2() const { return fE2; } ///< Get the second energy value.
58 void SetE2(Double_t value) { fE2 = value; } ///< Set the second energy value.
59 /// @}
60
61 /// @name Position Accessors
62 /// @{
63 Double_t GetP1() const { return fP1; } ///< Get the first position value.
64 void SetP1(Double_t value) { fP1 = value; } ///< Set the first position value.
65
66 Double_t GetP2() const { return fP2; } ///< Get the second position value.
67 void SetP2(Double_t value) { fP2 = value; } ///< Set the second position value.
68 /// @}
69
70 /// @name Timing Accessors
71 /// @{
72 Double_t GetTrig() const { return fTiming; } ///< Get the timing value.
73 void SetTrig(Double_t value) { fTiming = value; } ///< Set the timing value.
74
75 /**
76 * @brief Get the timing value at a specific index.
77 * @param index The index of the timing value to retrieve.
78 * @return The timing value if valid, otherwise `kInvalidD`.
79 */
80 Double_t GetT(Int_t index = 0) const;
81
82 /**
83 * @brief Add a new timing value.
84 * @param value The timing value to add.
85 */
86 void PushTiming(Double_t value);
87 /// @}
88
89 /**
90 * @brief Copy the contents of this object to another TObject.
91 * @param dest The destination TObject.
92 */
93 void Copy(TObject &dest) const override;
94
95 /**
96 * @brief Clear the object's contents.
97 * @param opt Optional arguments for the clear operation.
98 */
99 void Clear(Option_t *opt = "") override;
100
101 /// Number of raw data elements (E1, E2, P1, P2, Trigger).
102 static const Int_t kNRAW = 5;
103
104 private:
105 Double_t fE1; ///< First energy value.
106 Double_t fE2; ///< Second energy value.
107 Double_t fP1; ///< First position value.
108 Double_t fP2; ///< Second position value.
109 Double_t fTiming; ///< Timing value for the trigger.
110
111 std::vector<Double_t> fTVec; ///< Vector of timing values from MHTDC.
112
114};
115} // namespace art::crib
116
117#endif // CRIB_TMUXDATA_H
Represents data from the MUX module (E1, E2, P1, P2, T).
Definition TMUXData.h:25
static const Int_t kNRAW
Number of raw data elements (E1, E2, P1, P2, Trigger).
Definition TMUXData.h:102
Double_t fP2
Second position value.
Definition TMUXData.h:108
Double_t fP1
First position value.
Definition TMUXData.h:107
void SetE2(Double_t value)
Set the second energy value.
Definition TMUXData.h:58
Double_t GetE1() const
Get the first energy value.
Definition TMUXData.h:54
std::vector< Double_t > fTVec
Vector of timing values from MHTDC.
Definition TMUXData.h:111
Double_t GetP2() const
Get the second position value.
Definition TMUXData.h:66
ClassDefOverride(TMUXData, 2)
Double_t fE2
Second energy value.
Definition TMUXData.h:106
void PushTiming(Double_t value)
Add a new timing value.
Definition TMUXData.cc:77
void Copy(TObject &dest) const override
Copy the contents of this object to another TObject.
Definition TMUXData.cc:50
~TMUXData() override
Destructor.
Double_t GetP1() const
Get the first position value.
Definition TMUXData.h:63
TMUXData()
Constructor.
Definition TMUXData.cc:18
void SetP1(Double_t value)
Set the first position value.
Definition TMUXData.h:64
Double_t fE1
First energy value.
Definition TMUXData.h:105
Double_t fTiming
Timing value for the trigger.
Definition TMUXData.h:109
void Clear(Option_t *opt="") override
Clear the object's contents.
Definition TMUXData.cc:65
void SetE1(Double_t value)
Set the first energy value.
Definition TMUXData.h:55
Double_t GetT(Int_t index=0) const
Get the timing value at a specific index.
Definition TMUXData.cc:81
void SetTrig(Double_t value)
Set the timing value.
Definition TMUXData.h:73
Double_t GetE2() const
Get the second energy value.
Definition TMUXData.h:57
void SetP2(Double_t value)
Set the second position value.
Definition TMUXData.h:67
TMUXData & operator=(const TMUXData &rhs)
Copy assignment operator.
Definition TMUXData.cc:37
Double_t GetTrig() const
Get the timing value.
Definition TMUXData.h:72
return to the guide