CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
l1t::MP7BufferDumpToRaw Class Reference
Inheritance diagram for l1t::MP7BufferDumpToRaw:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 MP7BufferDumpToRaw (const edm::ParameterSet &)
 
 ~MP7BufferDumpToRaw () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Private Member Functions

void beginJob () override
 
void endJob () override
 
void formatAMC (amc13::Packet &amc13, const std::vector< Block > &blocks, int iAmc)
 
void formatRaw (edm::Event &iEvent, amc13::Packet &amc13, FEDRawData &fed_data)
 
std::vector< BlockgetBlocks (int iAmc)
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

std::vector< int > boardId_
 
int evType_
 
int fedId_
 
int fwVer_
 
unsigned iBoard_
 
bool mux_
 
int muxOffset_
 
unsigned nBoard_
 
unsigned nFramesPerEvent_
 
bool packetisedData_
 
std::vector< std::vector< int > > rxBlockLength_
 
MP7FileReader rxFileReader_
 
std::vector< unsigned > rxIndex_
 
MP7PacketReader rxPacketReader_
 
int slinkHeaderSize_
 
int slinkTrailerSize_
 
std::vector< std::vector< int > > txBlockLength_
 
MP7FileReader txFileReader_
 
std::vector< unsigned > txIndex_
 
MP7PacketReader txPacketReader_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 57 of file MP7BufferDumpToRaw.cc.

Constructor & Destructor Documentation

l1t::MP7BufferDumpToRaw::MP7BufferDumpToRaw ( const edm::ParameterSet iConfig)
explicit

Definition at line 134 of file MP7BufferDumpToRaw.cc.

References boardId_, edm::ParameterSet::getUntrackedParameter(), mps_fire::i, LogDebug, SiStripPI::max, nBoard_, nFramesPerEvent_, corrVsCorr::rx, rxBlockLength_, rxFileReader_, rxIndex_, MP7FileReader::size(), txBlockLength_, txFileReader_, and txIndex_.

134  :
135  rxFileReader_(iConfig.getUntrackedParameter<std::string>("rxFile", "rx_summary.txt")),
136  txFileReader_(iConfig.getUntrackedParameter<std::string>("txFile", "tx_summary.txt")),
137  rxPacketReader_(iConfig.getUntrackedParameter<std::string>("rxFile", "rx_summary.txt"), iConfig.getUntrackedParameter<int>("rxHeaderFrames", 1), 0, iConfig.getUntrackedParameter<int>("rxKeyLink", 0)),
138  txPacketReader_(iConfig.getUntrackedParameter<std::string>("txFile", "tx_summary.txt"), iConfig.getUntrackedParameter<int>("txHeaderFrames", 1), 0, iConfig.getUntrackedParameter<int>("txKeyLink", 0)),
139  packetisedData_(iConfig.getUntrackedParameter<bool>("packetisedData", true)),
140  nFramesPerEvent_(iConfig.getUntrackedParameter<int>("nFramesPerEvent", 6)),
141  iBoard_(iConfig.getUntrackedParameter<int>("boardOffset", 0)),
142  boardId_(iConfig.getUntrackedParameter<std::vector<int> >("boardId")),
143  mux_(iConfig.getUntrackedParameter<bool>("mux", false)),
144  fedId_(iConfig.getUntrackedParameter<int>("fedId", 1)),
145  evType_(iConfig.getUntrackedParameter<int>("eventType", 1)),
146  fwVer_(iConfig.getUntrackedParameter<int>("fwVersion", 1)),
147  slinkHeaderSize_(iConfig.getUntrackedParameter<int>("lenSlinkHeader", 8)),
148  slinkTrailerSize_(iConfig.getUntrackedParameter<int>("lenSlinkTrailer", 8))
149 {
150 
151  produces<FEDRawDataCollection>();
152 
153  // check tx/rx file size consistency and number of boards
154  if (rxFileReader_.size() != txFileReader_.size()) {
155  edm::LogError("L1T") << "Different number of boards in Rx and Tx files";
156  }
158  LogDebug("L1T") << "# boards : " << nBoard_;
159 
160  // advance pointers for non packetised data
161  rxIndex_ = iConfig.getUntrackedParameter< std::vector<unsigned> >("nFramesOffset");
162  if (rxIndex_.size() != nBoard_) {
163  edm::LogError("L1T") << "Wrong number of boards in nFramesOffset " << rxIndex_.size();
164  }
165 
166  txIndex_ = iConfig.getUntrackedParameter< std::vector<unsigned> >("nFramesLatency");
167  if (txIndex_.size() != nBoard_) {
168  edm::LogError("L1T") << "Wrong number of boards in nFramesLatency " << txIndex_.size();
169  }
170 
171  // add latency to offset for Tx
172  for (unsigned i=0; i<rxIndex_.size(); ++i) txIndex_.at(i) += rxIndex_.at(i);
173 
174  // check board IDs
175  if (nBoard_ != boardId_.size()) {
176  edm::LogError("L1T") << "Found " << nBoard_ << " boards, but given " << boardId_.size() << " IDs";
177  }
178 
179 
180  // block length PSet
181  std::vector<edm::ParameterSet> vpset = iConfig.getUntrackedParameter< std::vector<edm::ParameterSet> >("blocks");
182 
183  if (vpset.size() != nBoard_) {
184  edm::LogError("L1T") << "Wrong number of block specs " << vpset.size();
185  }
186 
187  rxBlockLength_.resize(nBoard_);
188  txBlockLength_.resize(nBoard_);
189 
190  for (unsigned i=0; i<nBoard_; ++i) {
191 
192  std::vector<int> rx = vpset.at(i).getUntrackedParameter< std::vector<int> >("rxBlockLength");
193 
194  rxBlockLength_.at(i).resize(rx.size());
195 
196  for (unsigned j=0; j<rx.size(); ++j) {
197  rxBlockLength_.at(i).at(j) = rx.at(j);
198 
199  if (rx.at(j) != 0) {
200  // LogDebug("L1T") << "Block readout : board " << i << " Rx link " << j << " size " << rx.at(j);
201  }
202  }
203 
204  std::vector<int> tx = vpset.at(i).getUntrackedParameter< std::vector<int> >("txBlockLength");
205  txBlockLength_.at(i).resize(tx.size());
206 
207  for (unsigned j=0; j<tx.size(); ++j) {
208  txBlockLength_.at(i).at(j) = tx.at(j);
209 
210  if (tx.at(j) != 0) {
211  // LogDebug("L1T") << "Block readout : board " << i << " Tx link " << j << " size " << tx.at(j);
212  }
213  }
214 
215  }
216 
217  LogDebug("L1T") << "Board ID size " << boardId_.size();
218 
219  LogDebug("L1T") << "Frames per event " << nFramesPerEvent_;
220 
221 }
#define LogDebug(id)
T getUntrackedParameter(std::string const &, T const &) const
std::vector< std::vector< int > > rxBlockLength_
std::vector< std::vector< int > > txBlockLength_
MP7PacketReader txPacketReader_
size_t size() const
number of rawdata objects stored
Definition: MP7FileReader.h:74
std::vector< unsigned > rxIndex_
std::vector< unsigned > txIndex_
std::vector< int > boardId_
MP7PacketReader rxPacketReader_
l1t::MP7BufferDumpToRaw::~MP7BufferDumpToRaw ( )
override

Definition at line 224 of file MP7BufferDumpToRaw.cc.

225 {
226 
227  // do anything here that needs to be done at desctruction time
228  // (e.g. close files, deallocate resources etc.)
229 
230 }

Member Function Documentation

void l1t::MP7BufferDumpToRaw::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 465 of file MP7BufferDumpToRaw.cc.

466 {
467 
468 
469 
470 }
void l1t::MP7BufferDumpToRaw::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 475 of file MP7BufferDumpToRaw.cc.

476 {
477 
478 
479 }
void l1t::MP7BufferDumpToRaw::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 515 of file MP7BufferDumpToRaw.cc.

References edm::ConfigurationDescriptions::addDefault(), DEFINE_FWK_MODULE, and edm::ParameterSetDescription::setUnknown().

515  {
516  //The following says we do not know what parameters are allowed so do no validation
517  // Please change this to state exactly what you do use, even if it is no parameters
519  desc.setUnknown();
520  descriptions.addDefault(desc);
521 }
void addDefault(ParameterSetDescription const &psetDescription)
void l1t::MP7BufferDumpToRaw::formatAMC ( amc13::Packet amc13,
const std::vector< Block > &  blocks,
int  iAmc 
)
private

Definition at line 390 of file MP7BufferDumpToRaw.cc.

References amc13::Packet::add(), groupFilesInBlocks::block, boardId_, fwVer_, mps_fire::i, svgfig::load(), LogDebug, and alignCSCRings::s.

Referenced by produce().

390  {
391 
392  LogDebug("L1T") << "Formatting Board " << iBoard;
393 
394  std::vector<uint32_t> load32;
395  // TODO this is an empty word to be replaced with a proper MP7
396  // header containing at least the firmware version
397  load32.push_back(0);
398  load32.push_back(fwVer_);
399 
400  for (const auto& block: blocks) {
401  LogDebug("L1T") << "Adding block " << block.header().getID() << " with size " << block.payload().size();
402  auto load = block.payload();
403 
404 #ifdef EDM_ML_DEBUG
405  std::stringstream s("");
406  s << "Block content:" << std::endl << std::hex << std::setfill('0');
407  for (const auto& word: load)
408  s << std::setw(8) << word << std::endl;
409  LogDebug("L1T") << s.str();
410 #endif
411 
412  load32.push_back(block.header().raw());
413  load32.insert(load32.end(), load.begin(), load.end());
414  }
415 
416  LogDebug("L1T") << "Converting payload " << iBoard;
417 
418  std::vector<uint64_t> load64;
419  for (unsigned int i = 0; i < load32.size(); i += 2) {
420  uint64_t word = load32[i];
421  if (i + 1 < load32.size())
422  word |= static_cast<uint64_t>(load32[i + 1]) << 32;
423  load64.push_back(word);
424  }
425 
426  LogDebug("L1T") << "Creating AMC packet " << iBoard;
427  // LogDebug("L1T") << iBoard << ", " << boardId_.at(iBoard) << ", " << load64.size();
428 
429  amc13.add(iBoard, boardId_.at(iBoard), 0, 0, 0, load64);
430 
431 }
#define LogDebug(id)
void add(unsigned int amc_no, unsigned int board, unsigned int lv1id, unsigned int orbit, unsigned int bx, const std::vector< uint64_t > &load, unsigned int user=0)
Definition: AMC13Spec.cc:61
unsigned long long uint64_t
Definition: Time.h:15
def load(fileName)
Definition: svgfig.py:547
std::vector< int > boardId_
void l1t::MP7BufferDumpToRaw::formatRaw ( edm::Event iEvent,
amc13::Packet amc13,
FEDRawData fed_data 
)
private

Definition at line 436 of file MP7BufferDumpToRaw.cc.

References edm::EventBase::bunchCrossing(), evf::compute_crc(), FEDRawData::data(), edm::EventID::event(), evType_, fedId_, RecoTauValidation_cfi::header, edm::EventBase::id(), LogDebug, jets_cff::payload, FEDRawData::resize(), FEDHeader::set(), FEDTrailer::set(), amc13::Packet::size(), findQualityFiles::size, slinkHeaderSize_, slinkTrailerSize_, and amc13::Packet::write().

Referenced by produce().

437 {
438 
439  unsigned int size = slinkHeaderSize_ + slinkTrailerSize_ + amc13.size() * 8;
440  fed_data.resize(size);
441  unsigned char * payload = fed_data.data();
442  unsigned char * payload_start = payload;
443 
444  auto bxId = iEvent.bunchCrossing();
445  auto evtId = iEvent.id().event();
446 
447  LogDebug("L1T") << "Creating FEDRawData ID " << fedId_ << ", size " << size;
448 
449  FEDHeader header(payload);
450  header.set(payload, evType_, evtId, bxId, fedId_);
451 
452  amc13.write(iEvent, payload, slinkHeaderSize_, size - slinkHeaderSize_ - slinkTrailerSize_);
453 
454  payload += slinkHeaderSize_;
455  payload += amc13.size() * 8;
456 
457  FEDTrailer trailer(payload);
458  trailer.set(payload, size / 8, evf::compute_crc(payload_start, size), 0, 0);
459 
460 }
#define LogDebug(id)
size
Write out results.
EventNumber_t event() const
Definition: EventID.h:41
unsigned int size() const
Definition: AMC13Spec.cc:200
int bunchCrossing() const
Definition: EventBase.h:64
bool write(const edm::Event &ev, unsigned char *ptr, unsigned int skip, unsigned int size) const
Definition: AMC13Spec.cc:218
void resize(size_t newsize)
Definition: FEDRawData.cc:32
unsigned short compute_crc(unsigned char *buffer, unsigned int bufSize)
Definition: CRC16.h:46
edm::EventID id() const
Definition: EventBase.h:59
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
std::vector< Block > l1t::MP7BufferDumpToRaw::getBlocks ( int  iAmc)
private

Definition at line 282 of file MP7BufferDumpToRaw.cc.

References PacketData::begin(), groupFilesInBlocks::block, gather_cfg::blocks, edmIntegrityCheck::d, data, MP7PacketReader::get(), MP7FileReader::get(), mps_fire::i, FileData::link(), LogDebug, nFramesPerEvent_, AlCaHLTBitMon_ParallelJobs::p, packetisedData_, rxBlockLength_, rxFileReader_, rxIndex_, rxPacketReader_, findQualityFiles::size, txBlockLength_, txFileReader_, txIndex_, and txPacketReader_.

Referenced by produce().

283 {
284 
285  LogDebug("L1T") << "Getting blocks from board " << iBoard << ", " << rxBlockLength_.at(iBoard).size() << " Rx links, " << txBlockLength_.at(iBoard).size() << " Tx links";
286 
287  std::vector<Block> blocks;
288 
289  // Rx blocks first
290  for (unsigned link=0; link<rxBlockLength_.at(iBoard).size(); ++link) {
291 
292  unsigned id = link*2;
293  unsigned size = rxBlockLength_.at(iBoard).at(link);
294 
295  if (size==0) continue;
296 
297  std::vector<uint32_t> data;
298  if (packetisedData_) {
299 
300  const PacketData& p = rxPacketReader_.get(iBoard);
302  for (unsigned i=0; i<rxIndex_.at(iBoard); i++) itr++;
303 
304  LogDebug("L1T") << "Found packet [" << itr->first_ << ", " << itr->last_ << "]";
305  LogDebug("L1T") << "Link " << link << " has " << itr->links_.find(link)->second.size() << " frames";
306 
307  for (unsigned iFrame=0; iFrame<itr->links_.find(link)->second.size(); ++iFrame) {
308  uint64_t d = itr->links_.find(link)->second.at(iFrame);
309  data.push_back(d);
310  }
311  }
312  else {
313 
314  for (unsigned iFrame=rxIndex_.at(iBoard); iFrame<rxIndex_.at(iBoard)+size; ++iFrame) {
315  uint64_t d = rxFileReader_.get(iBoard).link(link).at(iFrame);
316  LogDebug("L1T") << "Frame " << iFrame << " : " << std::hex << d;
317  if ((d & 0x100000000) > 0) data.push_back( d & 0xffffffff );
318  }
319 
320  }
321 
322  LogDebug("L1T") << "Board " << iBoard << " block " << id << ", size " << data.size();
323 
324  Block block(id, data);
325  blocks.push_back(block);
326 
327  }
328 
329  // then Tx blocks
330  for (unsigned link=0; link<txBlockLength_.at(iBoard).size(); ++link) {
331 
332  unsigned id = (link*2)+1;
333  unsigned size = txBlockLength_.at(iBoard).at(link);
334 
335  if (size==0) continue;
336 
337  LogDebug("L1T") << "Block " << id << " expecting size " << size;
338 
339  std::vector<uint32_t> data;
340  if (packetisedData_) {
341 
342  const PacketData& p = txPacketReader_.get(iBoard);
344  for (unsigned i=0; i<txIndex_.at(iBoard); i++) itr++;
345 
346  LogDebug("L1T") << "Found packet [" << itr->first_ << ", " << itr->last_ << "]";
347  LogDebug("L1T") << "Link " << link << " has " << itr->links_.find(link)->second.size() << " frames";
348 
349  for (unsigned iFrame=0; iFrame<itr->links_.find(link)->second.size(); ++iFrame) {
350  uint64_t d = itr->links_.find(link)->second.at(iFrame);
351  data.push_back(d);
352  }
353 
354  }
355  else {
356 
357  for (unsigned iFrame=txIndex_.at(iBoard); iFrame<txIndex_.at(iBoard)+size; ++iFrame) {
358  uint64_t d = txFileReader_.get(iBoard).link(link).at(iFrame);
359  LogDebug("L1T") << "Frame " << iFrame << " : " << std::hex << d;
360  if ((d & 0x100000000) > 0) data.push_back( d & 0xffffffff );
361  }
362 
363  }
364 
365  LogDebug("L1T") << "Board " << iBoard << " block " << id << ", size " << data.size();
366 
367  Block block(id, data);
368 
369  blocks.push_back(block);
370 
371  }
372 
373  if (packetisedData_) {
374  rxIndex_.at(iBoard)++;
375  txIndex_.at(iBoard)++;
376  }
377  else {
378  rxIndex_.at(iBoard) += nFramesPerEvent_;
379  txIndex_.at(iBoard) += nFramesPerEvent_;
380  }
381 
382  LogDebug("L1T") << "Board " << iBoard << ", read " << blocks.size() << " blocks";
383 
384  return blocks;
385 
386 }
#define LogDebug(id)
size
Write out results.
const_iterator begin() const
std::vector< std::vector< int > > rxBlockLength_
std::vector< std::vector< int > > txBlockLength_
MP7PacketReader txPacketReader_
const FileData & get(size_t k) const
data getter via index
const PacketData & get(size_t i)
std::vector< unsigned > rxIndex_
std::vector< unsigned > txIndex_
unsigned long long uint64_t
Definition: Time.h:15
std::vector< Packet >::const_iterator const_iterator
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
MP7PacketReader rxPacketReader_
const std::vector< uint64_t > & link(uint32_t i) const
void l1t::MP7BufferDumpToRaw::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 239 of file MP7BufferDumpToRaw.cc.

References gather_cfg::blocks, fedId_, formatAMC(), formatRaw(), getBlocks(), iBoard_, LogDebug, eostools::move(), mux_, nBoard_, edm::Event::put(), FEDRawData::size(), and amc13::Packet::size().

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

240 {
241  using namespace edm;
242 
243  // AMC 13 packet
245 
246  // create AMC formatted data
247  if (mux_) {
248  std::vector<Block> blocks = getBlocks(iBoard_);
249  formatAMC(amc13, blocks, iBoard_);
250  }
251  else {
252  for (unsigned iBoard=0; iBoard<nBoard_; ++iBoard) {
253  std::vector<Block> blocks = getBlocks(iBoard);
254  formatAMC(amc13, blocks, iBoard);
255  }
256  }
257 
258  LogDebug("L1T") << "AMC13 size " << amc13.size();
259 
260  // prepare the raw data collection
261  std::unique_ptr<FEDRawDataCollection> raw_coll(new FEDRawDataCollection());
262  FEDRawData& fed_data = raw_coll->FEDData(fedId_);
263 
264  formatRaw(iEvent, amc13, fed_data);
265 
266  LogDebug("L1T") << "Packing FED ID " << fedId_ << " size " << fed_data.size();
267 
268  // put the collection in the event
269  iEvent.put(std::move(raw_coll));
270 
271  //advance to next AMC for next event, if required...
272  if (mux_) {
273  iBoard_++;
274  iBoard_ = iBoard_ % nBoard_;
275  }
276 
277 }
#define LogDebug(id)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
unsigned int size() const
Definition: AMC13Spec.cc:200
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
std::vector< Block > getBlocks(int iAmc)
void formatAMC(amc13::Packet &amc13, const std::vector< Block > &blocks, int iAmc)
HLT enums.
void formatRaw(edm::Event &iEvent, amc13::Packet &amc13, FEDRawData &fed_data)
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

std::vector<int> l1t::MP7BufferDumpToRaw::boardId_
private

Definition at line 106 of file MP7BufferDumpToRaw.cc.

Referenced by formatAMC(), and MP7BufferDumpToRaw().

int l1t::MP7BufferDumpToRaw::evType_
private

Definition at line 116 of file MP7BufferDumpToRaw.cc.

Referenced by formatRaw().

int l1t::MP7BufferDumpToRaw::fedId_
private

Definition at line 115 of file MP7BufferDumpToRaw.cc.

Referenced by formatRaw(), and produce().

int l1t::MP7BufferDumpToRaw::fwVer_
private

Definition at line 117 of file MP7BufferDumpToRaw.cc.

Referenced by formatAMC().

unsigned l1t::MP7BufferDumpToRaw::iBoard_
private

Definition at line 105 of file MP7BufferDumpToRaw.cc.

Referenced by produce().

bool l1t::MP7BufferDumpToRaw::mux_
private

Definition at line 111 of file MP7BufferDumpToRaw.cc.

Referenced by produce().

int l1t::MP7BufferDumpToRaw::muxOffset_
private

Definition at line 112 of file MP7BufferDumpToRaw.cc.

unsigned l1t::MP7BufferDumpToRaw::nBoard_
private

Definition at line 104 of file MP7BufferDumpToRaw.cc.

Referenced by MP7BufferDumpToRaw(), and produce().

unsigned l1t::MP7BufferDumpToRaw::nFramesPerEvent_
private

Definition at line 99 of file MP7BufferDumpToRaw.cc.

Referenced by getBlocks(), and MP7BufferDumpToRaw().

bool l1t::MP7BufferDumpToRaw::packetisedData_
private

Definition at line 96 of file MP7BufferDumpToRaw.cc.

Referenced by getBlocks().

std::vector< std::vector<int> > l1t::MP7BufferDumpToRaw::rxBlockLength_
private

Definition at line 109 of file MP7BufferDumpToRaw.cc.

Referenced by getBlocks(), and MP7BufferDumpToRaw().

MP7FileReader l1t::MP7BufferDumpToRaw::rxFileReader_
private

Definition at line 84 of file MP7BufferDumpToRaw.cc.

Referenced by getBlocks(), and MP7BufferDumpToRaw().

std::vector<unsigned> l1t::MP7BufferDumpToRaw::rxIndex_
private

Definition at line 86 of file MP7BufferDumpToRaw.cc.

Referenced by getBlocks(), and MP7BufferDumpToRaw().

MP7PacketReader l1t::MP7BufferDumpToRaw::rxPacketReader_
private

Definition at line 90 of file MP7BufferDumpToRaw.cc.

Referenced by getBlocks().

int l1t::MP7BufferDumpToRaw::slinkHeaderSize_
private

Definition at line 118 of file MP7BufferDumpToRaw.cc.

Referenced by formatRaw().

int l1t::MP7BufferDumpToRaw::slinkTrailerSize_
private

Definition at line 119 of file MP7BufferDumpToRaw.cc.

Referenced by formatRaw().

std::vector< std::vector<int> > l1t::MP7BufferDumpToRaw::txBlockLength_
private

Definition at line 110 of file MP7BufferDumpToRaw.cc.

Referenced by getBlocks(), and MP7BufferDumpToRaw().

MP7FileReader l1t::MP7BufferDumpToRaw::txFileReader_
private

Definition at line 85 of file MP7BufferDumpToRaw.cc.

Referenced by getBlocks(), and MP7BufferDumpToRaw().

std::vector<unsigned> l1t::MP7BufferDumpToRaw::txIndex_
private

Definition at line 87 of file MP7BufferDumpToRaw.cc.

Referenced by getBlocks(), and MP7BufferDumpToRaw().

MP7PacketReader l1t::MP7BufferDumpToRaw::txPacketReader_
private

Definition at line 91 of file MP7BufferDumpToRaw.cc.

Referenced by getBlocks().