34 using namespace rpcrawtodigi;
40 : dataLabel_(pset.getParameter<edm::
InputTag>(
"InputLabel")),
41 doSynchro_(pset.getParameter<bool>(
"doSynchro")),
45 produces<RPCDigiCollection>();
46 produces<RPCRawDataCounts>();
47 if (
doSynchro_) produces<RPCRawSynchro::ProdItem>();
58 LogTrace(
"") <<
"record has CHANGED!!, (re)initialise readout map!";
81 std::auto_ptr<RPCRawSynchro::ProdItem> producedRawSynchoCounts;
87 const FEDRawData & rawData = allFEDRawData->FEDData(fedId);
92 if (nWords==0)
continue;
97 const Word64* header =
reinterpret_cast<const Word64*
>(rawData.
data()); header--;
98 bool moreHeaders =
true;
101 FEDHeader fedHeader( reinterpret_cast<const unsigned char*>(header));
102 if (!fedHeader.
check()) {
103 producedRawDataCounts->addReadoutError(fedId,
ReadoutError(ReadoutError::HeaderCheckFail));
104 if (debug)
LogTrace(
"") <<
" ** PROBLEM **, header.check() failed, break";
107 if ( fedHeader.
sourceID() != fedId) {
108 producedRawDataCounts->addReadoutError(fedId,
ReadoutError(ReadoutError::InconsitentFedId));
109 if (debug)
LogTrace (
"") <<
" ** PROBLEM **, fedHeader.sourceID() != fedId"
110 <<
"fedId = " << fedId<<
" sourceID="<<fedHeader.
sourceID();
112 triggerBX = fedHeader.
bxID();
116 str <<
" header: "<< *
reinterpret_cast<const bitset<64>*
> (header) << endl;
117 str <<
" header triggerType: " << fedHeader.
triggerType()<<endl;
118 str <<
" header lvl1ID: " << fedHeader.
lvl1ID() << endl;
119 str <<
" header bxID: " << fedHeader.
bxID() << endl;
120 str <<
" header sourceID: " << fedHeader.
sourceID() << endl;
121 str <<
" header version: " << fedHeader.
version() << endl;
129 const Word64* trailer=
reinterpret_cast<const Word64*
>(rawData.
data())+(nWords-1); trailer++;
130 bool moreTrailers =
true;
131 while (moreTrailers) {
133 FEDTrailer fedTrailer(reinterpret_cast<const unsigned char*>(trailer));
134 if ( !fedTrailer.
check()) {
135 producedRawDataCounts->addReadoutError(fedId,
ReadoutError(ReadoutError::TrailerCheckFail));
136 if (debug)
LogTrace(
"") <<
" ** PROBLEM **, trailer.check() failed, break";
139 if ( fedTrailer.
lenght()!= nWords) {
140 producedRawDataCounts->addReadoutError(fedId,
ReadoutError(ReadoutError::InconsistentDataSize));
141 if (debug)
LogTrace(
"")<<
" ** PROBLEM **, fedTrailer.lenght()!= nWords, break";
147 str <<
" trailer: "<< *
reinterpret_cast<const bitset<64>*
> (trailer) << endl;
148 str <<
" trailer lenght: "<<fedTrailer.
lenght()<<endl;
149 str <<
" trailer crc: "<<fedTrailer.
crc()<<endl;
150 str <<
" trailer evtStatus: "<<fedTrailer.
evtStatus()<<endl;
151 str <<
" trailer ttsBits: "<<fedTrailer.
ttsBits()<<endl;
161 for (
const Word64* word = header+1; word != trailer; word++) {
162 str<<
" data: "<<*
reinterpret_cast<const bitset<64>*
>(word) << endl;
169 for (
const Word64* word = header+1; word != trailer; word++) {
170 for(
int iRecord=1; iRecord<=4; iRecord++){
175 std::ostringstream str;
176 str <<
"record: "<<record.
print()<<
" hex: "<<hex<<*pRecord<<dec;
179 str<<
" --> dccId: "<<fedId
180 <<
" rmb: " <<
event.recordSLD().rmb()
181 <<
" lnk: "<<
event.recordSLD().tbLinkInputNumber()
182 <<
" lb: "<<
event.recordCD().lbInLink()
183 <<
" part: "<<
event.recordCD().partitionNumber()
184 <<
" data: "<<
event.recordCD().partitionData()
185 <<
" eod: "<<
event.recordCD().eod();
189 producedRawDataCounts->addDccRecord(fedId, record);
193 producedRPCDigis.get(), producedRawDataCounts.get(), producedRawSynchoCounts.get());
194 if (statusTMP != 0) status = statusTMP;
198 if (status && debug)
LogTrace(
"")<<
" RPCUnpackingModule - There was unpacking PROBLEM in this event"<<endl;
200 ev.
put(producedRPCDigis);
201 ev.
put(producedRawDataCounts);
RPCReadOutMappingWithFastSearch theReadoutMappingSearch
std::vector< std::pair< LinkBoardElectronicIndex, int > > ProdItem
std::string print(const Track &, edm::Verbosity=edm::Concise)
Track print utility.
int evtStatus()
Event fragment status information.
static MessageDrop * instance()
void init(const RPCReadOutMapping *arm)
takes ownership of map
size_t size() const
Lenght of the data buffer in bytes.
RPCUnpackingModule(const edm::ParameterSet &pset)
Constructor.
const std::string & version() const
version as string
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
void produce(edm::Event &ev, const edm::EventSetup &es) override
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
const RPCReadOutMapping * theCabling
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual ~RPCUnpackingModule()
Destructor.
int ttsBits()
Current value of the Trigger Throttling System bitsAQ).
unsigned long long uint64_t
int lenght()
The length of the event fragment counted in 64-bit words including header and trailer.
void beginRun(const edm::Run &run, const edm::EventSetup &es) override
bool check(const edm::EventSetup &iSetup)
std::string print() const
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
int crc()
Cyclic Redundancy Code of the event fragment including header and trailer.
DataRecordType type() const
unsigned long eventCounter_
edm::ESWatcher< RPCEMapRcd > theRecordWatcher