CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 75 of file L1TCtL2EgProducer.cc.

Constructor & Destructor Documentation

◆ PatternWriter()

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

Definition at line 77 of file L1TCtL2EgProducer.cc.

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

77  : dataWriter_(nullptr) {
78  unsigned int nFramesPerBX = conf.getParameter<uint32_t>("nFramesPerBX");
79 
80  std::map<l1t::demo::LinkId, std::pair<l1t::demo::ChannelSpec, std::vector<size_t>>> channelSpecs;
81 
82  for (const auto &channelConf : conf.getParameter<std::vector<edm::ParameterSet>>("channels")) {
83  unsigned int inTMUX = channelConf.getParameter<uint32_t>("TMUX");
84  unsigned int eventGap =
85  inTMUX * nFramesPerBX - channelConf.getParameter<uint32_t>("nWords"); // assuming 96bit (= 3/2 word)
86  // words = TMUX*9-2*3/2*words
87  std::vector<uint32_t> chns = channelConf.getParameter<std::vector<uint32_t>>("channels");
88  channelSpecs[l1t::demo::LinkId{channelConf.getParameter<std::string>("interface"),
89  channelConf.getParameter<uint32_t>("id")}] =
90  std::make_pair(l1t::demo::ChannelSpec{inTMUX, eventGap},
91  std::vector<size_t>(std::begin(chns), std::end(chns)));
92  }
93 
94  dataWriter_ = std::make_unique<l1t::demo::BoardDataWriter>(
96  conf.getParameter<std::string>("outputFilename"),
97  conf.getParameter<std::string>("outputFileExtension"),
99  conf.getParameter<uint32_t>("TMUX"),
100  conf.getParameter<uint32_t>("maxLinesPerFile"),
101  channelSpecs);
102  }
std::unique_ptr< l1t::demo::BoardDataWriter > dataWriter_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
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:73

Member Function Documentation

◆ addEvent()

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

Definition at line 104 of file L1TCtL2EgProducer.cc.

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

◆ flush()

void L1TCtL2EgProducer::PatternWriter::flush ( )
inline

Definition at line 106 of file L1TCtL2EgProducer.cc.

106 { 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 109 of file L1TCtL2EgProducer.cc.