BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnMSCZSDigit.h
Go to the documentation of this file.
1#ifndef BMNMSCZSDIGIT_H
2#define BMNMSCZSDIGIT_H
3
4#include <chrono>
5#include <vector>
6// ROOT
7#include "TObject.h"
8// BmnRoot
9#include "BmnFunctionSet.h"
10#include "RawTypes.h"
11
12using SysClock = std::chrono::system_clock;
13using SysPoint = std::chrono::time_point<SysClock>;
14
15/**
16 * Raw MSC block with zero suppression and for one specific channel
17 */
18template<typename IntType = UChar_t>
19class BmnMSCZSDigit : public TObject
20{
21 public:
22 /** Constructor
23 * \param[in] serial : crate serial
24 * \param[in] channel : channel number
25 * \param[in] time : timestamp for normal spill data
26 * \param[in] size : value count
27 * \param[in] missing_hits : number of missing hits
28 */
29 BmnMSCZSDigit(uint32_t serial = 0,
30 uint8_t channel = 0,
31 SysPoint time = SysPoint::min(),
32 size_t size = 0,
33 uint32_t missing_hits = 0)
34 : fSerial(serial)
35 , fChannel(channel)
36 , fTS(BmnFunctionSet::TimePoint2TS(time))
37 , fSize(size)
38 // , fTime(time)
39 , fMissingHits(missing_hits)
40 {
41 fValue.resize(fSize);
42 fTimes.resize(fSize);
43 fExtCond.resize(fSize);
44 }
45
46 uint32_t GetSerial() const { return fSerial; }
47
48 uint8_t GetChannel() const { return fChannel; }
49
50 std::vector<IntType>& GetValues() { return fValue; }
51
52 // std::vector<SysPoint>& GetTimes() { return fTimes; }
53 std::vector<TTimeStamp>& GetTimes() { return fTimes; }
54
55 std::vector<uint8_t>& GetExtCond() { return fExtCond; }
56
58
59 TTimeStamp GetTS() const { return fTS; }
60
61 // bool IsSpill() { return (fExtCond & MSC_EC_SPILL); }
62 //
63 // bool IsBusy() { return (fExtCond & MSC_EC_BUSY); }
64
65 size_t GetNVals() { return fSize; }
66
67 uint32_t GetMissingHits() { return fMissingHits; }
68 /** Destructor **/
69 virtual ~BmnMSCZSDigit() {}
70
71 private:
72 uint32_t fSerial;
73 uint8_t fChannel;
75 size_t fSize;
76 std::vector<IntType> fValue;
77 // std::vector<SysPoint> fTimes;
78 std::vector<TTimeStamp> fTimes;
79 std::vector<uint8_t> fExtCond;
80 // SysPoint fTime;
81 uint32_t fMissingHits;
82
84};
85
86#endif // BMNMSCZSDIGIT_H
#define ClassDef(name, id)
std::chrono::system_clock SysClock
std::chrono::time_point< SysClock > SysPoint
Class with static common functions to simplify experiment code.
static SysPoint TimeStamp2TP(TTimeStamp p)
Raw MSC block with zero suppression and for one specific channel.
uint32_t GetMissingHits()
TTimeStamp fTS
std::vector< IntType > fValue
uint32_t fMissingHits
SysPoint GetTime() const
BmnMSCZSDigit(uint32_t serial=0, uint8_t channel=0, SysPoint time=SysPoint::min(), size_t size=0, uint32_t missing_hits=0)
Constructor.
std::vector< uint8_t > fExtCond
TTimeStamp GetTS() const
virtual ~BmnMSCZSDigit()
Destructor.
std::vector< TTimeStamp > fTimes
std::vector< IntType > & GetValues()
uint32_t fSerial
uint8_t GetChannel() const
uint32_t GetSerial() const
std::vector< TTimeStamp > & GetTimes()
std::vector< uint8_t > & GetExtCond()
size_t GetNVals()
std::chrono::time_point< SysClock > SysPoint