34 std::unique_ptr<DTDigiCollection>& detectorProduct,
35 std::unique_ptr<DTLocalTriggerCollection>& triggerProduct,
38 const int wordSize_32 = 4;
39 const int wordSize_64 = 8;
41 int numberOf32Words = datasize / wordSize_32;
43 const unsigned char* index8 =
reinterpret_cast<const unsigned char*
>(index32);
51 if (dduHeader.
check()) {
53 cout <<
"[DTDDUUnpacker] FED Header. BXID: " << dduHeader.
bxID() <<
" L1ID: " << dduHeader.
lvl1ID() << endl;
56 <<
"[DTDDUUnpacker] WARNING!, this is not a DDU Header, FED ID: " << dduID << endl;
61 FEDTrailer dduTrailer(index8 + datasize - 1 * wordSize_64);
63 if (dduTrailer.
check()) {
65 cout <<
"[DTDDUUnpacker] FED Trailer. Length of the DT event: " << dduTrailer.
fragmentLength() << endl;
68 <<
"[DTDDUUnpacker] WARNING!, this is not a DDU Trailer, FED ID: " << dduID << endl;
79 vector<DTDDUFirstStatusWord> rosStatusWords;
84 for (
int rosId = 0; rosId < 4; rosId++) {
85 int wordIndex8 = numberOf32Words * wordSize_32 - 3 * wordSize_64 + wordSize_32 + rosId;
89 for (
int rosId = 0; rosId < 4; rosId++) {
90 int wordIndex8 = numberOf32Words * wordSize_32 - 3 * wordSize_64 + rosId;
94 for (
int rosId = 0; rosId < 4; rosId++) {
95 int wordIndex8 = numberOf32Words * wordSize_32 - 2 * wordSize_64 + wordSize_32 + rosId;
99 for (
int rosId = 0; rosId < 12; rosId++) {
100 int wordIndex8 = numberOf32Words * wordSize_32 - 3 * wordSize_64 + rosId;
111 theROSList = dduStatusWord.
rosList();
115 theROSList = dduStatusWord.
rosList();
124 index32 += (wordSize_64) / wordSize_32;
128 datasize -= 4 * wordSize_64;
void interpretRawData(const unsigned int *index, int datasize, int dduID, edm::ESHandle< DTReadOutMapping > &mapping, std::unique_ptr< DTDigiCollection > &product, std::unique_ptr< DTLocalTriggerCollection > &product2, uint16_t rosList=0) override
void addDDUStatusWord(const DTDDUSecondStatusWord &word)
T getParameter(std::string const &) const
void addROSStatusWord(const DTDDUFirstStatusWord &word)
uint32_t fragmentLength() const
The length of the event fragment counted in 64-bit words including header and trailer.
void interpretRawData(const unsigned int *index, int datasize, int dduID, edm::ESHandle< DTReadOutMapping > &mapping, std::unique_ptr< DTDigiCollection > &product, std::unique_ptr< DTLocalTriggerCollection > &product2, uint16_t rosList=0) override
T getUntrackedParameter(std::string const &, T const &) const
DTROS25Unpacker * ros25Unpacker
void addDDUHeader(const FEDHeader &word)
Setters.
void addDDUTrailer(const FEDTrailer &word)
bool localDAQ
if data are read locally, status words are swapped
const edm::ParameterSet dduPSet
void checkCRCBit(const unsigned char *trailer)
~DTDDUUnpacker() override
Destructor.
Log< level::Warning, false > LogWarning
DTDDUUnpacker(const edm::ParameterSet &ps)
Constructor.
bool check() const
Check that the trailer is OK.