CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
HcalCPUDigisProducer Class Reference
Inheritance diagram for HcalCPUDigisProducer:
edm::stream::EDProducer< edm::ExternalWork >

Public Member Functions

 HcalCPUDigisProducer (edm::ParameterSet const &ps)
 
 ~HcalCPUDigisProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::ExternalWork >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 

Private Types

using IProductTypef01 = cms::cuda::Product< hcal::DigiCollection< hcal::Flavor1, calo::common::DevStoragePolicy > >
 
using IProductTypef3 = cms::cuda::Product< hcal::DigiCollection< hcal::Flavor3, calo::common::DevStoragePolicy > >
 
using IProductTypef5 = cms::cuda::Product< hcal::DigiCollection< hcal::Flavor5, calo::common::DevStoragePolicy > >
 
using OProductTypef01 = hcal::DigiCollection< hcal::Flavor1, calo::common::VecStoragePolicy< calo::common::CUDAHostAllocatorAlias > >
 
using OProductTypef3 = hcal::DigiCollection< hcal::Flavor3, calo::common::VecStoragePolicy< calo::common::CUDAHostAllocatorAlias > >
 
using OProductTypef5 = hcal::DigiCollection< hcal::Flavor5, calo::common::VecStoragePolicy< calo::common::CUDAHostAllocatorAlias > >
 

Private Member Functions

void acquire (edm::Event const &, edm::EventSetup const &, edm::WaitingTaskWithArenaHolder) override
 
void produce (edm::Event &, edm::EventSetup const &) override
 

Private Attributes

OProductTypef01 digisf01HE_
 
edm::EDGetTokenT< IProductTypef01digisF01HETokenIn_
 
edm::EDPutTokenT< OProductTypef01digisF01HETokenOut_
 
OProductTypef3 digisf3HB_
 
edm::EDGetTokenT< IProductTypef3digisF3HBTokenIn_
 
edm::EDPutTokenT< OProductTypef3digisF3HBTokenOut_
 
OProductTypef5 digisf5HB_
 
edm::EDGetTokenT< IProductTypef5digisF5HBTokenIn_
 
edm::EDPutTokenT< OProductTypef5digisF5HBTokenOut_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer< edm::ExternalWork >
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 15 of file HcalCPUDigisProducer.cc.

Member Typedef Documentation

◆ IProductTypef01

Definition at line 26 of file HcalCPUDigisProducer.cc.

◆ IProductTypef3

Definition at line 30 of file HcalCPUDigisProducer.cc.

◆ IProductTypef5

Definition at line 28 of file HcalCPUDigisProducer.cc.

◆ OProductTypef01

Definition at line 34 of file HcalCPUDigisProducer.cc.

◆ OProductTypef3

Definition at line 40 of file HcalCPUDigisProducer.cc.

◆ OProductTypef5

Definition at line 37 of file HcalCPUDigisProducer.cc.

Constructor & Destructor Documentation

◆ HcalCPUDigisProducer()

HcalCPUDigisProducer::HcalCPUDigisProducer ( edm::ParameterSet const &  ps)
explicit

Definition at line 62 of file HcalCPUDigisProducer.cc.

References edm::ParameterSet::getParameter().

63  : digisF01HETokenIn_{consumes<IProductTypef01>(ps.getParameter<edm::InputTag>("digisLabelF01HEIn"))},
64  digisF5HBTokenIn_{consumes<IProductTypef5>(ps.getParameter<edm::InputTag>("digisLabelF5HBIn"))},
65  digisF3HBTokenIn_{consumes<IProductTypef3>(ps.getParameter<edm::InputTag>("digisLabelF3HBIn"))},
66  digisF01HETokenOut_{produces<OProductTypef01>(ps.getParameter<std::string>("digisLabelF01HEOut"))},
67  digisF5HBTokenOut_{produces<OProductTypef5>(ps.getParameter<std::string>("digisLabelF5HBOut"))},
68  digisF3HBTokenOut_{produces<OProductTypef3>(ps.getParameter<std::string>("digisLabelF3HBOut"))} {}
edm::EDPutTokenT< OProductTypef01 > digisF01HETokenOut_
edm::EDPutTokenT< OProductTypef3 > digisF3HBTokenOut_
edm::EDGetTokenT< IProductTypef01 > digisF01HETokenIn_
edm::EDPutTokenT< OProductTypef5 > digisF5HBTokenOut_
edm::EDGetTokenT< IProductTypef3 > digisF3HBTokenIn_
edm::EDGetTokenT< IProductTypef5 > digisF5HBTokenIn_

◆ ~HcalCPUDigisProducer()

HcalCPUDigisProducer::~HcalCPUDigisProducer ( )
override

Definition at line 70 of file HcalCPUDigisProducer.cc.

70 {}

Member Function Documentation

◆ acquire()

void HcalCPUDigisProducer::acquire ( edm::Event const &  event,
edm::EventSetup const &  setup,
edm::WaitingTaskWithArenaHolder  taskHolder 
)
overrideprivate

Definition at line 72 of file HcalCPUDigisProducer.cc.

References cudaCheck, hcal::DigiCollectionBase< StoragePolicy >::data, mps_fire::dest, digisf01HE_, digisF01HETokenIn_, digisf3HB_, digisF3HBTokenIn_, digisf5HB_, digisF5HBTokenIn_, hcal::DigiCollectionBase< StoragePolicy >::ids, eostools::move(), hcal::DigiCollectionBase< StoragePolicy >::resize(), TrackRefitter_38T_cff::src, hcal::DigiCollectionBase< StoragePolicy >::stride, and relativeConstraints::value.

74  {
75  // retrieve data/ctx
76  auto const& f01HEProduct = event.get(digisF01HETokenIn_);
77  auto const& f5HBProduct = event.get(digisF5HBTokenIn_);
78  auto const& f3HBProduct = event.get(digisF3HBTokenIn_);
79  cms::cuda::ScopedContextAcquire ctx{f01HEProduct, std::move(taskHolder)};
80  auto const& f01HEDigis = ctx.get(f01HEProduct);
81  auto const& f5HBDigis = ctx.get(f5HBProduct);
82  auto const& f3HBDigis = ctx.get(f3HBProduct);
83 
84  // resize out tmp buffers
85  digisf01HE_.stride = f01HEDigis.stride;
86  digisf5HB_.stride = f5HBDigis.stride;
87  digisf3HB_.stride = f3HBDigis.stride;
88  digisf01HE_.resize(f01HEDigis.size);
89  digisf5HB_.resize(f5HBDigis.size);
90  digisf3HB_.resize(f3HBDigis.size);
91 
92  auto lambdaToTransfer = [&ctx](auto& dest, auto* src) {
93  using vector_type = typename std::remove_reference<decltype(dest)>::type;
94  using type = typename vector_type::value_type;
95  using src_data_type = typename std::remove_pointer<decltype(src)>::type;
96  static_assert(std::is_same<src_data_type, type>::value && "Dest and Src data types do not match");
97  cudaCheck(cudaMemcpyAsync(dest.data(), src, dest.size() * sizeof(type), cudaMemcpyDeviceToHost, ctx.stream()));
98  };
99 
100  lambdaToTransfer(digisf01HE_.data, f01HEDigis.data.get());
101  lambdaToTransfer(digisf01HE_.ids, f01HEDigis.ids.get());
102 
103  lambdaToTransfer(digisf5HB_.data, f5HBDigis.data.get());
104  lambdaToTransfer(digisf5HB_.ids, f5HBDigis.ids.get());
105  lambdaToTransfer(digisf5HB_.npresamples, f5HBDigis.npresamples.get());
106 
107  lambdaToTransfer(digisf3HB_.data, f3HBDigis.data.get());
108  lambdaToTransfer(digisf3HB_.ids, f3HBDigis.ids.get());
109 }
std::enable_if< std::is_same< T, ::calo::common::tags::Vec >::value, void >::type resize(std::size_t size)
StoragePolicy::template StorageSelector< uint16_t >::type data
edm::EDGetTokenT< IProductTypef01 > digisF01HETokenIn_
StoragePolicy::template StorageSelector< uint32_t >::type ids
#define cudaCheck(ARG,...)
Definition: cudaCheck.h:69
edm::EDGetTokenT< IProductTypef3 > digisF3HBTokenIn_
def move(src, dest)
Definition: eostools.py:511
edm::EDGetTokenT< IProductTypef5 > digisF5HBTokenIn_

◆ fillDescriptions()

void HcalCPUDigisProducer::fillDescriptions ( edm::ConfigurationDescriptions confDesc)
static

Definition at line 49 of file HcalCPUDigisProducer.cc.

References edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, and AlCaHLTBitMon_QueryRunRegistry::string.

49  {
51 
52  desc.add<edm::InputTag>("digisLabelF01HEIn", edm::InputTag{"hcalRawToDigiGPU", "f01HEDigisGPU"});
53  desc.add<edm::InputTag>("digisLabelF5HBIn", edm::InputTag{"hcalRawToDigiGPU", "f5HBDigisGPU"});
54  desc.add<edm::InputTag>("digisLabelF3HBIn", edm::InputTag{"hcalRawToDigiGPU", "f3HBDigisGPU"});
55  desc.add<std::string>("digisLabelF01HEOut", "f01HEDigis");
56  desc.add<std::string>("digisLabelF5HBOut", "f5HBDigis");
57  desc.add<std::string>("digisLabelF3HBOut", "f3HBDigis");
58 
59  confDesc.addWithDefaultLabel(desc);
60 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ produce()

void HcalCPUDigisProducer::produce ( edm::Event event,
edm::EventSetup const &  setup 
)
overrideprivate

Definition at line 111 of file HcalCPUDigisProducer.cc.

References digisf01HE_, digisF01HETokenOut_, digisf3HB_, digisF3HBTokenOut_, digisf5HB_, digisF5HBTokenOut_, and eostools::move().

111  {
112  event.emplace(digisF01HETokenOut_, std::move(digisf01HE_));
113  event.emplace(digisF5HBTokenOut_, std::move(digisf5HB_));
114  event.emplace(digisF3HBTokenOut_, std::move(digisf3HB_));
115 }
edm::EDPutTokenT< OProductTypef01 > digisF01HETokenOut_
edm::EDPutTokenT< OProductTypef3 > digisF3HBTokenOut_
edm::EDPutTokenT< OProductTypef5 > digisF5HBTokenOut_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ digisf01HE_

OProductTypef01 HcalCPUDigisProducer::digisf01HE_
private

Definition at line 44 of file HcalCPUDigisProducer.cc.

Referenced by acquire(), and produce().

◆ digisF01HETokenIn_

edm::EDGetTokenT<IProductTypef01> HcalCPUDigisProducer::digisF01HETokenIn_
private

Definition at line 27 of file HcalCPUDigisProducer.cc.

Referenced by acquire().

◆ digisF01HETokenOut_

edm::EDPutTokenT<OProductTypef01> HcalCPUDigisProducer::digisF01HETokenOut_
private

Definition at line 35 of file HcalCPUDigisProducer.cc.

Referenced by produce().

◆ digisf3HB_

OProductTypef3 HcalCPUDigisProducer::digisf3HB_
private

Definition at line 46 of file HcalCPUDigisProducer.cc.

Referenced by acquire(), and produce().

◆ digisF3HBTokenIn_

edm::EDGetTokenT<IProductTypef3> HcalCPUDigisProducer::digisF3HBTokenIn_
private

Definition at line 31 of file HcalCPUDigisProducer.cc.

Referenced by acquire().

◆ digisF3HBTokenOut_

edm::EDPutTokenT<OProductTypef3> HcalCPUDigisProducer::digisF3HBTokenOut_
private

Definition at line 41 of file HcalCPUDigisProducer.cc.

Referenced by produce().

◆ digisf5HB_

OProductTypef5 HcalCPUDigisProducer::digisf5HB_
private

Definition at line 45 of file HcalCPUDigisProducer.cc.

Referenced by acquire(), and produce().

◆ digisF5HBTokenIn_

edm::EDGetTokenT<IProductTypef5> HcalCPUDigisProducer::digisF5HBTokenIn_
private

Definition at line 29 of file HcalCPUDigisProducer.cc.

Referenced by acquire().

◆ digisF5HBTokenOut_

edm::EDPutTokenT<OProductTypef5> HcalCPUDigisProducer::digisF5HBTokenOut_
private

Definition at line 38 of file HcalCPUDigisProducer.cc.

Referenced by produce().