|
ATLAS Offline Software
|
This class provides the core BLOB infrastructure.
More...
#include <CaloCondBlobBase.h>
|
| CaloCondBlobBase (const coral::Blob &blob) |
| Ctor for const blob. More...
|
|
| CaloCondBlobBase (coral::Blob &blob) |
| Ctor for non-const blob. More...
|
|
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. More...
|
|
void | dumpHeader (std::ostream &stm) const |
| Prints the BLOB header summary information. More...
|
|
This class provides the core BLOB infrastructure.
- Author
- Nils Gollub nils..nosp@m.goll.nosp@m.ub@ce.nosp@m.rn.c.nosp@m.h
All data storage classes inherit from this class. It provides the infrastructure to store and retrieve units of conditions data associated with one channel/gain ("data object") by implementing a common BLOB header. This header holds the following information:
- The type of the object stored in the BLOB (see CaloCondType class for known types)
- The version of the type (allows for schema evolution)
- The size of a data object in units of uint32_t (4 bytes)
- The total number of data objects
- The number of channels stored in the blob
- The number of gains stored for each channel
- The number of uint32_t used to store comment information (after the actual blob data)
A data object contains all conditions data related to one channel/gain (depending on data stored on channel or adc level), for example 5 floats. The conditions data units themselves must be build from objects of 32 bit length, i.e. available types are float, uint32_t and int32_t.
Definition at line 42 of file CaloCondBlobBase.h.
◆ ~CaloCondBlobBase()
CaloCondBlobBase::~CaloCondBlobBase |
( |
| ) |
|
|
virtual |
◆ CaloCondBlobBase() [1/4]
◆ CaloCondBlobBase() [2/4]
CaloCondBlobBase::CaloCondBlobBase |
( |
const coral::Blob & |
blob | ) |
|
|
protected |
◆ CaloCondBlobBase() [3/4]
CaloCondBlobBase::CaloCondBlobBase |
( |
coral::Blob & |
blob | ) |
|
|
protected |
◆ CaloCondBlobBase() [4/4]
CaloCondBlobBase::CaloCondBlobBase |
( |
coral::Blob * |
blob_nc, |
|
|
const coral::Blob * |
blob |
|
) |
| |
|
private |
◆ createBlob()
uint32_t CaloCondBlobBase::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 |
|
) |
| |
|
protected |
(re-)creation of the referenced BLOB object.
- Parameters
-
objType | Object type |
objVersion | Object version |
objSizeUint32 | Size of a data object (in uint32_t) |
nObjs | Total number of data objects |
nChans | number of stored channels |
nGains | number of stored gains |
author | comment author |
comment | actual comment |
timeStamp | unix time stamp (if 0, current time is used) |
Definition at line 83 of file CaloCondBlobBase.cxx.
102 commentSizeChar += (commentSizeChar %
sizeof(
uint32_t)) ?
107 const uint32_t blobSizeInBytes = dataSizeByte+commentSizeChar;
126 char* pChar =
reinterpret_cast<char*
>(++pTimeStamp);
127 std::string::const_iterator iStr =
author.begin();
128 for(; iStr!=
author.end(); ++iStr){ *pChar = *iStr; ++pChar; }
130 for(iStr=
comment.begin(); iStr!=
comment.end(); ++iStr){ *(++pChar) = *iStr; }
135 return (blobSizeInBytes/
sizeof(
uint32_t));
◆ dump() [1/2]
virtual void CaloCondBlobBase::dump |
( |
| ) |
const |
|
inlinevirtual |
◆ dump() [2/2]
virtual void CaloCondBlobBase::dump |
( |
std::ostream & |
stm | ) |
const |
|
inlinevirtual |
◆ dumpHeader()
void CaloCondBlobBase::dumpHeader |
( |
std::ostream & |
stm | ) |
const |
|
protected |
Prints the BLOB header summary information.
- Parameters
-
Definition at line 229 of file CaloCondBlobBase.cxx.
232 stm <<
"ObjType : " <<
getObjType() << std::endl;
235 stm <<
"NObjs : " <<
getNObjs() << std::endl;
236 stm <<
"NChannels : " <<
getNChans() << std::endl;
237 stm <<
"NGains : " <<
getNGains() << std::endl;
239 stm <<
"=== No comment available ===" << std::endl;
242 stm <<
"Author : " <<
getAuthor() << std::endl;
244 stm <<
"Comment: : " <<
getComment() << std::endl;
◆ getAddress() [1/2]
void * CaloCondBlobBase::getAddress |
( |
unsigned int |
iEle | ) |
|
|
inline |
◆ getAddress() [2/2]
const void * CaloCondBlobBase::getAddress |
( |
unsigned int |
iEle | ) |
const |
|
inline |
Returns start address of iEle-th basic unit.
- Parameters
-
iEle | sequential basic unit number |
Definition at line 259 of file CaloCondBlobBase.h.
264 return static_cast<const void*
>
◆ getAuthor()
std::string CaloCondBlobBase::getAuthor |
( |
| ) |
const |
◆ getBlobSize()
long CaloCondBlobBase::getBlobSize |
( |
| ) |
const |
|
inline |
◆ getBlobStart() [1/2]
uint32_t * CaloCondBlobBase::getBlobStart |
( |
| ) |
|
|
inlineprivate |
◆ getBlobStart() [2/2]
const uint32_t * CaloCondBlobBase::getBlobStart |
( |
| ) |
const |
|
inlineprivate |
◆ getComment()
std::string CaloCondBlobBase::getComment |
( |
| ) |
const |
◆ getCommentSizeChar()
uint32_t CaloCondBlobBase::getCommentSizeChar |
( |
| ) |
const |
|
inline |
Returns the space occupied by the comment fields in units of chars.
Definition at line 83 of file CaloCondBlobBase.h.
◆ getCommentSizeUint32()
uint32_t CaloCondBlobBase::getCommentSizeUint32 |
( |
| ) |
const |
|
inline |
Returns the space occupied by the comment fields in units of uint32_t.
Definition at line 249 of file CaloCondBlobBase.h.
253 return static_cast<const uint32_t*
>(
m_blob->startingAddress())[4];
◆ getDate()
std::string CaloCondBlobBase::getDate |
( |
| ) |
const |
Returns the date of the comment as string (derived from timestamp)
Definition at line 205 of file CaloCondBlobBase.cxx.
212 while(*iEnd!=
'\n'){++iEnd;}
213 return std::string(iBeg,iEnd-iBeg);
◆ getFullComment()
std::string CaloCondBlobBase::getFullComment |
( |
| ) |
const |
◆ getHdrSize()
unsigned int CaloCondBlobBase::getHdrSize |
( |
| ) |
const |
|
inline |
Returns the size of the header in units of uint32_t.
Definition at line 85 of file CaloCondBlobBase.h.
◆ getNChans()
uint32_t CaloCondBlobBase::getNChans |
( |
| ) |
const |
|
inline |
◆ getNGains()
uint32_t CaloCondBlobBase::getNGains |
( |
| ) |
const |
|
inline |
◆ getNObjs()
uint32_t CaloCondBlobBase::getNObjs |
( |
| ) |
const |
|
inline |
Returns the number of data objects stored int the BLOB.
Definition at line 221 of file CaloCondBlobBase.h.
225 return static_cast<const uint32_t*
>(
m_blob->startingAddress())[2];
◆ getObjSizeByte()
uint32_t CaloCondBlobBase::getObjSizeByte |
( |
| ) |
const |
|
inline |
Returns the size of a data object in units of bytes.
Definition at line 73 of file CaloCondBlobBase.h.
◆ getObjSizeUint32()
uint32_t CaloCondBlobBase::getObjSizeUint32 |
( |
| ) |
const |
|
inline |
Returns the size of a data object in units of uint32_t.
Definition at line 213 of file CaloCondBlobBase.h.
◆ getObjType()
uint16_t CaloCondBlobBase::getObjType |
( |
| ) |
const |
|
inline |
◆ getObjVersion()
uint16_t CaloCondBlobBase::getObjVersion |
( |
| ) |
const |
|
inline |
◆ getTimeStamp()
uint64_t CaloCondBlobBase::getTimeStamp |
( |
| ) |
const |
|
inline |
Returns the unix timestamp of the comment (seconds since 1.1.1970)
Definition at line 283 of file CaloCondBlobBase.h.
◆ getType()
virtual uint16_t CaloCondBlobBase::getType |
( |
| ) |
const |
|
inlinevirtual |
◆ operator=()
◆ packGainAndNchans()
uint32_t CaloCondBlobBase::packGainAndNchans |
( |
const uint32_t |
gain, |
|
|
const uint32_t |
nChans |
|
) |
| |
|
staticprivate |
◆ unpacknChans()
uint32_t CaloCondBlobBase::unpacknChans |
( |
const uint32_t |
gainAndnChans | ) |
|
|
staticprivate |
Definition at line 160 of file CaloCondBlobBase.cxx.
161 if (gainAndnChans & 0x80000000) {
163 return gainAndnChans & 0xFFFFFF;
167 return gainAndnChans & 0xFFFF;
◆ unpacknGains()
uint32_t CaloCondBlobBase::unpacknGains |
( |
const uint32_t |
gainAndnChans | ) |
|
|
staticprivate |
Definition at line 150 of file CaloCondBlobBase.cxx.
151 if (gainAndnChans & 0x80000000) {
153 return (gainAndnChans>>24) & 0x7F;
157 return (gainAndnChans>>16) & 0xFFFF;
◆ m_blob
const coral::Blob* CaloCondBlobBase::m_blob |
|
private |
◆ m_blob_nc
coral::Blob* CaloCondBlobBase::m_blob_nc |
|
private |
Non-const reference to the BLOB.
(Only present if we were created with a non-const blob.)
Definition at line 157 of file CaloCondBlobBase.h.
◆ m_isBlobOwner
bool CaloCondBlobBase::m_isBlobOwner |
|
private |
◆ m_nChans
unsigned CaloCondBlobBase::m_nChans |
|
private |
◆ m_nGains
unsigned CaloCondBlobBase::m_nGains |
|
private |
◆ m_pDataStart
const void* CaloCondBlobBase::m_pDataStart |
|
protected |
◆ m_sizeOfObj
unsigned CaloCondBlobBase::m_sizeOfObj |
|
private |
The documentation for this class was generated from the following files:
uint32_t getCommentSizeUint32() const
Returns the space occupied by the comment fields in units of uint32_t.
bool m_isBlobOwner
Do I own the BLOB?
static uint32_t packGainAndNchans(const uint32_t gain, const uint32_t nChans)
uint32_t getObjSizeUint32() const
Returns the size of a data object in units of uint32_t.
std::string getAuthor() const
Returns the comment author.
std::string find(const std::string &s)
return a remapped string
coral::Blob * m_blob_nc
Non-const reference to the BLOB.
const void * m_pDataStart
uint16_t getObjType() const
Returns the BLOB object type.
std::string getDate() const
Returns the date of the comment as string (derived from timestamp)
CaloCondBlobBase(const CaloCondBlobBase &other)
Copy Ctor.
unsigned int getHdrSize() const
Returns the size of the header in units of uint32_t.
uint32_t getCommentSizeChar() const
Returns the space occupied by the comment fields in units of chars.
const uint32_t * getBlobStart() const
Returns the BLOB start address as uint32_t pointer.
uint16_t getObjVersion() const
Returns the BLOB object version.
@ BASE
Enum for CaloCondBlobBase class.
std::string getComment() const
Returns the actual comment.
void dumpHeader(std::ostream &stm) const
Prints the BLOB header summary information.
static uint32_t unpacknChans(const uint32_t gainAndnChans)
Thrown if coral::Blob does not conform with expected structure.
Thrown if an index is out of range.
static std::string getClassName(CaloCondType::TYPE type)
Returns the class name.
uint32_t getNObjs() const
Returns the number of data objects stored int the BLOB.
uint32_t getNGains() const
Returns the number of gains stored for each channel.
const coral::Blob * m_blob
Const reference to the BLOB (always there)
uint32_t getObjSizeByte() const
Returns the size of a data object in units of bytes.
def time(flags, cells_name, *args, **kw)
This class provides the core BLOB infrastructure.
unsigned m_sizeOfObj
Chache of some frequently-used numbers.
uint64_t getTimeStamp() const
Returns the unix timestamp of the comment (seconds since 1.1.1970)
static uint32_t unpacknGains(const uint32_t gainAndnChans)
uint32_t getNChans() const
Returns the number of channels stored in the BLOB.