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

void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 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 60 of file HEBRecHitGPU.cc.

References edm::ParameterSet::getParameter().

61  : uncalibRecHitCPUToken_{consumes<HGCUncalibratedRecHitCollection>(
62  ps.getParameter<edm::InputTag>("HGCHEBUncalibRecHitsTok"))},
63  recHitGPUToken_{produces<cms::cuda::Product<HGCRecHitGPUProduct>>()} {
64  cdata_.keV2DIGI_ = ps.getParameter<double>("HGCHEB_keV2DIGI");
65  cdata_.noise_MIP_ = ps.getParameter<edm::ParameterSet>("HGCHEB_noise_MIP").getParameter<double>("noise_MIP");
66  vdata_.weights_ = ps.getParameter<std::vector<double>>("weights");
68  cdata_.layerOffset_ = 28;
70 
73 
74  tools_ = std::make_unique<hgcal::RecHitTools>();
75 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HGCConstantVectorData vdata_
Definition: HEBRecHitGPU.cc:40
edm::EDPutTokenT< cms::cuda::Product< HGCRecHitGPUProduct > > recHitGPUToken_
Definition: HEBRecHitGPU.cc:34
HGChebUncalibRecHitConstantData cdata_
Definition: HEBRecHitGPU.cc:39
void convert_constant_data_(KernelConstantData< HGChebUncalibRecHitConstantData > *)
std::unique_ptr< hgcal::RecHitTools > tools_
Definition: HEBRecHitGPU.cc:47
edm::EDGetTokenT< HGChebUncalibratedRecHitCollection > uncalibRecHitCPUToken_
Definition: HEBRecHitGPU.cc:33
KernelConstantData< HGChebUncalibRecHitConstantData > * kcdata_
Definition: HEBRecHitGPU.cc:57
void assert_sizes_constants_(const HGCConstantVectorData &)
Definition: HEBRecHitGPU.cc:86

◆ ~HEBRecHitGPU()

HEBRecHitGPU::~HEBRecHitGPU ( )
override

Definition at line 77 of file HEBRecHitGPU.cc.

References kcdata_.

77 { delete kcdata_; }
KernelConstantData< HGChebUncalibRecHitConstantData > * kcdata_
Definition: HEBRecHitGPU.cc:57

Member Function Documentation

◆ assert_error_message_()

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

Definition at line 79 of file HEBRecHitGPU.cc.

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

Referenced by assert_sizes_constants_().

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

◆ assert_sizes_constants_()

void HEBRecHitGPU::assert_sizes_constants_ ( const HGCConstantVectorData vd)
private

Definition at line 86 of file HEBRecHitGPU.cc.

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

86  {
88  edm::LogError("WrongSize") << this->assert_error_message_("weights", vdata_.fCPerMIP_.size());
89 }
HGCConstantVectorData vdata_
Definition: HEBRecHitGPU.cc:40
std::string assert_error_message_(std::string, const size_t &)
Definition: HEBRecHitGPU.cc:79

◆ beginRun()

void HEBRecHitGPU::beginRun ( edm::Run const &  ,
edm::EventSetup const &  setup 
)
override

Definition at line 91 of file HEBRecHitGPU.cc.

91 {}

◆ 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 93 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_.

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

Member Data Documentation

◆ cdata_

HGChebUncalibRecHitConstantData HEBRecHitGPU::cdata_
private

Definition at line 39 of file HEBRecHitGPU.cc.

◆ d_uncalib_

HGCUncalibRecHitDevice HEBRecHitGPU::d_uncalib_
private

Definition at line 54 of file HEBRecHitGPU.cc.

Referenced by produce().

◆ h_uncalib_

HGCUncalibRecHitHost<HGChebUncalibratedRecHitCollection> HEBRecHitGPU::h_uncalib_
private

Definition at line 55 of file HEBRecHitGPU.cc.

Referenced by produce().

◆ kcdata_

KernelConstantData<HGChebUncalibRecHitConstantData>* HEBRecHitGPU::kcdata_
private

Definition at line 57 of file HEBRecHitGPU.cc.

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

◆ prod_

HGCRecHitGPUProduct HEBRecHitGPU::prod_
private

Definition at line 53 of file HEBRecHitGPU.cc.

Referenced by produce().

◆ recHitGPUToken_

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

Definition at line 34 of file HEBRecHitGPU.cc.

Referenced by produce().

◆ rechits_

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

Definition at line 36 of file HEBRecHitGPU.cc.

Referenced by produce().

◆ tools_

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

Definition at line 47 of file HEBRecHitGPU.cc.

◆ uncalibRecHitCPUToken_

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

Definition at line 33 of file HEBRecHitGPU.cc.

Referenced by produce().

◆ vdata_

HGCConstantVectorData HEBRecHitGPU::vdata_
private

Definition at line 40 of file HEBRecHitGPU.cc.

Referenced by assert_sizes_constants_().