CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
L1TCtL2EgProducer::PatternWriter Class Reference

Public Member Functions

void addEvent (const l1t::demo::EventData &eventData)
 
void flush ()
 
 PatternWriter (const edm::ParameterSet &conf)
 

Private Attributes

std::unique_ptr< l1t::demo::BoardDataWriterdataWriter_
 

Detailed Description

Definition at line 77 of file L1TCtL2EgProducer.cc.

Constructor & Destructor Documentation

◆ PatternWriter()

L1TCtL2EgProducer::PatternWriter::PatternWriter ( const edm::ParameterSet conf)
inline

Definition at line 79 of file L1TCtL2EgProducer.cc.

References edm::ParameterSet::getParameter(), l1ctJetFileWriter_cfi::nFramesPerBX, l1t::demo::parseFileFormat(), and AlCaHLTBitMon_QueryRunRegistry::string.

79  : dataWriter_(nullptr) {
80  unsigned int nFramesPerBX = conf.getParameter<uint32_t>("nFramesPerBX");
81 
82  std::map<l1t::demo::LinkId, std::pair<l1t::demo::ChannelSpec, std::vector<size_t>>> channelSpecs;
83 
84  for (const auto &channelConf : conf.getParameter<std::vector<edm::ParameterSet>>("channels")) {
85  unsigned int inTMUX = channelConf.getParameter<uint32_t>("TMUX");
86  unsigned int eventGap =
87  inTMUX * nFramesPerBX - channelConf.getParameter<uint32_t>("nWords"); // assuming 96bit (= 3/2 word)
88  // words = TMUX*9-2*3/2*words
89  std::vector<uint32_t> chns = channelConf.getParameter<std::vector<uint32_t>>("channels");
90  channelSpecs[l1t::demo::LinkId{channelConf.getParameter<std::string>("interface"),
91  channelConf.getParameter<uint32_t>("id")}] =
92  std::make_pair(l1t::demo::ChannelSpec{inTMUX, eventGap},
93  std::vector<size_t>(std::begin(chns), std::end(chns)));
94  }
95 
96  dataWriter_ = std::make_unique<l1t::demo::BoardDataWriter>(
98  conf.getParameter<std::string>("outputFilename"),
100  conf.getParameter<uint32_t>("TMUX"),
101  conf.getParameter<uint32_t>("maxLinesPerFile"),
102  channelSpecs);
103  }
std::unique_ptr< l1t::demo::BoardDataWriter > dataWriter_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
Logical ID for link within any given time slice (e.g. ["tracks", 0] -> ["tracks", 17] for links from ...
Definition: LinkId.h:10
FileFormat parseFileFormat(const std::string &)
Definition: utilities.cc:70

Member Function Documentation

◆ addEvent()

void L1TCtL2EgProducer::PatternWriter::addEvent ( const l1t::demo::EventData eventData)
inline

Definition at line 105 of file L1TCtL2EgProducer.cc.

105 { dataWriter_->addEvent(eventData); }
std::unique_ptr< l1t::demo::BoardDataWriter > dataWriter_

◆ flush()

void L1TCtL2EgProducer::PatternWriter::flush ( )
inline

Definition at line 107 of file L1TCtL2EgProducer.cc.

107 { dataWriter_->flush(); }
std::unique_ptr< l1t::demo::BoardDataWriter > dataWriter_

Member Data Documentation

◆ dataWriter_

std::unique_ptr<l1t::demo::BoardDataWriter> L1TCtL2EgProducer::PatternWriter::dataWriter_
private

Definition at line 110 of file L1TCtL2EgProducer.cc.