120 #ifndef EVENTREADER_HH
121 #define EVENTREADER_HH
125 #include <sys/types.h>
128 #if !defined ST_NO_NAMESPACES
137 #include "RecHeaderFormats.hh"
157 unsigned int UnixTime;
158 unsigned int EventSeqNo;
159 unsigned int TrigWord;
160 unsigned int TrigInputWord;
161 unsigned char TPCPresent;
162 unsigned char SVTPresent;
163 unsigned char TOFPresent;
164 unsigned char BTOWPresent;
165 unsigned char FPDPresent;
166 unsigned char FTPCPresent;
167 unsigned char EXTPresent;
168 unsigned char RICHPresent;
169 unsigned char TRGPresent;
170 unsigned char L3Present;
171 unsigned char SCPresent;
172 unsigned char EXT2Present;
173 unsigned char PMDPresent;
174 unsigned char SSDPresent;
175 unsigned char ETOWPresent;
176 unsigned char DAQPresent;
177 unsigned char FP2Present;
178 unsigned char PPPresent;
179 unsigned char BSMDPresent;
180 unsigned char ESMDPresent;
182 unsigned char EMCPresent;
184 void printEventInfo(FILE *fd=stdout);
190 u_short startTimeBin;
220 short start_time_bin;
232 unsigned short flags;
242 virtual int getPadList(
int PadRow, u_char **padList)=0;
247 virtual int getSequences(
int PadRow,
int Pad,
int *nSeq,
256 virtual int getSpacePts(
int PadRow,
int *nSpacePts,
SpacePt **SpacePts)=0;
263 virtual int MemUsed()=0;
271 virtual int getPadList(
int PadRow,
unsigned char **padList)=0;
277 virtual int getSequences(
int PadRow,
int Pad,
int *nArray, u_char **Array)=0;
283 virtual int MemUsed()=0;
291 virtual int getPadList(
int PadRow,
unsigned char **padList)=0;
297 virtual int getSequences(
int PadRow,
int Pad,
int *nArray, u_char **Array)=0;
303 virtual int getNumberOfEvents()=0;
306 virtual int MemUsed()=0;
314 virtual int getPadList(
int PadRow, u_char **padList)=0;
320 virtual int getSequences(
int PadRow,
int Pad,
int *nArray, u_char **Array)=0;
326 virtual int getNumberOfEvents()=0;
329 virtual int MemUsed()=0;
337 virtual int getGain(
int PadRow,
int Pad,
struct Gain **gain)=0;
342 virtual int getMeanGain()=0;
345 virtual int getNumberOfEvents()=0;
348 virtual int MemUsed()=0;
356 virtual int getClusters(
int PadRow,
int Pad,
int *nClusters,
365 virtual int MemUsed()=0;
373 virtual int IsBad(
int PadRow,
int Pad)=0;
377 virtual int MemUsed()=0;
385 virtual int FEE_id(
int PadRow,
int Pad) = 0;
388 virtual int MemUsed()=0;
404 virtual GainReader *getGainReader(
int sector)=0;
405 virtual CPPReader *getCPPReader(
int sector)=0;
410 virtual int MemUsed()=0;
412 int errorNo() {
return errnum; };
413 string errstr() {
return string(errstr0); };
424 virtual int InformBuffers(
GainReader *,
int sector)=0;
425 virtual int InformBuffers(
CPPReader *,
int sector)=0;
430 virtual int AttachBuffers(
ADCRawReader *,
int sector)=0;
433 virtual int AttachBuffers(
GainReader *,
int sector)=0;
434 virtual int AttachBuffers(
CPPReader *,
int sector)=0;
436 virtual int AttachBuffers(
ConfigReader *,
int sector)=0;
440 void *motherPointerBank;
454 void InitEventReader(
int fd,
long offset,
int mmap);
457 void InitEventReader(
int fd,
long offset);
460 void InitEventReader(
void *event);
466 long NextEventOffset();
467 void setVerbose(
int);
468 char * findBank(
const char *bankid);
473 char *getDATAP() {
return DATAP; };
474 daqReader *getDaqReader() {
return fDaqReader; };
475 void setDaqReader(
daqReader *rdr) { fDaqReader = rdr; }
477 int system_present(
Bank_DATAP *datap,
int sys);
479 void printEventInfo(FILE *fd=stdout);
480 void fprintError(
int err,
const char *file,
int line,
const char *userstring);
482 int runno() {
return runnum; }
483 int errorNo() {
return errnum; };
484 string errstr() {
return string(errstr0); };
486 char err_string[MX_MESSAGE][30];
489 char eventIsCorrupted(
int fdes,
long offsetInFile);
507 long next_event_offset;
512 char *ConvertToString(
unsigned long *input);
513 void WhereAreThePointers(
int *beg,
int *end,
char *xx);
514 void Swap4(
unsigned long *
data);
515 char BankOrItsDescendentsIsBad(
int fd,
long currentOffset);
525 EventReader *getEventReader(
int fd,
long offset,
int MMap=1);
526 EventReader *getEventReader(
int fd,
long offset,
const char *logfile,
int MMap=1);