CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
L1GTEvaluationProducer Class Reference
Inheritance diagram for L1GTEvaluationProducer:
edm::one::EDProducer<> edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 L1GTEvaluationProducer (const edm::ParameterSet &)
 
 ~L1GTEvaluationProducer () override=default
 
- Public Member Functions inherited from edm::one::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=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::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) 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 &)
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void endJob () override
 
int nextEta ()
 
int nextPhi ()
 
int nextPt ()
 
int nextValue (int mean=1000, bool sign=false, int max=std::numeric_limits< int >::max())
 
void produce (edm::Event &, const edm::EventSetup &) override
 
void writeInputPatterns (const std::unordered_map< std::string, std::vector< std::unique_ptr< l1t::L1TGT_BaseInterface >>> &inputObjects)
 
void writeOutputPatterns (const std::unordered_map< std::string, std::vector< std::unique_ptr< l1t::L1TGT_BaseInterface >>> &inputObjects)
 

Private Attributes

l1t::demo::BoardDataWriter inputBoardDataWriter_
 
std::unordered_map< std::string, std::size_t > numChannels_
 
l1t::demo::BoardDataWriter outputBoardDataWriter_
 
std::mt19937 randomGenerator_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- 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 38 of file L1GTEvaluationProducer.cc.

Constructor & Destructor Documentation

◆ L1GTEvaluationProducer()

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

Definition at line 112 of file L1GTEvaluationProducer.cc.

References edm::ParameterSet::getUntrackedParameter().

113  : randomGenerator_(config.exists("random_seed") ? config.getUntrackedParameter<unsigned int>("random_seed")
114  : std::random_device()()),
116  l1t::demo::parseFileFormat(config.getUntrackedParameter<std::string>("patternFormat")),
117  config.getUntrackedParameter<std::string>("inputFilename"),
118  config.getUntrackedParameter<std::string>("inputFileExtension"),
119  9,
120  1,
121  config.getUntrackedParameter<unsigned int>("maxFrames"),
122  [&]() {
123  const edm::ParameterSet &iChannels = config.getUntrackedParameterSet("InputChannels");
124  demo::BoardDataWriter::ChannelMap_t channelMap;
125 
126  channelMap.insert(
127  {{"GCT", 1},
128  {{6, 0}, vconvert<std::size_t>(iChannels.getUntrackedParameter<std::vector<unsigned int>>("GCT_1"))}});
129  channelMap.insert(
130  {{"GMT", 1},
131  {{18, 0},
132  vconvert<std::size_t>(iChannels.getUntrackedParameter<std::vector<unsigned int>>("GMT_1"))}});
133  channelMap.insert(
134  {{"GTT", 1},
135  {{6, 0}, vconvert<std::size_t>(iChannels.getUntrackedParameter<std::vector<unsigned int>>("GTT_1"))}});
136  channelMap.insert(
137  {{"GTT", 2},
138  {{6, 0}, vconvert<std::size_t>(iChannels.getUntrackedParameter<std::vector<unsigned int>>("GTT_2"))}});
139  channelMap.insert(
140  {{"GTT", 3},
141  {{6, 0}, vconvert<std::size_t>(iChannels.getUntrackedParameter<std::vector<unsigned int>>("GTT_3"))}});
142  channelMap.insert(
143  {{"GTT", 4},
144  {{6, 0}, vconvert<std::size_t>(iChannels.getUntrackedParameter<std::vector<unsigned int>>("GTT_4"))}});
145  channelMap.insert(
146  {{"CL2", 1},
147  {{6, 0}, vconvert<std::size_t>(iChannels.getUntrackedParameter<std::vector<unsigned int>>("CL2_1"))}});
148  channelMap.insert(
149  {{"CL2", 2},
150  {{6, 0}, vconvert<std::size_t>(iChannels.getUntrackedParameter<std::vector<unsigned int>>("CL2_2"))}});
151  channelMap.insert(
152  {{"CL2", 3},
153  {{6, 0}, vconvert<std::size_t>(iChannels.getUntrackedParameter<std::vector<unsigned int>>("CL2_3"))}});
154 
155  return channelMap;
156  }()),
157  numChannels_(),
158  outputBoardDataWriter_(l1t::demo::parseFileFormat(config.getUntrackedParameter<std::string>("patternFormat")),
159  config.getUntrackedParameter<std::string>("outputFilename"),
160  config.getUntrackedParameter<std::string>("outputFileExtension"),
161  9,
162  1,
163  config.getUntrackedParameter<unsigned int>("maxFrames"),
164  [&]() {
165  const edm::ParameterSet &oChannels = config.getUntrackedParameterSet("OutputChannels");
166  demo::BoardDataWriter::ChannelMap_t channelMap;
167  for (const char *name : AVAILABLE_COLLECTIONS) {
168  if (oChannels.exists(name)) {
169  std::vector<unsigned int> channels =
170  oChannels.getUntrackedParameter<std::vector<unsigned int>>(name);
171  for (std::size_t i = 0; i < channels.size(); i++) {
172  channelMap.insert({{name, i}, {{1, 0}, {channels.at(i)}}});
173  }
174 
175  numChannels_.insert({name, channels.size()});
176  } else {
177  numChannels_.insert({name, 0});
178  }
179  }
180  return channelMap;
181  }()) {
182  for (const char *name : AVAILABLE_COLLECTIONS) {
183  produces<P2GTCandidateCollection>(name);
184  }
185 }
std::unordered_map< std::string, std::size_t > numChannels_
FileFormat parseFileFormat(const std::string &)
Definition: utilities.cc:73
Definition: config.py:1
static constexpr std::array< const char *, 29 > AVAILABLE_COLLECTIONS
l1t::demo::BoardDataWriter inputBoardDataWriter_
l1t::demo::BoardDataWriter outputBoardDataWriter_

◆ ~L1GTEvaluationProducer()

L1GTEvaluationProducer::~L1GTEvaluationProducer ( )
overridedefault

Member Function Documentation

◆ endJob()

void L1GTEvaluationProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 420 of file L1GTEvaluationProducer.cc.

References l1t::demo::BoardDataWriter::flush(), inputBoardDataWriter_, and outputBoardDataWriter_.

420  {
423 }
l1t::demo::BoardDataWriter inputBoardDataWriter_
l1t::demo::BoardDataWriter outputBoardDataWriter_

◆ fillDescriptions()

void L1GTEvaluationProducer::fillDescriptions ( edm::ConfigurationDescriptions description)
static

Definition at line 187 of file L1GTEvaluationProducer.cc.

References edm::ParameterSetDescription::addOptionalUntracked(), edm::ParameterSetDescription::addUntracked(), AVAILABLE_COLLECTIONS, submitPVResolutionJobs::desc, makeListRunsInFiles::description, mergeVDriftHistosByStation::name, and AlCaHLTBitMon_QueryRunRegistry::string.

187  {
189  desc.addOptionalUntracked<unsigned int>("random_seed");
190  desc.addUntracked<unsigned int>("maxFrames", 1024);
191  desc.addUntracked<std::string>("inputFilename");
192  desc.addUntracked<std::string>("inputFileExtension", "txt");
193  desc.addUntracked<std::string>("outputFilename");
194  desc.addUntracked<std::string>("outputFileExtension", "txt");
195  desc.addUntracked<std::string>("patternFormat", "EMPv2");
196 
197  edm::ParameterSetDescription inputChannelDesc;
198  inputChannelDesc.addUntracked<std::vector<unsigned int>>("GCT_1");
199  inputChannelDesc.addUntracked<std::vector<unsigned int>>("GMT_1");
200  inputChannelDesc.addUntracked<std::vector<unsigned int>>("GTT_1");
201  inputChannelDesc.addUntracked<std::vector<unsigned int>>("GTT_2");
202  inputChannelDesc.addUntracked<std::vector<unsigned int>>("GTT_3");
203  inputChannelDesc.addUntracked<std::vector<unsigned int>>("GTT_4");
204  inputChannelDesc.addUntracked<std::vector<unsigned int>>("CL2_1");
205  inputChannelDesc.addUntracked<std::vector<unsigned int>>("CL2_2");
206  inputChannelDesc.addUntracked<std::vector<unsigned int>>("CL2_3");
207 
208  desc.addUntracked<edm::ParameterSetDescription>("InputChannels", inputChannelDesc);
209 
210  edm::ParameterSetDescription outputChannelDesc;
211  for (const char *name : AVAILABLE_COLLECTIONS) {
212  outputChannelDesc.addOptionalUntracked<std::vector<unsigned int>>(name);
213  }
214 
215  desc.addUntracked<edm::ParameterSetDescription>("OutputChannels", outputChannelDesc);
216 
217  description.addWithDefaultLabel(desc);
218 }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
static constexpr std::array< const char *, 29 > AVAILABLE_COLLECTIONS
ParameterDescriptionBase * addOptionalUntracked(U const &iLabel, T const &value)

◆ nextEta()

int L1GTEvaluationProducer::nextEta ( )
inlineprivate

Definition at line 54 of file L1GTEvaluationProducer.cc.

References ApeEstimator_cff::width.

Referenced by produce().

54  {
55  return std::uniform_int_distribution<int>(-(1 << (P2GTCandidate::hwEta_t::width - 1)),
57  }

◆ nextPhi()

int L1GTEvaluationProducer::nextPhi ( )
inlineprivate

Definition at line 58 of file L1GTEvaluationProducer.cc.

References ApeEstimator_cff::width.

Referenced by produce().

58  {
59  return std::uniform_int_distribution<int>(-(1 << (P2GTCandidate::hwPhi_t::width - 1)),
61  }

◆ nextPt()

int L1GTEvaluationProducer::nextPt ( )
inlineprivate

Definition at line 49 of file L1GTEvaluationProducer.cc.

References ApeEstimator_cff::width.

Referenced by produce().

49  {
50  return std::max<int>(0,
51  nextValue(300, false, (1 << P2GTCandidate::hwPT_t::width) - 1) +
52  std::normal_distribution<double>(0, 500)(randomGenerator_));
53  }
int nextValue(int mean=1000, bool sign=false, int max=std::numeric_limits< int >::max())

◆ nextValue()

int L1GTEvaluationProducer::nextValue ( int  mean = 1000,
bool  sign = false,
int  max = std::numeric_limits<int>::max() 
)
private

Definition at line 220 of file L1GTEvaluationProducer.cc.

References WZElectronSkims53X_cff::max, SiStripPI::mean, randomGenerator_, mps_fire::result, and Validation_hcalonly_cfi::sign.

Referenced by produce().

220  {
221  bool positive = sign ? std::bernoulli_distribution(0.5)(randomGenerator_) : true;
222 
223  int result;
224  do {
225  result = std::poisson_distribution<int>(mean)(randomGenerator_);
226  } while (result > max);
227 
228  return positive ? result : -result;
229 }

◆ produce()

void L1GTEvaluationProducer::produce ( edm::Event event,
const edm::EventSetup setup 
)
overrideprivatevirtual

Implements edm::one::EDProducerBase.

Definition at line 327 of file L1GTEvaluationProducer.cc.

References mps_fire::i, valuemaptraslator_cfi::inputCollection, HLT_2024v14_cff::inputObjects, submitPVResolutionJobs::key, eostools::move(), nextEta(), nextPhi(), nextPt(), nextValue(), default_text_conditions_cfi::object, writeInputPatterns(), and writeOutputPatterns().

327  {
328  // Generate random input objects
329  std::unordered_map<std::string, std::vector<std::unique_ptr<l1t::L1TGT_BaseInterface>>> inputObjects;
330  for (std::size_t i = 0; i < 12; ++i) {
331  // Global Muon Trigger
332  inputObjects["GMTSaPromptMuons"].emplace_back(std::make_unique<l1t::L1TGT_GMT_PromptDisplacedMuon>(
333  true, nextPt(), nextEta(), nextPhi(), nextValue(), nextValue(), nextValue(), nextValue()));
334 
335  inputObjects["GMTSaDisplacedMuons"].emplace_back(std::make_unique<l1t::L1TGT_GMT_PromptDisplacedMuon>(
336  true, nextPt(), nextEta(), nextPhi(), nextValue(), nextValue(), nextValue(), nextValue()));
337  inputObjects["GMTTkMuons"].emplace_back(std::make_unique<l1t::L1TGT_GMT_TrackMatchedmuon>(true,
338  nextPt(),
339  nextEta(),
340  nextPhi(),
341  nextValue(),
342  nextValue(),
343  nextValue(),
344  nextValue(),
345  nextValue(),
346  nextValue()));
347  inputObjects["GMTTopo"].emplace_back(
348  std::make_unique<l1t::L1TGT_GMT_TopoObject>(true, nextPt(), nextEta(), nextPhi(), nextValue(), nextValue()));
349 
350  // Global Calorimeter Trigger
351  inputObjects["GCTNonIsoEg"].emplace_back(
352  std::make_unique<l1t::L1TGT_GCT_EgammaNonIsolated6p6>(true, nextPt(), nextEta(), nextPhi()));
353  inputObjects["GCTIsoEg"].emplace_back(
354  std::make_unique<l1t::L1TGT_GCT_EgammaIsolated6p6>(true, nextPt(), nextEta(), nextPhi()));
355  inputObjects["GCTJets"].emplace_back(std::make_unique<l1t::L1TGT_GCT_jet6p6>(true, nextPt(), nextEta(), nextPhi()));
356  inputObjects["GCTTaus"].emplace_back(
357  std::make_unique<l1t::L1TGT_GCT_tau6p6>(true, nextPt(), nextEta(), nextPhi(), nextValue()));
358 
359  // Global Track Trigger
360  inputObjects["GTTPromptTracks"].emplace_back(std::make_unique<l1t::L1TGT_GTT_Track>());
361  inputObjects["GTTDisplacedTracks"].emplace_back(std::make_unique<l1t::L1TGT_GTT_Track>());
362  inputObjects["GTTPrimaryVert"].emplace_back(
363  std::make_unique<l1t::L1TGT_GTT_PrimaryVert>(true, nextPt(), nextEta(), nextPhi(), nextValue(), nextValue()));
364  inputObjects["GTTPromptJets"].emplace_back(
365  std::make_unique<l1t::L1TGT_GTT_PromptJet>(true, nextPt(), nextEta(), nextPhi(), nextValue(), nextValue()));
366  inputObjects["GTTDisplacedJets"].emplace_back(std::make_unique<l1t::L1TGT_GTT_DisplacedJet>(
367  true, nextPt(), nextEta(), nextPhi(), nextValue(), nextValue(), nextValue()));
368  inputObjects["GTTHadronicTaus"].emplace_back(std::make_unique<l1t::L1TGT_GTT_HadronicTau>(
369  true, nextPt(), nextEta(), nextPhi(), nextValue(), nextValue(), nextValue(), nextValue()));
370  inputObjects["GTTPhiCandidates"].emplace_back(
371  std::make_unique<l1t::L1TGT_GTT_LightMeson>(true, nextPt(), nextEta(), nextPhi(), nextValue()));
372  inputObjects["GTTRhoCandidates"].emplace_back(
373  std::make_unique<l1t::L1TGT_GTT_LightMeson>(true, nextPt(), nextEta(), nextPhi(), nextValue()));
374  inputObjects["GTTBsCandidates"].emplace_back(
375  std::make_unique<l1t::L1TGT_GTT_LightMeson>(true, nextPt(), nextEta(), nextPhi(), nextValue()));
376 
377  // Correlator Layer-2
378  inputObjects["CL2JetsSC4"].emplace_back(
379  std::make_unique<l1t::L1TGT_CL2_Jet>(true, nextPt(), nextEta(), nextPhi(), nextValue()));
380  inputObjects["CL2JetsSC8"].emplace_back(
381  std::make_unique<l1t::L1TGT_CL2_Jet>(true, nextPt(), nextEta(), nextPhi(), nextValue()));
382  inputObjects["CL2Electrons"].emplace_back(std::make_unique<l1t::L1TGT_CL2_Electron>(
383  true, nextPt(), nextEta(), nextPhi(), nextValue(), nextValue(), nextValue(), nextValue()));
384  inputObjects["CL2Photons"].emplace_back(
385  std::make_unique<l1t::L1TGT_CL2_Photon>(true, nextPt(), nextEta(), nextPhi(), nextValue(), nextValue()));
386  inputObjects["CL2Taus"].emplace_back(std::make_unique<l1t::L1TGT_CL2_Tau>(
387  true, nextPt(), nextEta(), nextPhi(), nextValue(), nextValue(), nextValue(), nextValue()));
388  }
389 
390  inputObjects["CL2HtSum"].emplace_back(
391  std::make_unique<l1t::L1TGT_CL2_Sum>(true, nextValue(), nextValue(), nextValue()));
392  inputObjects["CL2EtSum"].emplace_back(
393  std::make_unique<l1t::L1TGT_CL2_Sum>(true, nextValue(), nextValue(), nextValue()));
394  inputObjects["GCTHtSum"].emplace_back(
395  std::make_unique<l1t::L1TGT_GCT_Sum2>(true, nextValue(), nextValue(), nextValue()));
396  inputObjects["GCTEtSum"].emplace_back(
397  std::make_unique<l1t::L1TGT_GCT_Sum2>(true, nextValue(), nextValue(), nextValue()));
398 
399  inputObjects["GTTPromptHtSum"].emplace_back(
400  std::make_unique<l1t::L1TGT_GTT_Sum>(true, nextValue(), nextValue(), nextValue()));
401  inputObjects["GTTDisplacedHtSum"].emplace_back(
402  std::make_unique<l1t::L1TGT_GTT_Sum>(true, nextValue(), nextValue(), nextValue()));
403  inputObjects["GTTEtSum"].emplace_back(
404  std::make_unique<l1t::L1TGT_GTT_Sum>(true, nextValue(), nextValue(), nextValue()));
405 
406  // Write them to a pattern file
409 
410  for (const auto &[key, inputCollection] : inputObjects) {
411  std::unique_ptr<P2GTCandidateCollection> gtCollection = std::make_unique<P2GTCandidateCollection>();
412  for (const auto &object : inputCollection) {
413  gtCollection->emplace_back(object->to_GTObject());
414  }
415 
416  event.put(std::move(gtCollection), key);
417  }
418 }
key
prepare the HTCondor submission files and eventually submit them
void writeOutputPatterns(const std::unordered_map< std::string, std::vector< std::unique_ptr< l1t::L1TGT_BaseInterface >>> &inputObjects)
void writeInputPatterns(const std::unordered_map< std::string, std::vector< std::unique_ptr< l1t::L1TGT_BaseInterface >>> &inputObjects)
int nextValue(int mean=1000, bool sign=false, int max=std::numeric_limits< int >::max())
def move(src, dest)
Definition: eostools.py:511

◆ writeInputPatterns()

void L1GTEvaluationProducer::writeInputPatterns ( const std::unordered_map< std::string, std::vector< std::unique_ptr< l1t::L1TGT_BaseInterface >>> &  inputObjects)
private

Definition at line 267 of file L1GTEvaluationProducer.cc.

References l1t::demo::BoardDataWriter::addEvent(), inputBoardDataWriter_, HLT_2024v14_cff::inputObjects, and vpack().

Referenced by produce().

268  {
270  l1t::demo::EventData{{{{"GTT", 1},
271  vpack(inputObjects.at("GTTPromptJets"),
272  inputObjects.at("GTTDisplacedJets"),
273  inputObjects.at("GTTPromptHtSum"),
274  inputObjects.at("GTTDisplacedHtSum"),
275  inputObjects.at("GTTEtSum"))},
276  {{"GTT", 2}, vpack(inputObjects.at("GTTHadronicTaus"))},
277  {{"CL2", 1},
278  vpack(inputObjects.at("CL2JetsSC4"),
279  inputObjects.at("CL2HtSum"),
280  inputObjects.at("CL2EtSum"),
281  inputObjects.at("CL2JetsSC8"))},
282  {{"CL2", 2}, vpack(inputObjects.at("CL2Taus"))},
283  {{"GCT", 1},
284  vpack(inputObjects.at("GCTNonIsoEg"),
285  inputObjects.at("GCTIsoEg"),
286  inputObjects.at("GCTJets"),
287  inputObjects.at("GCTTaus"),
288  inputObjects.at("GCTEtSum"),
289  inputObjects.at("GCTHtSum"))},
290  {{"GMT", 1},
291  vpack(inputObjects.at("GMTSaPromptMuons"),
292  inputObjects.at("GMTSaDisplacedMuons"),
293  inputObjects.at("GMTTkMuons"),
294  inputObjects.at("GMTTopo"))},
295  {{"CL2", 3}, vpack(inputObjects.at("CL2Electrons"), inputObjects.at("CL2Photons"))},
296  {{"GTT", 3},
297  vpack(inputObjects.at("GTTPhiCandidates"),
298  inputObjects.at("GTTRhoCandidates"),
299  inputObjects.at("GTTBsCandidates"))},
300  {{"GTT", 4},
301  vpack(inputObjects.at("GTTPromptTracks"),
302  inputObjects.at("GTTDisplacedTracks"),
303  inputObjects.at("GTTPrimaryVert"))}}});
304 }
void addEvent(const EventData &data)
l1t::demo::BoardDataWriter inputBoardDataWriter_
static std::vector< ap_uint< 64 > > vpack(const Args &...vobjects)
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

◆ writeOutputPatterns()

void L1GTEvaluationProducer::writeOutputPatterns ( const std::unordered_map< std::string, std::vector< std::unique_ptr< l1t::L1TGT_BaseInterface >>> &  inputObjects)
private

Definition at line 306 of file L1GTEvaluationProducer.cc.

References l1t::demo::BoardDataWriter::addEvent(), AVAILABLE_COLLECTIONS, data, mps_fire::i, dqmiolumiharvest::j, mergeVDriftHistosByStation::name, numChannels_, outputBoardDataWriter_, and vpack().

Referenced by produce().

307  {
308  std::map<demo::LinkId, std::vector<ap_uint<64>>> eventData;
309 
310  for (const char *name : AVAILABLE_COLLECTIONS) {
311  std::vector<ap_uint<64>> data = vpack(outputObjects.at(name));
312 
313  for (std::size_t i = 0; i < numChannels_.at(name); i++) {
314  for (std::size_t j = i; j < data.size(); j += numChannels_.at(name)) {
315  eventData[{name, i}].push_back(data[j]);
316  }
317 
318  while (eventData[{name, i}].size() < 9) {
319  eventData[{name, i}].push_back(0);
320  }
321  }
322  }
323 
324  outputBoardDataWriter_.addEvent(eventData);
325 }
std::unordered_map< std::string, std::size_t > numChannels_
void addEvent(const EventData &data)
static constexpr std::array< const char *, 29 > AVAILABLE_COLLECTIONS
l1t::demo::BoardDataWriter outputBoardDataWriter_
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
static std::vector< ap_uint< 64 > > vpack(const Args &...vobjects)

Member Data Documentation

◆ inputBoardDataWriter_

l1t::demo::BoardDataWriter L1GTEvaluationProducer::inputBoardDataWriter_
private

Definition at line 72 of file L1GTEvaluationProducer.cc.

Referenced by endJob(), and writeInputPatterns().

◆ numChannels_

std::unordered_map<std::string, std::size_t> L1GTEvaluationProducer::numChannels_
private

Definition at line 73 of file L1GTEvaluationProducer.cc.

Referenced by writeOutputPatterns().

◆ outputBoardDataWriter_

l1t::demo::BoardDataWriter L1GTEvaluationProducer::outputBoardDataWriter_
private

Definition at line 74 of file L1GTEvaluationProducer.cc.

Referenced by endJob(), and writeOutputPatterns().

◆ randomGenerator_

std::mt19937 L1GTEvaluationProducer::randomGenerator_
private

Definition at line 71 of file L1GTEvaluationProducer.cc.

Referenced by nextValue().