1 #ifndef CUDADataFormats_HcalDigi_interface_DigiCollection_h 2 #define CUDADataFormats_HcalDigi_interface_DigiCollection_h 14 static constexpr uint8_t
adc(uint16_t
const*
const sample_start) {
return (*sample_start & 0xff); }
15 static constexpr uint8_t
tdc(uint16_t
const*
const sample_start) {
return (*sample_start >> 8) & 0x3f; }
16 static constexpr uint8_t
soibit(uint16_t
const*
const sample_start) {
return (*sample_start >> 14) & 0x1; }
25 static constexpr uint8_t
adc(uint16_t
const*
const sample_start) {
return (*sample_start & 0xff); }
26 static constexpr uint8_t
tdc(uint16_t
const*
const sample_start) {
return ((*sample_start >> 8) & 0x3); }
27 static constexpr uint8_t
soibit(uint16_t
const*
const sample_start) {
return ((*sample_start >> 14) & 0x1); }
28 static constexpr uint8_t
capid(uint16_t
const*
const sample_start) {
return ((*sample_start >> 10) & 0x3); }
37 static constexpr uint8_t
adc(uint16_t
const*
const sample_start, uint8_t
const shifter) {
38 return ((*sample_start >> shifter * 8) & 0x7f);
42 template <
typename Flavor>
44 auto const capid_first = (*dfstart >> 8) & 0x3;
45 return (capid_first +
sample) & 0x3;
53 template <
typename Flavor>
55 return Flavor::soibit(dfstart + Flavor::HEADER_WORDS +
sample * Flavor::WORDS_PER_SAMPLE);
58 template <
typename Flavor>
60 return Flavor::adc(dfstart + Flavor::HEADER_WORDS +
sample * Flavor::WORDS_PER_SAMPLE);
63 template <
typename Flavor>
65 return Flavor::tdc(dfstart + Flavor::HEADER_WORDS +
sample * Flavor::WORDS_PER_SAMPLE);
74 template <
typename Flavor>
76 return static_cast<uint32_t
>(nsamples * Flavor::WORDS_PER_SAMPLE) + Flavor::HEADER_WORDS;
79 template <
typename Flavor>
81 if constexpr (Flavor::SAMPLES_PER_WORD >= 1)
82 return (nwords - Flavor::HEADER_WORDS) * Flavor::SAMPLES_PER_WORD;
84 return (nwords - Flavor::HEADER_WORDS) / Flavor::WORDS_PER_SAMPLE;
88 template <
typename StoragePolicy>
97 template <
typename T =
typename StoragePolicy::TagType>
103 template <
typename T =
typename StoragePolicy::TagType>
109 template <
typename T =
typename StoragePolicy::TagType>
120 template <
typename Flavor,
typename StoragePolicy>
126 template <
typename StoragePolicy>
136 template <
typename T =
typename StoragePolicy::TagType>
139 npresamples.resize(size);
142 template <
typename T =
typename StoragePolicy::TagType>
145 npresamples.reserve(size);
148 template <
typename T =
typename StoragePolicy::TagType>
160 #endif // CUDADataFormats_HcalDigi_interface_DigiCollection_h constexpr uint32_t compute_nsamples(uint32_t const nwords)
static constexpr int HEADER_WORDS
DigiCollectionBase()=default
std::enable_if< std::is_same< T, ::calo::common::tags::Vec >::value, void >::type resize(std::size_t size)
static constexpr int WORDS_PER_SAMPLE
static constexpr int SAMPLES_PER_WORD
StoragePolicy::template StorageSelector< uint16_t >::type data
constexpr uint8_t tdc_for_sample(uint16_t const *const dfstart, uint32_t const sample)
DigiCollectionBase & operator=(DigiCollectionBase const &)=default
constexpr uint8_t soibit_for_sample(uint16_t const *const dfstart, uint32_t const sample)
static constexpr uint8_t soibit(uint16_t const *const sample_start)
static constexpr uint8_t adc(uint16_t const *const sample_start)
def template(fileName, svg, replaceme="REPLACEME")
constexpr uint8_t capid_for_sample(uint16_t const *const dfstart, uint32_t const sample)
StoragePolicy::template StorageSelector< uint32_t >::type ids
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 uint8_t soibit(uint16_t const *const sample_start)
static constexpr uint8_t adc(uint16_t const *const sample_start, uint8_t const shifter)
std::enable_if< std::is_same< T, ::calo::common::tags::Vec >::value, void >::type resize(std::size_t size)
std::enable_if< std::is_same< T, ::calo::common::tags::Vec >::value, void >::type reserve(std::size_t size)
StoragePolicy::template StorageSelector< uint8_t >::type npresamples
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)
static constexpr float WORDS_PER_SAMPLE
std::enable_if< std::is_same< T, ::calo::common::tags::Vec >::value, void >::type clear()
static constexpr int HEADER_WORDS
std::enable_if< std::is_same< T, ::calo::common::tags::Vec >::value, void >::type clear()
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
std::enable_if< std::is_same< T, ::calo::common::tags::Vec >::value, void >::type reserve(std::size_t size)
static constexpr uint8_t capid(uint16_t const *const sample_start)