CMS 3D CMS Logo

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

Public Member Functions

void beginRun (edm::Run const &, edm::EventSetup const &) override
 
 EERecHitGPU (const edm::ParameterSet &ps)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~EERecHitGPU () 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 &, const size_t &)
 
void assert_sizes_constants_ (const HGCConstantVectorData &)
 
void convert_collection_data_to_soa_ (const uint32_t &, const HGCeeUncalibratedRecHitCollection &)
 
void convert_constant_data_ (KernelConstantData< HGCeeUncalibRecHitConstantData > *)
 

Private Attributes

HGCeeUncalibRecHitConstantData cdata_
 
HGCUncalibRecHitDevice d_uncalib_
 
HGCUncalibRecHitHost< HGCeeUncalibratedRecHitCollectionh_uncalib_
 
KernelConstantData< HGCeeUncalibRecHitConstantData > * kcdata_
 
HGCRecHitGPUProduct prod_
 
edm::EDPutTokenT< cms::cuda::Product< HGCRecHitGPUProduct > > recHitGPUToken_
 
std::unique_ptr< HGCeeRecHitCollectionrechits_
 
std::unique_ptr< hgcal::RecHitToolstools_
 
edm::EDGetTokenT< HGCeeUncalibratedRecHitCollectionuncalibRecHitCPUToken_
 
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 EERecHitGPU.cc.

Constructor & Destructor Documentation

◆ EERecHitGPU()

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

Definition at line 59 of file EERecHitGPU.cc.

60  : uncalibRecHitCPUToken_{consumes<HGCUncalibratedRecHitCollection>(
61  ps.getParameter<edm::InputTag>("HGCEEUncalibRecHitsTok"))},
62  recHitGPUToken_{produces<cms::cuda::Product<HGCRecHitGPUProduct>>()} {
63  cdata_.keV2DIGI_ = ps.getParameter<double>("HGCEE_keV2DIGI");
64  cdata_.xmin_ = ps.getParameter<double>("minValSiPar"); //float
65  cdata_.xmax_ = ps.getParameter<double>("maxValSiPar"); //float
66  cdata_.aterm_ = ps.getParameter<double>("noiseSiPar"); //float
67  cdata_.cterm_ = ps.getParameter<double>("constSiPar"); //float
68  vdata_.fCPerMIP_ = ps.getParameter<std::vector<double>>("HGCEE_fCPerMIP");
69  vdata_.cce_ = ps.getParameter<edm::ParameterSet>("HGCEE_cce").getParameter<std::vector<double>>("values");
70  vdata_.noise_fC_ = ps.getParameter<edm::ParameterSet>("HGCEE_noise_fC").getParameter<std::vector<double>>("values");
71  vdata_.rcorr_ = ps.getParameter<std::vector<double>>("rcorr");
72  vdata_.weights_ = ps.getParameter<std::vector<double>>("weights");
75 
78 
79  tools_ = std::make_unique<hgcal::RecHitTools>();
80 }

References edm::ParameterSet::getParameter().

◆ ~EERecHitGPU()

EERecHitGPU::~EERecHitGPU ( )
override

Definition at line 82 of file EERecHitGPU.cc.

82 { delete kcdata_; }

References kcdata_.

Member Function Documentation

◆ assert_error_message_()

std::string EERecHitGPU::assert_error_message_ ( std::string  var,
const size_t &  s1,
const size_t &  s2 
)
private

Definition at line 84 of file EERecHitGPU.cc.

84  {
85  std::string str1 = "The '";
86  std::string str2 = "' array must be of size ";
87  std::string str3 = " to hold the configuration data, but is of size ";
88  return str1 + var + str2 + std::to_string(s1) + str3 + std::to_string(s2);
89 }

References indexGen::s2, AlCaHLTBitMon_QueryRunRegistry::string, and trigObjTnPSource_cfi::var.

Referenced by assert_sizes_constants_().

◆ assert_sizes_constants_()

void EERecHitGPU::assert_sizes_constants_ ( const HGCConstantVectorData vd)
private

Definition at line 91 of file EERecHitGPU.cc.

References assert_error_message_(), HGCConstantVectorData::cce_, HGCeeUncalibRecHitConstantData::ee_cce, HGCeeUncalibRecHitConstantData::ee_fCPerMIP, HGCeeUncalibRecHitConstantData::ee_noise_fC, HGCeeUncalibRecHitConstantData::ee_rcorr, HGCeeUncalibRecHitConstantData::ee_weights, HGCConstantVectorData::fCPerMIP_, HGCConstantVectorData::noise_fC_, HGCConstantVectorData::rcorr_, vdata_, and HGCConstantVectorData::weights_.

◆ beginRun()

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

Definition at line 109 of file EERecHitGPU.cc.

109 {}

◆ convert_collection_data_to_soa_()

void EERecHitGPU::convert_collection_data_to_soa_ ( const uint32_t &  ,
const HGCeeUncalibratedRecHitCollection  
)
private

◆ convert_constant_data_()

void EERecHitGPU::convert_constant_data_ ( KernelConstantData< HGCeeUncalibRecHitConstantData > *  kcdata)
private

Definition at line 131 of file EERecHitGPU.cc.

131  {
132  for (size_t i = 0; i < kcdata->vdata_.fCPerMIP_.size(); ++i)
133  kcdata->data_.fCPerMIP_[i] = kcdata->vdata_.fCPerMIP_[i];
134  for (size_t i = 0; i < kcdata->vdata_.cce_.size(); ++i)
135  kcdata->data_.cce_[i] = kcdata->vdata_.cce_[i];
136  for (size_t i = 0; i < kcdata->vdata_.noise_fC_.size(); ++i)
137  kcdata->data_.noise_fC_[i] = kcdata->vdata_.noise_fC_[i];
138  for (size_t i = 0; i < kcdata->vdata_.rcorr_.size(); ++i)
139  kcdata->data_.rcorr_[i] = kcdata->vdata_.rcorr_[i];
140  for (size_t i = 0; i < kcdata->vdata_.weights_.size(); ++i)
141  kcdata->data_.weights_[i] = kcdata->vdata_.weights_[i];
142 }

References HGCConstantVectorData::cce_, HGCeeUncalibRecHitConstantData::cce_, KernelConstantData< T >::data_, HGCConstantVectorData::fCPerMIP_, HGCeeUncalibRecHitConstantData::fCPerMIP_, cms::cuda::for(), mps_fire::i, HGCConstantVectorData::noise_fC_, HGCeeUncalibRecHitConstantData::noise_fC_, HGCConstantVectorData::rcorr_, HGCeeUncalibRecHitConstantData::rcorr_, KernelConstantData< T >::vdata_, HGCConstantVectorData::weights_, and HGCeeUncalibRecHitConstantData::weights_.

◆ produce()

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

Definition at line 111 of file EERecHitGPU.cc.

111  {
112  cms::cuda::ScopedContextProduce ctx{event.streamID()};
113 
114  const auto &hits = event.get(uncalibRecHitCPUToken_);
115  const unsigned nhits(hits.size());
116  rechits_ = std::make_unique<HGCRecHitCollection>();
117 
118  if (nhits == 0)
119  edm::LogError("EERecHitGPU") << "WARNING: no input hits!";
120 
121  prod_ = HGCRecHitGPUProduct(nhits, ctx.stream());
122  d_uncalib_ = HGCUncalibRecHitDevice(nhits, ctx.stream());
124 
126  km.run_kernels(kcdata_, ctx.stream());
127 
128  ctx.emplace(event, recHitGPUToken_, std::move(prod_));
129 }

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_

HGCeeUncalibRecHitConstantData EERecHitGPU::cdata_
private

Definition at line 39 of file EERecHitGPU.cc.

◆ d_uncalib_

HGCUncalibRecHitDevice EERecHitGPU::d_uncalib_
private

Definition at line 53 of file EERecHitGPU.cc.

Referenced by produce().

◆ h_uncalib_

HGCUncalibRecHitHost<HGCeeUncalibratedRecHitCollection> EERecHitGPU::h_uncalib_
private

Definition at line 54 of file EERecHitGPU.cc.

Referenced by produce().

◆ kcdata_

KernelConstantData<HGCeeUncalibRecHitConstantData>* EERecHitGPU::kcdata_
private

Definition at line 56 of file EERecHitGPU.cc.

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

◆ prod_

HGCRecHitGPUProduct EERecHitGPU::prod_
private

Definition at line 52 of file EERecHitGPU.cc.

Referenced by produce().

◆ recHitGPUToken_

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

Definition at line 34 of file EERecHitGPU.cc.

Referenced by produce().

◆ rechits_

std::unique_ptr<HGCeeRecHitCollection> EERecHitGPU::rechits_
private

Definition at line 36 of file EERecHitGPU.cc.

Referenced by produce().

◆ tools_

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

Definition at line 46 of file EERecHitGPU.cc.

◆ uncalibRecHitCPUToken_

edm::EDGetTokenT<HGCeeUncalibratedRecHitCollection> EERecHitGPU::uncalibRecHitCPUToken_
private

Definition at line 33 of file EERecHitGPU.cc.

Referenced by produce().

◆ vdata_

HGCConstantVectorData EERecHitGPU::vdata_
private

Definition at line 40 of file EERecHitGPU.cc.

Referenced by assert_sizes_constants_().

HGCUncalibRecHitHost
Definition: HGCUncalibRecHitHost.h:12
EERecHitGPU::rechits_
std::unique_ptr< HGCeeRecHitCollection > rechits_
Definition: EERecHitGPU.cc:36
EERecHitGPU::prod_
HGCRecHitGPUProduct prod_
Definition: EERecHitGPU.cc:52
mps_fire.i
i
Definition: mps_fire.py:428
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
HGCeeUncalibRecHitConstantData::ee_cce
static constexpr size_t ee_cce
Definition: HGCUncalibRecHitsToRecHitsConstants.h:19
KernelConstantData::vdata_
HGCConstantVectorData vdata_
Definition: KernelManagerHGCalRecHit.h:30
KernelConstantData::data_
T data_
Definition: KernelManagerHGCalRecHit.h:29
HGCeeUncalibRecHitConstantData::weights_
double weights_[ee_weights]
Definition: HGCUncalibRecHitsToRecHitsConstants.h:28
cms::cuda::ScopedContextProduce
Definition: ScopedContext.h:149
HGCeeUncalibRecHitConstantData::cce_
double cce_[ee_cce]
Definition: HGCUncalibRecHitsToRecHitsConstants.h:25
HGCeeUncalibRecHitConstantData::keV2DIGI_
double keV2DIGI_
Definition: HGCUncalibRecHitsToRecHitsConstants.h:30
EERecHitGPU::uncalibRecHitCPUToken_
edm::EDGetTokenT< HGCeeUncalibratedRecHitCollection > uncalibRecHitCPUToken_
Definition: EERecHitGPU.cc:33
HGCeeUncalibRecHitConstantData::xmin_
float xmin_
Definition: HGCUncalibRecHitsToRecHitsConstants.h:32
HGCRecHitGPUProduct
Definition: HGCRecHitGPUProduct.h:12
HGCeeUncalibRecHitConstantData::ee_noise_fC
static constexpr size_t ee_noise_fC
Definition: HGCUncalibRecHitsToRecHitsConstants.h:20
indexGen.s2
s2
Definition: indexGen.py:107
HGCeeUncalibRecHitConstantData::aterm_
float aterm_
Definition: HGCUncalibRecHitsToRecHitsConstants.h:34
KernelManagerHGCalRecHit
Definition: KernelManagerHGCalRecHit.h:33
trigObjTnPSource_cfi.var
var
Definition: trigObjTnPSource_cfi.py:21
EERecHitGPU::recHitGPUToken_
edm::EDPutTokenT< cms::cuda::Product< HGCRecHitGPUProduct > > recHitGPUToken_
Definition: EERecHitGPU.cc:34
EERecHitGPU::kcdata_
KernelConstantData< HGCeeUncalibRecHitConstantData > * kcdata_
Definition: EERecHitGPU.cc:56
HGCUncalibRecHitDevice
Definition: HGCUncalibRecHitDevice.h:11
HGCConstantVectorData::fCPerMIP_
std::vector< double > fCPerMIP_
Definition: HGCUncalibRecHitsToRecHitsConstants.h:9
nhits
Definition: HIMultiTrackSelector.h:42
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
HGCeeUncalibRecHitConstantData::ee_rcorr
static constexpr size_t ee_rcorr
Definition: HGCUncalibRecHitsToRecHitsConstants.h:21
EERecHitGPU::tools_
std::unique_ptr< hgcal::RecHitTools > tools_
Definition: EERecHitGPU.cc:46
EERecHitGPU::cdata_
HGCeeUncalibRecHitConstantData cdata_
Definition: EERecHitGPU.cc:39
HGCeeUncalibRecHitConstantData::cterm_
float cterm_
Definition: HGCUncalibRecHitsToRecHitsConstants.h:35
HGCConstantVectorData::rcorr_
std::vector< double > rcorr_
Definition: HGCUncalibRecHitsToRecHitsConstants.h:12
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
cms::cuda::for
for(int i=first, nt=offsets[nh];i< nt;i+=gridDim.x *blockDim.x)
Definition: HistoContainer.h:27
HGCeeUncalibRecHitConstantData::fCPerMIP_
double fCPerMIP_[ee_fCPerMIP]
Definition: HGCUncalibRecHitsToRecHitsConstants.h:24
HGCeeUncalibRecHitConstantData::rcorr_
double rcorr_[ee_rcorr]
Definition: HGCUncalibRecHitsToRecHitsConstants.h:27
HGCConstantVectorData::cce_
std::vector< double > cce_
Definition: HGCUncalibRecHitsToRecHitsConstants.h:10
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
EERecHitGPU::assert_sizes_constants_
void assert_sizes_constants_(const HGCConstantVectorData &)
Definition: EERecHitGPU.cc:91
EERecHitGPU::vdata_
HGCConstantVectorData vdata_
Definition: EERecHitGPU.cc:40
HGCeeUncalibRecHitConstantData::ee_weights
static constexpr size_t ee_weights
Definition: HGCUncalibRecHitsToRecHitsConstants.h:22
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
EERecHitGPU::convert_constant_data_
void convert_constant_data_(KernelConstantData< HGCeeUncalibRecHitConstantData > *)
Definition: EERecHitGPU.cc:131
KernelConstantData< HGCeeUncalibRecHitConstantData >
EERecHitGPU::h_uncalib_
HGCUncalibRecHitHost< HGCeeUncalibratedRecHitCollection > h_uncalib_
Definition: EERecHitGPU.cc:54
HGCeeUncalibRecHitConstantData::uncalib2GeV_
double uncalib2GeV_
Definition: HGCUncalibRecHitsToRecHitsConstants.h:31
HGCeeUncalibRecHitConstantData::ee_fCPerMIP
static constexpr size_t ee_fCPerMIP
Definition: HGCUncalibRecHitsToRecHitsConstants.h:18
HGCeeUncalibRecHitConstantData::noise_fC_
double noise_fC_[ee_noise_fC]
Definition: HGCUncalibRecHitsToRecHitsConstants.h:26
HGCConstantVectorData::weights_
std::vector< double > weights_
Definition: HGCUncalibRecHitsToRecHitsConstants.h:13
event
Definition: event.py:1
HGCConstantVectorData::noise_fC_
std::vector< double > noise_fC_
Definition: HGCUncalibRecHitsToRecHitsConstants.h:11
edm::Log
Definition: MessageLogger.h:70
EERecHitGPU::assert_error_message_
std::string assert_error_message_(std::string, const size_t &, const size_t &)
Definition: EERecHitGPU.cc:84
edm::InputTag
Definition: InputTag.h:15
EERecHitGPU::d_uncalib_
HGCUncalibRecHitDevice d_uncalib_
Definition: EERecHitGPU.cc:53
HGCeeUncalibRecHitConstantData::xmax_
float xmax_
Definition: HGCUncalibRecHitsToRecHitsConstants.h:33
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37