CMS 3D CMS Logo

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

Public Member Functions

void acquire (device::Event const &iEvent, device::EventSetup const &iSetup) override
 
 HGCalSoALayerClustersProducer (edm::ParameterSet const &config)
 
void produce (device::Event &iEvent, device::EventSetup const &iSetup) override
 
 ~HGCalSoALayerClustersProducer () override=default
 
- 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

HGCalLayerClustersSoAAlgoWrapper algo_
 
device::EDPutToken< HGCalSoAClustersDeviceCollection > const deviceTokenSoAClusters_
 
device::EDGetToken< HGCalSoARecHitsExtraDeviceCollection > const getTokenDeviceClusters_
 
device::EDGetToken< HGCalSoARecHitsDeviceCollection > const getTokenDeviceRecHits_
 
unsigned int num_clusters_
 
float positionDeltaRho2_
 
float thresholdW0_
 

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 26 of file HGCalSoALayerClustersProducer.cc.

Constructor & Destructor Documentation

◆ HGCalSoALayerClustersProducer()

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

Definition at line 28 of file HGCalSoALayerClustersProducer.cc.

29  : getTokenDeviceRecHits_{consumes(config.getParameter<edm::InputTag>("hgcalRecHitsSoA"))},
30  getTokenDeviceClusters_{consumes(config.getParameter<edm::InputTag>("hgcalRecHitsLayerClustersSoA"))},
32  thresholdW0_(config.getParameter<double>("thresholdW0")),
33  positionDeltaRho2_(config.getParameter<double>("positionDeltaRho2")) {}
device::EDGetToken< HGCalSoARecHitsDeviceCollection > const getTokenDeviceRecHits_
device::EDPutToken< HGCalSoAClustersDeviceCollection > const deviceTokenSoAClusters_
Definition: config.py:1
device::EDGetToken< HGCalSoARecHitsExtraDeviceCollection > const getTokenDeviceClusters_
auto produces(std::string instanceName) noexcept
declare what type of product will make and with which optional label

◆ ~HGCalSoALayerClustersProducer()

ALPAKA_ACCELERATOR_NAMESPACE::HGCalSoALayerClustersProducer::~HGCalSoALayerClustersProducer ( )
overridedefault

Member Function Documentation

◆ acquire()

void ALPAKA_ACCELERATOR_NAMESPACE::HGCalSoALayerClustersProducer::acquire ( device::Event const &  iEvent,
device::EventSetup const &  iSetup 
)
inlineoverridevirtual

Implements ALPAKA_ACCELERATOR_NAMESPACE::stream::SynchronizingEDProducer<>.

Definition at line 37 of file HGCalSoALayerClustersProducer.cc.

References getTokenDeviceClusters_, iEvent, and num_clusters_.

37  {
38  // Get LayerClusters almost-SoA on device: this has still the same
39  // cardinality as the RecHitsSoA, but has all the required information
40  // to assemble the clusters, i.e., it has the cluster index assigned to
41  // each rechit.
42  auto const& deviceInputClusters = iEvent.get(getTokenDeviceClusters_);
43  auto const inputClusters_v = deviceInputClusters.view();
44  //
45  // Allocate output SoA for the clusters, one entry for each cluster
46  auto device_numclusters = cms::alpakatools::make_device_view<const unsigned int>(
47  alpaka::getDev(iEvent.queue()), inputClusters_v.numberOfClustersScalar());
48  auto host_numclusters = cms::alpakatools::make_host_view<unsigned int>(num_clusters_);
49  alpaka::memcpy(iEvent.queue(), host_numclusters, device_numclusters);
50  }
int iEvent
Definition: GenABIO.cc:224
device::EDGetToken< HGCalSoARecHitsExtraDeviceCollection > const getTokenDeviceClusters_

◆ fillDescriptions()

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

Definition at line 81 of file HGCalSoALayerClustersProducer.cc.

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

81  {
83  desc.add<edm::InputTag>("hgcalRecHitsLayerClustersSoA", edm::InputTag("TO BE DEFINED"));
84  desc.add<edm::InputTag>("hgcalRecHitsSoA", edm::InputTag("TO BE DEFINED"));
85  desc.add<double>("thresholdW0", 2.9);
86  desc.add<double>("positionDeltaRho2", 1.69);
87  descriptions.addWithDefaultLabel(desc);
88  }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ produce()

void ALPAKA_ACCELERATOR_NAMESPACE::HGCalSoALayerClustersProducer::produce ( device::Event iEvent,
device::EventSetup const &  iSetup 
)
inlineoverridevirtual

Implements ALPAKA_ACCELERATOR_NAMESPACE::stream::SynchronizingEDProducer<>.

Definition at line 52 of file HGCalSoALayerClustersProducer.cc.

References algo_, deviceTokenSoAClusters_, getTokenDeviceClusters_, getTokenDeviceRecHits_, iEvent, eostools::move(), num_clusters_, convertSQLitetoXML_cfg::output, positionDeltaRho2_, ALPAKA_ACCELERATOR_NAMESPACE::HGCalLayerClustersSoAAlgoWrapper::run(), and thresholdW0_.

52  {
53  // Get RecHitsSoA on the device
54  auto const& deviceInputRecHits = iEvent.get(getTokenDeviceRecHits_);
55  auto const inputRechits_v = deviceInputRecHits.view();
56 
57  // Get LayerClusters almost-SoA on device: this has still the same
58  // cardinality as the RecHitsSoA, but has all the required information
59  // to assemble the clusters, i.e., it has the cluster index assigned to
60  // each rechit.
61  auto const& deviceInputClusters = iEvent.get(getTokenDeviceClusters_);
62  auto const inputClusters_v = deviceInputClusters.view();
63 
65  auto output_v = output.view();
66  // Allocate workspace SoA cluster
68  auto output_workspace_v = outputWorkspace.view();
69 
70  algo_.run(iEvent.queue(),
74  inputRechits_v,
75  inputClusters_v,
76  output_v,
77  output_workspace_v);
79  }
device::EDGetToken< HGCalSoARecHitsDeviceCollection > const getTokenDeviceRecHits_
device::EDPutToken< HGCalSoAClustersDeviceCollection > const deviceTokenSoAClusters_
int iEvent
Definition: GenABIO.cc:224
void run(Queue &queue, const unsigned int numer_of_clusters, float thresholdW0, float positionDeltaRho2, const HGCalSoARecHitsDeviceCollection::ConstView input_rechits_soa, const HGCalSoARecHitsExtraDeviceCollection::ConstView input_clusters_soa, HGCalSoAClustersDeviceCollection::View outputs, HGCalSoAClustersExtraDeviceCollection::View outputs_service) const
PortableCollection< HGCalSoAClustersExtra > HGCalSoAClustersExtraDeviceCollection
PortableCollection< HGCalSoAClusters > HGCalSoAClustersDeviceCollection
device::EDGetToken< HGCalSoARecHitsExtraDeviceCollection > const getTokenDeviceClusters_
Definition: output.py:1
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ algo_

HGCalLayerClustersSoAAlgoWrapper ALPAKA_ACCELERATOR_NAMESPACE::HGCalSoALayerClustersProducer::algo_
private

Definition at line 94 of file HGCalSoALayerClustersProducer.cc.

Referenced by produce().

◆ deviceTokenSoAClusters_

device::EDPutToken<HGCalSoAClustersDeviceCollection> const ALPAKA_ACCELERATOR_NAMESPACE::HGCalSoALayerClustersProducer::deviceTokenSoAClusters_
private

Definition at line 93 of file HGCalSoALayerClustersProducer.cc.

Referenced by produce().

◆ getTokenDeviceClusters_

device::EDGetToken<HGCalSoARecHitsExtraDeviceCollection> const ALPAKA_ACCELERATOR_NAMESPACE::HGCalSoALayerClustersProducer::getTokenDeviceClusters_
private

Definition at line 92 of file HGCalSoALayerClustersProducer.cc.

Referenced by acquire(), and produce().

◆ getTokenDeviceRecHits_

device::EDGetToken<HGCalSoARecHitsDeviceCollection> const ALPAKA_ACCELERATOR_NAMESPACE::HGCalSoALayerClustersProducer::getTokenDeviceRecHits_
private

Definition at line 91 of file HGCalSoALayerClustersProducer.cc.

Referenced by produce().

◆ num_clusters_

unsigned int ALPAKA_ACCELERATOR_NAMESPACE::HGCalSoALayerClustersProducer::num_clusters_
private

Definition at line 95 of file HGCalSoALayerClustersProducer.cc.

Referenced by acquire(), and produce().

◆ positionDeltaRho2_

float ALPAKA_ACCELERATOR_NAMESPACE::HGCalSoALayerClustersProducer::positionDeltaRho2_
private

Definition at line 97 of file HGCalSoALayerClustersProducer.cc.

Referenced by produce().

◆ thresholdW0_

float ALPAKA_ACCELERATOR_NAMESPACE::HGCalSoALayerClustersProducer::thresholdW0_
private

Definition at line 96 of file HGCalSoALayerClustersProducer.cc.

Referenced by produce().