CMS 3D CMS Logo

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

Public Member Functions

 EcalCPUUncalibRecHitProducer (edm::ParameterSet const &ps)
 
 ~EcalCPUUncalibRecHitProducer () 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 InputProduct = cms::cuda::Product< ecal::UncalibratedRecHit< calo::common::DevStoragePolicy > >
 
using OutputProduct = ecal::UncalibratedRecHit< 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

bool containsTimingInformation_
 
OutputProduct recHitsEB_
 
OutputProduct recHitsEE_
 
edm::EDGetTokenT< InputProductrecHitsInEBToken_
 
edm::EDGetTokenT< InputProductrecHitsInEEToken_
 
edm::EDPutTokenT< OutputProductrecHitsOutEBToken_
 
edm::EDPutTokenT< OutputProductrecHitsOutEEToken_
 

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 19 of file EcalCPUUncalibRecHitProducer.cc.

Member Typedef Documentation

◆ InputProduct

Definition at line 30 of file EcalCPUUncalibRecHitProducer.cc.

◆ OutputProduct

Definition at line 32 of file EcalCPUUncalibRecHitProducer.cc.

Constructor & Destructor Documentation

◆ EcalCPUUncalibRecHitProducer()

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

Definition at line 51 of file EcalCPUUncalibRecHitProducer.cc.

52  : recHitsInEBToken_{consumes<InputProduct>(ps.getParameter<edm::InputTag>("recHitsInLabelEB"))},
53  recHitsInEEToken_{consumes<InputProduct>(ps.getParameter<edm::InputTag>("recHitsInLabelEE"))},
54  recHitsOutEBToken_{produces<OutputProduct>(ps.getParameter<std::string>("recHitsOutLabelEB"))},
55  recHitsOutEEToken_{produces<OutputProduct>(ps.getParameter<std::string>("recHitsOutLabelEE"))},
56  containsTimingInformation_{ps.getParameter<bool>("containsTimingInformation")} {}

References edm::ParameterSet::getParameter().

◆ ~EcalCPUUncalibRecHitProducer()

EcalCPUUncalibRecHitProducer::~EcalCPUUncalibRecHitProducer ( )
override

Definition at line 58 of file EcalCPUUncalibRecHitProducer.cc.

58 {}

Member Function Documentation

◆ acquire()

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

Definition at line 60 of file EcalCPUUncalibRecHitProducer.cc.

62  {
63  // retrieve data/ctx
64  auto const& ebRecHitsProduct = event.get(recHitsInEBToken_);
65  auto const& eeRecHitsProduct = event.get(recHitsInEEToken_);
66  cms::cuda::ScopedContextAcquire ctx{ebRecHitsProduct, std::move(taskHolder)};
67  auto const& ebRecHits = ctx.get(ebRecHitsProduct);
68  auto const& eeRecHits = ctx.get(eeRecHitsProduct);
69 
70  // resize the output buffers
71  recHitsEB_.resize(ebRecHits.size);
72  recHitsEE_.resize(eeRecHits.size);
73 
74  auto lambdaToTransfer = [&ctx](auto& dest, auto* src) {
75  using vector_type = typename std::remove_reference<decltype(dest)>::type;
76  using type = typename vector_type::value_type;
77  using src_type = typename std::remove_pointer<decltype(src)>::type;
78  static_assert(std::is_same<src_type, type>::value && "dst and src data types do not match");
79  cudaCheck(cudaMemcpyAsync(dest.data(), src, dest.size() * sizeof(type), cudaMemcpyDeviceToHost, ctx.stream()));
80  };
81 
82  // enqeue transfers
83  lambdaToTransfer(recHitsEB_.did, ebRecHits.did.get());
84  lambdaToTransfer(recHitsEE_.did, eeRecHits.did.get());
85 
86  lambdaToTransfer(recHitsEB_.amplitudesAll, ebRecHits.amplitudesAll.get());
87  lambdaToTransfer(recHitsEE_.amplitudesAll, eeRecHits.amplitudesAll.get());
88 
89  lambdaToTransfer(recHitsEB_.amplitude, ebRecHits.amplitude.get());
90  lambdaToTransfer(recHitsEE_.amplitude, eeRecHits.amplitude.get());
91 
92  lambdaToTransfer(recHitsEB_.chi2, ebRecHits.chi2.get());
93  lambdaToTransfer(recHitsEE_.chi2, eeRecHits.chi2.get());
94 
95  lambdaToTransfer(recHitsEB_.pedestal, ebRecHits.pedestal.get());
96  lambdaToTransfer(recHitsEE_.pedestal, eeRecHits.pedestal.get());
97 
98  lambdaToTransfer(recHitsEB_.flags, ebRecHits.flags.get());
99  lambdaToTransfer(recHitsEE_.flags, eeRecHits.flags.get());
100 
102  lambdaToTransfer(recHitsEB_.jitter, ebRecHits.jitter.get());
103  lambdaToTransfer(recHitsEE_.jitter, eeRecHits.jitter.get());
104 
105  lambdaToTransfer(recHitsEB_.jitterError, ebRecHits.jitterError.get());
106  lambdaToTransfer(recHitsEE_.jitterError, eeRecHits.jitterError.get());
107  }
108 }

References ecal::UncalibratedRecHit< StoragePolicy >::amplitude, ecal::UncalibratedRecHit< StoragePolicy >::amplitudesAll, ecal::UncalibratedRecHit< StoragePolicy >::chi2, containsTimingInformation_, cudaCheck, mps_fire::dest, ecal::UncalibratedRecHit< StoragePolicy >::did, ecal::UncalibratedRecHit< StoragePolicy >::flags, ecal::UncalibratedRecHit< StoragePolicy >::jitter, ecal::UncalibratedRecHit< StoragePolicy >::jitterError, eostools::move(), ecal::UncalibratedRecHit< StoragePolicy >::pedestal, recHitsEB_, recHitsEE_, recHitsInEBToken_, recHitsInEEToken_, ecal::UncalibratedRecHit< StoragePolicy >::resize(), TrackRefitter_38T_cff::src, and relativeConstraints::value.

◆ fillDescriptions()

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

Definition at line 39 of file EcalCPUUncalibRecHitProducer.cc.

39  {
41 
42  desc.add<edm::InputTag>("recHitsInLabelEB", edm::InputTag{"ecalUncalibRecHitProducerGPU", "EcalUncalibRecHitsEB"});
43  desc.add<edm::InputTag>("recHitsInLabelEE", edm::InputTag{"ecalUncalibRecHitProducerGPU", "EcalUncalibRecHitsEE"});
44  desc.add<std::string>("recHitsOutLabelEB", "EcalUncalibRecHitsEB");
45  desc.add<std::string>("recHitsOutLabelEE", "EcalUncalibRecHitsEE");
46  desc.add<bool>("containsTimingInformation", false);
47 
48  confDesc.add("ecalCPUUncalibRecHitProducer", desc);
49 }

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

◆ produce()

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

Definition at line 110 of file EcalCPUUncalibRecHitProducer.cc.

110  {
111  // tmp vectors
112  auto recHitsOutEB = std::make_unique<OutputProduct>(std::move(recHitsEB_));
113  auto recHitsOutEE = std::make_unique<OutputProduct>(std::move(recHitsEE_));
114 
115  // put into event
116  event.put(recHitsOutEBToken_, std::move(recHitsOutEB));
117  event.put(recHitsOutEEToken_, std::move(recHitsOutEE));
118 }

References eostools::move(), recHitsEB_, recHitsEE_, recHitsOutEBToken_, and recHitsOutEEToken_.

Member Data Documentation

◆ containsTimingInformation_

bool EcalCPUUncalibRecHitProducer::containsTimingInformation_
private

Definition at line 36 of file EcalCPUUncalibRecHitProducer.cc.

Referenced by acquire().

◆ recHitsEB_

OutputProduct EcalCPUUncalibRecHitProducer::recHitsEB_
private

Definition at line 35 of file EcalCPUUncalibRecHitProducer.cc.

Referenced by acquire(), and produce().

◆ recHitsEE_

OutputProduct EcalCPUUncalibRecHitProducer::recHitsEE_
private

Definition at line 35 of file EcalCPUUncalibRecHitProducer.cc.

Referenced by acquire(), and produce().

◆ recHitsInEBToken_

edm::EDGetTokenT<InputProduct> EcalCPUUncalibRecHitProducer::recHitsInEBToken_
private

Definition at line 31 of file EcalCPUUncalibRecHitProducer.cc.

Referenced by acquire().

◆ recHitsInEEToken_

edm::EDGetTokenT<InputProduct> EcalCPUUncalibRecHitProducer::recHitsInEEToken_
private

Definition at line 31 of file EcalCPUUncalibRecHitProducer.cc.

Referenced by acquire().

◆ recHitsOutEBToken_

edm::EDPutTokenT<OutputProduct> EcalCPUUncalibRecHitProducer::recHitsOutEBToken_
private

Definition at line 33 of file EcalCPUUncalibRecHitProducer.cc.

Referenced by produce().

◆ recHitsOutEEToken_

edm::EDPutTokenT<OutputProduct> EcalCPUUncalibRecHitProducer::recHitsOutEEToken_
private

Definition at line 33 of file EcalCPUUncalibRecHitProducer.cc.

Referenced by produce().

ecal::UncalibratedRecHit::jitter
StoragePolicy::template StorageSelector< reco::StorageScalarType >::type jitter
Definition: EcalUncalibratedRecHit.h:26
EcalCPUUncalibRecHitProducer::recHitsOutEBToken_
edm::EDPutTokenT< OutputProduct > recHitsOutEBToken_
Definition: EcalCPUUncalibRecHitProducer.cc:33
ecal::UncalibratedRecHit::jitterError
StoragePolicy::template StorageSelector< reco::StorageScalarType >::type jitterError
Definition: EcalUncalibratedRecHit.h:27
ecal::UncalibratedRecHit::amplitudesAll
StoragePolicy::template StorageSelector< reco::ComputationScalarType >::type amplitudesAll
Definition: EcalUncalibratedRecHit.h:22
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ecal::UncalibratedRecHit::did
StoragePolicy::template StorageSelector< uint32_t >::type did
Definition: EcalUncalibratedRecHit.h:28
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
ecal::UncalibratedRecHit::pedestal
StoragePolicy::template StorageSelector< reco::StorageScalarType >::type pedestal
Definition: EcalUncalibratedRecHit.h:25
EcalCPUUncalibRecHitProducer::recHitsOutEEToken_
edm::EDPutTokenT< OutputProduct > recHitsOutEEToken_
Definition: EcalCPUUncalibRecHitProducer.cc:33
EcalCPUUncalibRecHitProducer::containsTimingInformation_
bool containsTimingInformation_
Definition: EcalCPUUncalibRecHitProducer.cc:36
ecal::UncalibratedRecHit::resize
std::enable_if< std::is_same< U, ::calo::common::tags::Vec >::value, void >::type resize(size_t size)
Definition: EcalUncalibratedRecHit.h:32
ecal::UncalibratedRecHit::amplitude
StoragePolicy::template StorageSelector< reco::StorageScalarType >::type amplitude
Definition: EcalUncalibratedRecHit.h:23
EcalCPUUncalibRecHitProducer::recHitsEE_
OutputProduct recHitsEE_
Definition: EcalCPUUncalibRecHitProducer.cc:35
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
EcalCPUUncalibRecHitProducer::recHitsEB_
OutputProduct recHitsEB_
Definition: EcalCPUUncalibRecHitProducer.cc:35
reco::JetExtendedAssociation::value_type
Container::value_type value_type
Definition: JetExtendedAssociation.h:30
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
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
cudaCheck
#define cudaCheck(ARG,...)
Definition: cudaCheck.h:69
relativeConstraints.value
value
Definition: relativeConstraints.py:53
ecal::UncalibratedRecHit::chi2
StoragePolicy::template StorageSelector< reco::StorageScalarType >::type chi2
Definition: EcalUncalibratedRecHit.h:24
ecal::UncalibratedRecHit::flags
StoragePolicy::template StorageSelector< uint32_t >::type flags
Definition: EcalUncalibratedRecHit.h:29
EcalCPUUncalibRecHitProducer::recHitsInEBToken_
edm::EDGetTokenT< InputProduct > recHitsInEBToken_
Definition: EcalCPUUncalibRecHitProducer.cc:31
edm::InputTag
Definition: InputTag.h:15
mps_fire.dest
dest
Definition: mps_fire.py:179
EcalCPUUncalibRecHitProducer::recHitsInEEToken_
edm::EDGetTokenT< InputProduct > recHitsInEEToken_
Definition: EcalCPUUncalibRecHitProducer.cc:31