-static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.50 2002-11-07 20:40:41 hadaq Exp $";
+static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.51 2002-11-14 17:24:02 hadaq Exp $";
#define _POSIX_C_SOURCE 199309L
#include "ansiTape.h"
#define NTRIGTYPES 64UL /* must be 2^n */
+#define NTRIGTYPES_IN_FILE 16 /* must be 2^n */
static time_t ourTime;
static int argsFromCL(TheArgs *my, int argc, char *argv[]) {
extern char *optarg;
int i;
- int trigType = 0;
while ((i = getopt(argc, argv, "am:f:s:r:o:d:q:p:v:x:")) != -1) {
switch (i) {
currTrigNr = SubEvt_trigNr(subEvt) >> 8;
currTrigTag = SubEvt_trigNr(subEvt) & 0xff;
currId = SubEvt_pureId(subEvt);
- Evt_setId(evt, currId);
#ifndef NDEBUG
syslog(LOG_DEBUG,
"currTrigNr: 0x%06x, currTrigTag 0x%02x, currId 0x%08x", currTrigNr, currTrigTag, currId);
}
}
if (!evtIsBroken) {
+ (*theStats->evtsComplete)++;
+
if (dataError) {
Evt_setDataError(evt);
(*theStats->evtsDataError)++;
Evt_setDataError(evt);
(*theStats->evtsTagError)++;
}
+
+ (*theStats->triggerType[currId & (NTRIGTYPES - 1)])++;
+ Evt_setId(evt, currId & (NTRIGTYPES_IN_FILE - 1));
+
+ (*theStats->bytesWritten) += Evt_size(evt);
if (outFile != NULL) {
fwrite(evt, 1, Evt_paddedSize(evt), outFile);
} else if (outTape != NULL) {
writeAnsiTape(outTape, evt, Evt_paddedSize(evt));
}
Evt_online(evt);
- (*theStats->evtsComplete)++;
- (*theStats->triggerType[currId & (NTRIGTYPES - 1)])++;
- (*theStats->bytesWritten) += Evt_size(evt);
} else {
(*theStats->evtsDiscarded)++;
}