1 #ifndef DataFormats_HcalDigi_HcalDigiSoA_h 2 #define DataFormats_HcalDigi_HcalDigiSoA_h 20 static constexpr uint8_t
adc(uint16_t
const*
const sample_start) {
return (*sample_start & 0xff); }
21 static constexpr uint8_t
tdc(uint16_t
const*
const sample_start) {
return (*sample_start >> 8) & 0x3f; }
22 static constexpr uint8_t
soibit(uint16_t
const*
const sample_start) {
return (*sample_start >> 14) & 0x1; }
31 static constexpr uint8_t
adc(uint16_t
const*
const sample_start) {
return (*sample_start & 0xff); }
32 static constexpr uint8_t
tdc(uint16_t
const*
const sample_start) {
return ((*sample_start >> 8) & 0x3); }
33 static constexpr uint8_t
soibit(uint16_t
const*
const sample_start) {
return ((*sample_start >> 14) & 0x1); }
34 static constexpr uint8_t
capid(uint16_t
const*
const sample_start) {
return ((*sample_start >> 10) & 0x3); }
43 static constexpr uint8_t
adc(uint16_t
const*
const sample_start, uint8_t
const shifter) {
44 return ((*sample_start >> shifter * 8) & 0x7f);
48 template <
typename Flavor>
50 auto const capid_first = (*dfstart >> 8) & 0x3;
51 return (capid_first +
sample) & 0x3;
59 template <
typename Flavor>
61 return Flavor::soibit(dfstart + Flavor::HEADER_WORDS +
sample * Flavor::WORDS_PER_SAMPLE);
64 template <
typename Flavor>
66 return Flavor::adc(dfstart + Flavor::HEADER_WORDS +
sample * Flavor::WORDS_PER_SAMPLE);
69 template <
typename Flavor>
71 return Flavor::tdc(dfstart + Flavor::HEADER_WORDS +
sample * Flavor::WORDS_PER_SAMPLE);
80 template <
typename Flavor>
82 return static_cast<uint32_t
>(nsamples * Flavor::WORDS_PER_SAMPLE) + Flavor::HEADER_WORDS;
85 template <
typename Flavor>
87 if constexpr (Flavor::SAMPLES_PER_WORD >= 1)
88 return (nwords - Flavor::HEADER_WORDS) * Flavor::SAMPLES_PER_WORD;
90 return (nwords - Flavor::HEADER_WORDS) / Flavor::WORDS_PER_SAMPLE;
constexpr uint32_t compute_nsamples(uint32_t const nwords)
static constexpr int HEADER_WORDS
static constexpr int WORDS_PER_SAMPLE
static constexpr int SAMPLES_PER_WORD
constexpr uint8_t tdc_for_sample(uint16_t const *const dfstart, uint32_t const sample)
constexpr uint8_t soibit_for_sample(uint16_t const *const dfstart, uint32_t const sample)
constexpr uint32_t stride
static constexpr uint8_t soibit(uint16_t const *const sample_start)
#define GENERATE_SOA_LAYOUT(CLASS,...)
#define SOA_SCALAR(TYPE, NAME)
static constexpr uint8_t adc(uint16_t const *const sample_start)
constexpr uint8_t capid_for_sample(uint16_t const *const dfstart, uint32_t const sample)
constexpr uint8_t adc_for_sample< Flavor5 >(uint16_t const *const dfstart, uint32_t const sample)
constexpr uint32_t compute_stride(uint32_t const nsamples)
static constexpr int SAMPLES_PER_WORD
static constexpr int MAXSAMPLES
static constexpr uint8_t soibit(uint16_t const *const sample_start)
static constexpr uint8_t adc(uint16_t const *const sample_start, uint8_t const shifter)
static constexpr uint8_t tdc(uint16_t const *const sample_start)
static constexpr int SAMPLES_PER_WORD
static constexpr int HEADER_WORDS
constexpr uint8_t adc_for_sample(uint16_t const *const dfstart, uint32_t const sample)
constexpr uint8_t capid_for_sample< Flavor3 >(uint16_t const *const dfstart, uint32_t const sample)
static constexpr uint8_t adc(uint16_t const *const sample_start)
char data[epos_bytes_allocation]
static constexpr float WORDS_PER_SAMPLE
static constexpr int HEADER_WORDS
#define SOA_COLUMN(TYPE, NAME)
static constexpr int WORDS_PER_SAMPLE
static constexpr uint8_t tdc(uint16_t const *const sample_start)
uint16_t *__restrict__ uint16_t const *__restrict__ adc
static constexpr uint8_t capid(uint16_t const *const sample_start)