CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
ALPAKA_ACCELERATOR_NAMESPACE::PFRecHitSoAProducer< CAL > Class Template Reference
Inheritance diagram for ALPAKA_ACCELERATOR_NAMESPACE::PFRecHitSoAProducer< CAL >:
ALPAKA_ACCELERATOR_NAMESPACE::global::EDProducer<> edm::ProducerBase< edm::global::EDProducer, Args... >

Public Member Functions

 PFRecHitSoAProducer (edm::ParameterSet const &config)
 
void produce (edm::StreamID, device::Event &event, const device::EventSetup &setup) const override
 
- Public Member Functions inherited from ALPAKA_ACCELERATOR_NAMESPACE::global::EDProducer<>
void produce (edm::StreamID sid, edm::Event &iEvent, edm::EventSetup const &iSetup) const final
 
- Public Member Functions inherited from edm::ProducerBase< edm::global::EDProducer, Args... >
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
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

const device::EDPutToken< reco::PFRecHitDeviceCollectionpfRecHitsToken_
 
std::vector< std::pair< device::EDGetToken< typename CAL::CaloRecHitSoATypeDevice >, device::ESGetToken< typename CAL::ParameterType, typename CAL::ParameterRecordType > > > recHitsToken_
 
const bool synchronise_
 
const device::ESGetToken< typename CAL::TopologyTypeDevice, typename CAL::TopologyRecordType > topologyToken_
 

Additional Inherited Members

- Public Types inherited from edm::ProducerBase< edm::global::EDProducer, Args... >
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
 
- Protected Member Functions inherited from edm::ProducerBase< edm::global::EDProducer, Args... >
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
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)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
BranchAliasSetterT< ProductType > produces ()
 
auto produces () noexcept
 
ProducesCollector producesCollector ()
 

Detailed Description

template<typename CAL>
class ALPAKA_ACCELERATOR_NAMESPACE::PFRecHitSoAProducer< CAL >

Definition at line 21 of file PFRecHitSoAProducer.cc.

Constructor & Destructor Documentation

◆ PFRecHitSoAProducer()

template<typename CAL >
ALPAKA_ACCELERATOR_NAMESPACE::PFRecHitSoAProducer< CAL >::PFRecHitSoAProducer ( edm::ParameterSet const &  config)
inline

Definition at line 23 of file PFRecHitSoAProducer.cc.

References deDxTools::esConsumes(), and HLT_2024v14_cff::producers.

24  : topologyToken_(esConsumes(config.getParameter<edm::ESInputTag>("topology"))),
26  synchronise_(config.getUntrackedParameter<bool>("synchronise")) {
27  const std::vector<edm::ParameterSet> producers = config.getParameter<std::vector<edm::ParameterSet>>("producers");
28  recHitsToken_.reserve(producers.size());
29  for (const edm::ParameterSet& producer : producers) {
30  recHitsToken_.emplace_back(consumes(producer.getParameter<edm::InputTag>("src")),
31  esConsumes(producer.getParameter<edm::ESInputTag>("params")));
32  }
33  }
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
Definition: config.py:1
const device::EDPutToken< reco::PFRecHitDeviceCollection > pfRecHitsToken_
const device::ESGetToken< typename CAL::TopologyTypeDevice, typename CAL::TopologyRecordType > topologyToken_
auto produces(std::string instanceName) noexcept
declare what type of product will make and with which optional label
std::vector< std::pair< device::EDGetToken< typename CAL::CaloRecHitSoATypeDevice >, device::ESGetToken< typename CAL::ParameterType, typename CAL::ParameterRecordType > > > recHitsToken_

Member Function Documentation

◆ fillDescriptions()

template<typename CAL >
static void ALPAKA_ACCELERATOR_NAMESPACE::PFRecHitSoAProducer< CAL >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
inlinestatic

Definition at line 58 of file PFRecHitSoAProducer.cc.

References edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, and HLT_2024v14_cff::producers.

58  {
61  producers.add<edm::InputTag>("src", edm::InputTag(""))->setComment("Input CaloRecHitSoA");
62  producers.add<edm::ESInputTag>("params", edm::ESInputTag(""))->setComment("Quality cut parameters");
63  std::vector<edm::ParameterSet> producersDefault(1);
64  producersDefault[0].addParameter<edm::InputTag>("src", edm::InputTag(""));
65  producersDefault[0].addParameter<edm::ESInputTag>("params", edm::ESInputTag(""));
66  desc.addVPSet("producers", producers, producersDefault)->setComment("List of inputs and quality cuts");
67  desc.add<edm::ESInputTag>("topology", edm::ESInputTag(""))->setComment("Topology information");
68  desc.addUntracked<bool>("synchronise", false)
69  ->setComment("Add synchronisation point after execution (for benchmarking asynchronous execution)");
70  descriptions.addWithDefaultLabel(desc);
71  }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ produce()

template<typename CAL >
void ALPAKA_ACCELERATOR_NAMESPACE::PFRecHitSoAProducer< CAL >::produce ( edm::StreamID  ,
device::Event event,
const device::EventSetup setup 
) const
inlineoverridevirtual

Implements ALPAKA_ACCELERATOR_NAMESPACE::global::EDProducer<>.

Definition at line 35 of file PFRecHitSoAProducer.cc.

References createfilelist::int, eostools::move(), HLT_2024v14_cff::pfRecHits, ALPAKA_ACCELERATOR_NAMESPACE::PFRecHitProducerKernel< CAL >::processRecHits(), singleTopDQM_cfi::setup, unpackBuffers-CaloStage2::token, HLT_2024v14_cff::topology, and SequenceTypes::wait().

35  {
36  const typename CAL::TopologyTypeDevice& topology = setup.getData(topologyToken_);
37 
38  uint32_t num_recHits = 0;
39  for (const auto& token : recHitsToken_)
40  num_recHits += event.get(token.first)->metadata().size();
41 
42  reco::PFRecHitDeviceCollection pfRecHits{(int)num_recHits, event.queue()};
43 
44  if (num_recHits != 0) {
45  PFRecHitProducerKernel<CAL> kernel{event.queue(), num_recHits};
46  for (const auto& token : recHitsToken_)
47  kernel.processRecHits(
48  event.queue(), event.get(token.first), setup.getData(token.second), topology, pfRecHits);
49  kernel.associateTopologyInfo(event.queue(), topology, pfRecHits);
50  }
51 
52  if (synchronise_)
53  alpaka::wait(event.queue());
54 
55  event.emplace(pfRecHitsToken_, std::move(pfRecHits));
56  }
PortableCollection<::reco::PFRecHitSoA > PFRecHitDeviceCollection
const device::EDPutToken< reco::PFRecHitDeviceCollection > pfRecHitsToken_
const device::ESGetToken< typename CAL::TopologyTypeDevice, typename CAL::TopologyRecordType > topologyToken_
std::vector< std::pair< device::EDGetToken< typename CAL::CaloRecHitSoATypeDevice >, device::ESGetToken< typename CAL::ParameterType, typename CAL::ParameterRecordType > > > recHitsToken_
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1

Member Data Documentation

◆ pfRecHitsToken_

template<typename CAL >
const device::EDPutToken<reco::PFRecHitDeviceCollection> ALPAKA_ACCELERATOR_NAMESPACE::PFRecHitSoAProducer< CAL >::pfRecHitsToken_
private

Definition at line 78 of file PFRecHitSoAProducer.cc.

◆ recHitsToken_

template<typename CAL >
std::vector<std::pair<device::EDGetToken<typename CAL::CaloRecHitSoATypeDevice>, device::ESGetToken<typename CAL::ParameterType, typename CAL::ParameterRecordType> > > ALPAKA_ACCELERATOR_NAMESPACE::PFRecHitSoAProducer< CAL >::recHitsToken_
private

Definition at line 77 of file PFRecHitSoAProducer.cc.

◆ synchronise_

template<typename CAL >
const bool ALPAKA_ACCELERATOR_NAMESPACE::PFRecHitSoAProducer< CAL >::synchronise_
private

Definition at line 79 of file PFRecHitSoAProducer.cc.

◆ topologyToken_

template<typename CAL >
const device::ESGetToken<typename CAL::TopologyTypeDevice, typename CAL::TopologyRecordType> ALPAKA_ACCELERATOR_NAMESPACE::PFRecHitSoAProducer< CAL >::topologyToken_
private

Definition at line 74 of file PFRecHitSoAProducer.cc.