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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache 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.

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 }

References edm::ParameterSet::getParameter().

◆ ~HEBRecHitGPU()

HEBRecHitGPU::~HEBRecHitGPU ( )
override

Definition at line 77 of file HEBRecHitGPU.cc.

77 { delete kcdata_; }

References kcdata_.

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.

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 }

References alignCSCRings::s, AlCaHLTBitMon_QueryRunRegistry::string, and trigObjTnPSource_cfi::var.

Referenced by assert_sizes_constants_().

◆ assert_sizes_constants_()

void HEBRecHitGPU::assert_sizes_constants_ ( const HGCConstantVectorData vd)
private

◆ 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

Definition at line 113 of file HEBRecHitGPU.cc.

113  {
114  for (size_t i = 0; i < kcdata->vdata_.weights_.size(); ++i)
115  kcdata->data_.weights_[i] = kcdata->vdata_.weights_[i];
116 }

References KernelConstantData< T >::data_, mps_fire::i, KernelConstantData< T >::vdata_, HGCConstantVectorData::weights_, and HGChebUncalibRecHitConstantData::weights_.

◆ produce()

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

Definition at line 93 of file HEBRecHitGPU.cc.

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 }

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

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_().

HEBRecHitGPU::h_uncalib_
HGCUncalibRecHitHost< HGChebUncalibratedRecHitCollection > h_uncalib_
Definition: HEBRecHitGPU.cc:55
HGCUncalibRecHitHost
Definition: HGCUncalibRecHitHost.h:12
mps_fire.i
i
Definition: mps_fire.py:428
HEBRecHitGPU::assert_error_message_
std::string assert_error_message_(std::string, const size_t &)
Definition: HEBRecHitGPU.cc:79
HGChebUncalibRecHitConstantData::keV2DIGI_
double keV2DIGI_
Definition: HGCUncalibRecHitsToRecHitsConstants.h:67
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
KernelConstantData::vdata_
HGCConstantVectorData vdata_
Definition: KernelManagerHGCalRecHit.h:30
KernelConstantData::data_
T data_
Definition: KernelManagerHGCalRecHit.h:29
cms::cuda::ScopedContextProduce
Definition: ScopedContext.h:149
HEBRecHitGPU::tools_
std::unique_ptr< hgcal::RecHitTools > tools_
Definition: HEBRecHitGPU.cc:47
HGCRecHitGPUProduct
Definition: HGCRecHitGPUProduct.h:12
KernelManagerHGCalRecHit
Definition: KernelManagerHGCalRecHit.h:33
HGChebUncalibRecHitConstantData::layerOffset_
std::int32_t layerOffset_
Definition: HGCUncalibRecHitsToRecHitsConstants.h:70
HEBRecHitGPU::rechits_
std::unique_ptr< HGChebRecHitCollection > rechits_
Definition: HEBRecHitGPU.cc:36
HEBRecHitGPU::uncalibRecHitCPUToken_
edm::EDGetTokenT< HGChebUncalibratedRecHitCollection > uncalibRecHitCPUToken_
Definition: HEBRecHitGPU.cc:33
HGChebUncalibRecHitConstantData::weights_
double weights_[heb_weights]
Definition: HGCUncalibRecHitsToRecHitsConstants.h:65
trigObjTnPSource_cfi.var
var
Definition: trigObjTnPSource_cfi.py:21
alignCSCRings.s
s
Definition: alignCSCRings.py:92
HGChebUncalibRecHitConstantData::noise_MIP_
double noise_MIP_
Definition: HGCUncalibRecHitsToRecHitsConstants.h:69
HEBRecHitGPU::kcdata_
KernelConstantData< HGChebUncalibRecHitConstantData > * kcdata_
Definition: HEBRecHitGPU.cc:57
HGCUncalibRecHitDevice
Definition: HGCUncalibRecHitDevice.h:11
HGCConstantVectorData::fCPerMIP_
std::vector< double > fCPerMIP_
Definition: HGCUncalibRecHitsToRecHitsConstants.h:9
HEBRecHitGPU::vdata_
HGCConstantVectorData vdata_
Definition: HEBRecHitGPU.cc:40
nhits
Definition: HIMultiTrackSelector.h:42
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HEBRecHitGPU::cdata_
HGChebUncalibRecHitConstantData cdata_
Definition: HEBRecHitGPU.cc:39
edm::ParameterSet
Definition: ParameterSet.h:47
HEBRecHitGPU::assert_sizes_constants_
void assert_sizes_constants_(const HGCConstantVectorData &)
Definition: HEBRecHitGPU.cc:86
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
HGCRecHitGPUProduct::get
HGCRecHitSoA get()
Definition: HGCRecHitGPUProduct.h:27
KernelManagerHGCalRecHit::run_kernels
void run_kernels(const KernelConstantData< HGCeeUncalibRecHitConstantData > *, const cudaStream_t &)
eostools.move
def move(src, dest)
Definition: eostools.py:511
HGCUncalibRecHitDevice::get
HGCUncalibRecHitSoA get() const
Definition: HGCUncalibRecHitDevice.h:23
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
KernelConstantData< HGChebUncalibRecHitConstantData >
HEBRecHitGPU::convert_constant_data_
void convert_constant_data_(KernelConstantData< HGChebUncalibRecHitConstantData > *)
Definition: HEBRecHitGPU.cc:113
HEBRecHitGPU::recHitGPUToken_
edm::EDPutTokenT< cms::cuda::Product< HGCRecHitGPUProduct > > recHitGPUToken_
Definition: HEBRecHitGPU.cc:34
HGCConstantVectorData::weights_
std::vector< double > weights_
Definition: HGCUncalibRecHitsToRecHitsConstants.h:13
event
Definition: event.py:1
HEBRecHitGPU::d_uncalib_
HGCUncalibRecHitDevice d_uncalib_
Definition: HEBRecHitGPU.cc:54
edm::Log
Definition: MessageLogger.h:70
HGChebUncalibRecHitConstantData::uncalib2GeV_
double uncalib2GeV_
Definition: HGCUncalibRecHitsToRecHitsConstants.h:68
edm::InputTag
Definition: InputTag.h:15
HGChebUncalibRecHitConstantData::heb_weights
static constexpr size_t heb_weights
Definition: HGCUncalibRecHitsToRecHitsConstants.h:63
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
HEBRecHitGPU::prod_
HGCRecHitGPUProduct prod_
Definition: HEBRecHitGPU.cc:53