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 (reco::CaloRecHitHostCollection::View::element to, const HCAL::CaloRecHitType &from)
 
template<>
void convertRecHit (reco::CaloRecHitHostCollection::View::element to, const ECAL::CaloRecHitType &from)
 

Static Private Member Functions

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

Private Attributes

const device::EDPutToken< reco::CaloRecHitDeviceCollectiondeviceToken_
 
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 23 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 25 of file CaloRecHitSoAProducer.cc.

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

Member Function Documentation

◆ convertRecHit() [1/3]

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

◆ convertRecHit() [2/3]

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

Definition at line 71 of file CaloRecHitSoAProducer.cc.

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

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

◆ convertRecHit() [3/3]

template<>
void ALPAKA_ACCELERATOR_NAMESPACE::CaloRecHitSoAProducer< ECAL >::convertRecHit ( reco::CaloRecHitHostCollection::View::element  to,
const ECAL::CaloRecHitType from 
)
private

Definition at line 81 of file CaloRecHitSoAProducer.cc.

References EcalRecHit::energy(), EcalRecHit::flagsBits(), EcalRecHit::id(), DetId::rawId(), and EcalRecHit::time().

82  {
83  // Fill SoA from ECAL rec hit
84  to.detId() = from.id().rawId();
85  to.energy() = from.energy();
86  to.time() = from.time();
87  to.flags() = from.flagsBits();
88  }

◆ fillDescriptions()

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

Definition at line 53 of file CaloRecHitSoAProducer.cc.

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

53  {
55  desc.add<edm::InputTag>("src", edm::InputTag(""))->setComment("Input calorimeter rec hit collection");
56  desc.addUntracked<bool>("synchronise", false)
57  ->setComment("Add synchronisation point after execution (for benchmarking asynchronous execution)");
58  descriptions.addWithDefaultLabel(desc);
59  }
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 30 of file CaloRecHitSoAProducer.cc.

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

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

Member Data Documentation

◆ deviceToken_

Definition at line 63 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 62 of file CaloRecHitSoAProducer.cc.

◆ synchronise_

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

Definition at line 64 of file CaloRecHitSoAProducer.cc.