BmnRoot
26.10.0-19-g6979a6c6
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
BmnADCDigit.h
Go to the documentation of this file.
1
#ifndef BMNADCDIGIT_H
2
#define BMNADCDIGIT_H
3
4
#include "
TObject.h
"
5
6
#include <type_traits>
7
8
using
std::vector;
9
10
template
<
typename
IntType>
11
class
BmnADCDigit
:
public
TObject
12
{
13
static_assert
(std::is_integral_v<IntType>,
"This class only supports integer types"
);
14
15
protected
:
16
uint32_t
fSerial
;
17
uint16_t
fChannel
;
18
vector<IntType>
fValue
;
19
bool
isEmbedded
;
20
21
public
:
22
/** Default constructor **/
23
BmnADCDigit
()
24
:
fSerial
(0)
25
,
fChannel
(0)
26
,
isEmbedded
(
kFALSE
)
27
{}
28
29
// BmnADCDigit::BmnADCDigit(uint32_t iSerial, uint16_t iChannel, ContType& iValue, Bool_t flag = kFALSE)
30
BmnADCDigit
(uint32_t iSerial, uint16_t iChannel, vector<IntType>&& iValue,
Bool_t
flag =
kFALSE
)
31
:
fSerial
(iSerial)
32
,
fChannel
(iChannel)
33
,
fValue
(std::move(iValue))
34
,
isEmbedded
(flag)
35
{
36
// if (typeid(ContType) == typeid(vector<IntType>))
37
// fValue = std::move(iValue);
38
// else
39
// fValue = vector(begin(iValue), end(iValue));
40
}
41
42
BmnADCDigit
(uint32_t iSerial, uint16_t iChannel,
const
vector<IntType>& iValue,
Bool_t
flag =
kFALSE
)
43
:
fSerial
(iSerial)
44
,
fChannel
(iChannel)
45
,
fValue
(iValue)
46
,
isEmbedded
(flag)
47
{}
48
49
uint32_t
GetSerial
()
const
{
return
fSerial
; }
50
51
uint16_t
GetChannel
()
const
{
return
fChannel
; }
52
53
uint32_t
GetNSamples
() {
return
fValue
.size(); }
54
55
vector<IntType>&
GetValue
() {
return
fValue
; }
56
57
void
SetAsEmbedded
(
Bool_t
flag) {
isEmbedded
= flag; }
58
59
Bool_t
IsEmbedded
() {
return
isEmbedded
; }
60
61
/** Destructor **/
62
virtual
~BmnADCDigit
() {}
63
64
ClassDef
(
BmnADCDigit
, 4);
65
};
66
67
#endif
/* BMNADCDIGIT_H */
Bool_t
bool Bool_t
kFALSE
constexpr Bool_t kFALSE
ClassDef
#define ClassDef(name, id)
TObject.h
BmnADCDigit
Definition
BmnADCDigit.h:12
BmnADCDigit::BmnADCDigit
BmnADCDigit(uint32_t iSerial, uint16_t iChannel, const vector< IntType > &iValue, Bool_t flag=kFALSE)
Definition
BmnADCDigit.h:42
BmnADCDigit::fChannel
uint16_t fChannel
Definition
BmnADCDigit.h:17
BmnADCDigit::~BmnADCDigit
virtual ~BmnADCDigit()
Destructor.
Definition
BmnADCDigit.h:62
BmnADCDigit::SetAsEmbedded
void SetAsEmbedded(Bool_t flag)
Definition
BmnADCDigit.h:57
BmnADCDigit::GetNSamples
uint32_t GetNSamples()
Definition
BmnADCDigit.h:53
BmnADCDigit::BmnADCDigit
BmnADCDigit()
Default constructor.
Definition
BmnADCDigit.h:23
BmnADCDigit::IsEmbedded
Bool_t IsEmbedded()
Definition
BmnADCDigit.h:59
BmnADCDigit::fValue
vector< IntType > fValue
Definition
BmnADCDigit.h:18
BmnADCDigit::GetSerial
uint32_t GetSerial() const
Definition
BmnADCDigit.h:49
BmnADCDigit::BmnADCDigit
BmnADCDigit(uint32_t iSerial, uint16_t iChannel, vector< IntType > &&iValue, Bool_t flag=kFALSE)
Definition
BmnADCDigit.h:30
BmnADCDigit::fSerial
uint32_t fSerial
Definition
BmnADCDigit.h:16
BmnADCDigit::isEmbedded
bool isEmbedded
Definition
BmnADCDigit.h:19
BmnADCDigit::GetValue
vector< IntType > & GetValue()
Definition
BmnADCDigit.h:55
BmnADCDigit::GetChannel
uint16_t GetChannel() const
Definition
BmnADCDigit.h:51
TObject::TObject
TObject()
base
raw
BmnADCDigit.h
Generated on
for BmnRoot by
1.17.0