|
ATLAS Offline Software
|
Class for storing a number of floats (Flt) and functions on those.
More...
#include <CaloCondBlobFlt.h>
|
typedef std::vector< std::vector< float > > | DefType |
| Object to hold default data used for initialization. More...
|
|
|
virtual | ~CaloCondBlobFlt () |
| Dtor. More...
|
|
virtual uint16_t | getType () const |
| Returns CaloCondType::FLT. More...
|
|
float | getCalib (unsigned int channel, unsigned int adc, float x, bool invert=false) const |
| Returns the calibrated energy for a given channel/gain and input energy. More...
|
|
float | getData (const unsigned int channel, const unsigned int adc, const unsigned int idx) const |
| Returns a single T belonging to a channel/gain. More...
|
|
float | getData (const unsigned int channel) const |
| Returns a single T belonging to a channel/gain. More...
|
|
void | init (const DefType &def, uint32_t nChans, uint16_t objVers, const std::string &author="", const std::string &comment="", uint64_t timeStamp=0) |
| Initializing function. More...
|
|
void | setData (unsigned int channel, unsigned int adc, unsigned int idx, float data) |
| Sets a single T belonging to a channel/gain. More...
|
|
void | setData (unsigned int channel, unsigned int adc, const std::vector< float > &data) |
| Sets a number of Ts stored in the input vector. More...
|
|
virtual void | dump () const |
| Prints out the content of the blob to std::out. More...
|
|
virtual void | dump (std::ostream &stm) const |
| Prints out the content of the blob. More...
|
|
virtual void | dump () const |
| Prints the BLOB header summary information to std::cout. More...
|
|
const void * | getAddress (unsigned int iEle) const |
| Returns start address of iEle-th basic unit. More...
|
|
void * | getAddress (unsigned int iEle) |
|
long | getBlobSize () const |
| Returns the BLOB size. More...
|
|
uint16_t | getObjType () const |
| Returns the BLOB object type. More...
|
|
uint16_t | getObjVersion () const |
| Returns the BLOB object version. More...
|
|
uint32_t | getObjSizeUint32 () const |
| Returns the size of a data object in units of uint32_t. More...
|
|
uint32_t | getObjSizeByte () const |
| Returns the size of a data object in units of bytes. More...
|
|
uint32_t | getNObjs () const |
| Returns the number of data objects stored int the BLOB. More...
|
|
uint32_t | getNChans () const |
| Returns the number of channels stored in the BLOB. More...
|
|
uint32_t | getNGains () const |
| Returns the number of gains stored for each channel. More...
|
|
uint32_t | getCommentSizeUint32 () const |
| Returns the space occupied by the comment fields in units of uint32_t. More...
|
|
uint32_t | getCommentSizeChar () const |
| Returns the space occupied by the comment fields in units of chars. More...
|
|
unsigned int | getHdrSize () const |
| Returns the size of the header in units of uint32_t. More...
|
|
std::string | getAuthor () const |
| Returns the comment author. More...
|
|
std::string | getComment () const |
| Returns the actual comment. More...
|
|
uint64_t | getTimeStamp () const |
| Returns the unix timestamp of the comment (seconds since 1.1.1970) More...
|
|
std::string | getDate () const |
| Returns the date of the comment as string (derived from timestamp) More...
|
|
std::string | getFullComment () const |
| Returns a formated string build from all comment fields. More...
|
|
|
| CaloCondBlobFlt (const coral::Blob &blob) |
| Ctor. More...
|
|
| CaloCondBlobFlt (coral::Blob &blob) |
| Ctor. More...
|
|
const float * | getAddress (const unsigned int channel, const unsigned int adc) const |
| Returns a pointer to the first value for the specified channel/gain. More...
|
|
float * | getAddress (const unsigned int channel, const unsigned int adc) |
|
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...
|
|
Class for storing a number of floats (Flt) and functions on those.
- Author
- Nils Gollub nils..nosp@m.goll.nosp@m.ub@ce.nosp@m.rn.c.nosp@m.h
This class implements the infrastructure to store a (variable) number of floats for each channel or ADC. The stored floats can be used to define a function of one parameter. Different functional forms can be implemented and differentiated by the objVersion header variable (this allows for e.g. schema evolution). The functions are evaluated by calling the getCalib() function.
Definition at line 28 of file CaloCondBlobFlt.h.
◆ DefType
Object to hold default data used for initialization.
The length of the outer and inner vector determines respectively the number of gains and values per gain to be stored. The indexing is thus DefType[iGain][iValue].
Definition at line 37 of file CaloCondBlobDat.h.
◆ ~CaloCondBlobFlt()
virtual CaloCondBlobFlt::~CaloCondBlobFlt |
( |
| ) |
|
|
inlinevirtual |
◆ CaloCondBlobFlt() [1/2]
CaloCondBlobFlt::CaloCondBlobFlt |
( |
const coral::Blob & |
blob | ) |
|
|
protected |
◆ CaloCondBlobFlt() [2/2]
CaloCondBlobFlt::CaloCondBlobFlt |
( |
coral::Blob & |
blob | ) |
|
|
protected |
◆ 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 |
|
) |
| |
|
protectedinherited |
(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/3]
virtual void CaloCondBlobBase::dump |
( |
| ) |
const |
|
inlinevirtualinherited |
◆ dump() [2/3]
Prints out the content of the blob to std::out.
Definition at line 89 of file CaloCondBlobDat.h.
◆ dump() [3/3]
◆ dumpHeader()
void CaloCondBlobBase::dumpHeader |
( |
std::ostream & |
stm | ) |
const |
|
protectedinherited |
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/4]
◆ getAddress() [2/4]
Returns a pointer to the first value for the specified channel/gain.
- Parameters
-
channel | The channel number; if >= getNChans() it is reset to 0 without warning (default policy)
|
adc | The gain index; if >= getNGains() it is reset to 0 without warning (default policy) |
Definition at line 104 of file CaloCondBlobDat.h.
◆ getAddress() [3/4]
void * CaloCondBlobBase::getAddress |
( |
unsigned int |
iEle | ) |
|
|
inlineinherited |
◆ getAddress() [4/4]
const void * CaloCondBlobBase::getAddress |
( |
unsigned int |
iEle | ) |
const |
|
inlineinherited |
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 |
|
inherited |
◆ getBlobSize()
long CaloCondBlobBase::getBlobSize |
( |
| ) |
const |
|
inlineinherited |
◆ getBlobStart() [1/2]
uint32_t * CaloCondBlobBase::getBlobStart |
( |
| ) |
|
|
inlineprivateinherited |
◆ getBlobStart() [2/2]
const uint32_t * CaloCondBlobBase::getBlobStart |
( |
| ) |
const |
|
inlineprivateinherited |
◆ getCalib()
float CaloCondBlobFlt::getCalib |
( |
unsigned int |
channel, |
|
|
unsigned int |
adc, |
|
|
float |
x, |
|
|
bool |
invert = false |
|
) |
| const |
Returns the calibrated energy for a given channel/gain and input energy.
- Parameters
-
channel | The channel number |
adc | The gain index |
x | Parameter of the (calibration) function |
invert | If true, the calibration is undone |
Definition at line 53 of file CaloCondBlobFlt.cxx.
61 if(invert){
x = (
x*
x -
a*
a) / (
b*
b) ;}
62 else {
x = std::sqrt(
a*
a +
b*
b*
x );}
68 if(invert){
x = (
x -
a) / (
b) ;}
◆ getComment()
std::string CaloCondBlobBase::getComment |
( |
| ) |
const |
|
inherited |
◆ getCommentSizeChar()
uint32_t CaloCondBlobBase::getCommentSizeChar |
( |
| ) |
const |
|
inlineinherited |
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 |
|
inlineinherited |
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];
◆ getData() [1/2]
Returns a single T belonging to a channel/gain.
- Parameters
-
channel | The channel number |
Definition at line 57 of file CaloCondBlobDat.h.
◆ getData() [2/2]
Returns a single T belonging to a channel/gain.
- Parameters
-
channel | The channel number |
adc | The gain index |
idx | The index of the requested value |
Definition at line 49 of file CaloCondBlobDat.h.
◆ getDate()
std::string CaloCondBlobBase::getDate |
( |
| ) |
const |
|
inherited |
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 |
|
inherited |
◆ getHdrSize()
unsigned int CaloCondBlobBase::getHdrSize |
( |
| ) |
const |
|
inlineinherited |
Returns the size of the header in units of uint32_t.
Definition at line 85 of file CaloCondBlobBase.h.
◆ getInstance() [1/2]
◆ getInstance() [2/2]
◆ getNChans()
uint32_t CaloCondBlobBase::getNChans |
( |
| ) |
const |
|
inlineinherited |
◆ getNGains()
uint32_t CaloCondBlobBase::getNGains |
( |
| ) |
const |
|
inlineinherited |
◆ getNObjs()
uint32_t CaloCondBlobBase::getNObjs |
( |
| ) |
const |
|
inlineinherited |
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 |
|
inlineinherited |
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 |
|
inlineinherited |
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 |
|
inlineinherited |
◆ getObjVersion()
uint16_t CaloCondBlobBase::getObjVersion |
( |
| ) |
const |
|
inlineinherited |
◆ getTimeStamp()
uint64_t CaloCondBlobBase::getTimeStamp |
( |
| ) |
const |
|
inlineinherited |
Returns the unix timestamp of the comment (seconds since 1.1.1970)
Definition at line 283 of file CaloCondBlobBase.h.
◆ getType()
virtual uint16_t CaloCondBlobFlt::getType |
( |
| ) |
const |
|
inlinevirtual |
◆ init()
void CaloCondBlobDat< float >::init |
( |
const DefType & |
def, |
|
|
uint32_t |
nChans, |
|
|
uint16_t |
objVers, |
|
|
const std::string & |
author = "" , |
|
|
const std::string & |
comment = "" , |
|
|
uint64_t |
timeStamp = 0 |
|
) |
| |
|
inherited |
Initializing function.
- Parameters
-
def | A reference to a DefType object, specifying the inital layout and values |
nChans | Number of channels to create |
objType | Type of the object |
objVers | Version of the object |
author | String containing the author user id |
comment | String containing the actual comment |
timeStamp | Unix time stamp (if 0, current time is used) |
Definition at line 67 of file CaloCondBlobDat.h.
125 for(
unsigned int adc=0;
adc<nGains; ++
adc){
◆ packGainAndNchans()
uint32_t CaloCondBlobBase::packGainAndNchans |
( |
const uint32_t |
gain, |
|
|
const uint32_t |
nChans |
|
) |
| |
|
staticprivateinherited |
◆ setData() [1/2]
void CaloCondBlobDat< float >::setData |
( |
unsigned int |
channel, |
|
|
unsigned int |
adc, |
|
|
const std::vector< float > & |
data |
|
) |
| |
|
inherited |
Sets a number of Ts stored in the input vector.
- Parameters
-
channel | The channel number |
adc | The gain index |
data | A vector containing the values to be set |
Definition at line 85 of file CaloCondBlobDat.h.
161 for(
typename std::vector<T>::const_iterator
i=
data.begin();
i!=
data.end(); ++
i){
◆ setData() [2/2]
void CaloCondBlobDat< float >::setData |
( |
unsigned int |
channel, |
|
|
unsigned int |
adc, |
|
|
unsigned int |
idx, |
|
|
float |
data |
|
) |
| |
|
inherited |
Sets a single T belonging to a channel/gain.
- Parameters
-
channel | The channel number |
adc | The gain index |
idx | The index of the value to set |
data | The data value to set |
Definition at line 79 of file CaloCondBlobDat.h.
◆ unpacknChans()
uint32_t CaloCondBlobBase::unpacknChans |
( |
const uint32_t |
gainAndnChans | ) |
|
|
staticprivateinherited |
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 | ) |
|
|
staticprivateinherited |
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 |
|
privateinherited |
◆ m_blob_nc
coral::Blob* CaloCondBlobBase::m_blob_nc |
|
privateinherited |
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 |
|
privateinherited |
◆ m_nChans
unsigned CaloCondBlobBase::m_nChans |
|
privateinherited |
◆ m_nGains
unsigned CaloCondBlobBase::m_nGains |
|
privateinherited |
◆ m_pDataStart
const void* CaloCondBlobBase::m_pDataStart |
|
protectedinherited |
◆ m_sizeOfObj
unsigned CaloCondBlobBase::m_sizeOfObj |
|
privateinherited |
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.
void setData(unsigned int channel, unsigned int adc, unsigned int idx, float data)
Sets a single T belonging to a channel/gain.
CaloCondBlobFlt(const coral::Blob &blob)
Ctor.
static uint32_t packGainAndNchans(const uint32_t gain, const uint32_t nChans)
char data[hepevt_bytes_allocation_ATLAS]
uint32_t getObjSizeUint32() const
Returns the size of a data object in units of uint32_t.
float getData(const unsigned int channel, const unsigned int adc, const unsigned int idx) const
Returns a single T belonging to a channel/gain.
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 * getAddress(unsigned int iEle) const
Returns start address of iEle-th basic unit.
const float * getAddress(const unsigned int channel, const unsigned int adc) const
Returns a pointer to the first value for the specified channel/gain.
long getBlobSize() const
Returns the BLOB size.
const void * m_pDataStart
virtual uint16_t getType() const
Returns CaloCondDrawer::BASE.
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.
uint16_t getObjType() const
Returns the BLOB object type.
std::string getDate() const
Returns the date of the comment as string (derived from timestamp)
Thrown if object type in BLOB does not agree with class type.
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.
virtual uint16_t getType() const
Returns CaloCondType::FLT.
uint16_t getObjVersion() const
Returns the BLOB object version.
std::string getComment() const
Returns the actual comment.
void dumpHeader(std::ostream &stm) const
Prints the BLOB header summary information.
Thrown if object version in BLOB does not agree with class version.
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.
@ FLT
Enum for CaloCondBlobFlt class.
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)
virtual void dump() const
Prints out the content of the blob to std::out.
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)
uint32_t getNChans() const
Returns the number of channels stored in the BLOB.