17 template <
class DigiClass>
19 const unsigned short*
limit,
29 digi.setReadoutIds(
eid);
30 int flavor, error_flags, capid0, channelid;
33 bool isCapRotating = !(error_flags & 0x1);
34 bool fiberErr = (error_flags & 0x2);
35 bool dataValid = !(error_flags & 0x2);
36 int fiberchan = channelid & 0x3;
37 int fiber = ((channelid >> 2) & 0x7) + 1;
47 int ncurr = 0, ntaken = 0;
48 const unsigned short* qie_work = startPoint;
52 int capidn = (isCapRotating) ? ((capid0 + ncurr) % 4) : (capid0);
53 int capidn1 = (isCapRotating) ? ((capid0 + ncurr + 1) % 4) : (capid0);
55 HcalQIESample s0((*qie_work) & 0x7F, capidn, fiber, fiberchan, dataValid, fiberErr);
56 HcalQIESample s1(((*qie_work) >> 8) & 0x7F, capidn1, fiber, fiberchan, dataValid, fiberErr);
58 if (ncurr >= startSample && ncurr <= endSample) {
59 digi.setSample(ntaken, s0);
63 if (ncurr >= startSample && ncurr <= endSample) {
64 digi.setSample(ntaken, s1);
70 }
else if (flavor == 6) {
72 if (ncurr >= startSample && ncurr <= endSample) {
74 ((*qie_work) >> 8) & 0x3,
77 ((*qie_work) >> 10) & 0
x1,
78 ((*qie_work) >> 11) & 0
x1);
79 digi.setSample(ntaken,
sample);
95 : sourceIdOffset_(sourceIdOffset), expectedOrbitMessageTime_(-1) {
101 if (
end >= 0 && end <= ZDCDataFrame::MAXSAMPLES - 1 && end >= beg) {
113 if (raw.
size() < 16) {
125 const unsigned short *daq_first, *daq_last, *tp_first, *tp_last;
126 std::map<HcalElectronicsId, DetId> myEMap;
131 eid.setHTR(18, 8, 1);
135 eid.setHTR(18, 8, 1);
139 eid.setHTR(18, 8, 1);
143 eid.setHTR(18, 8, 1);
147 eid.setHTR(18, 8, 1);
151 eid.setHTR(18, 8, 1);
155 eid.setHTR(18, 8, 1);
159 eid.setHTR(18, 8, 1);
163 eid.setHTR(18, 8, 1);
168 eid.setHTR(18, 8, 0);
172 eid.setHTR(18, 8, 0);
176 eid.setHTR(18, 8, 0);
180 eid.setHTR(18, 8, 0);
184 eid.setHTR(18, 8, 0);
188 eid.setHTR(18, 8, 0);
192 eid.setHTR(18, 8, 0);
196 eid.setHTR(18, 8, 0);
200 eid.setHTR(18, 8, 0);
210 edm::LogWarning(
"Invalid Data") <<
"Invalid HTR data (data beyond payload size) observed on spigot " << spigot
211 <<
" of DCC with source id " << dccHeader->
getSourceId();
212 report.countSpigotFormatError();
219 edm::LogWarning(
"Invalid Data") <<
"CRC Error on HTR data observed on spigot " << spigot
220 <<
" of DCC with source id " << dccHeader->
getSourceId();
221 report.countSpigotFormatError();
226 edm::LogWarning(
"Invalid Data") <<
"Invalid HTR data observed on spigot " << spigot <<
" of DCC with source id "
228 report.countSpigotFormatError();
233 edm::LogWarning(
"Invalid Data") <<
"Histogram data passed to non-histogram unpacker on spigot " << spigot
234 <<
" of DCC with source id " << dccHeader->
getSourceId();
238 if (colls.
ttp !=
nullptr) {
241 ttpUnpack.
unpack(htr, colls.
ttp->back());
243 LogDebug(
"ZdcUnpackerHcalTechTrigProcessor")
244 <<
"Skipping data on spigot " << spigot <<
" of DCC with source id " << dccHeader->
getSourceId()
245 <<
" which is from the TechTrigProcessor (use separate unpacker!)";
251 edm::LogWarning(
"ZdcUnpacker") <<
"Skipping data on spigot " << spigot <<
" of DCC with source id "
252 << dccHeader->
getSourceId() <<
" which is of unknown flavor "
260 htr.
dataPointers(&daq_first, &daq_last, &tp_first, &tp_last);
262 int htr_tb = smid & 0x1;
263 int htr_slot = (smid >> 1) & 0x1F;
264 int htr_cr = (smid >> 6) & 0x1F;
266 const unsigned short* ptr_header = daq_first;
267 const unsigned short* ptr_end = daq_last + 1;
268 int flavor, error_flags, capid0, channelid;
270 while (ptr_header != ptr_end) {
271 if (*ptr_header == 0xFFFF) {
281 int fiberchan = channelid & 0x3;
282 int fiber = ((channelid >> 2) & 0x7) + 1;
286 eid.setHTR(htr_cr, htr_slot, htr_tb);
287 auto it = myEMap.find(
eid);
289 if (it != myEMap.end()) {
296 ptr_header = ZdcUnpacker_impl::unpack_compact<ZDCDataFrame>(ptr_header,