39 if(performDataIntegrityMonitor) {
44 "[DTDDUUnpacker] WARNING! Data Integrity Monitoring requested but no DTDataMonitorInterface Service available" << endl;
45 performDataIntegrityMonitor =
false;
60 std::auto_ptr<DTDigiCollection>& detectorProduct,
61 std::auto_ptr<DTLocalTriggerCollection>& triggerProduct,
65 const int wordSize_32 = 4;
66 const int wordSize_64 = 8;
68 int numberOf32Words = datasize/wordSize_32;
70 const unsigned char* index8 =
reinterpret_cast<const unsigned char*
>(index32);
79 if (dduHeader.
check()) {
80 if(
debug)
cout <<
"[DTDDUUnpacker] FED Header. BXID: "<<dduHeader.
bxID()
81 <<
" L1ID: "<<dduHeader.
lvl1ID() <<endl;
83 LogWarning(
"DTRawToDigi|DTDDUUnpacker") <<
"[DTDDUUnpacker] WARNING!, this is not a DDU Header, FED ID: "
89 FEDTrailer dduTrailer(index8 + datasize - 1*wordSize_64);
91 if (dduTrailer.
check()) {
92 if(
debug)
cout <<
"[DTDDUUnpacker] FED Trailer. Lenght of the DT event: "
93 << dduTrailer.
lenght() << endl;
95 LogWarning(
"DTRawToDigi|DTDDUUnpacker") <<
"[DTDDUUnpacker] WARNING!, this is not a DDU Trailer, FED ID: "
101 DTDDUData controlData(dduHeader,dduTrailer);
103 controlData.
checkCRCBit(index8 + datasize - 1*wordSize_64);
106 vector<DTDDUFirstStatusWord> rosStatusWords;
111 for (
int rosId = 0; rosId < 4; rosId++ ) {
112 int wordIndex8 = numberOf32Words*wordSize_32 - 3*wordSize_64 + wordSize_32 + rosId;
116 for (
int rosId = 0; rosId < 4; rosId++ ) {
117 int wordIndex8 = numberOf32Words*wordSize_32 - 3*wordSize_64 + rosId;
121 for (
int rosId = 0; rosId < 4; rosId++ ) {
122 int wordIndex8 = numberOf32Words*wordSize_32 - 2*wordSize_64 + wordSize_32 + rosId;
127 for (
int rosId = 0; rosId < 12; rosId++ ) {
128 int wordIndex8 = numberOf32Words*wordSize_32 - 3*wordSize_64 + rosId;
139 theROSList = dduStatusWord.
rosList();
144 theROSList = dduStatusWord.
rosList();
154 index32 += (wordSize_64)/wordSize_32;
158 datasize -= 4*wordSize_64;
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void addDDUStatusWord(const DTDDUSecondStatusWord &word)
DTDataMonitorInterface * dataMonitor
void addROSStatusWord(const DTDDUFirstStatusWord &word)
virtual void interpretRawData(const unsigned int *index, int datasize, int dduID, edm::ESHandle< DTReadOutMapping > &mapping, std::auto_ptr< DTDigiCollection > &product, std::auto_ptr< DTLocalTriggerCollection > &product2, uint16_t rosList=0)
DTROS25Unpacker * ros25Unpacker
virtual void processFED(DTDDUData &dduData, const std::vector< DTROS25Data > &rosData, int ddu)=0
bool localDAQ
if data are read locally, status words are swapped
virtual void interpretRawData(const unsigned int *index, int datasize, int dduID, edm::ESHandle< DTReadOutMapping > &mapping, std::auto_ptr< DTDigiCollection > &product, std::auto_ptr< DTLocalTriggerCollection > &product2, uint16_t rosList=0)
const edm::ParameterSet dduPSet
void checkCRCBit(const unsigned char *trailer)
virtual ~DTDDUUnpacker()
Destructor.
int lenght()
The length of the event fragment counted in 64-bit words including header and trailer.
bool performDataIntegrityMonitor
perform DQM for DDU
DTDDUUnpacker(const edm::ParameterSet &ps)
Constructor.
const std::vector< DTROS25Data > & getROSsControlData() const