ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | List of all members
TileCalibDrawerBch Class Reference

Class for storing a 32 bit status word for each ADC. More...

#include <TileCalibDrawerBch.h>

Inheritance diagram for TileCalibDrawerBch:
Collaboration diagram for TileCalibDrawerBch:

Public Types

typedef std::vector< std::vector< uint32_t > > DefType
 Object to hold default data used for initialization. More...
 

Public Member Functions

virtual ~TileCalibDrawerBch ()
 Dtor. More...
 
virtual uint16_t getType () const
 Returns TileCalibType::BCH. More...
 
TileBchDecoder::BitPatVer getBitPatternVersion () const
 Returns the bit pattern version. More...
 
void getStatusWords (unsigned int channel, unsigned int adc, uint32_t &adcStatus, uint32_t &chnStatus) const
 Extracts the adc and channel status words. More...
 
uint32_t getData (unsigned int channel, unsigned int adc, unsigned int idx) const
 Returns a single T belonging to a channel/ADC. More...
 
void init (const DefType &def, uint16_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, uint32_t data)
 Sets a single T belonging to a channel/ADC. More...
 
void setData (unsigned int channel, unsigned int adc, const std::vector< uint32_t > &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)
 
virtual void clone (const TileCalibDrawerBase &other)
 Initialzes Blob with content of other Blob. More...
 
long getBlobSize () const
 Returns the BLOB size in units of bytes. More...
 
long getBlobSize32 () const
 Returns the BLOB size in units of uint32_t. 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...
 
uint16_t getNChans () const
 Returns the number of channels stored in the BLOB. More...
 
uint16_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...
 
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...
 

Static Public Member Functions

static const TileCalibDrawerBchgetInstance (const coral::Blob &blob)
 Returns a pointer to a const TileCalibDrawerBch. More...
 
static TileCalibDrawerBchgetInstance (coral::Blob &blob, const DefType &def, uint16_t nChans, TileBchDecoder::BitPatVer bitPatVer, const std::string &author="", const std::string &comment="", uint64_t timeStamp=0)
 Returns a pointer to a non-const TileCalibDrawerBch. More...
 

Static Public Attributes

static const unsigned int m_hdrSize32 = 5
 The header size in units of uint32_t. More...
 

Protected Member Functions

 TileCalibDrawerBch (const coral::Blob &blob)
 Ctor (const). More...
 
 TileCalibDrawerBch (coral::Blob &blob)
 Ctor (non-const). More...
 
const uint32_t * getAddress (unsigned int channel, unsigned int adc) const
 Returns a pointer to the first value for the specified channel & ADC. More...
 
uint32_t * getAddress (unsigned int channel, unsigned int adc)
 
uint32_t createBlob (uint16_t objType, uint16_t objVersion, uint32_t objSizeUint32, uint32_t nObjs, uint16_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...
 

Private Attributes

coral::Blob * m_blob_nc
 Non-const reference to the BLOB. More...
 
const coral::Blob * m_blob
 Const reference to the BLOB (always there) More...
 
const uint32_t * m_blobStart32
 Cache blob starting address as uint_32t*. More...
 
const uint16_t * m_blobStart16
 Cache blob starting address as uint_16t*. More...
 
uint64_t m_blobSize32
 Cache blob size in units of uint32_t. More...
 
bool m_isBlobOwner
 Is this TileCalibDrawer owner of the BLOB. More...
 

Detailed Description

Class for storing a 32 bit status word for each ADC.

Author
Nils Gollub nils..nosp@m.goll.nosp@m.ub@ce.nosp@m.rn.c.nosp@m.h

This class stores a 32 bit (uint32_t) status word for each ADC. A "0" here means that the ADC is in good condition, non-zero values indicate problems.

The blobObjVersion variable contains the bitPatternVersion. See the TileBchDecoder class for more details and the interpretation of bits.

Definition at line 28 of file TileCalibDrawerBch.h.

Member Typedef Documentation

◆ DefType

typedef std::vector<std::vector<uint32_t > > TileCalibDrawerDat< uint32_t >::DefType
inherited

Object to hold default data used for initialization.

The length of the first and second 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 TileCalibDrawerDat.h.

Constructor & Destructor Documentation

◆ ~TileCalibDrawerBch()

virtual TileCalibDrawerBch::~TileCalibDrawerBch ( )
inlinevirtual

Dtor.

Definition at line 33 of file TileCalibDrawerBch.h.

33 {}

◆ TileCalibDrawerBch() [1/2]

TileCalibDrawerBch::TileCalibDrawerBch ( const coral::Blob &  blob)
protected

Ctor (const).

Definition at line 39 of file TileCalibDrawerBch.cxx.

41 {
42  //=== check for correct blob type
43  if(getBlobSize()){
45  throw TileCalib::TypeConflict("TileCalibDrawerBch::Ctor",getObjType(),TileCalibDrawerBch::getType());
46  }
47  }
48 }

◆ TileCalibDrawerBch() [2/2]

TileCalibDrawerBch::TileCalibDrawerBch ( coral::Blob &  blob)
protected

Ctor (non-const).

Definition at line 52 of file TileCalibDrawerBch.cxx.

54 {
55  //=== check for correct blob type
56  if(getBlobSize()){
58  throw TileCalib::TypeConflict("TileCalibDrawerBch::Ctor",getObjType(),TileCalibDrawerBch::getType());
59  }
60  }
61 }

Member Function Documentation

◆ clone()

void TileCalibDrawerBase::clone ( const TileCalibDrawerBase other)
virtualinherited

Initialzes Blob with content of other Blob.

Parameters
otherTileCalibDrawer used for initialization

Definition at line 74 of file TileCalibDrawerBase.cxx.

75 {
76  //=== copy content of other blob
77  *m_blob_nc = *other.m_blob;
78  //=== and reset cached attributes
79  m_blobStart32 = static_cast<const uint32_t*>(m_blob->startingAddress());
80  m_blobStart16 = static_cast<const uint16_t*>(m_blob->startingAddress());
81  m_blobSize32 = m_blob->size()/sizeof(uint32_t);
82 }

◆ createBlob()

uint32_t TileCalibDrawerBase::createBlob ( uint16_t  objType,
uint16_t  objVersion,
uint32_t  objSizeUint32,
uint32_t  nObjs,
uint16_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
objTypeObject type
objVersionObject version
objSizeUint32Size of a data object (in uint32_t)
nObjsTotal number of data objects
nChansnumber of stored channels
nGainsnumber of stored gains
authorcomment author
commentactual comment
timeStampunix time stamp (if 0, current time is used)

Definition at line 87 of file TileCalibDrawerBase.cxx.

96 {
97  //=== blob data length including header in bytes
98  uint32_t dataSizeByte = (m_hdrSize32+objSizeUint32*nObjs) * sizeof(uint32_t);
99 
100  //=== calculate comment length, including two ASCII NULLs to end text fields
101  uint32_t commentSizeChar(0);
102  if(author.size() || comment.size() || timeStamp){
103  commentSizeChar += author.size()+comment.size()+sizeof(uint64_t) + 2;
104  //=== force comment length to end on 4 byte boundary
105  commentSizeChar += (commentSizeChar % sizeof(uint32_t)) ?
106  (sizeof(uint32_t)-(commentSizeChar % sizeof(uint32_t))) : 0;
107  }
108 
109  //=== create blob
110  uint32_t blobSizeInBytes = dataSizeByte+commentSizeChar;
111  m_blob_nc->resize(blobSizeInBytes);
112  uint32_t* blobStart32 = static_cast<uint32_t*>(m_blob_nc->startingAddress());
113  uint16_t* blobStart16 = static_cast<uint16_t*>(m_blob_nc->startingAddress());
114  m_blobSize32 = m_blob_nc->size()/sizeof(uint32_t);
115 
116  m_blobStart32 = blobStart32;
117  m_blobStart16 = blobStart16;
118 
119  //=== fill header
120  blobStart16[0] = objType;
121  blobStart16[1] = objVersion;
122  blobStart32[1] = objSizeUint32;
123  blobStart32[2] = nObjs;
124  blobStart16[6] = nChans;
125  blobStart16[7] = nGains;
126  blobStart32[4] = commentSizeChar/sizeof(uint32_t);
127 
128  //==== fill comment fields
129  if(commentSizeChar){
130  if(!timeStamp) timeStamp = ::time(0);
131  uint64_t* pTimeStamp = reinterpret_cast<uint64_t*>(blobStart32+dataSizeByte/sizeof(uint32_t));
132  pTimeStamp[0] = timeStamp;
133  char* pChar = reinterpret_cast<char*>(++pTimeStamp);
134  std::string::const_iterator iStr = author.begin();
135  for(; iStr!=author.end(); ++iStr){ *pChar = *iStr; ++pChar; }
136  *pChar = 0;
137  for(iStr=comment.begin(); iStr!=comment.end(); ++iStr){ *(++pChar) = *iStr; }
138  *(++pChar) = 0;
139  }
140 
141  return (blobSizeInBytes/sizeof(uint32_t));
142 }

◆ dump() [1/3]

virtual void TileCalibDrawerDat< uint32_t >::dump
inlinevirtualinherited

Prints out the content of the blob to std::out.

Definition at line 81 of file TileCalibDrawerDat.h.

81 { dump(std::cout); }

◆ dump() [2/3]

virtual void TileCalibDrawerBase::dump ( ) const
inlinevirtualinherited

Prints the BLOB header summary information to std::cout.

Reimplemented in TileCalibDrawerOfc, TileCalibDrawerDat< T >, and TileCalibDrawerCmt.

Definition at line 83 of file TileCalibDrawerBase.h.

83 { dumpHeader(std::cout); }

◆ dump() [3/3]

void TileCalibDrawerDat< uint32_t >::dump ( std::ostream &  stm) const
virtualinherited

Prints out the content of the blob.

Parameters
stmThe stream to print to

Reimplemented from TileCalibDrawerBase.

Definition at line 84 of file TileCalibDrawerDat.h.

213 {
215  for(unsigned int channel=0; channel<getNChans(); ++channel){
216  for(unsigned int adc=0; adc<getNGains(); ++adc){
217  stm << channel<<"/"<<adc<<":\t";
218  for(unsigned int idx=0; idx<getObjSizeUint32(); ++idx){
219  stm << getData(channel,adc,idx) << "\t";
220  }
221  stm << std::endl;
222  }
223  }
224 }

◆ dumpHeader()

void TileCalibDrawerBase::dumpHeader ( std::ostream &  stm) const
protectedinherited

Prints the BLOB header summary information.

Parameters
stmoutput stream to use

Definition at line 200 of file TileCalibDrawerBase.cxx.

201 {
202  stm << "This is a " << TileCalibType::getClassName(getObjType()) << std::endl;
203  stm << "ObjType : " << getObjType() << std::endl;
204  stm << "ObjVersion : " << getObjVersion() << std::endl;
205  stm << "ObjSize [bytes]: " << getObjSizeByte() << std::endl;
206  stm << "NObjs : " << getNObjs() << std::endl;
207  stm << "NChannels : " << getNChans() << std::endl;
208  stm << "NGains : " << getNGains() << std::endl;
209  if(!getCommentSizeUint32()){
210  stm << "=== No comment available ===" << std::endl;
211  }
212  else{
213  stm << "Author : " << getAuthor() << std::endl;
214  stm << "Date : " << getDate() << " ("<< getTimeStamp() << ")" << std::endl;
215  stm << "Comment: : " << getComment() << std::endl;
216  }
217 }

◆ getAddress() [1/4]

uint32_t * TileCalibDrawerDat< uint32_t >::getAddress ( unsigned int  channel,
unsigned int  adc 
)
protectedinherited

Definition at line 101 of file TileCalibDrawerDat.h.

204 {
205  unsigned int idx = channel*getNGains() + adc;
206  return static_cast<T*>(TileCalibDrawerBase::getAddress(idx));
207 }

◆ getAddress() [2/4]

const uint32_t * TileCalibDrawerDat< uint32_t >::getAddress ( unsigned int  channel,
unsigned int  adc 
) const
protectedinherited

Returns a pointer to the first value for the specified channel & ADC.

Parameters
channelThe channel number; If channel number >= getNChans() it is reset to channel % (maximum number of channels in drawer) if channel number > (maximum number of channels in drawer) otherwise it is reset to 0 without warning (default policy)
adcThe gain index; if >= getNGains() it is reset to 0 without warning (default policy)

Definition at line 100 of file TileCalibDrawerDat.h.

195 {
196  unsigned int idx = channel*getNGains() + adc;
197  return static_cast<const T*>(TileCalibDrawerBase::getAddress(idx));
198 }

◆ getAddress() [3/4]

void* TileCalibDrawerBase::getAddress ( unsigned int  iEle)
inherited

◆ getAddress() [4/4]

const void* TileCalibDrawerBase::getAddress ( unsigned int  iEle) const
inherited

Returns start address of iEle-th basic unit.

Parameters
iElesequential basic unit number

◆ getAuthor()

std::string TileCalibDrawerBase::getAuthor ( ) const
inherited

Returns the comment author.

Definition at line 147 of file TileCalibDrawerBase.cxx.

148 {
149  if(!getCommentSizeUint32()) return std::string("");
150  const char* iBeg =
151  reinterpret_cast<const char*>(m_blobStart32 + m_hdrSize32 +
153  sizeof(uint64_t)/sizeof(uint32_t));
154  return std::string(iBeg);
155 }

◆ getBitPatternVersion()

TileBchDecoder::BitPatVer TileCalibDrawerBch::getBitPatternVersion ( ) const
inline

Returns the bit pattern version.

Definition at line 78 of file TileCalibDrawerBch.h.

79 {
80  return static_cast<TileBchDecoder::BitPatVer>(getObjVersion());
81 }

◆ getBlobSize()

long TileCalibDrawerBase::getBlobSize ( ) const
inlineinherited

Returns the BLOB size in units of bytes.

Definition at line 92 of file TileCalibDrawerBase.h.

92 { return m_blobSize32 * sizeof(uint32_t); }

◆ getBlobSize32()

long TileCalibDrawerBase::getBlobSize32 ( ) const
inlineinherited

Returns the BLOB size in units of uint32_t.

Definition at line 94 of file TileCalibDrawerBase.h.

94 { return m_blobSize32; }

◆ getComment()

std::string TileCalibDrawerBase::getComment ( ) const
inherited

Returns the actual comment.

Definition at line 161 of file TileCalibDrawerBase.cxx.

162 {
163  if(!getCommentSizeUint32()) return std::string("");
164  const char* iBeg =
165  reinterpret_cast<const char*>(m_blobStart32 + m_hdrSize32 +
167  sizeof(uint64_t)/sizeof(uint32_t));
168  const char* iEnd = iBeg + getCommentSizeChar();
169  iBeg = std::find(iBeg,iEnd,0);
170  return std::string(++iBeg);
171 }

◆ getCommentSizeChar()

uint32_t TileCalibDrawerBase::getCommentSizeChar ( ) const
inlineinherited

Returns the space occupied by the comment fields in units of chars.

Definition at line 112 of file TileCalibDrawerBase.h.

112 {return getCommentSizeUint32()*sizeof(uint32_t);}

◆ getCommentSizeUint32()

uint32_t TileCalibDrawerBase::getCommentSizeUint32 ( ) const
inherited

Returns the space occupied by the comment fields in units of uint32_t.

◆ getData()

uint32_t TileCalibDrawerDat< uint32_t >::getData ( unsigned int  channel,
unsigned int  adc,
unsigned int  idx 
) const
inherited

Returns a single T belonging to a channel/ADC.

Parameters
adcThe gain index; if >= getNGains() it is reset to 0 without warning (default policy)
idxThe index of the requested value

Definition at line 49 of file TileCalibDrawerDat.h.

141 {
142  if(idx>=getObjSizeUint32()){
143  throw TileCalib::IndexOutOfRange("TileCalibDrawerDat::getData",idx,getObjVersion());
144  }
145 
146  //=== Tile Default Policy
147 
148  if(channel >= getNChans()) {
150  channel = 0;
151  } else {
153  if (channel >= getNChans()) channel = 0;
154  }
155  }
156 
157  if(adc >= getNGains()) {adc = 0;}
158 
159  return getAddress(channel,adc)[idx];
160 }

◆ getDate()

std::string TileCalibDrawerBase::getDate ( ) const
inherited

Returns the date of the comment as string (derived from timestamp)

Definition at line 176 of file TileCalibDrawerBase.cxx.

177 {
178  if(!getCommentSizeUint32()) return std::string("");
179  ::time_t timeStamp = getTimeStamp();
180  char buf[32];
181  char* iBeg = ::ctime_r(&timeStamp, buf);
182  char* iEnd = iBeg;
183  while(*iEnd!='\n'){++iEnd;}
184  return std::string(iBeg,iEnd-iBeg);
185 }

◆ getFullComment()

std::string TileCalibDrawerBase::getFullComment ( ) const
inherited

Returns a formated string build from all comment fields.

Definition at line 190 of file TileCalibDrawerBase.cxx.

191 {
192  if(!getCommentSizeUint32()) return std::string("");
193  return getAuthor()+" ("+getDate()+"): "+getComment();
194 }

◆ getInstance() [1/2]

const TileCalibDrawerBch * TileCalibDrawerBch::getInstance ( const coral::Blob &  blob)
static

Returns a pointer to a const TileCalibDrawerBch.

Definition at line 28 of file TileCalibDrawerBch.cxx.

29 {
30  //=== const Blob needs to be correctly formated
31  if(blob.size()<static_cast<long>(m_hdrSize32)){
32  throw TileCalib::InvalidBlob("TileCalibDrawerBch::getInstance");
33  }
34  return (new TileCalibDrawerBch(blob));
35 }

◆ getInstance() [2/2]

TileCalibDrawerBch * TileCalibDrawerBch::getInstance ( coral::Blob &  blob,
const DefType def,
uint16_t  nChans,
TileBchDecoder::BitPatVer  bitPatVer,
const std::string &  author = "",
const std::string &  comment = "",
uint64_t  timeStamp = 0 
)
static

Returns a pointer to a non-const TileCalibDrawerBch.

Parameters
blobReference to a coral::Blob
defA reference to a DefType object, specifying the inital layout and values
nChansNumber of channels to create
bitPatVerBit pattern version used for problem encoding
authorString containing the author user id
commentString containing the actual comment
timeStampUnix time stamp (if 0, current time is used)

Definition at line 11 of file TileCalibDrawerBch.cxx.

18 {
20  uint16_t objVers = static_cast<uint16_t>(bitPatVer);
21  calibDrawer->init(def,nChans,objVers,author,comment,timeStamp);
22  return calibDrawer;
23 }

◆ getNChans()

uint16_t TileCalibDrawerBase::getNChans ( ) const
inherited

Returns the number of channels stored in the BLOB.

◆ getNGains()

uint16_t TileCalibDrawerBase::getNGains ( ) const
inherited

Returns the number of gains stored for each channel.

◆ getNObjs()

uint32_t TileCalibDrawerBase::getNObjs ( ) const
inherited

Returns the number of data objects stored int the BLOB.

◆ getObjSizeByte()

uint32_t TileCalibDrawerBase::getObjSizeByte ( ) const
inlineinherited

Returns the size of a data object in units of bytes.

Definition at line 102 of file TileCalibDrawerBase.h.

102 {return getObjSizeUint32()*sizeof(uint32_t);}

◆ getObjSizeUint32()

uint32_t TileCalibDrawerBase::getObjSizeUint32 ( ) const
inherited

Returns the size of a data object in units of uint32_t.

◆ getObjType()

uint16_t TileCalibDrawerBase::getObjType ( ) const
inherited

Returns the BLOB object type.

◆ getObjVersion()

uint16_t TileCalibDrawerBase::getObjVersion ( ) const
inherited

Returns the BLOB object version.

◆ getStatusWords()

void TileCalibDrawerBch::getStatusWords ( unsigned int  channel,
unsigned int  adc,
uint32_t &  adcStatus,
uint32_t &  chnStatus 
) const
inline

Extracts the adc and channel status words.

Parameters
channelThe channel index
adcThe gain index
adcStatusFilled with adc status word
chnStatusFilled with channel status word

Definition at line 86 of file TileCalibDrawerBch.h.

88 {
89  adcStatus = getData(channel,adc,0);
90  chnStatus = getData(channel, 2,0);
91 }

◆ getTimeStamp()

uint64_t TileCalibDrawerBase::getTimeStamp ( ) const
inherited

Returns the unix timestamp of the comment (seconds since 1.1.1970)

◆ getType()

virtual uint16_t TileCalibDrawerBch::getType ( ) const
inlinevirtual

Returns TileCalibType::BCH.

Reimplemented from TileCalibDrawerBase.

Definition at line 36 of file TileCalibDrawerBch.h.

36 {return TileCalibType::BCH;}

◆ init()

void TileCalibDrawerDat< uint32_t >::init ( const DefType def,
uint16_t  nChans,
uint16_t  objVers,
const std::string &  author = "",
const std::string &  comment = "",
uint64_t  timeStamp = 0 
)
inherited

Initializing function.

Parameters
defA reference to a DefType object, specifying the inital layout and values
nChansNumber of channels to create
objTypeType of the (derived class) object
objVersVersion of the (derived class) object
authorString containing the author user id
commentString containing the actual comment
timeStampUnix time stamp (if 0, current time is used)

Definition at line 59 of file TileCalibDrawerDat.h.

113 {
114  uint16_t nGains = def.size();
115  uint32_t objSize = nGains>0 ? def.begin()->size() * sizeof(T)/sizeof(uint32_t) : 0;
116  uint32_t nObjs = nChans*nGains;
117 
118  //=== ensure all gains have the same object size
119  for(unsigned int iGain=0; iGain<nGains; ++iGain){
120  unsigned int thisSize = def[iGain].size()*sizeof(T)/sizeof(uint32_t);
121  if( thisSize != objSize ){
122  throw TileCalib::SizeConflict("TileCalibDrawerDat<T>::init",thisSize,objSize);
123  }
124  }
125 
126  //=== create blob
127  createBlob(getType(), objVers, objSize, nObjs, nChans, nGains, author, comment, timeStamp);
128 
129  //=== fill the blob with default
130  for(unsigned int channel=0; channel<nChans; ++channel){
131  for(unsigned int adc=0; adc<nGains; ++adc){
132  setData(channel, adc, def[adc]);
133  }
134  }
135 }

◆ setData() [1/2]

void TileCalibDrawerDat< uint32_t >::setData ( unsigned int  channel,
unsigned int  adc,
const std::vector< uint32_t > &  data 
)
inherited

Sets a number of Ts stored in the input vector.

Parameters
channelThe channel number
adcThe gain index
dataA vector containing the values to be set

Definition at line 77 of file TileCalibDrawerDat.h.

185 {
186  for(typename std::vector<T>::const_iterator i=data.begin(); i!=data.end(); ++i){
187  setData(channel,adc,i-data.begin(),*i);
188  }
189 }

◆ setData() [2/2]

void TileCalibDrawerDat< uint32_t >::setData ( unsigned int  channel,
unsigned int  adc,
unsigned int  idx,
uint32_t  data 
)
inherited

Sets a single T belonging to a channel/ADC.

Parameters
channelThe channel number
adcThe gain index
idxThe index of the value to set
dataThe data value to set

Definition at line 71 of file TileCalibDrawerDat.h.

166 {
167  //=== check for out of bounds
168  if(channel >= getNChans()){
169  throw TileCalib::IndexOutOfRange("TileCalibDrawerDat::getAddress(channel)",channel,getNChans());
170  }
171  if(adc>=getNGains()){
172  throw TileCalib::IndexOutOfRange("CaloCalibDrawerDat::getAddress(gain)",adc,getNGains());
173  }
174  if(idx>=getObjSizeUint32()){
175  throw TileCalib::IndexOutOfRange("TileCalibDrawerDat::getData",idx,getObjVersion());
176  }
177 
179 }

Member Data Documentation

◆ m_blob

const coral::Blob* TileCalibDrawerBase::m_blob
privateinherited

Const reference to the BLOB (always there)

Definition at line 176 of file TileCalibDrawerBase.h.

◆ m_blob_nc

coral::Blob* TileCalibDrawerBase::m_blob_nc
privateinherited

Non-const reference to the BLOB.

(Only present if we were created with a non-const blob.)

Definition at line 174 of file TileCalibDrawerBase.h.

◆ m_blobSize32

uint64_t TileCalibDrawerBase::m_blobSize32
privateinherited

Cache blob size in units of uint32_t.

Definition at line 182 of file TileCalibDrawerBase.h.

◆ m_blobStart16

const uint16_t* TileCalibDrawerBase::m_blobStart16
privateinherited

Cache blob starting address as uint_16t*.

Definition at line 180 of file TileCalibDrawerBase.h.

◆ m_blobStart32

const uint32_t* TileCalibDrawerBase::m_blobStart32
privateinherited

Cache blob starting address as uint_32t*.

Definition at line 178 of file TileCalibDrawerBase.h.

◆ m_hdrSize32

const unsigned int TileCalibDrawerBase::m_hdrSize32 = 5
staticinherited

The header size in units of uint32_t.

Definition at line 138 of file TileCalibDrawerBase.h.

◆ m_isBlobOwner

bool TileCalibDrawerBase::m_isBlobOwner
privateinherited

Is this TileCalibDrawer owner of the BLOB.

Definition at line 184 of file TileCalibDrawerBase.h.


The documentation for this class was generated from the following files:
TileCalibDrawerBase::getAuthor
std::string getAuthor() const
Returns the comment author.
Definition: TileCalibDrawerBase.cxx:147
checkFileSG.nObjs
nObjs
Definition: checkFileSG.py:90
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
TileCalibDrawerBase::getBlobSize
long getBlobSize() const
Returns the BLOB size in units of bytes.
Definition: TileCalibDrawerBase.h:92
TileCalibDrawerBase::getType
virtual uint16_t getType() const
Returns TileCalibDrawer::BASE.
Definition: TileCalibDrawerBase.h:80
TileCalib::IndexOutOfRange
Thrown if an index is out of range.
Definition: TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/Exception.h:141
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
TileCalibDrawerBase::getNGains
uint16_t getNGains() const
Returns the number of gains stored for each channel.
TileCalibDrawerBase::m_blobStart32
const uint32_t * m_blobStart32
Cache blob starting address as uint_32t*.
Definition: TileCalibDrawerBase.h:178
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
TileCalibDrawerBase::m_blob_nc
coral::Blob * m_blob_nc
Non-const reference to the BLOB.
Definition: TileCalibDrawerBase.h:174
TileCalibDrawerBase::m_hdrSize32
static const unsigned int m_hdrSize32
The header size in units of uint32_t.
Definition: TileCalibDrawerBase.h:138
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
TileCalib::InvalidBlob
Thrown if coral::Blob does not conform with expected structure.
Definition: TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/Exception.h:63
TileCalibDrawerBase::getCommentSizeUint32
uint32_t getCommentSizeUint32() const
Returns the space occupied by the comment fields in units of uint32_t.
TileCalibType::getClassName
static std::string getClassName(TileCalibType::TYPE type)
Returns the class name.
Definition: TileCalibType.cxx:10
TileCalibDrawerBase::getCommentSizeChar
uint32_t getCommentSizeChar() const
Returns the space occupied by the comment fields in units of chars.
Definition: TileCalibDrawerBase.h:112
TileCalibDrawerBase::dumpHeader
void dumpHeader(std::ostream &stm) const
Prints the BLOB header summary information.
Definition: TileCalibDrawerBase.cxx:200
TileCalibDrawerDat< uint32_t >
TileCalib::SizeConflict
Thrown if BLOB size is not correct.
Definition: TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/Exception.h:120
TileCalibDrawerDat< uint32_t >::setData
void setData(unsigned int channel, unsigned int adc, unsigned int idx, uint32_t data)
Sets a single T belonging to a channel/ADC.
Definition: TileCalibDrawerDat.h:165
TileCalibBlobPython_writeOfc.objVersion
objVersion
Definition: TileCalibBlobPython_writeOfc.py:71
TileCalibDrawerBase::getObjVersion
uint16_t getObjVersion() const
Returns the BLOB object version.
TileCalibDrawerBase::getTimeStamp
uint64_t getTimeStamp() const
Returns the unix timestamp of the comment (seconds since 1.1.1970)
TileCalibDrawerBase::getObjSizeByte
uint32_t getObjSizeByte() const
Returns the size of a data object in units of bytes.
Definition: TileCalibDrawerBase.h:102
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
lumiFormat.i
int i
Definition: lumiFormat.py:92
python.DecayParser.buf
buf
print ("=> [%s]"cmd)
Definition: DecayParser.py:27
TileCalibDrawerBch::TileCalibDrawerBch
TileCalibDrawerBch(const coral::Blob &blob)
Ctor (const).
Definition: TileCalibDrawerBch.cxx:39
TileCalibDrawerBase::getNChans
uint16_t getNChans() const
Returns the number of channels stored in the BLOB.
TileCalibDrawerBase::getDate
std::string getDate() const
Returns the date of the comment as string (derived from timestamp)
Definition: TileCalibDrawerBase.cxx:176
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
CaloCondBlobAlgs_fillNoiseFromASCII.comment
string comment
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:27
TileCalibDrawerBase::createBlob
uint32_t createBlob(uint16_t objType, uint16_t objVersion, uint32_t objSizeUint32, uint32_t nObjs, uint16_t nChans, uint16_t nGains, const std::string &author="", const std::string &comment="", uint64_t timeStamp=0)
(re-)creation of the referenced BLOB object.
Definition: TileCalibDrawerBase.cxx:87
TileCalibDrawerBase::getComment
std::string getComment() const
Returns the actual comment.
Definition: TileCalibDrawerBase.cxx:161
TileBchDecoder::BitPatVer
BitPatVer
Definition: TileBchDecoder.h:40
BchCleanup.calibDrawer
calibDrawer
Definition: BchCleanup.py:217
TileCalibDrawerDat< uint32_t >::dump
virtual void dump() const
Prints out the content of the blob to std::out.
Definition: TileCalibDrawerDat.h:81
xAOD::timeStamp
setEventNumber timeStamp
Definition: EventInfo_v1.cxx:128
TileCalibDrawerBase::m_blobSize32
uint64_t m_blobSize32
Cache blob size in units of uint32_t.
Definition: TileCalibDrawerBase.h:182
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
TileCalibDrawerBase::getObjType
uint16_t getObjType() const
Returns the BLOB object type.
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
ReadFloatFromCool.adc
adc
Definition: ReadFloatFromCool.py:48
CaloCondBlobAlgs_fillNoiseFromASCII.author
string author
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:26
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
TileCalibDrawerDat< uint32_t >::getAddress
const uint32_t * getAddress(unsigned int channel, unsigned int adc) const
Returns a pointer to the first value for the specified channel & ADC.
Definition: TileCalibDrawerDat.h:194
TileCalib::TypeConflict
Thrown if object type in BLOB does not agree with class type.
Definition: TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/Exception.h:99
TileCalibDrawerBch
Class for storing a 32 bit status word for each ADC.
Definition: TileCalibDrawerBch.h:29
TileCalibDrawerBase::m_blob
const coral::Blob * m_blob
Const reference to the BLOB (always there)
Definition: TileCalibDrawerBase.h:176
TileCalibDrawerDat< uint32_t >::getData
uint32_t getData(unsigned int channel, unsigned int adc, unsigned int idx) const
Returns a single T belonging to a channel/ADC.
Definition: TileCalibDrawerDat.h:140
TileCalibUtils::MAX_CHAN
static const unsigned int MAX_CHAN
Number of channels in drawer.
Definition: TileCalibUtils.h:141
TileCalibType::BCH
@ BCH
Enum for TileCalibDrawerBch class.
Definition: TileCalibType.h:31
TileCalibDrawerBase::getObjSizeUint32
uint32_t getObjSizeUint32() const
Returns the size of a data object in units of uint32_t.
TileCalibDrawerBch::getType
virtual uint16_t getType() const
Returns TileCalibType::BCH.
Definition: TileCalibDrawerBch.h:36
TileCalibDrawerBase::getAddress
const void * getAddress(unsigned int iEle) const
Returns start address of iEle-th basic unit.
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
CaloCondBlobAlgs_fillNoiseFromASCII.blob
blob
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:96
TileCalibDrawerBase::m_blobStart16
const uint16_t * m_blobStart16
Cache blob starting address as uint_16t*.
Definition: TileCalibDrawerBase.h:180
TileCalibDrawerBase::getNObjs
uint32_t getNObjs() const
Returns the number of data objects stored int the BLOB.