CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
< HGChebUncalibratedRecHitCollection
h_uncalib_
 
KernelConstantData
< HGChebUncalibRecHitConstantData > * 
kcdata_
 
HGCRecHitGPUProduct prod_
 
edm::EDPutTokenT
< cms::cuda::Product
< HGCRecHitGPUProduct > > 
recHitGPUToken_
 
std::unique_ptr
< HGChebRecHitCollection
rechits_
 
std::unique_ptr
< hgcal::RecHitTools
tools_
 
edm::EDGetTokenT
< HGChebUncalibratedRecHitCollection
uncalibRecHitCPUToken_
 
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 ( 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 }
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
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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 ( )
override

Definition at line 77 of file HEBRecHitGPU.cc.

References kcdata_.

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

Member Function Documentation

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

Definition at line 79 of file HEBRecHitGPU.cc.

References AlCaHLTBitMon_QueryRunRegistry::string, and cond::impl::to_string().

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 }
std::string to_string(const V &value)
Definition: OMSAccess.h:71
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
void HEBRecHitGPU::beginRun ( edm::Run const &  ,
edm::EventSetup const &  setup 
)
override

Definition at line 91 of file HEBRecHitGPU.cc.

91 {}
void HEBRecHitGPU::convert_collection_data_to_soa_ ( const uint32_t &  ,
const HGChebUncalibratedRecHitCollection  
)
private
void HEBRecHitGPU::convert_constant_data_ ( KernelConstantData< HGChebUncalibRecHitConstantData > *  kcdata)
private
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(), cms::cuda::impl::ScopedContextGetterBase::get(), h_uncalib_, 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 
107  KernelManagerHGCalRecHit km(h_uncalib_.get(), d_uncalib_.get(), prod_.get());
108  km.run_kernels(kcdata_, ctx.stream());
109 
110  ctx.emplace(event, recHitGPUToken_, std::move(prod_));
111 }
HGCUncalibRecHitSoA get() const
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
def move
Definition: eostools.py:511
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
edm::EDGetTokenT< HGChebUncalibratedRecHitCollection > uncalibRecHitCPUToken_
Definition: HEBRecHitGPU.cc:33
const T & get(const Product< T > &data)
Definition: ScopedContext.h:58
KernelConstantData< HGChebUncalibRecHitConstantData > * kcdata_
Definition: HEBRecHitGPU.cc:57

Member Data Documentation

HGChebUncalibRecHitConstantData HEBRecHitGPU::cdata_
private

Definition at line 39 of file HEBRecHitGPU.cc.

HGCUncalibRecHitDevice HEBRecHitGPU::d_uncalib_
private

Definition at line 54 of file HEBRecHitGPU.cc.

Referenced by produce().

HGCUncalibRecHitHost<HGChebUncalibratedRecHitCollection> HEBRecHitGPU::h_uncalib_
private

Definition at line 55 of file HEBRecHitGPU.cc.

Referenced by produce().

KernelConstantData<HGChebUncalibRecHitConstantData>* HEBRecHitGPU::kcdata_
private

Definition at line 57 of file HEBRecHitGPU.cc.

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

HGCRecHitGPUProduct HEBRecHitGPU::prod_
private

Definition at line 53 of file HEBRecHitGPU.cc.

Referenced by produce().

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

Definition at line 34 of file HEBRecHitGPU.cc.

Referenced by produce().

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

Definition at line 36 of file HEBRecHitGPU.cc.

Referenced by produce().

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

Definition at line 47 of file HEBRecHitGPU.cc.

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

Definition at line 33 of file HEBRecHitGPU.cc.

Referenced by produce().

HGCConstantVectorData HEBRecHitGPU::vdata_
private

Definition at line 40 of file HEBRecHitGPU.cc.

Referenced by assert_sizes_constants_().