CMS 3D CMS Logo

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

Public Member Functions

 BeamSpotDeviceProducer (edm::ParameterSet const &config)
 
void produce (edm::StreamID, device::Event &event, device::EventSetup const &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< BeamSpotDevicedeviceToken_
 
const edm::EDGetTokenT< reco::BeamSpotlegacyToken_
 

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

Definition at line 15 of file BeamSpotDeviceProducer.cc.

Constructor & Destructor Documentation

◆ BeamSpotDeviceProducer()

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

Definition at line 17 of file BeamSpotDeviceProducer.cc.

18  : legacyToken_{consumes(config.getParameter<edm::InputTag>("src"))}, deviceToken_{produces()} {
19  // Workaround until the ProductID problem in issue https://github.com/cms-sw/cmssw/issues/44643 is fixed
20 #ifdef ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED
21  producesTemporarily("edm::DeviceProduct<alpaka_cuda_async::BeamSpotDevice>");
22 #endif
23  }
const device::EDPutToken< BeamSpotDevice > deviceToken_
Definition: config.py:1
const edm::EDGetTokenT< reco::BeamSpot > legacyToken_
auto produces(std::string instanceName) noexcept
declare what type of product will make and with which optional label

Member Function Documentation

◆ fillDescriptions()

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

◆ produce()

void ALPAKA_ACCELERATOR_NAMESPACE::BeamSpotDeviceProducer::produce ( edm::StreamID  ,
device::Event event,
device::EventSetup const &  setup 
) const
inlineoverridevirtual

Implements ALPAKA_ACCELERATOR_NAMESPACE::global::EDProducer<>.

Definition at line 25 of file BeamSpotDeviceProducer.cc.

References ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), deviceToken_, legacyToken_, and eostools::move().

25  {
26  reco::BeamSpot const& beamspot = event.get(legacyToken_);
27 
28  BeamSpotHost hostProduct{event.queue()};
29  hostProduct->x = beamspot.x0();
30  hostProduct->y = beamspot.y0();
31  hostProduct->z = beamspot.z0();
32  hostProduct->sigmaZ = beamspot.sigmaZ();
33  hostProduct->beamWidthX = beamspot.BeamWidthX();
34  hostProduct->beamWidthY = beamspot.BeamWidthY();
35  hostProduct->dxdz = beamspot.dxdz();
36  hostProduct->dydz = beamspot.dydz();
37  hostProduct->emittanceX = beamspot.emittanceX();
38  hostProduct->emittanceY = beamspot.emittanceY();
39  hostProduct->betaStar = beamspot.betaStar();
40 
41  if constexpr (std::is_same_v<Device, alpaka::DevCpu>) {
42  event.emplace(deviceToken_, std::move(hostProduct));
43  } else {
44  BeamSpotDevice deviceProduct{event.queue()};
45  alpaka::memcpy(event.queue(), deviceProduct.buffer(), hostProduct.const_buffer());
46  event.emplace(deviceToken_, std::move(deviceProduct));
47  }
48  }
const device::EDPutToken< BeamSpotDevice > deviceToken_
PortableHostObject< BeamSpotPOD > BeamSpotHost
Definition: BeamSpotHost.h:8
const edm::EDGetTokenT< reco::BeamSpot > legacyToken_
PortableObject< BeamSpotPOD > BeamSpotDevice
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1

Member Data Documentation

◆ deviceToken_

const device::EDPutToken<BeamSpotDevice> ALPAKA_ACCELERATOR_NAMESPACE::BeamSpotDeviceProducer::deviceToken_
private

Definition at line 58 of file BeamSpotDeviceProducer.cc.

Referenced by produce().

◆ legacyToken_

const edm::EDGetTokenT<reco::BeamSpot> ALPAKA_ACCELERATOR_NAMESPACE::BeamSpotDeviceProducer::legacyToken_
private

Definition at line 57 of file BeamSpotDeviceProducer.cc.

Referenced by produce().