|
ATLAS Offline Software
|
#include "TileCalibBlobObjs/TileCalibDrawerBase.h"
#include "TileCalibBlobObjs/TileCalibType.h"
#include "TileCalibBlobObjs/TileCalibUtils.h"
#include "CoralBase/Blob.h"
#include <stdint.h>
#include <iostream>
#include <vector>
#include <cstdlib>
#include <algorithm>
#include <cstring>
#include <cmath>
Go to the source code of this file.
◆ PHASE_PRECISION
#define PHASE_PRECISION 0.1 |
Class for storing Optimal Filtering Coefficients (OFCs) in a coral::Blob.
- Author
- Nils Gollub nils..nosp@m.goll.nosp@m.ub@ce.nosp@m.rn.c.nosp@m.h
This class extends the header defined in TileCalibDrawerBase by two additional 32 bit words:
- nSamples: The number of samples used in OFC computation
- nPhases: The number of phases stored in the BLOB.
Directly after these two extra header words a list of phases is stored. The phases are encoded as integers so that exact comparisons are possible. Since phases are only needed with a resolution of 0.1ns, a good convention is to store int(10*phase).
If the nPhases is set to a negative value in initialization with init(...), only one list of phases common for all ADCs is stored.
Definition at line 39 of file TileCalibDrawerOfc.h.
◆ __attribute__()
__attribute__ |
( |
(always_inline) |
| ) |
|
Definition at line 203 of file TileCalibDrawerOfc.h.
205 return *(
static_cast<const uint32_t*
>(getAddress(0)));
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);
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.
__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)
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!)
uint16_t getObjVersion() const
Returns the BLOB object version.
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.
float getPhase(unsigned int channel, unsigned int adc, unsigned int phaseIdx) const
Returns the stored phase.
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.
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.
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.