CMS 3D CMS Logo

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

Public Member Functions

 HEBRecHitGPU (const edm::ParameterSet &ps)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~HEBRecHitGPU () override
 
- 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
 

Private Member Functions

std::string assert_error_message_ (std::string, const size_t &)
 
void assert_sizes_constants_ (const HGCConstantVectorData &)
 
void convert_collection_data_to_soa_ (const uint32_t &, const HGChebUncalibratedRecHitCollection &)
 
void convert_constant_data_ (KernelConstantData< HGChebUncalibRecHitConstantData > *)
 

Private Attributes

HGChebUncalibRecHitConstantData cdata_
 
HGCUncalibRecHitDevice d_uncalib_
 
HGCUncalibRecHitHost< HGChebUncalibratedRecHitCollectionh_uncalib_
 
KernelConstantData< HGChebUncalibRecHitConstantData > * kcdata_
 
HGCRecHitGPUProduct prod_
 
edm::EDPutTokenT< cms::cuda::Product< HGCRecHitGPUProduct > > recHitGPUToken_
 
std::unique_ptr< HGChebRecHitCollectionrechits_
 
std::unique_ptr< hgcal::RecHitToolstools_
 
edm::EDGetTokenT< HGChebUncalibratedRecHitCollectionuncalibRecHitCPUToken_
 
HGCConstantVectorData vdata_
 

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 24 of file HEBRecHitGPU.cc.

Constructor & Destructor Documentation

◆ HEBRecHitGPU()

HEBRecHitGPU::HEBRecHitGPU ( const edm::ParameterSet ps)
explicit

Definition at line 59 of file HEBRecHitGPU.cc.

References edm::ParameterSet::getParameter().

60  : uncalibRecHitCPUToken_{consumes<HGCUncalibratedRecHitCollection>(
61  ps.getParameter<edm::InputTag>("HGCHEBUncalibRecHitsTok"))},
62  recHitGPUToken_{produces<cms::cuda::Product<HGCRecHitGPUProduct>>()} {
63  cdata_.keV2DIGI_ = ps.getParameter<double>("HGCHEB_keV2DIGI");
64  cdata_.noise_MIP_ = ps.getParameter<edm::ParameterSet>("HGCHEB_noise_MIP").getParameter<double>("noise_MIP");
65  vdata_.weights_ = ps.getParameter<std::vector<double>>("weights");
67  cdata_.layerOffset_ = 28;
69 
72 
73  tools_ = std::make_unique<hgcal::RecHitTools>();
74 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
HGCConstantVectorData vdata_
Definition: HEBRecHitGPU.cc:39
edm::EDPutTokenT< cms::cuda::Product< HGCRecHitGPUProduct > > recHitGPUToken_
Definition: HEBRecHitGPU.cc:33
HGChebUncalibRecHitConstantData cdata_
Definition: HEBRecHitGPU.cc:38
void convert_constant_data_(KernelConstantData< HGChebUncalibRecHitConstantData > *)
std::unique_ptr< hgcal::RecHitTools > tools_
Definition: HEBRecHitGPU.cc:46
edm::EDGetTokenT< HGChebUncalibratedRecHitCollection > uncalibRecHitCPUToken_
Definition: HEBRecHitGPU.cc:32
KernelConstantData< HGChebUncalibRecHitConstantData > * kcdata_
Definition: HEBRecHitGPU.cc:56
void assert_sizes_constants_(const HGCConstantVectorData &)
Definition: HEBRecHitGPU.cc:85

◆ ~HEBRecHitGPU()

HEBRecHitGPU::~HEBRecHitGPU ( )
override

Definition at line 76 of file HEBRecHitGPU.cc.

References kcdata_.

76 { delete kcdata_; }
KernelConstantData< HGChebUncalibRecHitConstantData > * kcdata_
Definition: HEBRecHitGPU.cc:56

Member Function Documentation

◆ assert_error_message_()

std::string HEBRecHitGPU::assert_error_message_ ( std::string  var,
const size_t &  s 
)
private

Definition at line 78 of file HEBRecHitGPU.cc.

References alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, to_string(), and trigObjTnPSource_cfi::var.

Referenced by assert_sizes_constants_().

78  {
79  std::string str1 = "The '";
80  std::string str2 = "' array must be of size ";
81  std::string str3 = " to hold the configuration data.";
82  return str1 + var + str2 + std::to_string(s) + str3;
83 }
static std::string to_string(const XMLCh *ch)

◆ assert_sizes_constants_()

void HEBRecHitGPU::assert_sizes_constants_ ( const HGCConstantVectorData vd)
private

Definition at line 85 of file HEBRecHitGPU.cc.

References assert_error_message_(), HGCConstantVectorData::fCPerMIP_, HGChebUncalibRecHitConstantData::heb_weights, vdata_, and HGCConstantVectorData::weights_.

85  {
87  edm::LogError("WrongSize") << this->assert_error_message_("weights", vdata_.fCPerMIP_.size());
88 }
HGCConstantVectorData vdata_
Definition: HEBRecHitGPU.cc:39
std::string assert_error_message_(std::string, const size_t &)
Definition: HEBRecHitGPU.cc:78

◆ convert_collection_data_to_soa_()

void HEBRecHitGPU::convert_collection_data_to_soa_ ( const uint32_t &  ,
const HGChebUncalibratedRecHitCollection  
)
private

◆ convert_constant_data_()

void HEBRecHitGPU::convert_constant_data_ ( KernelConstantData< HGChebUncalibRecHitConstantData > *  kcdata)
private

◆ produce()

void HEBRecHitGPU::produce ( edm::Event event,
const edm::EventSetup setup 
)
override

Definition at line 90 of file HEBRecHitGPU.cc.

References d_uncalib_, HGCUncalibRecHitDevice::get(), HGCRecHitGPUProduct::get(), h_uncalib_, hfClusterShapes_cfi::hits, kcdata_, eostools::move(), nhits, prod_, recHitGPUToken_, rechits_, KernelManagerHGCalRecHit::run_kernels(), and uncalibRecHitCPUToken_.

90  {
91  cms::cuda::ScopedContextProduce ctx{event.streamID()};
92 
93  const auto &hits = event.get(uncalibRecHitCPUToken_);
94  unsigned int nhits(hits.size());
95  rechits_ = std::make_unique<HGCRecHitCollection>();
96 
97  if (nhits == 0)
98  edm::LogError("HEBRecHitGPU") << "WARNING: no input hits!";
99 
100  prod_ = HGCRecHitGPUProduct(nhits, ctx.stream());
101  d_uncalib_ = HGCUncalibRecHitDevice(nhits, ctx.stream());
103 
105  km.run_kernels(kcdata_, ctx.stream());
106 
107  ctx.emplace(event, recHitGPUToken_, std::move(prod_));
108 }
Log< level::Error, false > LogError
edm::EDPutTokenT< cms::cuda::Product< HGCRecHitGPUProduct > > recHitGPUToken_
Definition: HEBRecHitGPU.cc:33
HGCUncalibRecHitDevice d_uncalib_
Definition: HEBRecHitGPU.cc:53
HGCRecHitGPUProduct prod_
Definition: HEBRecHitGPU.cc:52
void run_kernels(const KernelConstantData< HGCeeUncalibRecHitConstantData > *, const cudaStream_t &)
std::unique_ptr< HGChebRecHitCollection > rechits_
Definition: HEBRecHitGPU.cc:35
HGCUncalibRecHitHost< HGChebUncalibratedRecHitCollection > h_uncalib_
Definition: HEBRecHitGPU.cc:54
HGCUncalibRecHitSoA get() const
edm::EDGetTokenT< HGChebUncalibratedRecHitCollection > uncalibRecHitCPUToken_
Definition: HEBRecHitGPU.cc:32
KernelConstantData< HGChebUncalibRecHitConstantData > * kcdata_
Definition: HEBRecHitGPU.cc:56
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1

Member Data Documentation

◆ cdata_

HGChebUncalibRecHitConstantData HEBRecHitGPU::cdata_
private

Definition at line 38 of file HEBRecHitGPU.cc.

◆ d_uncalib_

HGCUncalibRecHitDevice HEBRecHitGPU::d_uncalib_
private

Definition at line 53 of file HEBRecHitGPU.cc.

Referenced by produce().

◆ h_uncalib_

HGCUncalibRecHitHost<HGChebUncalibratedRecHitCollection> HEBRecHitGPU::h_uncalib_
private

Definition at line 54 of file HEBRecHitGPU.cc.

Referenced by produce().

◆ kcdata_

KernelConstantData<HGChebUncalibRecHitConstantData>* HEBRecHitGPU::kcdata_
private

Definition at line 56 of file HEBRecHitGPU.cc.

Referenced by produce(), and ~HEBRecHitGPU().

◆ prod_

HGCRecHitGPUProduct HEBRecHitGPU::prod_
private

Definition at line 52 of file HEBRecHitGPU.cc.

Referenced by produce().

◆ recHitGPUToken_

edm::EDPutTokenT<cms::cuda::Product<HGCRecHitGPUProduct> > HEBRecHitGPU::recHitGPUToken_
private

Definition at line 33 of file HEBRecHitGPU.cc.

Referenced by produce().

◆ rechits_

std::unique_ptr<HGChebRecHitCollection> HEBRecHitGPU::rechits_
private

Definition at line 35 of file HEBRecHitGPU.cc.

Referenced by produce().

◆ tools_

std::unique_ptr<hgcal::RecHitTools> HEBRecHitGPU::tools_
private

Definition at line 46 of file HEBRecHitGPU.cc.

◆ uncalibRecHitCPUToken_

edm::EDGetTokenT<HGChebUncalibratedRecHitCollection> HEBRecHitGPU::uncalibRecHitCPUToken_
private

Definition at line 32 of file HEBRecHitGPU.cc.

Referenced by produce().

◆ vdata_

HGCConstantVectorData HEBRecHitGPU::vdata_
private

Definition at line 39 of file HEBRecHitGPU.cc.

Referenced by assert_sizes_constants_().