-
Notifications
You must be signed in to change notification settings - Fork 0
/
STMDataPacket.hpp
51 lines (43 loc) · 1.32 KB
/
STMDataPacket.hpp
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
//Author: S Middleton
//Date: July 2019
//Purpose: Class to hold STM Data Packet as outputted by STM ROC FPGA
#include<vector>
using namespace std;
typedef struct ChannelHeader{
//Local Header:
short int ChannelID;//2 bits
char Flags;
char Status;
} ChannelHeader;
typedef struct ChannelPacket{
//Local Data Packets:
short int ChannelID;//2 bits
long unsigned CountLength; //nDigits
vector<char> ErrFlags;
vector<double> ADCList;//Assume 1 channel at the moment
} ChannelPacket;
typedef struct DataSample{
//Global Header:
long int DataLength;//nSamples
int DetID; //8 bits
char TriggerType;//4 bits
int FPGAVersion; //8bits
long long unsigned int TriggerNumber; //64 bits
long unsigned ResetTime1; //48 bits for all these
long unsigned StopTime1;
long unsigned ResetTime2;
long unsigned StopTime2;
long unsigned ResetTime3;
long unsigned StopTime3;
long unsigned ResetTime4;
long unsigned StopTime4;
long unsigned RequestPacketTime;
double GlobalTimeStamp;
vector<ChannelPacket> channel;//for current purpose....
} DataSample;
class STMDataPacket{
public:
DataSample datasample;
ChannelHeader channelheader;
ChannelPacket channelpacket;
};