31 using namespace rpcrawtodigi;
41 produces<FEDRawDataCollection>();
55 LogInfo(
"RPCPackingModule") <<
"[RPCPackingModule::produce] "
63 if(recordWatcher.
check(es)) {
65 LogTrace(
"") <<
"record has CHANGED!!, initialise readout map!";
75 pair<int,int> rpcFEDS(790,792);
76 for (
int id= rpcFEDS.first;
id<=rpcFEDS.second; ++
id){
79 unsigned int lvl1_ID = ev.
id().
event();
101 vector<Word64> dataWords;
103 typedef vector<EventRecords>::const_iterator IR;
104 for (IR ir = merged.begin(), irEnd = merged.end() ; ir != irEnd; ++ir) {
105 Word64 w = ( ( (
Word64(ir->recordBX().data()) << 16) | ir->recordSLD().data() ) << 16
106 | ir->recordCD().data() ) << 16 | empty.
data();
107 dataWords.push_back(w);
115 int dataSize = (nHeaders+nTrailers+dataWords.size()) *
sizeof(
Word64);
121 unsigned char *pHeader = raw->
data();
123 int source_ID = fedId;
129 for (
unsigned int idata = 0; idata < dataWords.size(); idata ++) {
131 *word = dataWords[idata];
137 unsigned char *pTrailer = pHeader + raw->
size()-
sizeof(
Word64);
154 vector<EventRecords> dataRecords;
157 LogDebug(
"RPCRawDataPacker")<<
"Packing Fed id="<<fedId;
158 for (DigiRangeIterator it=digis->begin(); it != digis->end(); it++) {
160 uint32_t rawDetId = rpcDetId.
rawId();
162 for (vector<RPCDigi>::const_iterator
id = range.first;
id != range.second;
id++) {
164 vector<EventRecords> rawFromDigi = formatter.
recordPack(rawDetId, digi, trigger_BX);
165 dataRecords.insert(dataRecords.end(), rawFromDigi.begin(), rawFromDigi.end());
172 LogTrace(
"RPCRawDataPacker") <<
" size of data: " << dataRecords.size();
173 vector<EventRecords> merged = EventRecords::mergeRecords(dataRecords);
174 LogTrace(
"") <<
" size of megred: " << merged.size();
T getParameter(std::string const &) const
EventNumber_t event() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
static std::vector< rpcrawtodigi::EventRecords > eventRecords(int fedId, int trigger_BX, const RPCDigiCollection *, const RPCRecordFormatter &)
virtual ~RPCPackingModule()
dtor
static void set(unsigned char *trailer, int evt_lgth, int crc, int evt_stat, int tts, bool T=false)
Set all fields in the trailer.
size_t size() const
Lenght of the data buffer in bytes.
uint32_t rawId() const
get the raw id
unsigned long eventCounter_
const std::string & version() const
version as string
const Data & data() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
FEDRawData * rawData(int fedId, unsigned int lvl1_ID, const RPCDigiCollection *, const RPCRecordFormatter &)
const RPCReadOutMapping * theCabling
virtual void produce(edm::Event &, const edm::EventSetup &)
get data, convert to raw event, attach again to Event
T const * product() const
unsigned long long uint64_t
RPCPackingModule(const edm::ParameterSet &)
ctor
bool check(const edm::EventSetup &iSetup)
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
std::pair< const_iterator, const_iterator > Range
edm::EDGetTokenT< RPCDigiCollection > dataLabel_