14#ifndef TPCRAWCLUSTER_H
15#define TPCRAWCLUSTER_H
107 RawClusterArray() : mBuffer(nullptr), mBufferSize(0), mNClusters(0), mClusters(NULL), mClustersEnd(NULL) {}
122 std::ifstream input(
filename, std::ifstream::binary);
126 input.seekg(0, input.end);
127 int length = input.tellg();
128 input.seekg(0, input.beg);
135 input.read(
reinterpret_cast<char*
>(mBuffer),
length);
138 std::cerr <<
"failed to read " <<
length <<
" byte(s) from file " <<
filename << std::endl;
144 std::cerr <<
"failed to open file " <<
filename << std::endl;
167 if (
i + 1 > mNClusters) {
172 return *(mClusters +
i);
177 template <
typename StreamT>
180 std::cout <<
"RawClusterArray: " << mNClusters <<
" cluster(s)" << std::endl;
181 for (
RawCluster* cluster = mClusters; cluster != mClustersEnd; cluster++) {
182 std::cout <<
" " << *cluster << std::endl;
190 if (mBuffer ==
nullptr || mBufferSize == 0)
197 std::cerr <<
"Format error, " << clusterData.
fCount <<
" cluster(s) "
200 <<
" byte(s), but only " << mBufferSize <<
" available" << std::endl;
204 mNClusters = clusterData.
fCount;
206 mClustersEnd = mClusters + mNClusters;
211 int clear(
int returnValue)
226 RawCluster* mClusters;
227 RawCluster* mClustersEnd;
RawClusterArray(unsigned char *buffer, int size)
RawClusterArray(const char *filename)
StreamT & print(StreamT &stream)
RawCluster & operator[](int i)
int init(unsigned char *buffer, int size)
int init(const char *filename)
GLuint GLsizei GLsizei * length
std::ostream & operator<<(std::ostream &stream, const RawCluster &cluster)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
bool GetFlagSplitAny() const
bool GetFlagSplitPad() const
float GetSigmaTime2() const
uint16_t GetFlags() const
bool GetFlagSplitTime() const
float GetSigmaPad2() const
int16_t GetPadRow() const
int32_t GetCharge() const