Belle II Software development
PXDRawROIs.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#include <pxd/dataobjects/PXDRawROIs.h>
10#include <boost/endian/arithmetic.hpp>
11
12using namespace std;
13using namespace Belle2;
14
15PXDRawROIs::PXDRawROIs(unsigned int nrroi, unsigned int* data):
16 m_2timesNrROIs(2 * nrroi), m_rois(NULL)
17{
18 m_rois = new int[m_2timesNrROIs];
19 auto* d = (boost::endian::big_uint32_t*)data;
20 for (unsigned int i = 0; i < m_2timesNrROIs; i++) {
21 m_rois[i] = d[i];// We have to do 32bit endian swap, TODO VERIFY this!
22 }
23}
24
26{
27 if (m_rois)
28 delete[] m_rois;
29}
PXDRawROIs()
Default constructor for the ROOT IO.
Definition: PXDRawROIs.h:29
int * m_rois
Buffer of size 2*m_NrROIs ints.
Definition: PXDRawROIs.h:114
unsigned int m_2timesNrROIs
Number of ROIs times two (size of one ROI is 2*32bit)
Definition: PXDRawROIs.h:112
~PXDRawROIs()
Destructor.
Definition: PXDRawROIs.cc:25
Abstract base class for different kinds of events.
STL namespace.