|
|
Go to the documentation of this file.
13 template <
class DigiClass>
25 int fiber = startPoint->
fiber();
38 int ncurr = 0, ntaken = 0;
41 if (ncurr >= startSample && ncurr <= endSample) {
42 digi.setSample(ntaken, *qie_work);
58 : sourceIdOffset_(sourceIdOffset), expectedOrbitMessageTime_(-1) {
64 if (
end >= 0 && end <= CastorDataFrame::MAXSAMPLES - 1 && end >= beg) {
80 if (raw.
size() < 16) {
94 const unsigned short *daq_first, *daq_last, *tp_first, *tp_last;
105 edm::LogWarning(
"Invalid Data") <<
"Invalid HTR data (data beyond payload size) observed on spigot " << spigot
106 <<
" of DCC with source id " << dccHeader->
getSourceId();
107 report.countSpigotFormatError();
114 edm::LogWarning(
"Invalid Data") <<
"CRC Error on HTR data observed on spigot " << spigot
115 <<
" of DCC with source id " << dccHeader->
getSourceId();
116 report.countSpigotFormatError();
121 edm::LogWarning(
"Invalid Data") <<
"Invalid HTR data observed on spigot " << spigot <<
" of DCC with source id "
123 report.countSpigotFormatError();
128 edm::LogWarning(
"Invalid Data") <<
"Histogram data passed to non-histogram unpacker on spigot " << spigot
129 <<
" of DCC with source id " << dccHeader->
getSourceId();
133 if (colls.
ttp !=
nullptr) {
136 ttpUnpack.
unpack(htr, colls.
ttp->back());
138 LogDebug(
"CastorUnpackerHcalTechTrigProcessor")
139 <<
"Skipping data on spigot " << spigot <<
" of DCC with source id " << dccHeader->
getSourceId()
140 <<
" which is from the TechTrigProcessor (use separate unpacker!)";
147 <<
"Skipping data on spigot " << spigot <<
" of DCC with source id " << dccHeader->
getSourceId()
155 htr.
dataPointers(&daq_first, &daq_last, &tp_first, &tp_last);
157 int htr_tb = smid & 0x1;
158 int htr_slot = (smid >> 1) & 0x1F;
159 int htr_cr = (smid >> 6) & 0x1F;
165 int currFiberChan = 0x3F;
178 eid.setHTR(htr_cr, htr_slot, htr_tb);
184 if (
id1.module() > 12)
189 for (tp_work = tp_begin; tp_work != tp_end; tp_work++) {
191 if (tp_work->
raw() == 0xFFFF)
218 colls.
tpCont->back().setPresamples(nps);
228 colls.
tpCont->back().setSample(colls.
tpCont->back().size(), *tp_work);
229 colls.
tpCont->back().setSize(colls.
tpCont->back().size() + 1);
233 colls.
tpCont->back().setPresamples(ncurr);
246 for (qie_work = qie_begin; qie_work != qie_end;) {
247 if (qie_work->
raw() == 0xFFFF) {
254 eid.setHTR(htr_cr, htr_slot, htr_tb);
259 qie_work = CastorUnpacker_impl::unpack<CastorDataFrame>(qie_work,
269 report.countUnmappedDigi();
272 edm::LogWarning(
"CASTOR") <<
"CastorUnpacker: No match found for electronics id :" <<
eid;
unsigned int getSubmodule() const
Get the HTR submodule number.
bool isHistogramEvent() const
Is this event a histogram event? (do not call standard unpack in this case!!!!!)
uint32_t zsBunchMask() const
ZS Bunch Mask (if available)
bool isUnsuppressed() const
Is this event an unsuppresed event?
static bool isTPGSOI(const HcalTriggerPrimitiveSample &s)
void unpack(const FEDRawData &raw, const CastorElectronicsMap &emap, CastorRawCollections &conts, HcalUnpackerReport &report, bool silent=false)
For histograms, no begin and end.
constexpr uint16_t raw() const
get the raw word
bool wasMarkAndPassZS(int fiber, int fiberchan) const
Was this channel passed as part of Mark&Pass ZS?
constexpr bool null() const
is this a null id ?
CastorUnpacker(int sourceIdOffset, int beg, int end)
for normal data
Readout chain identification for Castor Bits for the readout chain : some names need change!...
constexpr int fiberAndChan() const
get the id channel
static int slbChan(const HcalTriggerPrimitiveSample &theSample)
Log< level::Warning, false > LogWarning
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
void dataPointers(const unsigned short **daq_first, const unsigned short **daq_last, const unsigned short **tp_first, const unsigned short **tp_last) const
Obtain the starting and ending pointers for external unpacking of the data.
const HcalQIESample * unpack(const HcalQIESample *startPoint, const HcalQIESample *limit, DigiClass &digi, int presamples, const CastorElectronicsId &eid, int startSample, int endSample, int expectedTime, const HcalHTRData &hhd)
static int slb(const HcalTriggerPrimitiveSample &theSample)
bool unpack(const HcalHTRData &data, HcalTTPDigi &digi)
bool wasMarkAndPassZSTP(int slb, int slbchan) const
Was this channel passed as part of Mark&Pass ZS?
uint16_t raw() const
get the raw word
int getNPS() const
Get the number of presamples in daq data.
static int slbAndChan(const HcalTriggerPrimitiveSample &theSample)
int getFirmwareFlavor() const
Get the HTR firmware flavor.
int getFormatVersion() const
Get the version number of this event.
constexpr int fiber() const
get the fiber number
int endSample_
last sample from fed raw data to copy (if present)
constexpr int fiberChan() const
get the fiber channel number
std::vector< CastorDataFrame > * castorCont
int expectedOrbitMessageTime_
Expected orbit bunch time (needed to evaluate time differences)
size_t size() const
Lenght of the data buffer in bytes.
const DetId lookup(CastorElectronicsId fId) const
lookup the logical detid associated with the given electronics id
unsigned int getFibOrbMsgBCN(int fiber) const
Get the BCN of the Fiber Orbit Messages.
std::vector< CastorTriggerPrimitiveDigi > * tpCont
std::set< CastorElectronicsId > unknownIds_
int startSample_
first sample from fed raw data to copy
std::vector< HcalTTPDigi > * ttp
static const int MAXSAMPLES
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.