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 78 of file L1TCtL2EgProducer.cc.

Constructor & Destructor Documentation

◆ PatternWriter()

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

Definition at line 80 of file L1TCtL2EgProducer.cc.

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

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

Member Function Documentation

◆ addEvent()

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

Definition at line 107 of file L1TCtL2EgProducer.cc.

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

◆ flush()

void L1TCtL2EgProducer::PatternWriter::flush ( )
inline

Definition at line 109 of file L1TCtL2EgProducer.cc.

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