diff --git a/src/evb/CompassFile.cpp b/src/evb/CompassFile.cpp index 939a7bf..f6c9e0f 100644 --- a/src/evb/CompassFile.cpp +++ b/src/evb/CompassFile.cpp @@ -90,8 +90,8 @@ namespace EventBuilder { if(IsWaves()) { m_hitsize += 5; - char* firstHit = new char[24]; //A compass hit by default has 24 bytes (at least in our setup) - m_file->read(firstHit, 24); + char* firstHit = new char[m_hitsize]; //A compass hit by default has 24 bytes (at least in our setup) + m_file->read(firstHit, m_hitsize); firstHit += m_hitsize - 4; uint32_t nsamples = *((uint32_t*) firstHit); m_hitsize += nsamples * 2; //Each sample is a 2 byte data value @@ -184,16 +184,18 @@ namespace EventBuilder { m_bufferIter += 1; m_currentHit.Ns = *((uint32_t*)m_bufferIter); m_bufferIter += 4; - for(uint32_t i=0; iGetShift(gchan); } diff --git a/src/evb/CompassFile.h b/src/evb/CompassFile.h index 193bb70..457d56b 100644 --- a/src/evb/CompassFile.h +++ b/src/evb/CompassFile.h @@ -64,6 +64,7 @@ namespace EventBuilder { bool m_hitUsedFlag; int m_bufsize = 200000; //size of the buffer in hits int m_hitsize; //size of a CompassHit in bytes (without alignment padding) + int m_channels_per_board = 16; //Number of channels per digitzer board, important for generating id! uint16_t m_header; int m_buffersize; diff --git a/src/evbdict/DataStructs.h b/src/evbdict/DataStructs.h index d28a09f..db8160a 100644 --- a/src/evbdict/DataStructs.h +++ b/src/evbdict/DataStructs.h @@ -13,7 +13,7 @@ struct DPPChannel { double Timestamp; int Channel, Board, Energy, EnergyShort; - uint64_t EnergyCal; + int64_t EnergyCal; int Flags; std::vector Samples; };