CFEL - ASG Software Suite  2.5.0
CASS
agattypes.hpp
Go to the documentation of this file.
1 // Copyright (C) 2011 Lutz Foucar
2 
3 /**
4  * @file agattypes.hpp contains the layout of the lma file headers.
5  *
6  * @author Lutz Foucar
7  */
8 
9 #ifndef _AGATTYPES_H_
10 #define _AGATTYPES_H_
11 
12 #include <stdint.h>
13 
14 namespace cass
15 {
16 #pragma pack(2)
17 
18 namespace lmaHeader
19 {
20 /** the general header of an lma file
21  *
22  * @author Lutz Foucar
23  */
24 struct General
25 {
26  /** size of the Header in bytes */
27  int32_t headersize;
28 
29  /** nbr of channels in the instrument */
30  int16_t nbrChannels;
31 
32  /** the size of the entries in the waveform in bits */
33  int16_t nbrBits;
34 
35  /** the sampling interval (the time between two datapoints in s */
37 
38  /** number of samples in the waveform */
39  int32_t nbrSamples;
40 
41  /** time between trigger and first sample */
42  double delayTime;
43 
44  /** the triggering channel */
45  int16_t triggerChannel;
46 
47  /** triggering level of the trigger in V */
48  double triggerLevel;
49 
50  /** on which slope the instruments triggers on */
51  int16_t triggerSlope;
52 
53  /** bitmask describing which channels are recorded */
55 
56  /** bitmask describing which channels are combined */
58 
59  /** how many converters are being used per channel */
61 };
62 
63 /** the header for each event
64  *
65  * @author Lutz Foucar
66  */
67 struct Event
68 {
69  /** the Event Id of the Event */
70  uint32_t id;
71 
72  /** the horpos value of the Event */
73  double horpos;
74 };
75 
76 /** the header of each channel as part of the file header
77  *
78  * @author Lutz Foucar
79  */
80 struct Channel
81 {
82  /** the full scale of the channel in mV */
83  int16_t fullscale_mV;
84 
85  /** the offset of the channel in mV */
86  int16_t offset_mV;
87 
88  /** the vertical Gain (conversion factor to convert the bits to mV) */
89  double gain_mVperLSB;
90 
91  /** baseline that was used for zero substraction in digitizer units */
92  int16_t baseline;
93 
94  /** noiselevel for zero substraction in digitizer units
95  *
96  * the zero substaction will check whether a value of the recorded waveform
97  * is outside the noiselevel. Mathematically:
98  * \f$ \left| value_Du - baseline \right| > noiselevel \f$
99  */
100  int16_t noiseLevel;
101 
102  /** stepsize in sample interval units
103  *
104  * after finding a waveform value thats outside the noiselevel this is the
105  * amount of values skipped before checking whether the wavefrom is in the
106  * noiselevel again.
107  */
108  int32_t stepsize;
109 
110  /** backsize of the zerosubstraction in sample interval units
111  *
112  * how many steps we should go back after a value is outside the noiselevel
113  * to start recording the wavefrom values
114  *
115  * puls of waveform outside noise := puls;
116  * waveform index first value outside noise := puls[i]
117  * puls.begin = puls[i-backsize]
118  */
119  int32_t backsize;
120 };
121 
122 /** the header of a puls
123  *
124  * @author Lutz Foucar
125  */
126 struct Puls
127 {
128  /** the start index position of this puls in the original waveform */
129  uint32_t idxPos;
130 
131  /** how many points of the wavefrom are in the puls */
132  uint32_t length;
133 };
134 } //end namespace lmafileheader
135 
136 namespace AGATRemoteHeader
137 {
138 /** the general stream header
139  *
140  * @author Lutz Foucar
141  */
142 struct Event
143 {
144  /** the event id */
145  uint32_t id;
146 
147  /** horpos value from acqiris */
148  double horpos;
149 
150  /** the size of the entries in the waveform in bits */
151  int16_t nbrBits;
152 
153  /** the sampling interval (the time between two datapoints in s */
155 
156  /** number of samples in the waveform */
157  int32_t nbrSamples;
158 
159  /** time between trigger and first sample */
160  double delayTime;
161 
162  /** the triggering channel */
163  int16_t triggerChannel;
164 
165  /** triggering level of the trigger in V */
166  double triggerLevel;
167 
168  /** on which slope the instruments triggers on */
169  int16_t triggerSlope;
170 
171  /** how many converters are being used per channel */
173 
174  /** bitmask describing which channels are combined */
176 
177  /** bitmask describing which channels are recorded */
179 
180  /** number of channels present in the acqiris instrument */
181  uint16_t nbrChannels;
182 };
183 
184 /** the header of an recorded channel
185  *
186  * @author Lutz Foucar
187  */
188 struct Channel
189 {
190  /** the full scale of the channel in mV */
191  int16_t fullscale_mV;
192 
193  /** the offset of the channel in mV */
194  int16_t offset_mV;
195 
196  /** the vertical Gain (conversion factor to convert the bits to mV) */
198 
199  /** baseline that was used for zero substraction in digitizer units */
200  int16_t baseline;
201 
202  /** noiselevel for zero substraction in digitizer units
203  *
204  * the zero substaction will check whether a value of the recorded waveform
205  * is outside the noiselevel. Mathematically:
206  * \f$ \left| value_Du - baseline \right| > noiselevel \f$
207  */
208  int16_t noiseLevel;
209 
210  /** stepsize in sample interval units
211  *
212  * after finding a waveform value thats outside the noiselevel this is the
213  * amount of values skipped before checking whether the wavefrom is in the
214  * noiselevel again.
215  */
216  int32_t stepsize;
217 
218  /** backsize of the zerosubstraction in sample interval units
219  *
220  * how many steps we should go back after a value is outside the noiselevel
221  * to start recording the wavefrom values
222  *
223  * puls of waveform outside noise := puls;
224  * waveform index first value outside noise := puls[i]
225  * puls.begin = puls[i-backsize]
226  */
227  int32_t backsize;
228 
229  /** the number of pulses contained in this channel */
230  uint16_t nbrPulses;
231 };
232 
233 }//end agatRemoteHeader
234 
235 #pragma pack()
236 } //end namespace cass
237 
238 #endif
int16_t offset_mV
the offset of the channel in mV
Definition: agattypes.hpp:194
int16_t noiseLevel
noiselevel for zero substraction in digitizer units
Definition: agattypes.hpp:208
int16_t baseline
baseline that was used for zero substraction in digitizer units
Definition: agattypes.hpp:200
int32_t backsize
backsize of the zerosubstraction in sample interval units
Definition: agattypes.hpp:227
double samplingInterval
the sampling interval (the time between two datapoints in s
Definition: agattypes.hpp:36
int32_t stepsize
stepsize in sample interval units
Definition: agattypes.hpp:216
uint16_t nbrPulses
the number of pulses contained in this channel
Definition: agattypes.hpp:230
uint32_t usedChannelBitmask
bitmask describing which channels are recorded
Definition: agattypes.hpp:178
int16_t nbrConvertersPerChan
how many converters are being used per channel
Definition: agattypes.hpp:60
the header for each event
Definition: agattypes.hpp:67
the general header of an lma file
Definition: agattypes.hpp:24
double horpos
the horpos value of the Event
Definition: agattypes.hpp:73
double gain_mVperLSB
the vertical Gain (conversion factor to convert the bits to mV)
Definition: agattypes.hpp:89
int32_t headersize
size of the Header in bytes
Definition: agattypes.hpp:27
int32_t backsize
backsize of the zerosubstraction in sample interval units
Definition: agattypes.hpp:119
double samplingInterval
the sampling interval (the time between two datapoints in s
Definition: agattypes.hpp:154
uint32_t id
the event id
Definition: agattypes.hpp:145
int32_t nbrSamples
number of samples in the waveform
Definition: agattypes.hpp:157
int16_t baseline
baseline that was used for zero substraction in digitizer units
Definition: agattypes.hpp:92
double delayTime
time between trigger and first sample
Definition: agattypes.hpp:160
int16_t nbrConvertersPerChan
how many converters are being used per channel
Definition: agattypes.hpp:172
int16_t offset_mV
the offset of the channel in mV
Definition: agattypes.hpp:86
double triggerLevel
triggering level of the trigger in V
Definition: agattypes.hpp:48
the header of an recorded channel
Definition: agattypes.hpp:188
int16_t fullscale_mV
the full scale of the channel in mV
Definition: agattypes.hpp:83
int16_t noiseLevel
noiselevel for zero substraction in digitizer units
Definition: agattypes.hpp:100
int32_t usedChannelBitmask
bitmask describing which channels are recorded
Definition: agattypes.hpp:54
int32_t channelCombinationBitmask
bitmask describing which channels are combined
Definition: agattypes.hpp:175
double triggerLevel
triggering level of the trigger in V
Definition: agattypes.hpp:166
the general stream header
Definition: agattypes.hpp:142
uint32_t length
how many points of the wavefrom are in the puls
Definition: agattypes.hpp:132
int32_t channelCombinationBitmask
bitmask describing which channels are combined
Definition: agattypes.hpp:57
int16_t triggerChannel
the triggering channel
Definition: agattypes.hpp:163
int16_t nbrBits
the size of the entries in the waveform in bits
Definition: agattypes.hpp:151
uint32_t idxPos
the start index position of this puls in the original waveform
Definition: agattypes.hpp:129
the header of a puls
Definition: agattypes.hpp:126
int32_t stepsize
stepsize in sample interval units
Definition: agattypes.hpp:108
uint16_t nbrChannels
number of channels present in the acqiris instrument
Definition: agattypes.hpp:181
int16_t fullscale_mV
the full scale of the channel in mV
Definition: agattypes.hpp:191
int16_t nbrChannels
nbr of channels in the instrument
Definition: agattypes.hpp:30
int16_t triggerSlope
on which slope the instruments triggers on
Definition: agattypes.hpp:169
double delayTime
time between trigger and first sample
Definition: agattypes.hpp:42
double horpos
horpos value from acqiris
Definition: agattypes.hpp:148
int16_t triggerChannel
the triggering channel
Definition: agattypes.hpp:45
the header of each channel as part of the file header
Definition: agattypes.hpp:80
uint32_t id
the Event Id of the Event
Definition: agattypes.hpp:70
int16_t nbrBits
the size of the entries in the waveform in bits
Definition: agattypes.hpp:33
double gain_mVperLSB
the vertical Gain (conversion factor to convert the bits to mV)
Definition: agattypes.hpp:197
int32_t nbrSamples
number of samples in the waveform
Definition: agattypes.hpp:39
int16_t triggerSlope
on which slope the instruments triggers on
Definition: agattypes.hpp:51