Auxiliary program to convert raw CLB data to KM3NETDAQ::JDAQTimeslice data.
More...
Go to the source code of this file.
|
| int | main (int argc, char **argv) |
| |
Auxiliary program to convert raw CLB data to KM3NETDAQ::JDAQTimeslice data.
- Author
- mdejong
Definition in file JCLB.cc.
◆ main()
| int main |
( |
int | argc, |
|
|
char ** | argv ) |
Definition at line 137 of file JCLB.cc.
138{
142
143
144 string inputFile;
145 int numberOfEvents;
148 size_t queue;
150
151 try {
152
153 JParser<> zap(
"Auxiliary program to convert raw CLB data to KM3NETDAQ::JDAQTimeslice data.");
154
155 zap[
'f'] =
make_field(inputFile,
"input file).");
157 zap[
'n'] =
make_field(numberOfEvents) = numeric_limits<int>::max();
158 zap[
'Q'] =
make_field(queue,
"queue depth") = 1000;
161
162 zap(argc, argv);
163 }
164 catch(const exception& error) {
165 FATAL(error.what() << endl);
166 }
167
168
170
173 }
174
176
178
179 uint32_t run = numeric_limits<uint32_t>::max();
180 uint32_t size;
181
182 ifstream in(inputFile.c_str(), ios::binary);
183
184 for (int count = 0; count != numberOfEvents && in.read((char*) &size, sizeof(uint32_t)); ++count) {
185
187
189
190 if (in.read(buffer.data(), size)) {
191
193
195
196 if (run == numeric_limits<uint32_t>::max()) {
198 }
199
204 << setw(8) << header->
dataType() << endl);
205
207
209
211
212 while (
data.size() > queue) {
214 }
215
216 } else {
217
218 WARNING(
"Run numbers differ " << run <<
' ' << header->
runNumber() <<
" -> skip data." << endl);
219 }
220 }
221 }
222 }
223 }
225
226 in.close();
227
228 while (!
data.empty()) {
230 }
231
233}
#define DEBUG(A)
Message macros.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
Utility class to parse command line options.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
KM3NeT DAQ data structures and auxiliaries.
uint64_t inMilliSeconds() const