BmnRoot
Loading...
Searching...
No Matches
BmnMSCZSDigit.h
Go to the documentation of this file.
1#pragma once
2
3#include <chrono>
4#include <vector>
5// ROOT
6#include "TObject.h"
7// BmnRoot
8#include "BmnFunctionSet.h"
9#include "RawTypes.h"
10
11using SysClock = std::chrono::system_clock;
12using SysPoint = std::chrono::time_point<SysClock>;
13
17template<typename IntType = UChar_t>
18class BmnMSCZSDigit : public TObject
19{
20 public:
26 BmnMSCZSDigit(uint32_t serial = 0, uint8_t channel = 0, SysPoint time = SysPoint::min(), size_t size = 0)
27 : fSerial(serial)
28 , fChannel(channel)
29 , fTS(BmnFunctionSet::TimePoint2TS(time))
30 , fSize(size)
31 // , fTime(time)
32 {
33 fValue.resize(fSize);
34 fTimes.resize(fSize);
35 fExtCond.resize(fSize);
36 }
37
38 uint32_t GetSerial() const { return fSerial; }
39
40 uint8_t GetChannel() const { return fChannel; }
41
42 std::vector<IntType>& GetValues() { return fValue; }
43
44 std::vector<SysPoint>& GetTimes() { return fTimes; }
45
46 std::vector<uint8_t>& GetExtCond() { return fExtCond; }
47
49
50 TTimeStamp GetTS() const { return fTS; }
51
52 // bool IsSpill() { return (fExtCond & MSC_EC_SPILL); }
53 //
54 // bool IsBusy() { return (fExtCond & MSC_EC_BUSY); }
55
56 size_t GetNVals() { return fSize; }
58 virtual ~BmnMSCZSDigit() {}
59
60 private:
61 uint32_t fSerial;
62 uint8_t fChannel;
63 TTimeStamp fTS;
64 size_t fSize;
65 std::vector<IntType> fValue;
66 std::vector<SysPoint> fTimes;
67 std::vector<uint8_t> fExtCond;
68 // SysPoint fTime;
69
70 ClassDef(BmnMSCZSDigit, 1);
71};
std::chrono::system_clock SysClock
std::chrono::time_point< SysClock > SysPoint
static SysPoint TimeStamp2TP(TTimeStamp p)
SysPoint GetTime() const
TTimeStamp GetTS() const
virtual ~BmnMSCZSDigit()
std::vector< IntType > & GetValues()
uint8_t GetChannel() const
uint32_t GetSerial() const
std::vector< uint8_t > & GetExtCond()
std::vector< SysPoint > & GetTimes()
BmnMSCZSDigit(uint32_t serial=0, uint8_t channel=0, SysPoint time=SysPoint::min(), size_t size=0)
size_t GetNVals()
std::chrono::time_point< SysClock > SysPoint