]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
JAM: Bugfixes/workaroune in eventbuilder lost events statistics
authorhadaq <hadaq>
Wed, 7 Mar 2012 14:35:23 +0000 (14:35 +0000)
committerhadaq <hadaq>
Wed, 7 Mar 2012 14:35:23 +0000 (14:35 +0000)
hadaq/evtbuild.c

index d9a626e701551d418456bb1b56cc3fbd42ae90ed..2d6675424ff1ca22bfadb2a352f5d5bc85ce96a4 100644 (file)
@@ -1,4 +1,4 @@
-static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.159 2012-02-22 15:05:20 hadaq Exp $";
+static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.160 2012-03-07 14:35:23 hadaq Exp $";
 
 #define _POSIX_C_SOURCE 199309L
 #define SYSLOG_NAMES
@@ -1504,7 +1504,23 @@ int main(int argc, char *argv[])
                } else {
                        if (lastTrigNr) {
                                /* check how many events we did lose since last complete one: */
-                               (*theStats->evtsDiscarded) += currTrigNr - lastTrigNr;
+                               uint32_t delta;
+                               delta = 1;
+                               if (currTrigNr > lastTrigNr)
+                                       delta = currTrigNr - lastTrigNr;
+                               if (delta > 16)
+                                       delta = delta / 16;
+                               else if (delta > 8)
+                                       delta = delta / 8;
+                               else if (delta > 4)
+                                       delta = delta / 4;
+                               /* worst case estimation for a n  eventbuilder setup
+                                * offset between trigger numbers should be # active EBs
+                                * the error is underestimated such most likely...*/
+
+
+
+                               (*theStats->evtsDiscarded) += delta;
                                /*sprintf(msglog, "<I> Discarded %d events at TrigNr: 0x%06x", currTrigNr - lastTrigNr, currTrigNr);
                                   storeLogInfo(theArgs, msglog); */
                                lastTrigNr = 0;