static unsigned long runId = 0;
runId = (unsigned long) psub->a; /* RUN Id */
-
- if( Worker_setStatistic( "daq_evtbuild", "runId", &runId ) == -1 ) {
+
+ char buf[_POSIX_PATH_MAX];
+ int ebnum = getenv("EBNUM");
+
+ sprintf( buf, "%s%s", "daq_evtbuild", getenv("EBNUM") );
+
+ if( Worker_setStatistic( buf, "runId", &runId ) == -1 ) {
if(writerunidDebug) {
- fprintf( stderr, "<E> writerunid.c: Worker_setStatistic failed for runId! Either shared memory daq_evtbuild was not created or statistic runId was not added by the event builder.\n");
+ fprintf( stderr, "<E> writerunid.c: Worker_setStatistic failed for runId! Either shared memory %s was not created or statistic runId was not added by the event builder.\n", buf);
}
}
else
unsigned long runId_check;
/* In the following we try to read back the RUN Id from the shared memory */
- if( Worker_getStatistic( "daq_evtbuild", "runId", &runId_check ) == -1 )
+ if( Worker_getStatistic( buf, "runId", &runId_check ) == -1 )
printf("<E> writerunid.c: check: Worker_getStatistic cannot access runId!\n");
else
printf("<D> writerunid.c: check: Worker_getStatistic runId = %lu\n", runId_check);