5#ifndef CALOCONDBLOBOBJS_CALOCONDBLOBBASE_H
6#define CALOCONDBLOBOBJS_CALOCONDBLOBBASE_H
38#include "CoralBase/Blob.h"
131 uint32_t objSizeUint32,
135 const std::string& author=
"",
136 const std::string& comment=
"",
137 uint64_t timeStamp=0);
148 static uint32_t
unpacknGains(
const uint32_t gainAndnChans);
149 static uint32_t
unpacknChans(
const uint32_t gainAndnChans);
177inline const uint32_t*
180 return static_cast<const uint32_t*
>(
m_blob->startingAddress());
188 return static_cast<uint32_t*
>(
m_blob_nc->startingAddress());
198 return static_cast<const uint16_t*
>(
m_blob->startingAddress())[0];
208 return static_cast<const uint16_t*
>(
m_blob->startingAddress())[1];
226 return static_cast<const uint32_t*
>(
m_blob->startingAddress())[2];
254 return static_cast<const uint32_t*
>(
m_blob->startingAddress())[4];
265 return static_cast<const void*
>
277 return static_cast<void*
>
uint32_t * getBlobStart()
Returns the BLOB start address as uint32_t pointer.
uint16_t getObjType() const
Returns the BLOB object type.
virtual void dump(std::ostream &stm) const
Prints the BLOB header summary information.
std::string getDate() const
Returns the date of the comment as string (derived from timestamp)
CaloCondBlobBase & operator=(const CaloCondBlobBase &other)
Assignment operator.
virtual ~CaloCondBlobBase()
Dtor.
uint32_t getNGains() const
Returns the number of gains stored for each channel.
uint64_t getTimeStamp() const
Returns the unix timestamp of the comment (seconds since 1.1.1970)
const void * getAddress(unsigned int iEle) const
Returns start address of iEle-th basic unit.
uint32_t getObjSizeUint32() const
Returns the size of a data object in units of uint32_t.
const uint32_t * getBlobStart() const
Returns the BLOB start address as uint32_t pointer.
static uint32_t packGainAndNchans(const uint32_t gain, const uint32_t nChans)
bool m_isBlobOwner
Do I own the BLOB?
std::string getAuthor() const
Returns the comment author.
static uint32_t unpacknGains(const uint32_t gainAndnChans)
uint32_t getCommentSizeUint32() const
Returns the space occupied by the comment fields in units of uint32_t.
unsigned m_sizeOfObj
Chache of some frequently-used numbers.
static uint32_t unpacknChans(const uint32_t gainAndnChans)
void dumpHeader(std::ostream &stm) const
Prints the BLOB header summary information.
uint32_t createBlob(uint16_t objType, uint16_t objVersion, uint32_t objSizeUint32, uint32_t nObjs, uint32_t nChans, uint16_t nGains, const std::string &author="", const std::string &comment="", uint64_t timeStamp=0)
(re-)creation of the referenced BLOB object.
CaloCondBlobBase(const CaloCondBlobBase &other)
Copy Ctor.
uint32_t getNObjs() const
Returns the number of data objects stored int the BLOB.
std::string getComment() const
Returns the actual comment.
uint32_t getNChans() const
Returns the number of channels stored in the BLOB.
void * getAddress(unsigned int iEle)
uint32_t getObjSizeByte() const
Returns the size of a data object in units of bytes.
uint16_t getObjVersion() const
Returns the BLOB object version.
uint32_t getCommentSizeChar() const
Returns the space occupied by the comment fields in units of chars.
coral::Blob * m_blob_nc
Non-const reference to the BLOB.
std::string getFullComment() const
Returns a formated string build from all comment fields.
unsigned int getHdrSize() const
Returns the size of the header in units of uint32_t.
const coral::Blob * m_blob
Const reference to the BLOB (always there)
virtual void dump() const
Prints the BLOB header summary information to std::cout.
long getBlobSize() const
Returns the BLOB size.
const void * m_pDataStart
virtual uint16_t getType() const
Returns CaloCondDrawer::BASE.
@ BASE
Enum for CaloCondBlobBase class.
Thrown if an index is out of range.
Thrown if coral::Blob does not conform with expected structure.
Read little-endian values through possibly unaligned pointers.
uint64_t get_unaligned64(const uint8_t *ATH_RESTRICT &p)
Read an 8-byte little-endian value from a possibly unaligned pointer.