32 dataLabel_ = consumes<RPCDigiCollection>(
pset.getParameter<
edm::InputTag>(
"InputLabel"));
33 readoutMappingToken_ = esConsumes<RPCEMap, RPCEMapRcd>();
35 produces<FEDRawDataCollection>();
45 if (recordWatcher_.check(es)) {
47 LogTrace(
"") <<
"record has CHANGED!!, initialise readout map!";
49 theCabling = readoutMapping->
convert();
50 LogTrace(
"") <<
" READOUT MAP VERSION: " << theCabling->version() << endl;
53 auto buffers = std::make_unique<FEDRawDataCollection>();
56 pair<int, int> rpcFEDS(790, 792);
57 for (
int id = rpcFEDS.first;
id <= rpcFEDS.second; ++
id) {
59 unsigned int lvl1_ID =
ev.id().event();
82 vector<Word64> dataWords;
84 typedef vector<EventRecords>::const_iterator IR;
85 for (IR ir = merged.begin(), irEnd = merged.end(); ir != irEnd; ++ir) {
86 Word64 w = (((
Word64(ir->recordBX().data()) << 16) | ir->recordSLD().data()) << 16 | ir->recordCD().data()) << 16 |
88 dataWords.push_back(
w);
96 int dataSize = (nHeaders + nTrailers + dataWords.size()) *
sizeof(
Word64);
102 unsigned char* pHeader = raw->
data();
104 int source_ID =
fedId;
110 for (
unsigned int idata = 0; idata < dataWords.size(); idata++) {
111 Word64*
word = reinterpret_cast<Word64*>(pHeader + (idata + 1) *
sizeof(
Word64));
112 *
word = dataWords[idata];
118 unsigned char* pTrailer = pHeader + raw->
size() -
sizeof(
Word64);
133 vector<EventRecords> dataRecords;
136 for (DigiRangeIterator it = digis->begin(); it != digis->end(); it++) {
138 uint32_t rawDetId = rpcDetId.
rawId();
140 for (vector<RPCDigi>::const_iterator
id =
range.first;
id !=
range.second;
id++) {
142 vector<EventRecords> rawFromDigi =
formatter.recordPack(rawDetId, digi, trigger_BX);
143 dataRecords.insert(dataRecords.end(), rawFromDigi.begin(), rawFromDigi.end());
150 LogTrace(
"RPCRawDataPacker") <<
" size of data: " << dataRecords.size();
151 vector<EventRecords> merged = EventRecords::mergeRecords(dataRecords);
152 LogTrace(
"") <<
" size of megred: " << merged.size();