CMS 3D CMS Logo

EcalRecHitParametersGPU.cc
Go to the documentation of this file.
2 
8 
10  auto const& channelStatusToBeExcluded = StringToEnumValue<EcalChannelStatusCode::Code>(
11  ps.getParameter<std::vector<std::string>>("ChannelStatusToBeExcluded"));
12 
13  channelStatusToBeExcluded_.resize(channelStatusToBeExcluded.size());
14  std::copy(channelStatusToBeExcluded.begin(), channelStatusToBeExcluded.end(), channelStatusToBeExcluded_.begin());
15 
16  // https://github.com/cms-sw/cmssw/blob/266e21cfc9eb409b093e4cf064f4c0a24c6ac293/RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitWorkerSimple.cc
17 
18  // Translate string representation of flagsMapDBReco into enum values
19  const edm::ParameterSet& p = ps.getParameter<edm::ParameterSet>("flagsMapDBReco");
20  std::vector<std::string> recoflagbitsStrings = p.getParameterNames();
21 
22  for (unsigned int i = 0; i != recoflagbitsStrings.size(); ++i) {
23  EcalRecHit::Flags recoflagbit = (EcalRecHit::Flags)StringToEnumValue<EcalRecHit::Flags>(recoflagbitsStrings[i]);
24  std::vector<std::string> dbstatus_s = p.getParameter<std::vector<std::string>>(recoflagbitsStrings[i]);
25  for (unsigned int j = 0; j != dbstatus_s.size(); ++j) {
27  (EcalChannelStatusCode::Code)StringToEnumValue<EcalChannelStatusCode::Code>(dbstatus_s[j]);
28  expanded_v_DB_reco_flags_.push_back(dbstatus);
29  }
30 
31  expanded_Sizes_v_DB_reco_flags_.push_back(dbstatus_s.size());
32  expanded_flagbit_v_DB_reco_flags_.push_back(recoflagbit);
33  }
34 }
35 
37  auto const& product = product_.dataForCurrentDeviceAsync(
38  cudaStream, [this](EcalRecHitParametersGPU::Product& product, cudaStream_t cudaStream) {
39  // allocate
41  cms::cuda::make_device_unique<int[]>(channelStatusToBeExcluded_.size(), cudaStream);
42  product.expanded_v_DB_reco_flags =
43  cms::cuda::make_device_unique<int[]>(expanded_v_DB_reco_flags_.size(), cudaStream);
45  cms::cuda::make_device_unique<uint32_t[]>(expanded_Sizes_v_DB_reco_flags_.size(), cudaStream);
47  cms::cuda::make_device_unique<uint32_t[]>(expanded_flagbit_v_DB_reco_flags_.size(), cudaStream);
48  // transfer
53  });
54  return product;
55 }
56 
EcalRecHitParametersGPU::channelStatusToBeExcluded_
std::vector< int, cms::cuda::HostAllocator< int > > channelStatusToBeExcluded_
Definition: EcalRecHitParametersGPU.h:41
mps_fire.i
i
Definition: mps_fire.py:428
EcalRecHitParametersGPU::Product::expanded_flagbit_v_DB_reco_flags
edm::propagate_const_array< cms::cuda::device::unique_ptr< uint32_t[]> > expanded_flagbit_v_DB_reco_flags
Definition: EcalRecHitParametersGPU.h:21
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
EcalRecHitParametersGPU::Product::expanded_Sizes_v_DB_reco_flags
edm::propagate_const_array< cms::cuda::device::unique_ptr< uint32_t[]> > expanded_Sizes_v_DB_reco_flags
Definition: EcalRecHitParametersGPU.h:20
EcalRecHitParametersGPU::expanded_v_DB_reco_flags_
std::vector< int, cms::cuda::HostAllocator< int > > expanded_v_DB_reco_flags_
Definition: EcalRecHitParametersGPU.h:42
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
EcalRecHit::Flags
Flags
Definition: EcalRecHit.h:20
EcalRecHitParametersGPU
Definition: EcalRecHitParametersGPU.h:15
EcalRecHitParametersGPU::expanded_Sizes_v_DB_reco_flags_
std::vector< uint32_t, cms::cuda::HostAllocator< uint32_t > > expanded_Sizes_v_DB_reco_flags_
Definition: EcalRecHitParametersGPU.h:43
typelookup.h
EcalRecHitParametersGPU::getProduct
const Product & getProduct(cudaStream_t) const
Definition: EcalRecHitParametersGPU.cc:36
EcalRecHitParametersGPU::product_
cms::cuda::ESProduct< Product > product_
Definition: EcalRecHitParametersGPU.h:46
EcalRecHitParametersGPU::Product
Definition: EcalRecHitParametersGPU.h:17
EcalRecHit.h
StringToEnumValue.h
edm::ParameterSet
Definition: ParameterSet.h:47
EcalRecHitParametersGPU::expanded_flagbit_v_DB_reco_flags_
std::vector< uint32_t, cms::cuda::HostAllocator< uint32_t > > expanded_flagbit_v_DB_reco_flags_
Definition: EcalRecHitParametersGPU.h:43
copyAsync.h
EcalRecHitParametersGPU.h
TYPELOOKUP_DATA_REG
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:102
EcalRecHitParametersGPU::Product::channelStatusToBeExcluded
edm::propagate_const_array< cms::cuda::device::unique_ptr< int[]> > channelStatusToBeExcluded
Definition: EcalRecHitParametersGPU.h:18
EcalRechitChannelStatusGPU.h
EcalChannelStatusCode::Code
Code
Definition: EcalChannelStatusCode.h:20
EcalRecHitParametersGPU::EcalRecHitParametersGPU
EcalRecHitParametersGPU(edm::ParameterSet const &)
Definition: EcalRecHitParametersGPU.cc:9
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
EcalRecHitParametersGPU::Product::expanded_v_DB_reco_flags
edm::propagate_const_array< cms::cuda::device::unique_ptr< int[]> > expanded_v_DB_reco_flags
Definition: EcalRecHitParametersGPU.h:19
cms::cuda::copyAsync
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20