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.

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"))} {}

References edm::ParameterSet::getParameter().

◆ ~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.

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 }

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.

◆ fillDescriptions()

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

Definition at line 49 of file HcalCPUDigisProducer.cc.

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 }

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

◆ produce()

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

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().

HcalCPUDigisProducer::digisF3HBTokenOut_
edm::EDPutTokenT< OProductTypef3 > digisF3HBTokenOut_
Definition: HcalCPUDigisProducer.cc:41
HcalCPUDigisProducer::digisf5HB_
OProductTypef5 digisf5HB_
Definition: HcalCPUDigisProducer.cc:45
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HcalCPUDigisProducer::digisF01HETokenIn_
edm::EDGetTokenT< IProductTypef01 > digisF01HETokenIn_
Definition: HcalCPUDigisProducer.cc:27
hcal::DigiCollectionBase::resize
std::enable_if< std::is_same< T, ::calo::common::tags::Vec >::value, void >::type resize(std::size_t size)
Definition: DigiCollection.h:98
HcalCPUDigisProducer::digisf3HB_
OProductTypef3 digisf3HB_
Definition: HcalCPUDigisProducer.cc:46
TrackRefitter_38T_cff.src
src
Definition: TrackRefitter_38T_cff.py:24
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:40
HcalCPUDigisProducer::digisF01HETokenOut_
edm::EDPutTokenT< OProductTypef01 > digisF01HETokenOut_
Definition: HcalCPUDigisProducer.cc:35
HcalCPUDigisProducer::digisF3HBTokenIn_
edm::EDGetTokenT< IProductTypef3 > digisF3HBTokenIn_
Definition: HcalCPUDigisProducer.cc:31
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
HcalCPUDigisProducer::digisF5HBTokenIn_
edm::EDGetTokenT< IProductTypef5 > digisF5HBTokenIn_
Definition: HcalCPUDigisProducer.cc:29
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
hcal::DigiCollectionBase::stride
uint32_t stride
Definition: DigiCollection.h:117
cms::cuda::ScopedContextAcquire
Definition: ScopedContext.h:101
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
hcal::DigiCollectionBase::data
StoragePolicy::template StorageSelector< uint16_t >::type data
Definition: DigiCollection.h:116
cudaCheck
#define cudaCheck(ARG,...)
Definition: cudaCheck.h:69
relativeConstraints.value
value
Definition: relativeConstraints.py:53
HcalCPUDigisProducer::digisf01HE_
OProductTypef01 digisf01HE_
Definition: HcalCPUDigisProducer.cc:44
hcal::DigiCollectionBase::ids
StoragePolicy::template StorageSelector< uint32_t >::type ids
Definition: DigiCollection.h:115
edm::InputTag
Definition: InputTag.h:15
HcalCPUDigisProducer::digisF5HBTokenOut_
edm::EDPutTokenT< OProductTypef5 > digisF5HBTokenOut_
Definition: HcalCPUDigisProducer.cc:38
edm::ConfigurationDescriptions::addWithDefaultLabel
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:87
mps_fire.dest
dest
Definition: mps_fire.py:179