CMS 3D CMS Logo

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

Public Member Functions

 L1CTJetFileWriter (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources >
 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices 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
 
std::vector< ap_uint< 64 > > encodeJets (const std::vector< l1t::PFJet > jets)
 
void endJob () override
 

Private Attributes

std::map< l1t::demo::LinkId, std::pair< l1t::demo::ChannelSpec, std::vector< size_t > > > channelSpecsOutputToGT_
 
size_t ctl2BoardTMUX_
 
l1t::demo::BoardDataWriter fileWriterOutputToGT_
 
size_t gapLengthOutput_
 
edm::EDGetTokenT< edm::View< l1t::PFJet > > jetsToken_
 
size_t maxLinesPerFile_
 
size_t nFramesPerBX_
 
unsigned nJets_
 

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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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 24 of file L1CTJetFileWriter.cc.

Constructor & Destructor Documentation

◆ L1CTJetFileWriter()

L1CTJetFileWriter::L1CTJetFileWriter ( const edm::ParameterSet iConfig)
explicit

Definition at line 48 of file L1CTJetFileWriter.cc.

References ctl2BoardTMUX_, and gapLengthOutput_.

49  : nJets_(iConfig.getParameter<unsigned>("nJets")),
50  nFramesPerBX_(iConfig.getParameter<unsigned>("nFramesPerBX")),
51  ctl2BoardTMUX_(iConfig.getParameter<unsigned>("TMUX")),
53  maxLinesPerFile_(iConfig.getParameter<unsigned>("maxLinesPerFile")),
57  iConfig.getParameter<std::string>("outputFilename"),
std::map< l1t::demo::LinkId, std::pair< l1t::demo::ChannelSpec, std::vector< size_t > > > channelSpecsOutputToGT_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
FileFormat parseFileFormat(const std::string &)
Definition: utilities.cc:70
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
l1t::demo::BoardDataWriter fileWriterOutputToGT_
edm::EDGetTokenT< edm::View< l1t::PFJet > > jetsToken_

Member Function Documentation

◆ analyze()

void L1CTJetFileWriter::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 63 of file L1CTJetFileWriter.cc.

References l1t::demo::EventData::add(), l1t::demo::BoardDataWriter::addEvent(), filterCSVwithJSON::copy, encodeJets(), fileWriterOutputToGT_, mps_fire::i, iEvent, dqmiolumiharvest::j, PDWG_EXODelayedJetMET_cff::jets, and jetsToken_.

63  {
64  using namespace edm;
65 
66  // 1) Encode jet information onto vectors containing link data
67  // TODO remove the sort here and sort the input collection where it's created
69  std::vector<l1t::PFJet> sortedJets;
70  sortedJets.reserve(jets.size());
71  std::copy(jets.begin(), jets.end(), std::back_inserter(sortedJets));
72 
73  std::stable_sort(
74  sortedJets.begin(), sortedJets.end(), [](l1t::PFJet i, l1t::PFJet j) { return (i.hwPt() > j.hwPt()); });
75  const auto outputJets(encodeJets(sortedJets));
76 
77  // 2) Pack jet information into 'event data' object, and pass that to file writer
78  l1t::demo::EventData eventDataJets;
79  eventDataJets.add({"jets", 0}, outputJets);
80  fileWriterOutputToGT_.addEvent(eventDataJets);
81 }
void addEvent(const EventData &data)
void add(const LinkId &, const std::vector< ap_uint< 64 >> &)
Definition: EventData.cc:14
int iEvent
Definition: GenABIO.cc:224
l1t::demo::BoardDataWriter fileWriterOutputToGT_
std::vector< ap_uint< 64 > > encodeJets(const std::vector< l1t::PFJet > jets)
HLT enums.
edm::EDGetTokenT< edm::View< l1t::PFJet > > jetsToken_
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

◆ encodeJets()

std::vector< ap_uint< 64 > > L1CTJetFileWriter::encodeJets ( const std::vector< l1t::PFJet jets)
private

Definition at line 89 of file L1CTJetFileWriter.cc.

References mps_fire::i, dqmiolumiharvest::j, PDWG_EXODelayedJetMET_cff::jets, and nJets_.

Referenced by analyze().

89  {
90  std::vector<ap_uint<64>> jet_words;
91  for (unsigned i = 0; i < nJets_; i++) {
92  l1t::PFJet j;
93  if (i < jets.size()) {
94  j = jets.at(i);
95  } else { // pad up to nJets_ with null jets
96  l1t::PFJet j(0, 0, 0, 0, 0, 0);
97  }
98  jet_words.push_back(j.encodedJet()[0]);
99  jet_words.push_back(j.encodedJet()[1]);
100  }
101  return jet_words;
102 }

◆ endJob()

void L1CTJetFileWriter::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 84 of file L1CTJetFileWriter.cc.

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

84  {
85  // Writing pending events to file before exiting
87 }
l1t::demo::BoardDataWriter fileWriterOutputToGT_

◆ fillDescriptions()

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

Definition at line 105 of file L1CTJetFileWriter.cc.

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

105  {
106  //The following says we do not know what parameters are allowed so do no validation
107  // Please change this to state exactly what you do use, even if it is no parameters
109  desc.add<edm::InputTag>("jets");
110  desc.add<std::string>("outputFilename");
111  desc.add<uint32_t>("nJets", 12);
112  desc.add<uint32_t>("nFramesPerBX", 9);
113  desc.add<uint32_t>("TMUX", 6);
114  desc.add<uint32_t>("maxLinesPerFile", 1024);
115  desc.add<std::string>("format", "EMP");
116  descriptions.addDefault(desc);
117 }
void addDefault(ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ channelSpecsOutputToGT_

std::map<l1t::demo::LinkId, std::pair<l1t::demo::ChannelSpec, std::vector<size_t> > > L1CTJetFileWriter::channelSpecsOutputToGT_
private

Definition at line 37 of file L1CTJetFileWriter.cc.

◆ ctl2BoardTMUX_

size_t L1CTJetFileWriter::ctl2BoardTMUX_
private

Definition at line 34 of file L1CTJetFileWriter.cc.

Referenced by L1CTJetFileWriter().

◆ fileWriterOutputToGT_

l1t::demo::BoardDataWriter L1CTJetFileWriter::fileWriterOutputToGT_
private

Definition at line 45 of file L1CTJetFileWriter.cc.

Referenced by analyze(), and endJob().

◆ gapLengthOutput_

size_t L1CTJetFileWriter::gapLengthOutput_
private

Definition at line 35 of file L1CTJetFileWriter.cc.

Referenced by L1CTJetFileWriter().

◆ jetsToken_

edm::EDGetTokenT<edm::View<l1t::PFJet> > L1CTJetFileWriter::jetsToken_
private

Definition at line 44 of file L1CTJetFileWriter.cc.

Referenced by analyze().

◆ maxLinesPerFile_

size_t L1CTJetFileWriter::maxLinesPerFile_
private

Definition at line 36 of file L1CTJetFileWriter.cc.

◆ nFramesPerBX_

size_t L1CTJetFileWriter::nFramesPerBX_
private

Definition at line 33 of file L1CTJetFileWriter.cc.

◆ nJets_

unsigned L1CTJetFileWriter::nJets_
private

Definition at line 32 of file L1CTJetFileWriter.cc.

Referenced by encodeJets().