CMS 3D CMS Logo

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

Public Member Functions

 EcalUncalibRecHitPhase2WeightsProducerGPU (edm::ParameterSet const &ps)
 
 ~EcalUncalibRecHitPhase2WeightsProducerGPU () override=default
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 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 InputProduct = cms::cuda::Product< ecal::DigisCollection< calo::common::DevStoragePolicy > >
 
using OutputProduct = cms::cuda::Product< ecal::UncalibratedRecHit< calo::common::DevStoragePolicy > >
 

Private Member Functions

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

Private Attributes

const edm::EDGetTokenT< InputProductdigisToken_
 
ecal::weights::EventOutputDataGPU eventOutputDataGPU_
 
const edm::EDPutTokenT< OutputProductrecHitsToken_
 
const std::vector< double, cms::cuda::HostAllocator< double > > weights_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
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 14 of file EcalUncalibRecHitPhase2WeightsProducerGPU.cc.

Member Typedef Documentation

◆ InputProduct

Definition at line 26 of file EcalUncalibRecHitPhase2WeightsProducerGPU.cc.

◆ OutputProduct

Definition at line 28 of file EcalUncalibRecHitPhase2WeightsProducerGPU.cc.

Constructor & Destructor Documentation

◆ EcalUncalibRecHitPhase2WeightsProducerGPU()

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

Definition at line 36 of file EcalUncalibRecHitPhase2WeightsProducerGPU.cc.

References createJobs::tmp.

37  : // use lambda to initialise the vector with CUDA::HostAllocator from a normal vector
38  weights_([tmp = ps.getParameter<std::vector<double>>("weights")] {
39  return std::vector<double, cms::cuda::HostAllocator<double>>(tmp.begin(), tmp.end());
40  }()),
41  digisToken_{consumes<InputProduct>(ps.getParameter<edm::InputTag>("digisLabelEB"))},
42  recHitsToken_{produces<OutputProduct>(ps.getParameter<std::string>("recHitsLabelEB"))} {}
const std::vector< double, cms::cuda::HostAllocator< double > > weights_
tmp
align.sh
Definition: createJobs.py:716

◆ ~EcalUncalibRecHitPhase2WeightsProducerGPU()

EcalUncalibRecHitPhase2WeightsProducerGPU::~EcalUncalibRecHitPhase2WeightsProducerGPU ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

void EcalUncalibRecHitPhase2WeightsProducerGPU::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 44 of file EcalUncalibRecHitPhase2WeightsProducerGPU.cc.

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

44  {
46 
47  desc.add<std::string>("recHitsLabelEB", "EcalUncalibRecHitsEB");
48  //The below weights values should be kept up to date with those on the CPU version of this module
49  desc.add<std::vector<double>>("weights",
50  {-0.121016,
51  -0.119899,
52  -0.120923,
53  -0.0848959,
54  0.261041,
55  0.509881,
56  0.373591,
57  0.134899,
58  -0.0233605,
59  -0.0913195,
60  -0.112452,
61  -0.118596,
62  -0.121737,
63  -0.121737,
64  -0.121737,
65  -0.121737});
66 
67  desc.add<edm::InputTag>("digisLabelEB", edm::InputTag("simEcalUnsuppressedDigis", ""));
68 
69  descriptions.addWithDefaultLabel(desc);
70 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ produce()

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

Definition at line 72 of file EcalUncalibRecHitPhase2WeightsProducerGPU.cc.

References ecal::weights::EventOutputDataGPU::allocate(), cudaCheck, digisToken_, eventOutputDataGPU_, cms::cuda::impl::ScopedContextGetterBase::get(), EcalDataFrame_Ph2::MAXSAMPLES, eostools::move(), ecal::weights::phase2Weights(), ecal::weights::EventOutputDataGPU::recHits, recHitsToken_, findQualityFiles::size, and weights_.

72  {
73  // cuda products
74  auto const &digisProduct = event.get(digisToken_);
75  // raii
76  cms::cuda::ScopedContextProduce ctx{digisProduct};
77 
78  // get actual obj
79  auto const &digis = ctx.get(digisProduct);
80 
81  const uint32_t size = digis.size;
82 
83  // do not run the algo if there are no digis
84  if (size > 0) {
85  auto weights_d = cms::cuda::make_device_unique<double[]>(EcalDataFrame_Ph2::MAXSAMPLES, ctx.stream());
86 
87  cudaCheck(cudaMemcpyAsync(weights_d.get(),
88  weights_.data(),
89  EcalDataFrame_Ph2::MAXSAMPLES * sizeof(double),
90  cudaMemcpyHostToDevice,
91  ctx.stream()));
92 
93  // output on GPU
94  eventOutputDataGPU_.allocate(size, ctx.stream());
95 
96  ecal::weights::phase2Weights(digis, eventOutputDataGPU_, weights_d, ctx.stream());
97  }
98 
99  // set the size of digis
101 
102  // put into the event
104 }
size
Write out results.
const std::vector< double, cms::cuda::HostAllocator< double > > weights_
UncalibratedRecHit<::calo::common::DevStoragePolicy > recHits
void phase2Weights(ecal::DigisCollection< calo::common::DevStoragePolicy > const &, EventOutputDataGPU &, cms::cuda::device::unique_ptr< double[]> &, cudaStream_t)
static constexpr int MAXSAMPLES
void allocate(uint32_t digi_size, cudaStream_t cudaStream)
#define cudaCheck(ARG,...)
Definition: cudaCheck.h:69
const T & get(const Product< T > &data)
Definition: ScopedContext.h:58
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1

Member Data Documentation

◆ digisToken_

const edm::EDGetTokenT<InputProduct> EcalUncalibRecHitPhase2WeightsProducerGPU::digisToken_
private

Definition at line 27 of file EcalUncalibRecHitPhase2WeightsProducerGPU.cc.

Referenced by produce().

◆ eventOutputDataGPU_

ecal::weights::EventOutputDataGPU EcalUncalibRecHitPhase2WeightsProducerGPU::eventOutputDataGPU_
private

Definition at line 32 of file EcalUncalibRecHitPhase2WeightsProducerGPU.cc.

Referenced by produce().

◆ recHitsToken_

const edm::EDPutTokenT<OutputProduct> EcalUncalibRecHitPhase2WeightsProducerGPU::recHitsToken_
private

Definition at line 29 of file EcalUncalibRecHitPhase2WeightsProducerGPU.cc.

Referenced by produce().

◆ weights_

const std::vector<double, cms::cuda::HostAllocator<double> > EcalUncalibRecHitPhase2WeightsProducerGPU::weights_
private

Definition at line 24 of file EcalUncalibRecHitPhase2WeightsProducerGPU.cc.

Referenced by produce().