CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
L1GTAlgoBoardWriter Class Reference
Inheritance diagram for L1GTAlgoBoardWriter:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 L1GTAlgoBoardWriter (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~EDAnalyzerBase () 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void endJob () override
 

Private Attributes

const std::array< unsigned long long, 9 > algoBitMask_
 
const edm::EDGetTokenT< P2GTAlgoBlockMapalgoBlocksToken_
 
l1t::demo::BoardDataWriter boardDataWriter_
 
const std::array< unsigned int, 2 > channels_
 
std::map< l1t::demo::LinkId, std::vector< ap_uint< 64 > > > linkData_
 
std::size_t tmuxCounter_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- 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)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 30 of file L1GTAlgoBoardWriter.cc.

Constructor & Destructor Documentation

◆ L1GTAlgoBoardWriter()

L1GTAlgoBoardWriter::L1GTAlgoBoardWriter ( const edm::ParameterSet config)
explicit

Definition at line 49 of file L1GTAlgoBoardWriter.cc.

References ewkTauDQM_cfi::channels.

50  : channels_(config.getParameter<std::array<unsigned int, 2>>("channels")),
51  algoBitMask_(config.getParameter<std::array<unsigned long long, 9>>("algoBitMask")),
52  algoBlocksToken_(consumes<P2GTAlgoBlockMap>(config.getParameter<edm::InputTag>("algoBlocksTag"))),
54  l1t::demo::parseFileFormat(config.getParameter<std::string>("patternFormat")),
55  config.getParameter<std::string>("outputFilename"),
56  config.getParameter<std::string>("outputFileExtension"),
57  9,
58  2,
59  config.getParameter<unsigned int>("maxLines"),
60  [](const std::array<unsigned int, 2>& channels) {
61  l1t::demo::BoardDataWriter::ChannelMap_t channelMap;
62  for (unsigned int channel : channels) {
63  channelMap.insert({l1t::demo::LinkId{"Algos", channel}, {l1t::demo::ChannelSpec{2, 0, 0}, {channel}}});
64  }
65  return channelMap;
66  }(channels_)),
67  linkData_(),
68  tmuxCounter_(0) {}
const std::array< unsigned long long, 9 > algoBitMask_
const edm::EDGetTokenT< P2GTAlgoBlockMap > algoBlocksToken_
FileFormat parseFileFormat(const std::string &)
Definition: utilities.cc:73
Definition: config.py:1
const std::array< unsigned int, 2 > channels_
std::map< l1t::demo::LinkId, std::vector< ap_uint< 64 > > > linkData_
l1t::demo::BoardDataWriter boardDataWriter_

Member Function Documentation

◆ analyze()

void L1GTAlgoBoardWriter::analyze ( const edm::Event event,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 70 of file L1GTAlgoBoardWriter.cc.

References l1t::demo::BoardDataWriter::addEvent(), algoBitMask_, algoBlocksToken_, MillePedeAlignmentAlgorithm_cfi::algoName, boardDataWriter_, channels_, heavyIonCSV_trainingSettings::idx, linkData_, ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::mask, and tmuxCounter_.

70  {
71  const P2GTAlgoBlockMap& algoBlocks = event.get(algoBlocksToken_);
72 
73  auto algoBlockIt = algoBlocks.begin();
74  auto algoMaskIt = algoBitMask_.begin();
75 
76  for (unsigned int channel : channels_) {
77  if (tmuxCounter_ == 0) {
78  linkData_[{"Algos", channel}] = std::vector<ap_uint<64>>(18, 0);
79  }
80 
81  for (std::size_t word = 0; word < 9; word++) {
82  ap_uint<64> mask = algoMaskIt != algoBitMask_.end() ? *algoMaskIt++ : ~static_cast<unsigned long long>(0);
83 
84  for (std::size_t idx = 0; idx < 64 && algoBlockIt != algoBlocks.end(); idx++, algoBlockIt++) {
85  auto& [algoName, algoBlock] = *algoBlockIt;
86  linkData_[{"Algos", channel}][word + tmuxCounter_ * 9].set(
87  idx, algoBlock.decisionBeforeBxMaskAndPrescale() && mask.bit(idx));
88  }
89  }
90  }
91 
92  if (tmuxCounter_ == 1) {
94  }
95 
96  tmuxCounter_ = (tmuxCounter_ + 1) % 2;
97 }
const std::array< unsigned long long, 9 > algoBitMask_
const edm::EDGetTokenT< P2GTAlgoBlockMap > algoBlocksToken_
void addEvent(const EventData &data)
std::map< std::string, P2GTAlgoBlock > P2GTAlgoBlockMap
Definition: P2GTAlgoBlock.h:11
uint64_t word
const std::array< unsigned int, 2 > channels_
std::map< l1t::demo::LinkId, std::vector< ap_uint< 64 > > > linkData_
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
l1t::demo::BoardDataWriter boardDataWriter_

◆ endJob()

void L1GTAlgoBoardWriter::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 99 of file L1GTAlgoBoardWriter.cc.

References l1t::demo::BoardDataWriter::addEvent(), boardDataWriter_, l1t::demo::BoardDataWriter::flush(), linkData_, and tmuxCounter_.

99  {
100  if (tmuxCounter_ == 1) {
102  }
103 
105 }
void addEvent(const EventData &data)
std::map< l1t::demo::LinkId, std::vector< ap_uint< 64 > > > linkData_
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
l1t::demo::BoardDataWriter boardDataWriter_

◆ fillDescriptions()

void L1GTAlgoBoardWriter::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 107 of file L1GTAlgoBoardWriter.cc.

References edm::ConfigurationDescriptions::addDefault(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

107  {
109  desc.add<std::string>("outputFilename");
110  desc.add<std::string>("outputFileExtension", "txt");
111  desc.add<edm::InputTag>("algoBlocksTag");
112  desc.add<std::vector<unsigned int>>("channels");
113  desc.add<std::vector<unsigned long long>>("algoBitMask",
114  {0xffffffffffffffffull,
115  0xffffffffffffffffull,
116  0xffffffffffffffffull,
117  0xffffffffffffffffull,
118  0xffffffffffffffffull,
119  0xffffffffffffffffull,
120  0xffffffffffffffffull,
121  0xffffffffffffffffull,
122  0xffffffffffffffffull});
123  desc.add<unsigned int>("maxLines", 1024);
124  desc.add<std::string>("patternFormat", "EMPv2");
125 
126  descriptions.addDefault(desc);
127 }
void addDefault(ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ algoBitMask_

const std::array<unsigned long long, 9> L1GTAlgoBoardWriter::algoBitMask_
private

Definition at line 41 of file L1GTAlgoBoardWriter.cc.

Referenced by analyze().

◆ algoBlocksToken_

const edm::EDGetTokenT<P2GTAlgoBlockMap> L1GTAlgoBoardWriter::algoBlocksToken_
private

Definition at line 42 of file L1GTAlgoBoardWriter.cc.

Referenced by analyze().

◆ boardDataWriter_

l1t::demo::BoardDataWriter L1GTAlgoBoardWriter::boardDataWriter_
private

Definition at line 43 of file L1GTAlgoBoardWriter.cc.

Referenced by analyze(), and endJob().

◆ channels_

const std::array<unsigned int, 2> L1GTAlgoBoardWriter::channels_
private

Definition at line 40 of file L1GTAlgoBoardWriter.cc.

Referenced by analyze().

◆ linkData_

std::map<l1t::demo::LinkId, std::vector<ap_uint<64> > > L1GTAlgoBoardWriter::linkData_
private

Definition at line 45 of file L1GTAlgoBoardWriter.cc.

Referenced by analyze(), and endJob().

◆ tmuxCounter_

std::size_t L1GTAlgoBoardWriter::tmuxCounter_
private

Definition at line 46 of file L1GTAlgoBoardWriter.cc.

Referenced by analyze(), and endJob().