#include // for ntohl #include #include "Tn3cEvent.h" ClassImp(Tn3cEvent) Tn3cEvent::Tn3cEvent() {} Tn3cEvent::Tn3cEvent(Char_t *buf) { ULong_t *bufl = (ULong_t*)buf; fsize = ntohl(*bufl); ftype = buf[4]; ftlen = buf[5]; fqual = buf[6]; fhlen = buf[7]; fevnum = ntohl(bufl[2]); fstamp = ntohl(bufl[3]); fpattern = ntohl(bufl[4]); ftimer = ntohl(bufl[5]); int ofs = sizeof(fsize)+fhlen; fch = (UShort_t*)(buf+ofs); fnch = (fsize-ftlen-ofs)/sizeof(*fch); } //Tn3c::~Tn3c() //{} void Tn3cEvent::Print() { printf("Size: 0x%04lx, Header: %02x.%02x.%02x.%02x %08lx %08lx %08lx %08lx nch=%i\n", fsize,ftype,ftlen,fqual,fhlen,fevnum,fstamp,fpattern,ftimer,fnch); }