35 produces<FEDRawDataCollection>();
45 if (recordWatcher_.check(es)) {
47 LogTrace(
"") <<
"record has CHANGED!!, initialise readout map!";
50 theCabling = readoutMapping->
convert();
51 LogTrace(
"") <<
" READOUT MAP VERSION: " << theCabling->version() << endl;
54 auto buffers = std::make_unique<FEDRawDataCollection>();
57 pair<int, int> rpcFEDS(790, 792);
58 for (
int id = rpcFEDS.first;
id <= rpcFEDS.second; ++
id) {
60 unsigned int lvl1_ID = ev.
id().
event();
83 vector<Word64> dataWords;
85 typedef vector<EventRecords>::const_iterator IR;
86 for (IR ir = merged.begin(), irEnd = merged.end(); ir != irEnd; ++ir) {
87 Word64 w = (((
Word64(ir->recordBX().data()) << 16) | ir->recordSLD().data()) << 16 | ir->recordCD().data()) << 16 |
89 dataWords.push_back(w);
97 int dataSize = (nHeaders + nTrailers + dataWords.size()) *
sizeof(
Word64);
103 unsigned char* pHeader = raw->
data();
105 int source_ID =
fedId;
111 for (
unsigned int idata = 0; idata < dataWords.size(); idata++) {
113 *word = dataWords[idata];
119 unsigned char* pTrailer = pHeader + raw->
size() -
sizeof(
Word64);
134 vector<EventRecords> dataRecords;
137 for (DigiRangeIterator it = digis->begin(); it != digis->end(); it++) {
139 uint32_t rawDetId = rpcDetId.
rawId();
141 for (vector<RPCDigi>::const_iterator
id = range.first;
id != range.second;
id++) {
143 vector<EventRecords> rawFromDigi = formatter.
recordPack(rawDetId, digi, trigger_BX);
144 dataRecords.insert(dataRecords.end(), rawFromDigi.begin(), rawFromDigi.end());
151 LogTrace(
"RPCRawDataPacker") <<
" size of data: " << dataRecords.size();
152 vector<EventRecords> merged = EventRecords::mergeRecords(dataRecords);
153 LogTrace(
"") <<
" size of megred: " << merged.size();
T getParameter(std::string const &) const
EventNumber_t event() const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
~RPCPackingModule() override
dtor
bool getByToken(EDGetToken token, Handle< PROD > &result) const
constexpr uint32_t rawId() const
get the raw id
static std::vector< rpcrawtodigi::EventRecords > eventRecords(int fedId, int trigger_BX, const RPCDigiCollection *, const RPCRecordFormatter &)
size_t size() const
Lenght of the data buffer in bytes.
FEDRawData * rawData(int fedId, unsigned int lvl1_ID, const RPCDigiCollection *, const RPCRecordFormatter &) const
static void set(unsigned char *trailer, uint32_t lenght, uint16_t crc, uint8_t evt_stat, uint8_t tts, bool moreTrailers=false)
Set all fields in the trailer.
const Data & data() const
T const * product() const
unsigned long long uint64_t
RPCPackingModule(const edm::ParameterSet &)
ctor
void produce(edm::Event &, const edm::EventSetup &) override
get data, convert to raw event, attach again to Event
std::pair< const_iterator, const_iterator > Range
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
RPCReadOutMapping const * convert() const