|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef TILECALIBDRAWEROFC_H
6 #define TILECALIBDRAWEROFC_H
29 #include "CoralBase/Blob.h"
38 #define PHASE_PRECISION 0.1
70 ,
const std::string&
author =
""
71 ,
const std::string&
comment =
""
125 virtual void dump(std::ostream& stm)
const;
147 ,
const std::string&
author=
""
148 ,
const std::string&
comment=
""
212 return *(
static_cast<const int32_t*
>(
getAddress(1)));
220 if (std::abs(
phase) > 1e6F) {
227 const int32_t*
pos = std::lower_bound(
beg,
end, db_phase);
269 ,
float* w_a,
float* w_b,
float* w_c,
float*
g,
float*
dg)
const {
276 memcpy(w_a, startAddress, allSamplesSize);
277 startAddress += fieldSize;
278 memcpy(w_b, startAddress, allSamplesSize);
279 startAddress += fieldSize;
280 memcpy(
g, startAddress, allSamplesSize);
281 startAddress += fieldSize;
282 memcpy(w_c, startAddress, allSamplesSize);
284 startAddress += fieldSize;
285 memcpy(
dg, startAddress, allSamplesSize);
287 memset(
dg, 0, allSamplesSize);
306 if(phaseIdx >=
static_cast<unsigned int>(std::abs(
getNPhases()))){
322 unsigned int nPhases = std::abs(
getNPhases());
365 if(objVer!=1 && objVer!=2 && objVer!=3){
380 unsigned int nPhaseAbs = std::abs(
getNPhases());
383 if(nPhaseSgn < 0) {
offset += nPhaseAbs; }
390 unsigned int lPhase = nSample * nField;
391 unsigned int lAdc = lPhase * nPhaseAbs;
392 unsigned int lChan = lAdc * nGain;
float getOfc(unsigned int field, unsigned int channel, unsigned int adc, float phase, unsigned int sample) const
Returns OFC data.
Thrown if an index is out of range.
uint16_t getNGains() const
Returns the number of gains stored for each channel.
FIELD
OFC field identifier.
__attribute__((always_inline)) inline uint32_t TileCalibDrawerOfc
#define PHASE_PRECISION
Class for storing Optimal Filtering Coefficients (OFCs) in a coral::Blob.
float round(const float toRound, const unsigned int decimals)
float * getOfcStartAddress(unsigned int field, unsigned int channel, unsigned int adc, float &phase)
void setOfc(unsigned int field, unsigned int channel, unsigned int adc, float phase, unsigned int sample, float value)
Sets OFC data.
void fillOfc(unsigned int channel, unsigned int adc, float &phase, float *w_a, float *w_b, float *w_c, float *g, float *dg) const
Fill all OFC for optimazation.
int32_t getNPhases() const
Returns the number of phases (WARNING: Can be negative!)
void setPhases(unsigned int channel, unsigned int adc, const std::vector< float > &phases)
Sets a phase value.
void init(uint16_t objVersion, uint32_t nSamples, int32_t nPhases, uint16_t nChans, uint16_t nGains, const std::string &author="", const std::string &comment="", uint64_t timeStamp=0)
Function for initializing a TileCalibDrawerOfc BLOB.
unsigned int getOfcStartOffset(unsigned int field, unsigned int channel, unsigned int adc, float &phase) const
uint16_t getObjVersion() const
Returns the BLOB object version.
virtual uint16_t getType() const
Returns TileCalibType::OFC.
This class provides the core BLOB infrastructure.
virtual void dump() const
Prints out the object content to std::cout.
uint16_t getNChans() const
Returns the number of channels stored in the BLOB.
Thrown if object version in BLOB does not agree with class.
unsigned int getPhaseNumber(unsigned int channel, unsigned int adc, float &phase) const
Returns the index for a given phase.
unsigned int getPhaseStartOffset(unsigned int channel, unsigned int adc, unsigned int phaseIdx) const
@ OFC
Enum for TileCalibDrawerOfc class.
float getPhase(unsigned int channel, unsigned int adc, unsigned int phaseIdx) const
Returns the stored phase.
virtual ~TileCalibDrawerOfc()
Dtor.
static TileCalibDrawerOfc * getInstance(coral::Blob &blob, uint16_t objVersion, uint32_t nSamples, int32_t nPhases, uint16_t nChans, uint16_t nGains, const std::string &author="", const std::string &comment="", uint64_t timeStamp=0)
Returns a pointer to a non-const TileCalibDrawerOfc.
const float * getOfcStartAddress(unsigned int field, unsigned int channel, unsigned int adc, float &phase) const
Returns pointer to first data OFC for a given field, ADC & phase.
TileCalibDrawerOfc(const coral::Blob &blob)
Ctor (const).
uint32_t getNSamples() const
Returns the number of sample stored.
const int32_t * getPhaseStartAddress(unsigned int channel, unsigned int adc, unsigned int phaseIdx) const
Returns pointer to the requested phase value.
uint32_t getNFields(uint16_t objVersion=0) const
Returns the number of fields.
int32_t * getPhaseStartAddress(unsigned int channel, unsigned int adc, unsigned int phaseIdx)
static const unsigned int MAX_CHAN
Number of channels in drawer.
uint32_t getObjSizeUint32() const
Returns the size of a data object in units of uint32_t.
const void * getAddress(unsigned int iEle) const
Returns start address of iEle-th basic unit.