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
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
 
 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 &, 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
< HGCeeUncalibratedRecHitCollection
h_uncalib_
 
KernelConstantData
< HGCeeUncalibRecHitConstantData > * 
kcdata_
 
HGCRecHitGPUProduct prod_
 
edm::EDPutTokenT
< cms::cuda::Product
< HGCRecHitGPUProduct > > 
recHitGPUToken_
 
std::unique_ptr
< HGCeeRecHitCollection
rechits_
 
std::unique_ptr
< hgcal::RecHitTools
tools_
 
edm::EDGetTokenT
< HGCeeUncalibratedRecHitCollection
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 EERecHitGPU.cc.

Constructor & Destructor Documentation

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

Definition at line 59 of file EERecHitGPU.cc.

References edm::ParameterSet::getParameter().

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 }
edm::EDGetTokenT< HGCeeUncalibratedRecHitCollection > uncalibRecHitCPUToken_
Definition: EERecHitGPU.cc:33
void convert_constant_data_(KernelConstantData< HGCeeUncalibRecHitConstantData > *)
Definition: EERecHitGPU.cc:131
KernelConstantData< HGCeeUncalibRecHitConstantData > * kcdata_
Definition: EERecHitGPU.cc:56
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HGCConstantVectorData vdata_
Definition: EERecHitGPU.cc:40
HGCeeUncalibRecHitConstantData cdata_
Definition: EERecHitGPU.cc:39
std::unique_ptr< hgcal::RecHitTools > tools_
Definition: EERecHitGPU.cc:46
edm::EDPutTokenT< cms::cuda::Product< HGCRecHitGPUProduct > > recHitGPUToken_
Definition: EERecHitGPU.cc:34
void assert_sizes_constants_(const HGCConstantVectorData &)
Definition: EERecHitGPU.cc:91
EERecHitGPU::~EERecHitGPU ( )
override

Definition at line 82 of file EERecHitGPU.cc.

References kcdata_.

82 { delete kcdata_; }
KernelConstantData< HGCeeUncalibRecHitConstantData > * kcdata_
Definition: EERecHitGPU.cc:56

Member Function Documentation

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.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by assert_sizes_constants_().

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 }
list var
if using global norm cols_to_minmax = [&#39;t_delta&#39;, &#39;t_hmaxNearP&#39;,&#39;t_emaxNearP&#39;, &#39;t_hAnnular&#39;, &#39;t_eAnnular&#39;,&#39;t_pt&#39;,&#39;t_nVtx&#39;,&#39;t_ieta&#39;,&#39;t_eHcal10&#39;, &#39;t_eHcal30&#39;,&#39;t_rhoh&#39;,&#39;t_eHcal&#39;] df[cols_to_minmax] = df[cols_to_minmax].apply(lambda x: (x - x.min()) / (x.max() - x.min()) if (x.max() - x.min() &gt; 0) else 1.0/200.0)
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_.

91  {
93  edm::LogError("WrongSize") << this->assert_error_message_(
96  edm::LogError("WrongSize") << this->assert_error_message_(
99  edm::LogError("WrongSize") << this->assert_error_message_(
102  edm::LogError("WrongSize") << this->assert_error_message_(
105  edm::LogError("WrongSize") << this->assert_error_message_(
107 }
std::string assert_error_message_(std::string, const size_t &, const size_t &)
Definition: EERecHitGPU.cc:84
HGCConstantVectorData vdata_
Definition: EERecHitGPU.cc:40
void EERecHitGPU::beginRun ( edm::Run const &  ,
edm::EventSetup const &  setup 
)
override

Definition at line 109 of file EERecHitGPU.cc.

109 {}
void EERecHitGPU::convert_collection_data_to_soa_ ( const uint32_t &  ,
const HGCeeUncalibratedRecHitCollection  
)
private
void EERecHitGPU::convert_constant_data_ ( KernelConstantData< HGCeeUncalibRecHitConstantData > *  kcdata)
private

Definition at line 131 of file EERecHitGPU.cc.

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

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 }
for(Iditer=Id.begin();Iditer!=Id.end();Iditer++)
HGCConstantVectorData vdata_
void EERecHitGPU::produce ( edm::Event event,
const edm::EventSetup setup 
)
override

Definition at line 111 of file EERecHitGPU.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_.

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 
125  KernelManagerHGCalRecHit km(h_uncalib_.get(), d_uncalib_.get(), prod_.get());
126  km.run_kernels(kcdata_, ctx.stream());
127 
128  ctx.emplace(event, recHitGPUToken_, std::move(prod_));
129 }
edm::EDGetTokenT< HGCeeUncalibratedRecHitCollection > uncalibRecHitCPUToken_
Definition: EERecHitGPU.cc:33
HGCUncalibRecHitHost< HGCeeUncalibratedRecHitCollection > h_uncalib_
Definition: EERecHitGPU.cc:54
HGCUncalibRecHitSoA get() const
std::unique_ptr< HGCeeRecHitCollection > rechits_
Definition: EERecHitGPU.cc:36
Log< level::Error, false > LogError
KernelConstantData< HGCeeUncalibRecHitConstantData > * kcdata_
Definition: EERecHitGPU.cc:56
def move
Definition: eostools.py:511
HGCUncalibRecHitDevice d_uncalib_
Definition: EERecHitGPU.cc:53
void run_kernels(const KernelConstantData< HGCeeUncalibRecHitConstantData > *, const cudaStream_t &)
HGCRecHitGPUProduct prod_
Definition: EERecHitGPU.cc:52
const T & get(const Product< T > &data)
Definition: ScopedContext.h:58
edm::EDPutTokenT< cms::cuda::Product< HGCRecHitGPUProduct > > recHitGPUToken_
Definition: EERecHitGPU.cc:34

Member Data Documentation

HGCeeUncalibRecHitConstantData EERecHitGPU::cdata_
private

Definition at line 39 of file EERecHitGPU.cc.

HGCUncalibRecHitDevice EERecHitGPU::d_uncalib_
private

Definition at line 53 of file EERecHitGPU.cc.

Referenced by produce().

HGCUncalibRecHitHost<HGCeeUncalibratedRecHitCollection> EERecHitGPU::h_uncalib_
private

Definition at line 54 of file EERecHitGPU.cc.

Referenced by produce().

KernelConstantData<HGCeeUncalibRecHitConstantData>* EERecHitGPU::kcdata_
private

Definition at line 56 of file EERecHitGPU.cc.

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

HGCRecHitGPUProduct EERecHitGPU::prod_
private

Definition at line 52 of file EERecHitGPU.cc.

Referenced by produce().

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

Definition at line 34 of file EERecHitGPU.cc.

Referenced by produce().

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

Definition at line 36 of file EERecHitGPU.cc.

Referenced by produce().

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

Definition at line 46 of file EERecHitGPU.cc.

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

Definition at line 33 of file EERecHitGPU.cc.

Referenced by produce().

HGCConstantVectorData EERecHitGPU::vdata_
private

Definition at line 40 of file EERecHitGPU.cc.

Referenced by assert_sizes_constants_().