7#ifndef CALOEVENT_CALOCOMPACTCELLCONTAINER_H
8#define CALOEVENT_CALOCOMPACTCELLCONTAINER_H
91 const int & nBytesPerCell)
const;
97 inline const std::vector<value_type> &
getData()
const {
113 const std::vector<value_type>
getHeader()
const;
127 void setHeader(
const std::vector<value_type> & theHeader);
136 const int & iCell,
const int &headerLength);
175 std::vector<value_type>::const_iterator
base()
const;
180 std::vector<value_type>::const_iterator
m_it;
250 std::vector<value_type>::iterator
m_it;
268 int iMod = (iCell%nRatio)<<(8/nRatio);
278 int iPos = headerLength + (int)(iCell/nRatio);
279 int iMod = (iCell%nRatio)<<(8/nRatio);
288 (std::vector<value_type>::const_iterator it)
314 if (((++
m_count)%ratio) == 0) {
328std::vector<CaloCompactCellContainer::value_type>::const_iterator
356 (std::vector<value_type>::iterator it)
373 *
m_it = (*
m_it & ~(mask<<shift)) | (
x << shift);
398 return (
m_count + ratio - 1) / ratio;
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
static unsigned int totalSize(const MultiDimArray< T, N > &ht)
Simple iterator-like object for writing to the container.
int used() const
Return the number of underlying value_type words used.
compact_output_iterator & operator++()
Advance the iterator.
std::vector< value_type >::iterator m_it
The iterator in the underlying container type.
void set(CaloCompactCell::value_type x)
Set the next value, and advance the iterator.
compact_output_iterator()
Default constructor.
int m_count
Count; used to tell how many more times we need to shift m_word.
container class for CaloCompactCell objects
std::vector< value_type > m_compactData
vector containing header and compact cell data.
compact_input_iterator compact_begin_input() const
Return a new compact_input_iterator pointing at the start of the data.
virtual ~CaloCompactCellContainer()
void setCompactCell(const CaloCompactCell &theCompactCell, const int &iCell, const int &headerLength)
store the compact cell with index iCell
void resize(const unsigned int &totalSize)
resize the data vector to totalSize (includes Header)
CaloCompactCell getCompactCell(const int &iCell, const int &nBytesPerCell) const
returns the compactified CaloCell data
CaloCompactCellContainer()
default Constructor.
compact_output_iterator compact_begin_output(int headerLength)
Return a new compact_output_iterator pointing at the start of the data.
compact_input_iterator compact_begin_input_from(int) const
Return a new compact_input_iterator pointing at position given as the parameter BUT from the end of t...
int value_type
value type for the internal data
void setCompactCellDataTime(CaloCompactCell::value_type &theCompactCell, const int &iCell, const int &headerLength)
to speed things up ivukotic@cern.ch added this inline function to be used instead of the one above.
void setHeader(const std::vector< value_type > &theHeader)
replaces the current header (if there was one)
CaloCompactCellContainer(const std::vector< value_type > &theCompactData)
Constructor.
std::vector< value_type > & getData()
returns the entire compact cell container (includes header)
const std::vector< value_type > getHeader() const
returns header portion of the compact cell container
const std::vector< value_type > & getData() const
returns the entire compact cell container (includes header)
void getCompactCellDataTime(const int &iCell, CaloCompactCell::value_type &dataTime) const
to speed things up ivukotic@cern.ch added this inline function to be used instead of the two bellow.
holds compactified CaloCell information
unsigned short value_type
value type for the compact CaloCell data