18 if (end >= 0 && end <= CastorDataFrame::MAXSAMPLES - 1 && end >= beg) {
29 if (raw.
size() < 16) {
53 edm::LogWarning(
"Invalid Data") <<
"Invalid COR data (data beyond payload size) observed on spigot " << spigot
54 <<
" of CTDC with source id " << ctdcHeader->
getSourceId();
61 edm::LogWarning(
"Invalid Data") <<
"Invalid COR data observed on spigot " << spigot <<
" of CTDC with source id "
67 edm::LogWarning(
"Invalid Data") <<
"Histogram data passed to non-histogram unpacker on spigot " << spigot
68 <<
" of CTDC with source id " << ctdcHeader->
getSourceId();
76 cor.
unpack(&(preclen[0]), &(precdata[0]), &(triglen[0]), &(trigdata[0]));
81 if (preclen[ichan] == 0 || preclen[ichan] & 0xc0)
83 int fiber = ichan / 3;
84 int fiberchan = ichan % 3;
91 found = emap.
lookup(partialEid, eid, did);
100 digi.
setSample(ntaken, precdata[ichan * CastorCORData::MAXIMUM_SAMPLES_PER_CHANNEL +
sample]);
108 edm::LogWarning(
"CASTOR") <<
"CastorCtdcUnpacker: No match found for electronics partialEid :" << partialEid;
int getNPS() const
Get the number of presamples in daq data.
static const int CHANNELS_PER_SPIGOT
void setSample(int i, const HcalQIESample &sam)
std::set< CastorElectronicsId > unknownIds_
void unpack(unsigned char *daq_lengths, unsigned short *daq_samples, unsigned char *tp_lengths, unsigned short *tp_samples) const
Obtain the starting and ending pointers for external unpacking of the data.
size_t size() const
Lenght of the data buffer in bytes.
void countSpigotFormatError()
const DetId lookup(CastorElectronicsId fId) const
lookup the logical detid associated with the given electronics id
void unpack(const FEDRawData &raw, const CastorElectronicsMap &emap, CastorRawCollections &conts, HcalUnpackerReport &report)
int endSample_
last sample from fed raw data to copy (if present)
static const int MAXIMUM_SAMPLES_PER_CHANNEL
int sourceIdOffset_
number to subtract from the source id to get the dcc id
bool check() const
Check for a good event Requires a minimum length, matching wordcount and length, not an empty event...
int startSample_
first sample from fed raw data to copy
std::vector< CastorDataFrame > * castorCont
bool isHistogramEvent() const
Is this event a histogram event? (do not call standard unpack in this case!!!!!)
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Readout chain identification for Castor Bits for the readout chain : some names need change! [31:26] ...
CastorCtdcUnpacker(int sourceIdOffset, int beg, int end)
for normal data
Log< level::Warning, false > LogWarning
void setPresamples(int ps)
static const int MAXSAMPLES