static char *rcsId =
- "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.90 2008-06-17 18:51:06 hadaq Exp $";
+ "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.91 2008-07-23 13:49:02 hadaq Exp $";
#define _POSIX_C_SOURCE 199309L
char lustrePath[PARAM_MAX_VALUE_LEN];
unsigned short buffStat;
unsigned short epicsCtrl;
-
+ unsigned short ignore; /* ignore all trigger mismatch conditions */
char shmname[PARAM_MAX_VALUE_LEN];
unsigned int ebnum;
char runinfo2ora[PARAM_MAX_VALUE_LEN];
syslog (LOG_ERR, "Usage: [--epicsctrl] enable synch and distribution of RUN Id by Epics for parallel event builders");
syslog (LOG_ERR, "Usage: [--lustre path_to_lustre] path to the file on the Lustre cluster");
syslog (LOG_ERR, "Usage: [--ebnum] number of the event builder");
+ syslog (LOG_ERR, "Usage: [--orapath path] path to eb_runinfo2ora.txt");
}
static void argsDump (TheArgs * my)
strcpy (my->rfioRemotePath, "");
strcpy (my->lustrePath, "");
- my->buffStat = 0;
+ my->buffStat = 0;
my->epicsCtrl = 0;
- my->ebnum = 0;
+ my->ebnum = 1;
+ my->ignore = 0;
/* read path from DAQ_SETUP and define full file name */
sprintf(my->runinfo2ora,"%s_runinfo2ora.txt",getenv("DAQ_SETUP"));
{"lustre", 1, 0, 'L'},
{"shmname", 1, 0, 'S'},
{"ebnum", 1, 0, 'B'},
+ {"orapath", 1, 0, 'O'},
+ {"ignore", 0, 0, 'i'},
{0, 0, 0, 0}
};
i = getopt_long (argc, argv,
- "am:f:r:o:d:q:p:v:x:I:tz:e:n:h:w:tz:e:n:Hs:l:R:bEL:S:B:",
+ "am:f:r:o:d:q:p:v:x:I:tz:e:n:h:w:tz:e:n:Hs:l:R:bEL:S:B:O:i",
long_options, &option_index);
if (i == -1)
break;
case 'E':
my->epicsCtrl = 1;
break;
+ case 'i':
+ my->ignore = 1;
+ break;
case 'B':
my->ebnum = strtoul (optarg, NULL, 0);
break;
+ case 'O':
+ sprintf(my->runinfo2ora,"%s_runinfo2ora.txt",optarg);
+ break;
case 'H':
usage (argv[0]);
return -1;
/* max number of evts with tag error allowed */
unsigned long maxtagerror = (*my->evtsComplete) * 0.03;
- if ((*my->bytesWritten) >= minfilesize) {
- if ((*my->evtsDiscarded) > maxdiscarded) {
+ if ((*my->bytesWritten) >= minfilesize && !(theArgs->ignore) ) {
+ if ((*my->evtsDiscarded) > maxdiscarded && !(theArgs->ignore) ) {
syslog (LOG_ERR, "<E> evtbuild.c: Too many events are broken!");
syslog (LOG_ERR, "<D> evtbuild.c: bytes written: %u, minimum file size: %u",
#endif
sleep(5);
}
- if ((*my->evtsTagError) > maxtagerror) {
+ if ((*my->evtsTagError) > maxtagerror && !(theArgs->ignore) ) {
syslog(LOG_ERR, "<E> evtbuild.c: Too many TagErrors!");
syslog (LOG_ERR, "<D> evtbuild.c: bytes written: %u, minimum file size: %u",
static once = 1;
diff_time = 1;
+
+ struct timeval tv;
- if( !(theArgs->epicsCtrl) )
- runNr = genId32 ();
+ if( !(theArgs->epicsCtrl) ) {
+ /* runNr = genId32 (); */
+ gettimeofday( &tv, NULL );
+ runNr = tv.tv_sec - TIMEOFFSET;
+ }
seqNr = 0;
* %j : day of year (001-366) %S : second (00-59)
* %H : hour (00-23)
*/
- if( theArgs->epicsCtrl && theArgs->ebnum > 0 ) {
- time_t iocTime;
- iocTime = theArgs->runNr + TIMEOFFSET;
- strftime( fileName + strlen(fileName), 18, "%y%j%H%M%S",
- localtime(&iocTime) );
- }
- else
- strftime( fileName + strlen(fileName), 18, "%y%j%H%M%S",
- localtime(&ourTime) );
+ time_t iocTime;
+ iocTime = theArgs->runNr + TIMEOFFSET;
+ strftime( fileName + strlen(fileName), 18, "%y%j%H%M%S",
+ localtime(&iocTime) );
/* if ebnum == 0 then we assume that there is only 1 EB,
* RUNID distribution by IOC is not needed and file name