CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes
L1TCorrelatorLayer1PatternFileWriter Class Reference

#include <L1TCorrelatorLayer1PatternFileWriter.h>

Public Member Functions

void flush ()
 
 L1TCorrelatorLayer1PatternFileWriter (const edm::ParameterSet &iConfig, const l1ct::Event &eventTemplate)
 
void write (const l1ct::Event &event)
 
 ~L1TCorrelatorLayer1PatternFileWriter ()
 

Static Public Member Functions

static edm::ParameterSetDescription getParameterSetDescription ()
 

Private Types

enum  Partition { Partition::Barrel, Partition::HGCal, Partition::HGCalNoTk, Partition::HF }
 

Private Member Functions

void configLinks (const edm::ParameterSet &iConfig, const std::string &prefix, unsigned int linksFactor, unsigned int offset)
 
void configSectors (const edm::ParameterSet &iConfig, const std::string &prefix, unsigned int nSectors, unsigned int linksFactor)
 
void configTimeSlices (const edm::ParameterSet &iConfig, const std::string &prefix, unsigned int nSectors, unsigned int nTimeSlices, unsigned int linksFactor)
 
void writeBarrelGCT (const l1ct::Event &event, l1t::demo::EventData &out)
 
void writeEgamma (const l1ct::OutputBoard &egboard, std::vector< ap_uint< 64 >> &out)
 
void writeEgamma (const l1ct::Event &event, l1t::demo::EventData &out)
 
void writeGMT (const l1ct::Event &event, l1t::demo::EventData &out)
 
void writeGTT (const l1ct::Event &event, l1t::demo::EventData &out)
 
void writeHGC (const l1ct::Event &event, l1t::demo::EventData &out)
 
void writePuppi (const l1ct::Event &event, l1t::demo::EventData &out)
 
void writeTF (const l1ct::Event &event, l1t::demo::EventData &out)
 

Static Private Member Functions

static std::unique_ptr< edm::ParameterDescriptionNodedescribeEG ()
 
static std::unique_ptr< edm::ParameterDescriptionNodedescribeGCT ()
 
static std::unique_ptr< edm::ParameterDescriptionNodedescribeGMT ()
 
static std::unique_ptr< edm::ParameterDescriptionNodedescribeGTT ()
 
static std::unique_ptr< edm::ParameterDescriptionNodedescribeHGC ()
 
static std::unique_ptr< edm::ParameterDescriptionNodedescribeLinks (const std::string &prefix)
 
static std::unique_ptr< edm::ParameterDescriptionNodedescribePuppi ()
 
static std::unique_ptr< edm::ParameterDescriptionNodedescribeSectors (const std::string &prefix)
 
static std::unique_ptr< edm::ParameterDescriptionNodedescribeTF ()
 
static std::unique_ptr< edm::ParameterDescriptionNodedescribeTimeSlices (const std::string &prefix)
 
static Partition parsePartition (const std::string &partition)
 

Private Attributes

std::map< l1t::demo::LinkId, std::vector< size_t > > channelIdsInput_
 
std::map< l1t::demo::LinkId, std::vector< size_t > > channelIdsOutput_
 
std::map< std::string, l1t::demo::ChannelSpecchannelSpecsInput_
 
std::map< std::string, l1t::demo::ChannelSpecchannelSpecsOutput_
 
uint32_t eventIndex_
 
const uint32_t eventsPerFile_
 
const std::string fileFormat_
 
const unsigned int gctLinksEcal_ = 1
 
const unsigned int gctLinksHad_ = 2
 
const unsigned int gctSectors_ = 3
 
const unsigned int gctTimeslices_
 
const unsigned int gctTmuxFactor_ = 1
 
const unsigned int gmtLinksFactor_ = 1
 
uint32_t gmtNumberOfMuons_
 
const unsigned int gmtTimeslices_
 
const unsigned int gmtTmuxFactor_ = 18
 
uint32_t gttLatency_
 
const unsigned int gttLinksFactor_ = 1
 
uint32_t gttNumberOfPVs_
 
const unsigned int gttTimeslices_
 
const unsigned int gttTmuxFactor_ = 6
 
const unsigned int hgcLinksFactor_ = 4
 
const unsigned int hgcTimeslices_
 
const unsigned int hgcTmuxFactor_ = 18
 
std::unique_ptr< l1t::demo::BoardDataWriterinputFileWriter_
 
uint32_t nEgammaObjectsOut_
 
uint32_t nInputFramesPerBX_
 
uint32_t nOutputFramesPerBX_
 
unsigned int nPuppiFramesPerRegion_
 
int32_t outputBoard_
 
std::unique_ptr< l1t::demo::BoardDataWriteroutputFileWriter_
 
int32_t outputLinkEgamma_
 
std::vector< uint32_t > outputLinksPuppi_
 
std::vector< uint32_t > outputRegions_
 
Partition partition_
 
const unsigned int tfLinksFactor_ = 1
 
const unsigned int tfTimeslices_
 
const unsigned int tfTmuxFactor_ = 18
 
const unsigned int tmuxFactor_
 
bool writeInputs_
 
bool writeOutputs_
 

Detailed Description

Definition at line 11 of file L1TCorrelatorLayer1PatternFileWriter.h.

Member Enumeration Documentation

◆ Partition

Enumerator
Barrel 
HGCal 
HGCalNoTk 
HF 

Definition at line 22 of file L1TCorrelatorLayer1PatternFileWriter.h.

22 { Barrel, HGCal, HGCalNoTk, HF };

Constructor & Destructor Documentation

◆ L1TCorrelatorLayer1PatternFileWriter()

L1TCorrelatorLayer1PatternFileWriter::L1TCorrelatorLayer1PatternFileWriter ( const edm::ParameterSet iConfig,
const l1ct::Event eventTemplate 
)

Definition at line 6 of file L1TCorrelatorLayer1PatternFileWriter.cc.

References Barrel, channelIdsInput_, channelIdsOutput_, channelSpecsInput_, channelSpecsOutput_, configTimeSlices(), fileFormat_, gctLinksEcal_, gctLinksHad_, gctSectors_, gctTimeslices_, edm::ParameterSet::getParameter(), gmtLinksFactor_, gmtNumberOfMuons_, gmtTimeslices_, gttLatency_, gttLinksFactor_, gttNumberOfPVs_, gttTimeslices_, HGCal, l1ct::RawInputs::hgcalcluster, HGCalNoTk, hgcLinksFactor_, hgcTimeslices_, mps_fire::i, inputFileWriter_, nEgammaObjectsOut_, nInputFramesPerBX_, nOutputFramesPerBX_, nPuppiFramesPerRegion_, outputBoard_, outputFileWriter_, outputLinkEgamma_, outputLinksPuppi_, outputRegions_, l1t::demo::parseFileFormat(), partition_, l1ct::Event::raw, AlCaHLTBitMon_QueryRunRegistry::string, tfLinksFactor_, tfTimeslices_, tfTmuxFactor_, tmuxFactor_, l1ct::RawInputs::track, writeInputs_, and writeOutputs_.

8  : partition_(parsePartition(iConfig.getParameter<std::string>("partition"))),
9  tmuxFactor_(iConfig.getParameter<uint32_t>("tmuxFactor")),
10  writeInputs_(!iConfig.getParameter<std::string>("inputFileName").empty()),
11  writeOutputs_(!iConfig.getParameter<std::string>("outputFileName").empty()),
17  outputBoard_(-1),
19  fileFormat_(iConfig.getParameter<std::string>("fileFormat")),
20  eventsPerFile_(iConfig.getParameter<uint32_t>("eventsPerFile")),
21  eventIndex_(0) {
22  if (writeInputs_) {
23  nInputFramesPerBX_ = iConfig.getParameter<uint32_t>("nInputFramesPerBX");
24 
26  configTimeSlices(iConfig, "tf", eventTemplate.raw.track.size(), tfTimeslices_, tfLinksFactor_);
28  }
30  auto sectorConfig = iConfig.getParameter<std::vector<edm::ParameterSet>>("gctSectors");
31  if (sectorConfig.size() != gctSectors_)
32  throw cms::Exception("Configuration", "Bad number of GCT sectors");
33  for (unsigned int iS = 0; iS < gctSectors_; ++iS) {
34  auto linksEcal = sectorConfig[iS].getParameter<std::vector<int32_t>>("gctLinksEcal");
35  auto linksHad = sectorConfig[iS].getParameter<std::vector<int32_t>>("gctLinksHad");
36  if (linksEcal.size() != gctLinksEcal_ || linksHad.size() != gctLinksHad_)
37  throw cms::Exception("Configuration", "Bad number of GCT links");
38  unsigned int iLink = 0;
39  for (unsigned int i = 0; i < gctLinksHad_; ++i, ++iLink) {
40  if (linksHad[i] != -1)
41  channelIdsInput_[l1t::demo::LinkId{"gct", iLink + 10 * iS}].push_back(linksHad[i]);
42  }
43  for (unsigned int i = 0; i < gctLinksEcal_; ++i) {
44  if (linksEcal[i] != -1)
45  channelIdsInput_[l1t::demo::LinkId{"gct", iLink + 10 * iS}].push_back(linksEcal[i]);
46  }
48  }
49  }
51  configTimeSlices(iConfig, "hgc", eventTemplate.raw.hgcalcluster.size(), hgcTimeslices_, hgcLinksFactor_);
53  }
55  configTimeSlices(iConfig, "gmt", 1, gmtTimeslices_, gmtLinksFactor_);
56  gmtNumberOfMuons_ = iConfig.getParameter<uint32_t>("gmtNumberOfMuons");
59  }
61  configTimeSlices(iConfig, "gtt", 1, gttTimeslices_, gttLinksFactor_);
62  gttLatency_ = iConfig.getParameter<uint32_t>("gttLatency");
63  gttNumberOfPVs_ = iConfig.getParameter<uint32_t>("gttNumberOfPVs");
65  }
67  std::make_unique<l1t::demo::BoardDataWriter>(l1t::demo::parseFileFormat(fileFormat_),
68  iConfig.getParameter<std::string>("inputFileName"),
69  iConfig.getParameter<std::string>("inputFileExtension"),
72  iConfig.getParameter<uint32_t>("maxLinesPerInputFile"),
75  }
76 
77  if (writeOutputs_) {
78  nOutputFramesPerBX_ = iConfig.getParameter<uint32_t>("nOutputFramesPerBX");
79 
80  outputRegions_ = iConfig.getParameter<std::vector<uint32_t>>("outputRegions");
81  outputLinksPuppi_ = iConfig.getParameter<std::vector<uint32_t>>("outputLinksPuppi");
82  for (unsigned int i = 0; i < outputLinksPuppi_.size(); ++i) {
84  }
85  channelSpecsOutput_["puppi"] = {tmuxFactor_, 0};
88  outputLinkEgamma_ = iConfig.getParameter<int32_t>("outputLinkEgamma");
89  nEgammaObjectsOut_ = iConfig.getParameter<uint32_t>("nEgammaObjectsOut");
90  if (outputLinkEgamma_ != -1) {
91  channelIdsOutput_[l1t::demo::LinkId{"egamma", 0}].push_back(outputLinkEgamma_);
92  if (partition_ == Partition::HGCal && tmuxFactor_ == 18) {
93  // the format is different, as we put together both endcaps
95  } else {
96  outputBoard_ = iConfig.getParameter<int32_t>("outputBoard");
98  }
99  }
100  }
102  std::make_unique<l1t::demo::BoardDataWriter>(l1t::demo::parseFileFormat(fileFormat_),
103  iConfig.getParameter<std::string>("outputFileName"),
104  iConfig.getParameter<std::string>("outputFileExtension"),
106  tmuxFactor_,
107  iConfig.getParameter<uint32_t>("maxLinesPerOutputFile"),
110  }
111 }
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
void configTimeSlices(const edm::ParameterSet &iConfig, const std::string &prefix, unsigned int nSectors, unsigned int nTimeSlices, unsigned int linksFactor)
std::unique_ptr< l1t::demo::BoardDataWriter > inputFileWriter_
FileFormat parseFileFormat(const std::string &)
Definition: utilities.cc:73
std::map< std::string, l1t::demo::ChannelSpec > channelSpecsInput_
std::map< l1t::demo::LinkId, std::vector< size_t > > channelIdsOutput_
RawInputs raw
std::unique_ptr< l1t::demo::BoardDataWriter > outputFileWriter_
static Partition parsePartition(const std::string &partition)
std::vector< DetectorSector< ap_uint< 96 > > > track
std::vector< DetectorSector< ap_uint< 256 > > > hgcalcluster
std::map< l1t::demo::LinkId, std::vector< size_t > > channelIdsInput_
std::map< std::string, l1t::demo::ChannelSpec > channelSpecsOutput_

◆ ~L1TCorrelatorLayer1PatternFileWriter()

L1TCorrelatorLayer1PatternFileWriter::~L1TCorrelatorLayer1PatternFileWriter ( )

Definition at line 113 of file L1TCorrelatorLayer1PatternFileWriter.cc.

113 {}

Member Function Documentation

◆ configLinks()

void L1TCorrelatorLayer1PatternFileWriter::configLinks ( const edm::ParameterSet iConfig,
const std::string &  prefix,
unsigned int  linksFactor,
unsigned int  offset 
)
private

Definition at line 271 of file L1TCorrelatorLayer1PatternFileWriter.cc.

References channelIdsInput_, edm::ParameterSet::getParameter(), mps_fire::i, electronStore::links, hltrates_dqm_sourceclient-live_cfg::offset, and hcallasereventfilter2012_cfi::prefix.

Referenced by configSectors().

274  {
275  if (linksFactor > 1) {
276  auto links = iConfig.getParameter<std::vector<int32_t>>(prefix + "Links");
277  if (links.size() != linksFactor)
278  throw cms::Exception("Configuration")
279  << "Mismatched number of " << prefix << "Links, expected " << linksFactor << std::endl;
280  for (unsigned int i = 0; i < linksFactor; ++i) {
281  if (links[i] != -1) {
283  }
284  }
285  } else {
286  auto link = iConfig.getParameter<int32_t>(prefix + "Link");
287  if (link != -1) {
288  channelIdsInput_[l1t::demo::LinkId{prefix, offset}].push_back(link);
289  }
290  }
291 }
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
std::map< l1t::demo::LinkId, std::vector< size_t > > channelIdsInput_

◆ configSectors()

void L1TCorrelatorLayer1PatternFileWriter::configSectors ( const edm::ParameterSet iConfig,
const std::string &  prefix,
unsigned int  nSectors,
unsigned int  linksFactor 
)
private

Definition at line 246 of file L1TCorrelatorLayer1PatternFileWriter.cc.

References configLinks(), edm::ParameterSet::getParameter(), and hcallasereventfilter2012_cfi::prefix.

Referenced by configTimeSlices().

249  {
250  if (nSectors > 1) {
251  auto sectorConfig = iConfig.getParameter<std::vector<edm::ParameterSet>>(prefix + "Sectors");
252  if (sectorConfig.size() != nSectors)
253  throw cms::Exception("Configuration")
254  << "Mismatched number of " << prefix << "Sectors, expected " << nSectors << std::endl;
255  for (unsigned int iS = 0; iS < nSectors; ++iS) {
256  configLinks(sectorConfig[iS], prefix, linksFactor, linksFactor > 1 ? iS * 10 : iS);
257  }
258  } else {
259  configLinks(iConfig, prefix, linksFactor, 0);
260  }
261 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
void configLinks(const edm::ParameterSet &iConfig, const std::string &prefix, unsigned int linksFactor, unsigned int offset)

◆ configTimeSlices()

void L1TCorrelatorLayer1PatternFileWriter::configTimeSlices ( const edm::ParameterSet iConfig,
const std::string &  prefix,
unsigned int  nSectors,
unsigned int  nTimeSlices,
unsigned int  linksFactor 
)
private

Definition at line 220 of file L1TCorrelatorLayer1PatternFileWriter.cc.

References configSectors(), edm::ParameterSet::getParameter(), and hcallasereventfilter2012_cfi::prefix.

Referenced by L1TCorrelatorLayer1PatternFileWriter().

224  {
225  if (nTimeSlices > 1) {
226  auto timeSliceConfig = iConfig.getParameter<std::vector<edm::ParameterSet>>(prefix + "TimeSlices");
227  if (timeSliceConfig.size() != nTimeSlices)
228  throw cms::Exception("Configuration")
229  << "Mismatched number of " << prefix << "TimeSlices, expected " << nTimeSlices << std::endl;
230  for (unsigned int iT = 0; iT < nTimeSlices; ++iT) {
231  configSectors(timeSliceConfig[iT], prefix, nSectors, linksFactor);
232  }
233  } else {
234  configSectors(iConfig, prefix, nSectors, linksFactor);
235  }
236 }
void configSectors(const edm::ParameterSet &iConfig, const std::string &prefix, unsigned int nSectors, unsigned int linksFactor)
T getParameter(std::string const &) const
Definition: ParameterSet.h:307

◆ describeEG()

std::unique_ptr< edm::ParameterDescriptionNode > L1TCorrelatorLayer1PatternFileWriter::describeEG ( )
staticprivate

Definition at line 163 of file L1TCorrelatorLayer1PatternFileWriter.cc.

Referenced by getParameterSetDescription().

163  {
164  return edm::ParameterDescription<int32_t>("outputLinkEgamma", -1, true) and
165  edm::ParameterDescription<uint32_t>("nEgammaObjectsOut", 16, true) and
166  edm::ParameterDescription<int32_t>("outputBoard", -1, true);
167 }
HLT enums.

◆ describeGCT()

std::unique_ptr< edm::ParameterDescriptionNode > L1TCorrelatorLayer1PatternFileWriter::describeGCT ( )
staticprivate

Definition at line 142 of file L1TCorrelatorLayer1PatternFileWriter.cc.

References edm::ParameterSetDescription::add().

Referenced by getParameterSetDescription().

142  {
143  edm::ParameterSetDescription gctSectorPSD;
144  gctSectorPSD.add<std::vector<int32_t>>("gctLinksEcal");
145  gctSectorPSD.add<std::vector<int32_t>>("gctLinksHad");
146  return std::make_unique<edm::ParameterDescription<std::vector<edm::ParameterSet>>>("gctSectors", gctSectorPSD, true);
147 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)

◆ describeGMT()

std::unique_ptr< edm::ParameterDescriptionNode > L1TCorrelatorLayer1PatternFileWriter::describeGMT ( )
staticprivate

Definition at line 151 of file L1TCorrelatorLayer1PatternFileWriter.cc.

References describeTimeSlices().

Referenced by getParameterSetDescription().

151  {
152  return describeTimeSlices("gmt") and edm::ParameterDescription<uint32_t>("gmtNumberOfMuons", 12, true);
153 }
static std::unique_ptr< edm::ParameterDescriptionNode > describeTimeSlices(const std::string &prefix)
HLT enums.

◆ describeGTT()

std::unique_ptr< edm::ParameterDescriptionNode > L1TCorrelatorLayer1PatternFileWriter::describeGTT ( )
staticprivate

Definition at line 154 of file L1TCorrelatorLayer1PatternFileWriter.cc.

References describeTimeSlices().

Referenced by getParameterSetDescription().

154  {
155  return describeTimeSlices("gtt") and
156  edm::ParameterDescription<uint32_t>("gttLatency", 162, true) and // minimal latency is 18 BX
157  edm::ParameterDescription<uint32_t>("gttNumberOfPVs", 10, true);
158 }
static std::unique_ptr< edm::ParameterDescriptionNode > describeTimeSlices(const std::string &prefix)
HLT enums.

◆ describeHGC()

std::unique_ptr< edm::ParameterDescriptionNode > L1TCorrelatorLayer1PatternFileWriter::describeHGC ( )
staticprivate

Definition at line 148 of file L1TCorrelatorLayer1PatternFileWriter.cc.

References describeTimeSlices().

Referenced by getParameterSetDescription().

148  {
149  return describeTimeSlices("hgc");
150 }
static std::unique_ptr< edm::ParameterDescriptionNode > describeTimeSlices(const std::string &prefix)

◆ describeLinks()

std::unique_ptr< edm::ParameterDescriptionNode > L1TCorrelatorLayer1PatternFileWriter::describeLinks ( const std::string &  prefix)
staticprivate

◆ describePuppi()

std::unique_ptr< edm::ParameterDescriptionNode > L1TCorrelatorLayer1PatternFileWriter::describePuppi ( )
staticprivate

◆ describeSectors()

std::unique_ptr< edm::ParameterDescriptionNode > L1TCorrelatorLayer1PatternFileWriter::describeSectors ( const std::string &  prefix)
staticprivate

Definition at line 263 of file L1TCorrelatorLayer1PatternFileWriter.cc.

References edm::ParameterSetDescription::addNode(), describeLinks(), and hcallasereventfilter2012_cfi::prefix.

Referenced by describeTimeSlices().

264  {
265  edm::ParameterSetDescription sectorsPSD;
266  sectorsPSD.addNode(describeLinks(prefix));
267  return edm::ParameterDescription<std::vector<edm::ParameterSet>>(prefix + "Sectors", sectorsPSD, true) xor
269 }
static std::unique_ptr< edm::ParameterDescriptionNode > describeLinks(const std::string &prefix)
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)

◆ describeTF()

std::unique_ptr< edm::ParameterDescriptionNode > L1TCorrelatorLayer1PatternFileWriter::describeTF ( )
staticprivate

Definition at line 139 of file L1TCorrelatorLayer1PatternFileWriter.cc.

References describeTimeSlices().

Referenced by getParameterSetDescription().

139  {
140  return describeTimeSlices("tf");
141 }
static std::unique_ptr< edm::ParameterDescriptionNode > describeTimeSlices(const std::string &prefix)

◆ describeTimeSlices()

std::unique_ptr< edm::ParameterDescriptionNode > L1TCorrelatorLayer1PatternFileWriter::describeTimeSlices ( const std::string &  prefix)
staticprivate

Definition at line 238 of file L1TCorrelatorLayer1PatternFileWriter.cc.

References edm::ParameterSetDescription::addNode(), describeSectors(), and hcallasereventfilter2012_cfi::prefix.

Referenced by describeGMT(), describeGTT(), describeHGC(), and describeTF().

239  {
240  edm::ParameterSetDescription timeslicesPSD;
241  timeslicesPSD.addNode(describeSectors(prefix));
242  return edm::ParameterDescription<std::vector<edm::ParameterSet>>(prefix + "TimeSlices", timeslicesPSD, true) xor
244 }
ParameterDescriptionNode * addNode(ParameterDescriptionNode const &node)
static std::unique_ptr< edm::ParameterDescriptionNode > describeSectors(const std::string &prefix)

◆ flush()

void L1TCorrelatorLayer1PatternFileWriter::flush ( )

Definition at line 449 of file L1TCorrelatorLayer1PatternFileWriter.cc.

References inputFileWriter_, and outputFileWriter_.

449  {
450  if (inputFileWriter_)
451  inputFileWriter_->flush();
452  if (outputFileWriter_)
453  outputFileWriter_->flush();
454 }
std::unique_ptr< l1t::demo::BoardDataWriter > inputFileWriter_
std::unique_ptr< l1t::demo::BoardDataWriter > outputFileWriter_

◆ getParameterSetDescription()

edm::ParameterSetDescription L1TCorrelatorLayer1PatternFileWriter::getParameterSetDescription ( )
static

Definition at line 115 of file L1TCorrelatorLayer1PatternFileWriter.cc.

References describeEG(), describeGCT(), describeGMT(), describeGTT(), describeHGC(), describePuppi(), describeTF(), makeListRunsInFiles::description, or, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by L1TCorrelatorLayer1Producer::fillDescriptions().

115  {
117  description.add<std::string>("inputFileName", "");
118  description.add<std::string>("inputFileExtension", "txt.gz");
119  description.add<uint32_t>("maxLinesPerInputFile", 1024u);
120  description.add<uint32_t>("nInputFramesPerBX", 9u);
121  description.add<std::string>("outputFileName", "");
122  description.add<std::string>("outputFileExtension", "txt.gz");
123  description.add<uint32_t>("maxLinesPerOutputFile", 1024u);
124  description.add<uint32_t>("nOutputFramesPerBX", 9u);
125  description.add<uint32_t>("tmuxFactor", 6u);
126  description.add<uint32_t>("eventsPerFile", 12u);
127  description.add<std::string>("fileFormat");
128 
129  description.ifValue(edm::ParameterDescription<std::string>("partition", "Barrel", true),
130  "Barrel" >> (describeTF() and describeGCT() and describeGTT() and describeGMT() and
131  describePuppi() and describeEG()) or
132  "HGCal" >> (describeTF() and describeHGC() and describeGTT() and describeGMT() and
133  describePuppi() and describeEG()) or
134  "HGCalNoTk" >> (describeHGC() and describeGMT() and describePuppi()) or
135  "HF" >> (describePuppi()));
136  return description;
137 }
static std::unique_ptr< edm::ParameterDescriptionNode > describeHGC()
static std::unique_ptr< edm::ParameterDescriptionNode > describePuppi()
static std::unique_ptr< edm::ParameterDescriptionNode > describeEG()
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
static std::unique_ptr< edm::ParameterDescriptionNode > describeGTT()
static std::unique_ptr< edm::ParameterDescriptionNode > describeGCT()
static std::unique_ptr< edm::ParameterDescriptionNode > describeTF()
static std::unique_ptr< edm::ParameterDescriptionNode > describeGMT()

◆ parsePartition()

L1TCorrelatorLayer1PatternFileWriter::Partition L1TCorrelatorLayer1PatternFileWriter::parsePartition ( const std::string &  partition)
staticprivate

◆ write()

void L1TCorrelatorLayer1PatternFileWriter::write ( const l1ct::Event event)

Definition at line 169 of file L1TCorrelatorLayer1PatternFileWriter.cc.

References Barrel, eventIndex_, eventsPerFile_, HGCal, HGCalNoTk, inputFileWriter_, PixelMapPlotter::inputs, outputFileWriter_, outputLinkEgamma_, PatBasicFWLiteJetAnalyzer_Selector_cfg::outputs, partition_, writeBarrelGCT(), writeEgamma(), writeGMT(), writeGTT(), writeHGC(), writeInputs_, writeOutputs_, writePuppi(), and writeTF().

169  {
170  if (writeInputs_) {
173  writeTF(event, inputs);
174  }
175  if (partition_ == Partition::Barrel) {
177  }
180  }
183  }
186  }
187  inputFileWriter_->addEvent(inputs);
188  }
189 
190  if (writeOutputs_) {
193  if (outputLinkEgamma_ != -1)
195  outputFileWriter_->addEvent(outputs);
196  }
197 
198  eventIndex_++;
199  if (eventIndex_ % eventsPerFile_ == 0) {
200  if (writeInputs_)
201  inputFileWriter_->flush();
202  if (writeOutputs_)
203  outputFileWriter_->flush();
204  }
205 }
void writeGMT(const l1ct::Event &event, l1t::demo::EventData &out)
std::unique_ptr< l1t::demo::BoardDataWriter > inputFileWriter_
void writeGTT(const l1ct::Event &event, l1t::demo::EventData &out)
void writePuppi(const l1ct::Event &event, l1t::demo::EventData &out)
void writeTF(const l1ct::Event &event, l1t::demo::EventData &out)
void writeBarrelGCT(const l1ct::Event &event, l1t::demo::EventData &out)
std::unique_ptr< l1t::demo::BoardDataWriter > outputFileWriter_
void writeHGC(const l1ct::Event &event, l1t::demo::EventData &out)
Class representing information phase-2 ATCA I/O data corresponding to a single event, with logical channel IDs (essentially string-uint pairs, e.g. tracks-0 to tracks-17).
Definition: EventData.h:28
void writeEgamma(const l1ct::OutputBoard &egboard, std::vector< ap_uint< 64 >> &out)
Definition: event.py:1

◆ writeBarrelGCT()

void L1TCorrelatorLayer1PatternFileWriter::writeBarrelGCT ( const l1ct::Event event,
l1t::demo::EventData out 
)
private

Definition at line 355 of file L1TCorrelatorLayer1PatternFileWriter.cc.

References channelIdsInput_, gctLinksEcal_, gctLinksHad_, gctSectors_, mps_fire::i, MillePedeFileConverter_cfg::out, timeUnitHelper::pack(), and runTheMatrix::ret.

Referenced by write().

355  {
356  std::vector<ap_uint<64>> ret;
357  for (unsigned int iS = 0; iS < gctSectors_; ++iS) {
358  l1t::demo::LinkId key0{"gct", iS * 10};
359  if (channelIdsInput_.count(key0) == 0)
360  continue;
361  const auto& had = event.decoded.hadcalo[iS];
362  const auto& ecal = event.decoded.emcalo[iS];
363  unsigned int iLink = 0, nHad = had.size(), nEcal = ecal.size();
364  for (unsigned int i = 0; i < gctLinksHad_; ++i, ++iLink) {
365  ret.clear();
366  for (unsigned int iHad = i; iHad < nHad; iHad += gctLinksHad_) {
367  ret.emplace_back(had[iHad].pack());
368  }
369  if (ret.empty())
370  ret.emplace_back(0);
371  out.add(l1t::demo::LinkId{"gct", iS * 10 + iLink}, ret);
372  }
373  for (unsigned int i = 0; i < gctLinksEcal_; ++i, ++iLink) {
374  ret.clear();
375  for (unsigned int iEcal = i; iEcal < nEcal; iEcal += gctLinksEcal_) {
376  ret.emplace_back(ecal[iEcal].pack());
377  }
378  if (ret.empty())
379  ret.emplace_back(0);
380  out.add(l1t::demo::LinkId{"gct", iS * 10 + iLink}, ret);
381  }
382  }
383 }
def pack(high, low)
Logical ID for link within any given time slice (e.g. ["tracks", 0] -> ["tracks", 17] for links from ...
Definition: LinkId.h:10
ret
prodAgent to be discontinued
std::map< l1t::demo::LinkId, std::vector< size_t > > channelIdsInput_

◆ writeEgamma() [1/2]

void L1TCorrelatorLayer1PatternFileWriter::writeEgamma ( const l1ct::OutputBoard egboard,
std::vector< ap_uint< 64 >> &  out 
)
private

Definition at line 418 of file L1TCorrelatorLayer1PatternFileWriter.cc.

References l1ct::OutputBoard::egelectron, l1ct::OutputBoard::egphoton, nEgammaObjectsOut_, AlCaHLTBitMon_ParallelJobs::p, and runTheMatrix::ret.

Referenced by write(), and writeEgamma().

419  {
420  unsigned int s0 = ret.size();
421  const auto& pho = egboard.egphoton;
422  const auto& ele = egboard.egelectron;
423  ret.reserve(s0 + 3 * nEgammaObjectsOut_);
424  for (const auto& p : pho) {
425  ret.emplace_back(p.pack());
426  }
427  ret.resize(s0 + nEgammaObjectsOut_, ap_uint<64>(0));
428  for (const auto& p : ele) {
429  ap_uint<128> dword = p.pack();
430  ret.push_back(dword(63, 0));
431  ret.push_back(dword(127, 64));
432  }
433  ret.resize(s0 + 3 * nEgammaObjectsOut_, ap_uint<64>(0));
434 }
ret
prodAgent to be discontinued
std::vector< EGIsoEleObjEmu > egelectron
std::vector< EGIsoObjEmu > egphoton

◆ writeEgamma() [2/2]

void L1TCorrelatorLayer1PatternFileWriter::writeEgamma ( const l1ct::Event event,
l1t::demo::EventData out 
)
private

Definition at line 436 of file L1TCorrelatorLayer1PatternFileWriter.cc.

References HGCal, nOutputFramesPerBX_, MillePedeFileConverter_cfg::out, outputBoard_, partition_, runTheMatrix::ret, tmuxFactor_, and writeEgamma().

436  {
437  std::vector<ap_uint<64>> ret;
438  if (partition_ == Partition::HGCal && tmuxFactor_ == 18) {
439  // the format is different, as we put together both endcaps
440  writeEgamma(event.board_out[0], ret);
441  ret.resize(nOutputFramesPerBX_ * tmuxFactor_ / 2, ap_uint<64>(0));
442  writeEgamma(event.board_out[1], ret);
443  } else {
444  writeEgamma(event.board_out[outputBoard_], ret);
445  }
446  out.add(l1t::demo::LinkId{"egamma", 0}, ret);
447 }
Logical ID for link within any given time slice (e.g. ["tracks", 0] -> ["tracks", 17] for links from ...
Definition: LinkId.h:10
ret
prodAgent to be discontinued
void writeEgamma(const l1ct::OutputBoard &egboard, std::vector< ap_uint< 64 >> &out)
Definition: event.py:1

◆ writeGMT()

void L1TCorrelatorLayer1PatternFileWriter::writeGMT ( const l1ct::Event event,
l1t::demo::EventData out 
)
private

Definition at line 385 of file L1TCorrelatorLayer1PatternFileWriter.cc.

References channelIdsInput_, gmtNumberOfMuons_, submitPVResolutionJobs::key, DiMuonV_cfg::muons, and MillePedeFileConverter_cfg::out.

Referenced by write().

385  {
386  l1t::demo::LinkId key{"gmt", 0};
387  if (channelIdsInput_.count(key) == 0)
388  return;
389  std::vector<ap_uint<64>> muons = event.raw.muon.obj;
390  muons.resize(gmtNumberOfMuons_, ap_uint<64>(0));
391  out.add(key, muons);
392 }
Logical ID for link within any given time slice (e.g. ["tracks", 0] -> ["tracks", 17] for links from ...
Definition: LinkId.h:10
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
Definition: DiMuonV_cfg.py:214
key
prepare the HTCondor submission files and eventually submit them
std::map< l1t::demo::LinkId, std::vector< size_t > > channelIdsInput_

◆ writeGTT()

void L1TCorrelatorLayer1PatternFileWriter::writeGTT ( const l1ct::Event event,
l1t::demo::EventData out 
)
private

Definition at line 394 of file L1TCorrelatorLayer1PatternFileWriter.cc.

References channelIdsInput_, gttNumberOfPVs_, submitPVResolutionJobs::key, MillePedeFileConverter_cfg::out, and FSQDQM_cfi::pvs.

Referenced by write().

394  {
395  l1t::demo::LinkId key{"gtt", 0};
396  if (channelIdsInput_.count(key) == 0)
397  return;
398  std::vector<ap_uint<64>> pvs = event.pvs_emu;
399  pvs.resize(gttNumberOfPVs_, ap_uint<64>(0));
400  out.add(key, pvs);
401 }
Logical ID for link within any given time slice (e.g. ["tracks", 0] -> ["tracks", 17] for links from ...
Definition: LinkId.h:10
key
prepare the HTCondor submission files and eventually submit them
std::map< l1t::demo::LinkId, std::vector< size_t > > channelIdsInput_

◆ writeHGC()

void L1TCorrelatorLayer1PatternFileWriter::writeHGC ( const l1ct::Event event,
l1t::demo::EventData out 
)
private

Definition at line 323 of file L1TCorrelatorLayer1PatternFileWriter.cc.

References cms::cuda::assert(), channelIdsInput_, eventIndex_, hgcLinksFactor_, hgcTimeslices_, dqmiolumiharvest::j, MillePedeFileConverter_cfg::out, runTheMatrix::ret, and tmuxFactor_.

Referenced by write().

323  {
324  assert(hgcLinksFactor_ == 4); // this piece of code won't really work otherwise
325  std::vector<ap_uint<64>> ret[hgcLinksFactor_];
326  for (unsigned int iS = 0, nS = event.raw.hgcalcluster.size(); iS < nS; ++iS) {
327  l1t::demo::LinkId key0{"hgc", iS * 10};
328  if (channelIdsInput_.count(key0) == 0)
329  continue;
330  for (unsigned int il = 0; il < hgcLinksFactor_; ++il) {
331  // put header word and (dummy) towers
332  ret[il].resize(31);
333  ap_uint<64>& head64 = ret[il][0];
334  head64(63, 48) = 0xABC0; // Magic
335  head64(47, 38) = 0; // Opaque
336  head64(39, 32) = (eventIndex_ % hgcTimeslices_) * tmuxFactor_; // TM slice
337  head64(31, 24) = iS; // Sector
338  head64(23, 16) = il; // link
339  head64(15, 0) = eventIndex_ % 3564; // BX
340  for (unsigned int j = 0; j < 30; ++j) {
341  ret[il][j + 1] = 4 * j + il;
342  }
343  }
344  for (auto clust : event.raw.hgcalcluster[iS].obj) {
345  for (unsigned int il = 0; il < hgcLinksFactor_; ++il) {
346  ret[il].push_back(clust(64 * il + 63, 64 * il));
347  }
348  }
349  for (unsigned int il = 0; il < hgcLinksFactor_; ++il) {
350  out.add(l1t::demo::LinkId{"hgc", iS * 10 + il}, ret[il]);
351  }
352  }
353 }
Logical ID for link within any given time slice (e.g. ["tracks", 0] -> ["tracks", 17] for links from ...
Definition: LinkId.h:10
ret
prodAgent to be discontinued
assert(be >=bs)
std::map< l1t::demo::LinkId, std::vector< size_t > > channelIdsInput_
Definition: event.py:1

◆ writePuppi()

void L1TCorrelatorLayer1PatternFileWriter::writePuppi ( const l1ct::Event event,
l1t::demo::EventData out 
)
private

Definition at line 403 of file L1TCorrelatorLayer1PatternFileWriter.cc.

References mps_fire::i, electronStore::links, dqmiodumpmetadata::n, nPuppiFramesPerRegion_, MillePedeFileConverter_cfg::out, outputLinksPuppi_, outputRegions_, and timeUnitHelper::pack().

Referenced by write().

403  {
404  unsigned int n = outputLinksPuppi_.size();
405  std::vector<std::vector<ap_uint<64>>> links(n);
406  for (auto ir : outputRegions_) {
407  auto puppi = event.out[ir].puppi;
408  unsigned int npuppi = puppi.size();
409  for (unsigned int i = 0; i < n * nPuppiFramesPerRegion_; ++i) {
410  links[i / nPuppiFramesPerRegion_].push_back(i < npuppi ? puppi[i].pack() : ap_uint<l1ct::PuppiObj::BITWIDTH>(0));
411  }
412  }
413  for (unsigned int i = 0; i < n; ++i) {
414  out.add(l1t::demo::LinkId{"puppi", i}, links[i]);
415  }
416 }
def pack(high, low)
Logical ID for link within any given time slice (e.g. ["tracks", 0] -> ["tracks", 17] for links from ...
Definition: LinkId.h:10

◆ writeTF()

void L1TCorrelatorLayer1PatternFileWriter::writeTF ( const l1ct::Event event,
l1t::demo::EventData out 
)
private

Definition at line 299 of file L1TCorrelatorLayer1PatternFileWriter.cc.

References channelIdsInput_, mps_fire::i, submitPVResolutionJobs::key, dqmiodumpmetadata::n, MillePedeFileConverter_cfg::out, runTheMatrix::ret, and DiMuonV_cfg::tracks.

Referenced by write().

299  {
300  for (unsigned int iS = 0, nS = event.raw.track.size(); iS < nS; ++iS) {
301  l1t::demo::LinkId key{"tf", iS};
302  if (channelIdsInput_.count(key) == 0)
303  continue;
304  std::vector<ap_uint<64>> ret;
305  std::vector<ap_uint<96>> tracks = event.raw.track[iS].obj;
306  if (tracks.empty())
307  tracks.emplace_back(0);
308  for (unsigned int i = 0, n = tracks.size(); i < n; ++i) {
309  const ap_uint<96>& packedtk = tracks[i];
310  if (i % 2 == 0) {
311  ret.emplace_back(packedtk(63, 0));
312  ret.emplace_back(0);
313  ret.back()(31, 0) = packedtk(95, 64);
314  } else {
315  ret.back()(63, 32) = packedtk(31, 0);
316  ret.emplace_back(packedtk(95, 32));
317  }
318  }
319  out.add(key, ret);
320  }
321 }
Logical ID for link within any given time slice (e.g. ["tracks", 0] -> ["tracks", 17] for links from ...
Definition: LinkId.h:10
ret
prodAgent to be discontinued
key
prepare the HTCondor submission files and eventually submit them
std::map< l1t::demo::LinkId, std::vector< size_t > > channelIdsInput_
Definition: event.py:1

Member Data Documentation

◆ channelIdsInput_

std::map<l1t::demo::LinkId, std::vector<size_t> > L1TCorrelatorLayer1PatternFileWriter::channelIdsInput_
private

◆ channelIdsOutput_

std::map<l1t::demo::LinkId, std::vector<size_t> > L1TCorrelatorLayer1PatternFileWriter::channelIdsOutput_
private

◆ channelSpecsInput_

std::map<std::string, l1t::demo::ChannelSpec> L1TCorrelatorLayer1PatternFileWriter::channelSpecsInput_
private

◆ channelSpecsOutput_

std::map<std::string, l1t::demo::ChannelSpec> L1TCorrelatorLayer1PatternFileWriter::channelSpecsOutput_
private

◆ eventIndex_

uint32_t L1TCorrelatorLayer1PatternFileWriter::eventIndex_
private

Definition at line 52 of file L1TCorrelatorLayer1PatternFileWriter.h.

Referenced by write(), and writeHGC().

◆ eventsPerFile_

const uint32_t L1TCorrelatorLayer1PatternFileWriter::eventsPerFile_
private

Definition at line 51 of file L1TCorrelatorLayer1PatternFileWriter.h.

Referenced by write().

◆ fileFormat_

const std::string L1TCorrelatorLayer1PatternFileWriter::fileFormat_
private

◆ gctLinksEcal_

const unsigned int L1TCorrelatorLayer1PatternFileWriter::gctLinksEcal_ = 1
private

◆ gctLinksHad_

const unsigned int L1TCorrelatorLayer1PatternFileWriter::gctLinksHad_ = 2
private

◆ gctSectors_

const unsigned int L1TCorrelatorLayer1PatternFileWriter::gctSectors_ = 3
private

◆ gctTimeslices_

const unsigned int L1TCorrelatorLayer1PatternFileWriter::gctTimeslices_
private

◆ gctTmuxFactor_

const unsigned int L1TCorrelatorLayer1PatternFileWriter::gctTmuxFactor_ = 1
private

Definition at line 32 of file L1TCorrelatorLayer1PatternFileWriter.h.

◆ gmtLinksFactor_

const unsigned int L1TCorrelatorLayer1PatternFileWriter::gmtLinksFactor_ = 1
private

◆ gmtNumberOfMuons_

uint32_t L1TCorrelatorLayer1PatternFileWriter::gmtNumberOfMuons_
private

◆ gmtTimeslices_

const unsigned int L1TCorrelatorLayer1PatternFileWriter::gmtTimeslices_
private

◆ gmtTmuxFactor_

const unsigned int L1TCorrelatorLayer1PatternFileWriter::gmtTmuxFactor_ = 18
private

Definition at line 34 of file L1TCorrelatorLayer1PatternFileWriter.h.

◆ gttLatency_

uint32_t L1TCorrelatorLayer1PatternFileWriter::gttLatency_
private

◆ gttLinksFactor_

const unsigned int L1TCorrelatorLayer1PatternFileWriter::gttLinksFactor_ = 1
private

◆ gttNumberOfPVs_

uint32_t L1TCorrelatorLayer1PatternFileWriter::gttNumberOfPVs_
private

◆ gttTimeslices_

const unsigned int L1TCorrelatorLayer1PatternFileWriter::gttTimeslices_
private

◆ gttTmuxFactor_

const unsigned int L1TCorrelatorLayer1PatternFileWriter::gttTmuxFactor_ = 6
private

Definition at line 35 of file L1TCorrelatorLayer1PatternFileWriter.h.

◆ hgcLinksFactor_

const unsigned int L1TCorrelatorLayer1PatternFileWriter::hgcLinksFactor_ = 4
private

◆ hgcTimeslices_

const unsigned int L1TCorrelatorLayer1PatternFileWriter::hgcTimeslices_
private

◆ hgcTmuxFactor_

const unsigned int L1TCorrelatorLayer1PatternFileWriter::hgcTmuxFactor_ = 18
private

Definition at line 31 of file L1TCorrelatorLayer1PatternFileWriter.h.

◆ inputFileWriter_

std::unique_ptr<l1t::demo::BoardDataWriter> L1TCorrelatorLayer1PatternFileWriter::inputFileWriter_
private

◆ nEgammaObjectsOut_

uint32_t L1TCorrelatorLayer1PatternFileWriter::nEgammaObjectsOut_
private

◆ nInputFramesPerBX_

uint32_t L1TCorrelatorLayer1PatternFileWriter::nInputFramesPerBX_
private

◆ nOutputFramesPerBX_

uint32_t L1TCorrelatorLayer1PatternFileWriter::nOutputFramesPerBX_
private

◆ nPuppiFramesPerRegion_

unsigned int L1TCorrelatorLayer1PatternFileWriter::nPuppiFramesPerRegion_
private

◆ outputBoard_

int32_t L1TCorrelatorLayer1PatternFileWriter::outputBoard_
private

◆ outputFileWriter_

std::unique_ptr<l1t::demo::BoardDataWriter> L1TCorrelatorLayer1PatternFileWriter::outputFileWriter_
private

◆ outputLinkEgamma_

int32_t L1TCorrelatorLayer1PatternFileWriter::outputLinkEgamma_
private

◆ outputLinksPuppi_

std::vector<uint32_t> L1TCorrelatorLayer1PatternFileWriter::outputLinksPuppi_
private

◆ outputRegions_

std::vector<uint32_t> L1TCorrelatorLayer1PatternFileWriter::outputRegions_
private

◆ partition_

Partition L1TCorrelatorLayer1PatternFileWriter::partition_
private

◆ tfLinksFactor_

const unsigned int L1TCorrelatorLayer1PatternFileWriter::tfLinksFactor_ = 1
private

◆ tfTimeslices_

const unsigned int L1TCorrelatorLayer1PatternFileWriter::tfTimeslices_
private

◆ tfTmuxFactor_

const unsigned int L1TCorrelatorLayer1PatternFileWriter::tfTmuxFactor_ = 18
private

◆ tmuxFactor_

const unsigned int L1TCorrelatorLayer1PatternFileWriter::tmuxFactor_
private

◆ writeInputs_

bool L1TCorrelatorLayer1PatternFileWriter::writeInputs_
private

◆ writeOutputs_

bool L1TCorrelatorLayer1PatternFileWriter::writeOutputs_
private