40 #include <boost/algorithm/string.hpp>
63 virtual void endJob()
override;
127 rxFileReader_(iConfig.getUntrackedParameter<std::
string>(
"rxFile",
"rx_summar\
129 txFileReader_(iConfig.getUntrackedParameter<std::
string>(
"txFile",
"tx_summar\
133 packetisedData_(iConfig.getUntrackedParameter<bool>(
"packetisedData",
true)),
134 nFramesPerEvent_(iConfig.getUntrackedParameter<unsigned>(
"nFramesPerEvent", 6)),
135 fedId_(iConfig.getUntrackedParameter<int>(
"fedId", 1)),
136 evType_(iConfig.getUntrackedParameter<int>(
"eventType", 1)),
137 fwVer_(iConfig.getUntrackedParameter<int>(
"fwVersion", 1)),
138 lenSlinkHeader_(iConfig.getUntrackedParameter<int>(
"lenSlinkHeader", 16)),
139 lenSlinkTrailer_(iConfig.getUntrackedParameter<int>(
"lenSlinkTrailer", 16)),
140 lenAMC13Header_(iConfig.getUntrackedParameter<int>(
"lenAMC13Header", 0)),
141 lenAMC13Trailer_(iConfig.getUntrackedParameter<int>(
"lenAMC13Trailer", 0)),
142 lenAMCHeader_(iConfig.getUntrackedParameter<int>(
"lenAMCHeader", 12)),
143 lenAMCTrailer_(iConfig.getUntrackedParameter<int>(
"lenAMCTrailer", 8)),
144 rxBlockLength_(iConfig.getUntrackedParameter< std::vector<int> >(
"rxBlockLength")),
145 txBlockLength_(iConfig.getUntrackedParameter< std::vector<int> >(
"txBlockLength"))
148 produces<FEDRawDataCollection>();
193 int evtId = iEvent.
id().
event();
215 std::vector<uint32_t>
data;
230 unsigned id = (
i*2)+1;
233 std::vector<uint32_t>
data(size);
261 for (std::vector<Block>::const_iterator itr=
blocks_.begin(); itr!=
blocks_.end(); ++itr) {
262 capEvtSize += itr->getSize() + 1;
269 int fedSize = amcSize;
276 fedSize = (fedSize+7) & ~0x7;
278 edm::LogInfo(
"mp7") <<
"Captured event size=" << capEvtSize <<
", AMCsize=" << amcSize <<
", FED size=" << fedSize << std::endl;
281 edm::LogInfo(
"mp7") <<
"Event : " << evtId <<
" orbit=" << orbit <<
" bx=" << bx << std::endl;
293 feddata.
data()[iWord+2] |= (bx<<4) & 0xff;
294 feddata.
data()[iWord+3] |= (bx>>4) & 0xff;
296 feddata.
data()[iWord+4] = evtId & 0xff;
297 feddata.
data()[iWord+5] = (evtId>>8) & 0xff;
298 feddata.
data()[iWord+6] = (evtId>>16) & 0xff;
301 feddata.
data()[iWord+7] |= 0x50;
312 feddata.
data()[iWord+0] = evtId & 0xff;
313 feddata.
data()[iWord+1] = (evtId>>8) & 0xff;
314 feddata.
data()[iWord+2] = (evtId>>16) & 0xff;
316 feddata.
data()[iWord+4] |= (orbit<<4) & 0xff;
317 feddata.
data()[iWord+5] |= (orbit>>4) & 0xff;
318 feddata.
data()[iWord+6] |= (orbit>>12) & 0xff;
320 feddata.
data()[iWord+6] |= (bx>>4) & 0xff;
321 feddata.
data()[iWord+7] |= (bx>>12) & 0xff;
325 feddata.
data()[iWord+9] = (amcSize/4) & 0xff;
326 feddata.
data()[iWord+10] = ((amcSize/4) >> 8) & 0xff;
334 std::ostringstream payloadInfo;
421 feddata.
data()[iWord] = evtId & 0xff;
422 feddata.
data()[iWord+1] = (evtId>>8) & 0xff;
429 iWord = (iWord+7) & ~0x7;
430 feddata.
data()[iWord+4] = (fedSize/8) & 0xff;
431 feddata.
data()[iWord+5] = ((fedSize/8)>>8) & 0xff;
432 feddata.
data()[iWord+6] = ((fedSize/8)>>16) & 0xff;
434 feddata.
data()[iWord+7] |= 0xa0;
436 edm::LogInfo(
"mp7") <<
"End of packet after " << iWord+8 <<
" bytes of " << fedSize << std::endl;
MP7FileReader rxFileReader_
EventNumber_t event() const
T getUntrackedParameter(std::string const &, T const &) const
void formatRaw(FEDRawData &feddata, int bx, int evtId, int orbit)
unsigned nFramesPerEvent_
std::vector< int > rxBlockLength_
#define DEFINE_FWK_MODULE(type)
MP7FileReader txFileReader_
int bunchCrossing() const
const FileData & get(size_t k) const
data getter via index
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
virtual void beginJob() override
void addDefault(ParameterSetDescription const &psetDescription)
void resize(size_t newsize)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
MP7BufferDumpToRaw(const edm::ParameterSet &)
virtual void endJob() override
virtual void produce(edm::Event &, const edm::EventSetup &) override
void fillBlocks(int iAmc)
std::vector< Block > blocks_
std::vector< int > txBlockLength_
char data[epos_bytes_allocation]
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
const std::vector< uint64_t > & link(uint32_t i) const
tuple size
Write out results.