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()} {}
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 20 of file BeamSpotDeviceProducer.cc.

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

20  {
21  reco::BeamSpot const& beamspot = event.get(legacyToken_);
22 
23  BeamSpotHost hostProduct{event.queue()};
24  hostProduct->x = beamspot.x0();
25  hostProduct->y = beamspot.y0();
26  hostProduct->z = beamspot.z0();
27  hostProduct->sigmaZ = beamspot.sigmaZ();
28  hostProduct->beamWidthX = beamspot.BeamWidthX();
29  hostProduct->beamWidthY = beamspot.BeamWidthY();
30  hostProduct->dxdz = beamspot.dxdz();
31  hostProduct->dydz = beamspot.dydz();
32  hostProduct->emittanceX = beamspot.emittanceX();
33  hostProduct->emittanceY = beamspot.emittanceY();
34  hostProduct->betaStar = beamspot.betaStar();
35 
36  if constexpr (std::is_same_v<Device, alpaka::DevCpu>) {
37  event.emplace(deviceToken_, std::move(hostProduct));
38  } else {
39  BeamSpotDevice deviceProduct{event.queue()};
40  alpaka::memcpy(event.queue(), deviceProduct.buffer(), hostProduct.const_buffer());
41  event.emplace(deviceToken_, std::move(deviceProduct));
42  }
43  }
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 53 of file BeamSpotDeviceProducer.cc.

Referenced by produce().

◆ legacyToken_

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

Definition at line 52 of file BeamSpotDeviceProducer.cc.

Referenced by produce().