-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathHKGeometryPMTV1.hpp
More file actions
184 lines (158 loc) · 4.79 KB
/
HKGeometryPMTV1.hpp
File metadata and controls
184 lines (158 loc) · 4.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
#ifndef HK_GEOMETRYPMT_V1_HPP
#define HK_GEOMETRYPMT_V1_HPP
#include "HKGeometryPMT.hpp"
/************************************************
* HKGeometryPMTV1 class definition
* Version 1 of HKGeometryPMT
*
* Just stores the PMT ID number used in software for this PMT.
* Other information will be able to be looked up using channel mapping functionality (currently undefined).
* This includes
* * Position
* * Orientation
* * PMT type (20"/mPMT/OD PMT)
* * PMT batch (e.g. 20" vX)
* * PMT serial #
* * Whether PMT is on barrel / top cap / bottom cap
* * Electronics board type
* * Electronics board serial #
* * Electronics board channel #
***********************************************/
class HKGeometryPMTV1 : public HKGeometryPMT {
public:
HKGeometryPMTV1(); //!< Constructor
//! Create HKGeometryPMTV1 from an HKGeometryPMT pointor
/*!
\param in HKGeometryPMT*
*/
HKGeometryPMTV1(HKGeometryPMT* in);
~HKGeometryPMTV1() override; //!< Destructor
void Reset() override; //!< Reset function, called after each event. Use it to initialize variable
static constexpr unsigned int GetVersionStatic() {
return 1;
} //!< Static function. Return the class version number
unsigned int GetVersion() const override {
return HKGeometryPMTV1::GetVersionStatic();
} //!< Return the class version number
// v1 functions
//! Get PMTSoftwareID
/*!
The PMT ID number used in software for this PMT
\return unsigned int
*/
unsigned int GetPMTSoftwareID() const override { return m_pmt_software_id; }
//! Set PMTSoftwareID
/*!
The PMT ID number used in software for this PMT
\param in unsigned int
\return `true` if successful, `false` if not
*/
bool SetPMTSoftwareID(unsigned int in) override {
m_pmt_software_id = in;
return true;
}
//! Get sub ID
/*!
Return the PMT sub ID number. 0 for 20" PMT and OD PMT. 1-19 for mPMT's 3" PMTs
\return unsigned int
*/
unsigned int GetSubID() const override { return m_pmt_sub_id; }
//! Set sub ID
/*!
Set the PMT sub ID number. 0 for 20" PMT and OD PMT. 1-19 for mPMT's 3" PMTs
\param in unsigned int
\return `true` if successful, `false` if not
*/
bool SetSubID(unsigned int in) override {
m_pmt_sub_id = in;
return true;
}
//! Get PMT Type
/*!
\return PMTType
*/
PMTType GetType() const override { return m_pmt_type; }
//! Set PMT Type
/*!
\param in PMTType
\return `true` if successful, `false` if not
*/
bool SetType(PMTType in) override {
m_pmt_type = in;
return true;
}
//! Get PMT Position in cm
/*!
\return ROOT::Math::XYZVector. position over [x,y,z]
*/
virtual ROOT::Math::XYZVector GetPositionInCm() const override { return m_pmt_position; }
//! Set PMT Position in cm
/*!
\param x double
\param y double
\param z double
\return `true` if successful, `false` if not
*/
bool SetPositionInCm(double x, double y, double z) override {
m_pmt_position.SetXYZ(x, y, z);
return true;
}
//! Set PMT Position in cm
/*!
\param x ROOT::Math::XYZVector
\return `true` if successful, `false` if not
*/
bool SetPositionInCm(ROOT::Math::XYZVector& in) override {
m_pmt_position = in;
return true;
}
//! Get PMT Orientation
/*!
\return ROOT::Math::XYZVector. orientation over [x,y,z]
*/
ROOT::Math::XYZVector GetOrientation() const override { return m_pmt_orientation; }
//! Set PMT Orientation
/*!
\param x double
\param y double
\param z double
\return `true` if successful, `false` if not
*/
bool SetOrientation(double x, double y, double z) override {
m_pmt_orientation.SetXYZ(x, y, z);
return true;
}
//! Set PMT Orientation
/*!
\param x ROOT::Math::XYZVector
\return `true` if successful, `false` if not
*/
bool SetOrientation(ROOT::Math::XYZVector& in) override {
m_pmt_orientation = in;
return true;
}
//! Get PMT Bad flag
/*!
\return bool. Indicate if the PMT is bad or not
*/
bool GetBadFlag() const override { return m_pmt_bad_flag; }
//! Set PMT Bad flag
/*!
\param in bool
\return `true` if successful, `false` if not
*/
bool SetBadFlag(bool in) override {
m_pmt_bad_flag = in;
return true;
}
private:
// v1 data members
unsigned int m_pmt_software_id; //!< PMTSoftwareID
PMTType m_pmt_type; //!< PMT type
unsigned int m_pmt_sub_id; //!< PMT sub id (0 for 20" or OD PMT, 1-19 for mPMT's 3" PMTs)
ROOT::Math::XYZVector m_pmt_position; //!< Position in cm
ROOT::Math::XYZVector m_pmt_orientation; //!< Normalized orientation
bool m_pmt_bad_flag; //!< Whether the PMT is bad or not
ClassDefOverride(HKGeometryPMTV1, 1); //!< ROOT Class definition
};
#endif