38 produces<FEDRawDataCollection>();
55 if(recordWatcher_.check(es)) {
57 LogTrace(
"") <<
"record has CHANGED!!, initialise readout map!";
60 theCabling = readoutMapping->
convert();
61 LogTrace(
"") <<
" READOUT MAP VERSION: " << theCabling->version() << endl;
64 auto buffers = std::make_unique<FEDRawDataCollection>();
67 pair<int,int> rpcFEDS(790,792);
68 for (
int id= rpcFEDS.first;
id<=rpcFEDS.second; ++
id){
71 unsigned int lvl1_ID = ev.
id().
event();
75 fedRawData = *rawData;
93 vector<Word64> dataWords;
95 typedef vector<EventRecords>::const_iterator IR;
96 for (IR ir = merged.begin(), irEnd = merged.end() ; ir != irEnd; ++ir) {
97 Word64 w = ( ( (
Word64(ir->recordBX().data()) << 16) | ir->recordSLD().data() ) << 16
98 | ir->recordCD().data() ) << 16 | empty.
data();
99 dataWords.push_back(w);
107 int dataSize = (nHeaders+nTrailers+dataWords.size()) *
sizeof(
Word64);
113 unsigned char *pHeader = raw->
data();
115 int source_ID =
fedId;
121 for (
unsigned int idata = 0; idata < dataWords.size(); idata ++) {
123 *word = dataWords[idata];
129 unsigned char *pTrailer = pHeader + raw->
size()-
sizeof(
Word64);
146 vector<EventRecords> dataRecords;
150 for (DigiRangeIterator it=digis->begin(); it != digis->end(); it++) {
152 uint32_t rawDetId = rpcDetId.
rawId();
154 for (vector<RPCDigi>::const_iterator
id = range.first;
id != range.second;
id++) {
156 vector<EventRecords> rawFromDigi = formatter.
recordPack(rawDetId, digi, trigger_BX);
157 dataRecords.insert(dataRecords.end(), rawFromDigi.begin(), rawFromDigi.end());
164 LogTrace(
"RPCRawDataPacker") <<
" size of data: " << dataRecords.size();
165 vector<EventRecords> merged = EventRecords::mergeRecords(dataRecords);
166 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
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
std::pair< const_iterator, const_iterator > Range
RPCReadOutMapping const * convert() const