CMS 3D CMS Logo

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

Public Member Functions

 CaloRecHitSoAProducer (edm::ParameterSet const &config)
 
void produce (edm::StreamID sid, device::Event &event, device::EventSetup const &) 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 Member Functions

template<>
void convertRecHit (hcal::RecHitHostCollection::View::element to, const HCAL::CaloRecHitType &from)
 

Static Private Member Functions

static void convertRecHit (hcal::RecHitHostCollection::View::element to, const typename CAL::CaloRecHitType &from)
 

Private Attributes

const device::EDPutToken< hcal::RecHitDeviceCollectiondeviceToken_
 
const edm::EDGetTokenT< edm::SortedCollection< typename CAL::CaloRecHitType > > recHitsToken_
 
const bool synchronise_
 

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::CaloRecHitSoAProducer< CAL >

Definition at line 26 of file CaloRecHitSoAProducer.cc.

Constructor & Destructor Documentation

◆ CaloRecHitSoAProducer()

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

Definition at line 28 of file CaloRecHitSoAProducer.cc.

29  : recHitsToken_(consumes(config.getParameter<edm::InputTag>("src"))),
31  synchronise_(config.getUntrackedParameter<bool>("synchronise")) {}
const device::EDPutToken< hcal::RecHitDeviceCollection > deviceToken_
Definition: config.py:1
const edm::EDGetTokenT< edm::SortedCollection< typename CAL::CaloRecHitType > > recHitsToken_
auto produces(std::string instanceName) noexcept
declare what type of product will make and with which optional label

Member Function Documentation

◆ convertRecHit() [1/2]

template<typename CAL >
static void ALPAKA_ACCELERATOR_NAMESPACE::CaloRecHitSoAProducer< CAL >::convertRecHit ( hcal::RecHitHostCollection::View::element  to,
const typename CAL::CaloRecHitType &  from 
)
staticprivate

◆ convertRecHit() [2/2]

template<>
void ALPAKA_ACCELERATOR_NAMESPACE::CaloRecHitSoAProducer< HCAL >::convertRecHit ( hcal::RecHitHostCollection::View::element  to,
const HCAL::CaloRecHitType from 
)
private

Definition at line 73 of file CaloRecHitSoAProducer.cc.

References CaloRecHit::energy(), HBHERecHit::id(), DetId::rawId(), and CaloRecHit::time().

74  {
75  // Fill SoA from HCAL rec hit
76  to.detId() = from.id().rawId();
77  to.energy() = from.energy();
78  to.timeM0() = from.time();
79  }

◆ fillDescriptions()

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

Definition at line 56 of file CaloRecHitSoAProducer.cc.

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

56  {
58  desc.add<edm::InputTag>("src", edm::InputTag(""))->setComment("Input calorimeter rec hit collection");
59  desc.addUntracked<bool>("synchronise", false)
60  ->setComment("Add synchronisation point after execution (for benchmarking asynchronous execution)");
61  descriptions.addWithDefaultLabel(desc);
62  }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ produce()

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

Implements ALPAKA_ACCELERATOR_NAMESPACE::global::EDProducer<>.

Definition at line 33 of file CaloRecHitSoAProducer.cc.

References DEBUG, mps_fire::i, eostools::move(), FastTrackerRecHitMaskProducer_cfi::recHits, and SequenceTypes::wait().

33  {
35  const int32_t num_recHits = recHits.size();
36  if (DEBUG)
37  printf("Found %d recHits\n", num_recHits);
38 
39  hcal::RecHitHostCollection hostProduct{num_recHits, event.queue()};
40  auto& view = hostProduct.view();
41 
42  for (int i = 0; i < num_recHits; i++) {
44 
45  if (DEBUG && i < 10)
46  printf("recHit %4d %u %f %f\n", i, view.detId(i), view.energy(i), view.timeM0(i));
47  }
48 
49  hcal::RecHitDeviceCollection deviceProduct{num_recHits, event.queue()};
50  alpaka::memcpy(event.queue(), deviceProduct.buffer(), hostProduct.buffer());
51  if (synchronise_)
52  alpaka::wait(event.queue());
53  event.emplace(deviceToken_, std::move(deviceProduct));
54  }
#define DEBUG
const device::EDPutToken< hcal::RecHitDeviceCollection > deviceToken_
const edm::EDGetTokenT< edm::SortedCollection< typename CAL::CaloRecHitType > > recHitsToken_
static void convertRecHit(hcal::RecHitHostCollection::View::element to, const typename CAL::CaloRecHitType &from)
def move(src, dest)
Definition: eostools.py:511
PortableCollection< HcalRecHitSoA > RecHitDeviceCollection
Definition: event.py:1

Member Data Documentation

◆ deviceToken_

Definition at line 66 of file CaloRecHitSoAProducer.cc.

◆ recHitsToken_

template<typename CAL >
const edm::EDGetTokenT<edm::SortedCollection<typename CAL::CaloRecHitType> > ALPAKA_ACCELERATOR_NAMESPACE::CaloRecHitSoAProducer< CAL >::recHitsToken_
private

Definition at line 65 of file CaloRecHitSoAProducer.cc.

◆ synchronise_

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

Definition at line 67 of file CaloRecHitSoAProducer.cc.