37 if(performDataIntegrityMonitor) {
42 "[DTDDUUnpacker] WARNING! Data Integrity Monitoring requested but no DTDataMonitorInterface Service available" << endl;
43 performDataIntegrityMonitor =
false;
58 std::auto_ptr<DTDigiCollection>& detectorProduct,
59 std::auto_ptr<DTLocalTriggerCollection>& triggerProduct,
63 const int wordSize_32 = 4;
64 const int wordSize_64 = 8;
66 int numberOf32Words = datasize/wordSize_32;
68 const unsigned char* index8 =
reinterpret_cast<const unsigned char*
>(index32);
77 if (dduHeader.
check()) {
78 if(
debug)
cout <<
"[DTDDUUnpacker] FED Header. BXID: "<<dduHeader.
bxID()
79 <<
" L1ID: "<<dduHeader.
lvl1ID() <<endl;
81 LogWarning(
"DTRawToDigi|DTDDUUnpacker") <<
"[DTDDUUnpacker] WARNING!, this is not a DDU Header, FED ID: "
87 FEDTrailer dduTrailer(index8 + datasize - 1*wordSize_64);
89 if (dduTrailer.
check()) {
90 if(
debug)
cout <<
"[DTDDUUnpacker] FED Trailer. Lenght of the DT event: "
91 << dduTrailer.
lenght() << endl;
93 LogWarning(
"DTRawToDigi|DTDDUUnpacker") <<
"[DTDDUUnpacker] WARNING!, this is not a DDU Trailer, FED ID: "
99 DTDDUData controlData(dduHeader,dduTrailer);
101 controlData.
checkCRCBit(index8 + datasize - 1*wordSize_64);
104 vector<DTDDUFirstStatusWord> rosStatusWords;
109 for (
int rosId = 0; rosId < 4; rosId++ ) {
110 int wordIndex8 = numberOf32Words*wordSize_32 - 3*wordSize_64 + wordSize_32 + rosId;
114 for (
int rosId = 0; rosId < 4; rosId++ ) {
115 int wordIndex8 = numberOf32Words*wordSize_32 - 3*wordSize_64 + rosId;
119 for (
int rosId = 0; rosId < 4; rosId++ ) {
120 int wordIndex8 = numberOf32Words*wordSize_32 - 2*wordSize_64 + wordSize_32 + rosId;
125 for (
int rosId = 0; rosId < 12; rosId++ ) {
126 int wordIndex8 = numberOf32Words*wordSize_32 - 3*wordSize_64 + rosId;
137 theROSList = dduStatusWord.
rosList();
142 theROSList = dduStatusWord.
rosList();
152 index32 += (wordSize_64)/wordSize_32;
156 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