BmnRoot
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#define ADC_SAMPLING_LIMIT 2048
7
8using namespace std;
9
10class BmnADCDigit : public TObject
11{
12 protected:
13 UInt_t fSerial;
14 UShort_t fChannel;
15 UInt_t fNsmpl;
16 UShort_t* fValueU; //[fNsmpl]
17 Short_t* fValueI; //[fNsmpl]
18
19 Bool_t isEmbedded;
20
21 public:
24
26 BmnADCDigit(UInt_t iSerial, UShort_t iChannel, UInt_t n, vector<UShort_t>& iValue);
27 BmnADCDigit(UInt_t iSerial, UShort_t iChannel, UInt_t n, vector<Short_t>& iValue);
28 BmnADCDigit(UInt_t iSerial, UShort_t iChannel, UInt_t n, UShort_t* iValue = nullptr);
29 BmnADCDigit(UInt_t iSerial, UShort_t iChannel, UInt_t n, Short_t* iValue, Bool_t flag = kFALSE);
30
31 UInt_t GetSerial() const { return fSerial; }
32
33 UShort_t GetChannel() const { return fChannel; }
34
35 UInt_t GetNSamples() const { return fNsmpl; }
36
37 UShort_t* GetUShortValue() const { return (UShort_t*)fValueU; }
38
39 Short_t* GetShortValue() const { return (Short_t*)fValueI; }
40
41 void SetShortValue(Short_t* iValue)
42 {
43 for (UInt_t i = 0; i < fNsmpl; ++i)
44 fValueI[i] = iValue[i];
45 }
46
47 void SetUShortValue(UShort_t* iValue) const
48 {
49 for (UInt_t i = 0; i < fNsmpl; ++i)
50 fValueU[i] = iValue[i];
51 }
52
53 void SetAsEmbedded(Bool_t flag) { isEmbedded = flag; }
54
55 Bool_t IsEmbedded() { return isEmbedded; }
56
58 virtual ~BmnADCDigit();
59
61};
62
63#endif /* BMNADCDIGIT_H */
int i
Definition P4_F32vec4.h:22
virtual ~BmnADCDigit()
UInt_t GetNSamples() const
Definition BmnADCDigit.h:35
ClassDef(BmnADCDigit, 3)
Short_t * fValueI
Definition BmnADCDigit.h:17
BmnADCDigit(UInt_t iSerial, UShort_t iChannel, UInt_t n, Short_t *iValue, Bool_t flag=kFALSE)
Bool_t isEmbedded
Definition BmnADCDigit.h:19
UShort_t GetChannel() const
Definition BmnADCDigit.h:33
BmnADCDigit(UInt_t iSerial, UShort_t iChannel, UInt_t n, UShort_t *iValue=nullptr)
BmnADCDigit(UInt_t iSerial, UShort_t iChannel, UInt_t n, vector< UShort_t > &iValue)
UInt_t fSerial
Definition BmnADCDigit.h:13
UShort_t * fValueU
Definition BmnADCDigit.h:16
UShort_t fChannel
Definition BmnADCDigit.h:14
UInt_t GetSerial() const
Definition BmnADCDigit.h:31
void SetAsEmbedded(Bool_t flag)
Definition BmnADCDigit.h:53
UInt_t fNsmpl
Definition BmnADCDigit.h:15
Bool_t IsEmbedded()
Definition BmnADCDigit.h:55
void SetShortValue(Short_t *iValue)
Definition BmnADCDigit.h:41
BmnADCDigit(UInt_t iSerial, UShort_t iChannel, UInt_t n, vector< Short_t > &iValue)
Short_t * GetShortValue() const
Definition BmnADCDigit.h:39
void SetUShortValue(UShort_t *iValue) const
Definition BmnADCDigit.h:47
UShort_t * GetUShortValue() const
Definition BmnADCDigit.h:37
STL namespace.