// This program attempts to quickly determine the number of // events in a CODA file by checking the start and the end. // It does not use evio, rather, it just looks for a certain // byte pattern indicating a bank header from which it can // extract the event number. Taking the difference of the first // and last event numbers gives the number of events in the file. // // NOTE: This does not work on all CODA formatted files. It // was originally written for use by PrimEx on SunOS. It has // been ported (but not really tested) for use by GlueX on // Linux. #include #include using namespace std; #include #include #include void Usage(void); #define buff_size 327680 int main(int narg, char* argv[]) { if(narg<2)Usage(); // Open EVIO file int handle; int err = evOpen((char*)argv[1],"r", &handle); if(err != S_SUCCESS){ cout<<"0"<fsize)fseek(f,0,SEEK_SET); Nbytes = fread(buff,1,buff_size,f); fseek(f,-Nbytes,SEEK_CUR); iptr = (unsigned int*)buff; for(int i=0;i