CMS 3D CMS Logo

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

Public Member Functions

 L1GTBoardWriter (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 final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const 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
 
bool wantsStreamRuns () const
 
 ~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::vector< unsigned long long > algoBitMask_
 
const edm::EDGetTokenT< P2GTAlgoBlockCollectionalgoBlocksToken_
 
l1t::demo::BoardDataWriter boardDataWriter_
 
const std::vector< unsigned int > channels_
 

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 L1GTBoardWriter.cc.

Constructor & Destructor Documentation

◆ L1GTBoardWriter()

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

Definition at line 46 of file L1GTBoardWriter.cc.

References ewkTauDQM_cfi::channels.

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

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 65 of file L1GTBoardWriter.cc.

References l1t::demo::EventData::add(), l1t::demo::BoardDataWriter::addEvent(), algoBitMask_, algoBlocksToken_, l1t::demo::EventData::begin(), ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::bits, boardDataWriter_, channels_, heavyIonCSV_trainingSettings::idx, and ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering::pixelStatus::mask.

65  {
66  l1t::demo::EventData eventData;
67  const P2GTAlgoBlockCollection& algoBlocks = event.get(algoBlocksToken_);
68 
69  auto algoBlockIt = algoBlocks.begin();
70  auto algoMaskIt = algoBitMask_.begin();
71 
72  for (unsigned int channel : channels_) {
73  std::vector<ap_uint<64>> bits(9, 0);
74  for (std::size_t word = 0; word < 9; word++) {
75  ap_uint<64> mask = algoMaskIt != algoBitMask_.end() ? *algoMaskIt++ : ~static_cast<unsigned long long>(0);
76 
77  for (std::size_t idx = 0; idx < 64 && algoBlockIt != algoBlocks.end(); idx++) {
78  bits[word].set(idx, algoBlockIt->decisionBeforeBxMaskAndPrescale() && mask.bit(idx));
79  algoBlockIt++;
80  }
81  }
82 
83  eventData.add({"Algos", channel}, bits);
84  }
85 
86  boardDataWriter_.addEvent(eventData);
87 }
l1t::demo::BoardDataWriter boardDataWriter_
void addEvent(const EventData &data)
void add(const LinkId &, const std::vector< ap_uint< 64 >> &)
Definition: EventData.cc:14
uint64_t word
const std::vector< unsigned int > channels_
const edm::EDGetTokenT< P2GTAlgoBlockCollection > algoBlocksToken_
const std::vector< unsigned long long > algoBitMask_
std::vector< P2GTAlgoBlock > P2GTAlgoBlockCollection
Definition: P2GTAlgoBlock.h:12
const_iterator begin() const
Definition: EventData.cc:10
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

◆ endJob()

void L1GTBoardWriter::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 89 of file L1GTBoardWriter.cc.

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

l1t::demo::BoardDataWriter boardDataWriter_

◆ fillDescriptions()

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

Definition at line 91 of file L1GTBoardWriter.cc.

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

91  {
93  desc.add<std::string>("outputFilename");
94  desc.add<std::string>("outputFileExtension", "txt");
95  desc.add<edm::InputTag>("algoBlocksTag");
96  desc.add<std::vector<unsigned int>>("channels");
97  desc.add<std::vector<unsigned long long>>("algoBitMask", {});
98  desc.add<unsigned int>("maxLines", 1024);
99  desc.add<std::string>("patternFormat", "EMPv2");
100 
101  descriptions.addDefault(desc);
102 }
void addDefault(ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ algoBitMask_

const std::vector<unsigned long long> L1GTBoardWriter::algoBitMask_
private

Definition at line 41 of file L1GTBoardWriter.cc.

Referenced by analyze().

◆ algoBlocksToken_

const edm::EDGetTokenT<P2GTAlgoBlockCollection> L1GTBoardWriter::algoBlocksToken_
private

Definition at line 42 of file L1GTBoardWriter.cc.

Referenced by analyze().

◆ boardDataWriter_

l1t::demo::BoardDataWriter L1GTBoardWriter::boardDataWriter_
private

Definition at line 43 of file L1GTBoardWriter.cc.

Referenced by analyze(), and endJob().

◆ channels_

const std::vector<unsigned int> L1GTBoardWriter::channels_
private

Definition at line 40 of file L1GTBoardWriter.cc.

Referenced by analyze().