60 desc.add<uint32_t>(
"maxChannelsF01HE", 10000u);
61 desc.add<uint32_t>(
"maxChannelsF5HB", 10000u);
62 desc.add<uint32_t>(
"maxChannelsF3HB", 10000u);
69 qie11DigiToken_{consumes(ps.getParameter<
edm::InputTag>(
"qie11DigiLabel"))},
70 digisF01HEToken_{produces(ps.getParameter<
std::string>(
"digisLabelF01HE"))},
71 digisF5HBToken_{produces(ps.getParameter<
std::string>(
"digisLabelF5HB"))},
72 digisF3HBToken_{produces(ps.getParameter<
std::string>(
"digisLabelF3HB"))} {
73 config_.maxChannelsF01HE = ps.getParameter<uint32_t>(
"maxChannelsF01HE");
74 config_.maxChannelsF5HB = ps.getParameter<uint32_t>(
"maxChannelsF5HB");
75 config_.maxChannelsF3HB = ps.getParameter<uint32_t>(
"maxChannelsF3HB");
84 const int size = hbheDigis.size() *
stride;
94 hf5_.view().size() = hbheDigis.size();
96 for (
unsigned int i = 0;
i < hbheDigis.size(); ++
i) {
97 auto const hbhe = hbheDigis[
i];
98 auto const id =
hbhe.id().rawId();
100 uint16_t header_word = (1 << 15) | (0x5 << 12) | (0 << 10) | ((
hbhe.sample(0).capid() & 0x3) << 8);
102 auto hf5_vi = hf5_.view()[
i];
105 hf5_vi.data()[0] = header_word;
107 for (
unsigned int i = 0;
i < hf5_.view().stride() - 1;
i++) {
108 uint16_t s0 = (0 << 7) | (static_cast<uint8_t>(
hbhe.sample(2 *
i).adc()) & 0x7f);
109 uint16_t s1 = (0 << 7) | (static_cast<uint8_t>(
hbhe.sample(2 *
i + 1).adc()) & 0x7f);
110 uint16_t
sample = (s1 << 8) | s0;
115 alpaka::memcpy(
event.queue(), df5_.buffer(), hf5_.const_buffer());
118 if (qie11Digis.empty()) {
127 for (
unsigned int i = 0;
i < qie11Digis.size();
i++) {
130 if (digi.flavor() == 0
or digi.flavor() == 1) {
134 }
else if (digi.flavor() == 3) {
140 auto const nsamples = qie11Digis.
samples();
152 hf1_.
view().stride() = stride01;
153 hf3_.view().stride() = stride01;
155 unsigned int i_f1 = 0;
156 unsigned int i_f3 = 0;
158 for (
unsigned int i = 0;
i < qie11Digis.size();
i++) {
160 assert(digi.samples() == qie11Digis.samples() &&
"collection nsamples must equal per digi samples");
162 if (digi.flavor() == 0
or digi.flavor() == 1) {
165 auto hf01_vi = hf1_.view()[i_f1];
167 hf01_vi.ids() = digi.detid().rawId();
169 hf01_vi.data()[hw] = (qie11Digis[
i][hw]);
172 }
else if (digi.flavor() == 3) {
175 auto hf03_vi = hf3_.view()[i_f3];
177 hf03_vi.ids() = digi.detid().rawId();
180 hf03_vi.data()[hw] = (qie11Digis[
i][hw]);
186 hf1_.view().size() = size_f1;
187 hf3_.view().size() = size_f3;
189 alpaka::memcpy(
event.queue(), df1_.buffer(), hf1_.const_buffer());
190 alpaka::memcpy(
event.queue(), df3_.buffer(), hf3_.const_buffer());
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
T getParameter(std::string const &) const
static const int MAXSAMPLES
device::EDPutToken< DeviceCollectionPhase0 > digisF5HBToken_
PortableCollection< HcalPhase0DigiSoA > Phase0DigiDeviceCollection
void produce(device::Event &, device::EventSetup const &) override
~HcalDigisSoAProducer() override=default
static const int HEADER_WORDS
PortableHostCollection< HcalPhase0DigiSoA > Phase0DigiHostCollection
static const int WORDS_PER_SAMPLE
constexpr uint32_t stride
uint32_t maxChannelsF01HE
HcalDigisSoAProducer(edm::ParameterSet const &ps)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
PortableHostCollection< HcalPhase1DigiSoA > Phase1DigiHostCollection
hcal::Phase0DigiDeviceCollection DeviceCollectionPhase0
static void fillDescriptions(edm::ConfigurationDescriptions &)
constexpr int samples() const
total number of samples in the digi
PortableCollection< HcalPhase1DigiSoA > Phase1DigiDeviceCollection
#define DEFINE_FWK_ALPAKA_MODULE(name)
device::EDPutToken< DeviceCollectionPhase1 > digisF3HBToken_
edm::EDGetTokenT< QIE11DigiCollection > qie11DigiToken_
device::EDPutToken< DeviceCollectionPhase1 > digisF01HEToken_
edm::EDGetTokenT< HBHEDigiCollection > hbheDigiToken_
hcal::Phase1DigiDeviceCollection DeviceCollectionPhase1