CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
ALPAKA_ACCELERATOR_NAMESPACE::PFClusterSoAProducer Class Reference
Inheritance diagram for ALPAKA_ACCELERATOR_NAMESPACE::PFClusterSoAProducer:
ALPAKA_ACCELERATOR_NAMESPACE::stream::SynchronizingEDProducer<> edm::ProducerBase< edm::stream::EDProducer, edm::ExternalWork, Args... >

Public Member Functions

void acquire (device::Event const &event, device::EventSetup const &setup) override
 
 PFClusterSoAProducer (edm::ParameterSet const &config)
 
void produce (device::Event &event, device::EventSetup const &setup) override
 
- Public Member Functions inherited from ALPAKA_ACCELERATOR_NAMESPACE::stream::SynchronizingEDProducer<>
void acquire (edm::Event const &iEvent, edm::EventSetup const &iSetup, edm::WaitingTaskWithArenaHolder holder) final
 
void produce (edm::Event &iEvent, edm::EventSetup const &iSetup) final
 
- Public Member Functions inherited from edm::ProducerBase< edm::stream::EDProducer, edm::ExternalWork, 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 edm::EDGetTokenT< reco::PFRecHitHostCollectioninputPFRecHitSoA_Token_
 
cms::alpakatools::host_buffer< uint32_t > numRHF_
 
const device::EDPutToken< reco::PFClusterDeviceCollectionoutputPFClusterSoA_Token_
 
const device::EDPutToken< reco::PFRecHitFractionDeviceCollectionoutputPFRHFractionSoA_Token_
 
const device::ESGetToken< reco::PFClusterParamsDeviceCollection, JobConfigurationGPURecordpfClusParamsToken
 
std::optional< reco::PFClusteringEdgeVarsDeviceCollectionpfClusteringEdgeVars_
 
std::optional< reco::PFClusteringVarsDeviceCollectionpfClusteringVars_
 
std::optional< reco::PFClusterDeviceCollectionpfClusters_
 
const bool synchronise_
 
const device::ESGetToken< reco::PFRecHitHCALTopologyDeviceCollection, PFRecHitHCALTopologyRecordtopologyToken_
 

Additional Inherited Members

- Public Types inherited from edm::ProducerBase< edm::stream::EDProducer, edm::ExternalWork, 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::stream::EDProducer, edm::ExternalWork, 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

Definition at line 19 of file PFClusterSoAProducer.cc.

Constructor & Destructor Documentation

◆ PFClusterSoAProducer()

ALPAKA_ACCELERATOR_NAMESPACE::PFClusterSoAProducer::PFClusterSoAProducer ( edm::ParameterSet const &  config)
inline

Definition at line 21 of file PFClusterSoAProducer.cc.

22  : pfClusParamsToken(esConsumes(config.getParameter<edm::ESInputTag>("pfClusterParams"))),
23  topologyToken_(esConsumes(config.getParameter<edm::ESInputTag>("topology"))),
24  inputPFRecHitSoA_Token_{consumes(config.getParameter<edm::InputTag>("pfRecHits"))},
27  numRHF_{cms::alpakatools::make_host_buffer<uint32_t, Platform>()},
28  synchronise_(config.getParameter<bool>("synchronise")) {}
const device::ESGetToken< reco::PFRecHitHCALTopologyDeviceCollection, PFRecHitHCALTopologyRecord > topologyToken_
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
const edm::EDGetTokenT< reco::PFRecHitHostCollection > inputPFRecHitSoA_Token_
Definition: config.py:1
const device::EDPutToken< reco::PFRecHitFractionDeviceCollection > outputPFRHFractionSoA_Token_
cms::alpakatools::host_buffer< uint32_t > numRHF_
const device::EDPutToken< reco::PFClusterDeviceCollection > outputPFClusterSoA_Token_
const device::ESGetToken< reco::PFClusterParamsDeviceCollection, JobConfigurationGPURecord > pfClusParamsToken
auto produces(std::string instanceName) noexcept
declare what type of product will make and with which optional label

Member Function Documentation

◆ acquire()

void ALPAKA_ACCELERATOR_NAMESPACE::PFClusterSoAProducer::acquire ( device::Event const &  event,
device::EventSetup const &  setup 
)
inlineoverridevirtual

Implements ALPAKA_ACCELERATOR_NAMESPACE::stream::SynchronizingEDProducer<>.

Definition at line 30 of file PFClusterSoAProducer.cc.

References inputPFRecHitSoA_Token_, numRHF_, submitPVValidationJobs::params, pfClusParamsToken, pfClusteringEdgeVars_, pfClusteringVars_, pfClusters_, HLT_2024v14_cff::pfRecHits, ALPAKA_ACCELERATOR_NAMESPACE::PFClusterProducerKernel::seedTopoAndContract(), singleTopDQM_cfi::setup, HLT_2024v14_cff::topology, and topologyToken_.

30  {
34  int nRH = 0;
35  if (pfRecHits->metadata().size() != 0)
36  nRH = pfRecHits->size();
37 
38  pfClusteringVars_.emplace(nRH, event.queue());
39  pfClusteringEdgeVars_.emplace(nRH * 8, event.queue());
40  pfClusters_.emplace(nRH, event.queue());
41 
42  *numRHF_ = 0;
43 
44  if (nRH != 0) {
45  PFClusterProducerKernel kernel(event.queue(), pfRecHits);
46  kernel.seedTopoAndContract(event.queue(),
47  params,
48  topology,
51  pfRecHits,
52  *pfClusters_,
53  numRHF_.data());
54  }
55  }
const device::ESGetToken< reco::PFRecHitHCALTopologyDeviceCollection, PFRecHitHCALTopologyRecord > topologyToken_
std::optional< reco::PFClusteringEdgeVarsDeviceCollection > pfClusteringEdgeVars_
std::optional< reco::PFClusteringVarsDeviceCollection > pfClusteringVars_
const edm::EDGetTokenT< reco::PFRecHitHostCollection > inputPFRecHitSoA_Token_
std::optional< reco::PFClusterDeviceCollection > pfClusters_
cms::alpakatools::host_buffer< uint32_t > numRHF_
PortableCollection<::reco::PFRecHitHCALTopologySoA > PFRecHitHCALTopologyDeviceCollection
PortableCollection<::reco::PFClusterParamsSoA > PFClusterParamsDeviceCollection
const device::ESGetToken< reco::PFClusterParamsDeviceCollection, JobConfigurationGPURecord > pfClusParamsToken
Definition: event.py:1

◆ fillDescriptions()

static void ALPAKA_ACCELERATOR_NAMESPACE::PFClusterSoAProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
inlinestatic

Definition at line 90 of file PFClusterSoAProducer.cc.

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

90  {
92  desc.add<edm::InputTag>("pfRecHits", edm::InputTag(""));
93  desc.add<edm::ESInputTag>("pfClusterParams", edm::ESInputTag(""));
94  desc.add<edm::ESInputTag>("topology", edm::ESInputTag(""));
95  desc.add<bool>("synchronise", false);
96  descriptions.addWithDefaultLabel(desc);
97  }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ produce()

void ALPAKA_ACCELERATOR_NAMESPACE::PFClusterSoAProducer::produce ( device::Event event,
device::EventSetup const &  setup 
)
inlineoverridevirtual

Implements ALPAKA_ACCELERATOR_NAMESPACE::stream::SynchronizingEDProducer<>.

Definition at line 57 of file PFClusterSoAProducer.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::PFClusterProducerKernel::cluster(), inputPFRecHitSoA_Token_, eostools::move(), numRHF_, outputPFClusterSoA_Token_, outputPFRHFractionSoA_Token_, submitPVValidationJobs::params, pfClusParamsToken, pfClusteringEdgeVars_, pfClusteringVars_, pfClusters_, HLT_2024v14_cff::pfRecHits, singleTopDQM_cfi::setup, synchronise_, HLT_2024v14_cff::topology, topologyToken_, and SequenceTypes::wait().

57  {
61  int nRH = 0;
62 
63  std::optional<reco::PFRecHitFractionDeviceCollection> pfrhFractions;
64 
65  if (pfRecHits->metadata().size() != 0)
66  nRH = pfRecHits->size();
67 
68  if (nRH != 0) {
69  pfrhFractions.emplace(*numRHF_.data(), event.queue());
70  PFClusterProducerKernel kernel(event.queue(), pfRecHits);
71  kernel.cluster(event.queue(),
72  params,
73  topology,
76  pfRecHits,
77  *pfClusters_,
78  *pfrhFractions);
79  } else {
80  pfrhFractions.emplace(0, event.queue());
81  }
82 
83  if (synchronise_)
84  alpaka::wait(event.queue());
85 
87  event.emplace(outputPFRHFractionSoA_Token_, std::move(*pfrhFractions));
88  }
const device::ESGetToken< reco::PFRecHitHCALTopologyDeviceCollection, PFRecHitHCALTopologyRecord > topologyToken_
std::optional< reco::PFClusteringEdgeVarsDeviceCollection > pfClusteringEdgeVars_
std::optional< reco::PFClusteringVarsDeviceCollection > pfClusteringVars_
const edm::EDGetTokenT< reco::PFRecHitHostCollection > inputPFRecHitSoA_Token_
std::optional< reco::PFClusterDeviceCollection > pfClusters_
const device::EDPutToken< reco::PFRecHitFractionDeviceCollection > outputPFRHFractionSoA_Token_
cms::alpakatools::host_buffer< uint32_t > numRHF_
PortableCollection<::reco::PFRecHitHCALTopologySoA > PFRecHitHCALTopologyDeviceCollection
PortableCollection<::reco::PFClusterParamsSoA > PFClusterParamsDeviceCollection
const device::EDPutToken< reco::PFClusterDeviceCollection > outputPFClusterSoA_Token_
const device::ESGetToken< reco::PFClusterParamsDeviceCollection, JobConfigurationGPURecord > pfClusParamsToken
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1

Member Data Documentation

◆ inputPFRecHitSoA_Token_

const edm::EDGetTokenT<reco::PFRecHitHostCollection> ALPAKA_ACCELERATOR_NAMESPACE::PFClusterSoAProducer::inputPFRecHitSoA_Token_
private

Definition at line 102 of file PFClusterSoAProducer.cc.

Referenced by acquire(), and produce().

◆ numRHF_

cms::alpakatools::host_buffer<uint32_t> ALPAKA_ACCELERATOR_NAMESPACE::PFClusterSoAProducer::numRHF_
private

Definition at line 105 of file PFClusterSoAProducer.cc.

Referenced by acquire(), and produce().

◆ outputPFClusterSoA_Token_

const device::EDPutToken<reco::PFClusterDeviceCollection> ALPAKA_ACCELERATOR_NAMESPACE::PFClusterSoAProducer::outputPFClusterSoA_Token_
private

Definition at line 103 of file PFClusterSoAProducer.cc.

Referenced by produce().

◆ outputPFRHFractionSoA_Token_

const device::EDPutToken<reco::PFRecHitFractionDeviceCollection> ALPAKA_ACCELERATOR_NAMESPACE::PFClusterSoAProducer::outputPFRHFractionSoA_Token_
private

Definition at line 104 of file PFClusterSoAProducer.cc.

Referenced by produce().

◆ pfClusParamsToken

const device::ESGetToken<reco::PFClusterParamsDeviceCollection, JobConfigurationGPURecord> ALPAKA_ACCELERATOR_NAMESPACE::PFClusterSoAProducer::pfClusParamsToken
private

Definition at line 100 of file PFClusterSoAProducer.cc.

Referenced by acquire(), and produce().

◆ pfClusteringEdgeVars_

std::optional<reco::PFClusteringEdgeVarsDeviceCollection> ALPAKA_ACCELERATOR_NAMESPACE::PFClusterSoAProducer::pfClusteringEdgeVars_
private

Definition at line 107 of file PFClusterSoAProducer.cc.

Referenced by acquire(), and produce().

◆ pfClusteringVars_

std::optional<reco::PFClusteringVarsDeviceCollection> ALPAKA_ACCELERATOR_NAMESPACE::PFClusterSoAProducer::pfClusteringVars_
private

Definition at line 106 of file PFClusterSoAProducer.cc.

Referenced by acquire(), and produce().

◆ pfClusters_

std::optional<reco::PFClusterDeviceCollection> ALPAKA_ACCELERATOR_NAMESPACE::PFClusterSoAProducer::pfClusters_
private

Definition at line 108 of file PFClusterSoAProducer.cc.

Referenced by acquire(), and produce().

◆ synchronise_

const bool ALPAKA_ACCELERATOR_NAMESPACE::PFClusterSoAProducer::synchronise_
private

Definition at line 109 of file PFClusterSoAProducer.cc.

Referenced by produce().

◆ topologyToken_

const device::ESGetToken<reco::PFRecHitHCALTopologyDeviceCollection, PFRecHitHCALTopologyRecord> ALPAKA_ACCELERATOR_NAMESPACE::PFClusterSoAProducer::topologyToken_
private

Definition at line 101 of file PFClusterSoAProducer.cc.

Referenced by acquire(), and produce().