CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Static Public Member Functions | Private Attributes
ecal::raw::ElectronicsMappingGPU Class Reference

#include <ElectronicsMappingGPU.h>

Classes

struct  Product
 

Public Member Functions

 ElectronicsMappingGPU (EcalMappingElectronics const &)
 
Product const & getProduct (cudaStream_t) const
 
 ~ElectronicsMappingGPU ()=default
 

Static Public Member Functions

static std::string name ()
 

Private Attributes

std::vector< uint32_t, cms::cuda::HostAllocator< uint32_t > > eid2did_
 
cms::cuda::ESProduct< Productproduct_
 

Detailed Description

Definition at line 16 of file ElectronicsMappingGPU.h.

Constructor & Destructor Documentation

◆ ElectronicsMappingGPU()

ecal::raw::ElectronicsMappingGPU::ElectronicsMappingGPU ( EcalMappingElectronics const &  mapping)

Definition at line 13 of file ElectronicsMappingGPU.cc.

13  : eid2did_(0x3FFFFF) {
14  // fill in eb
15  // TODO: EB vector is actually empty
16  auto const& barrelValues = mapping.barrelItems();
17  for (unsigned int i = 0; i < barrelValues.size(); i++) {
18  EcalElectronicsId eid{barrelValues[i].electronicsid};
20  eid2did_[eid.linearIndex()] = did.rawId();
21  }
22 
23  // fill in ee
24  auto const& endcapValues = mapping.endcapItems();
25  for (unsigned int i = 0; i < endcapValues.size(); i++) {
26  EcalElectronicsId eid{endcapValues[i].electronicsid};
28  eid2did_[eid.linearIndex()] = did.rawId();
29  }
30  }

References runTauDisplay::eid, eid2did_, mps_fire::i, taus_updatedMVAIds_cff::mapping, EBDetId::unhashIndex(), and EEDetId::unhashIndex().

◆ ~ElectronicsMappingGPU()

ecal::raw::ElectronicsMappingGPU::~ElectronicsMappingGPU ( )
default

Member Function Documentation

◆ getProduct()

ElectronicsMappingGPU::Product const & ecal::raw::ElectronicsMappingGPU::getProduct ( cudaStream_t  cudaStream) const

Definition at line 32 of file ElectronicsMappingGPU.cc.

32  {
33  auto const& product = product_.dataForCurrentDeviceAsync(
34  cudaStream, [this](ElectronicsMappingGPU::Product& product, cudaStream_t cudaStream) {
35  // allocate
36  product.eid2did = cms::cuda::make_device_unique<uint32_t[]>(eid2did_.size(), cudaStream);
37  // transfer
38  cms::cuda::copyAsync(product.eid2did, eid2did_, cudaStream);
39  });
40 
41  return product;
42  }

References cms::cuda::copyAsync(), ecal::raw::ElectronicsMappingGPU::Product::eid2did, eid2did_, and product_.

Referenced by EcalRawToDigiGPU::acquire().

◆ name()

static std::string ecal::raw::ElectronicsMappingGPU::name ( )
inlinestatic

Definition at line 34 of file ElectronicsMappingGPU.h.

34 { return std::string{"ecalElectronicsMappingGPU"}; }

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by config.CFG::__str__(), validation.Sample::digest(), and VIDSelectorBase.VIDSelectorBase::initialize().

Member Data Documentation

◆ eid2did_

std::vector<uint32_t, cms::cuda::HostAllocator<uint32_t> > ecal::raw::ElectronicsMappingGPU::eid2did_
private

Definition at line 39 of file ElectronicsMappingGPU.h.

Referenced by ElectronicsMappingGPU(), and getProduct().

◆ product_

cms::cuda::ESProduct<Product> ecal::raw::ElectronicsMappingGPU::product_
private

Definition at line 41 of file ElectronicsMappingGPU.h.

Referenced by getProduct().

mps_fire.i
i
Definition: mps_fire.py:428
EBDetId
Definition: EBDetId.h:17
EEDetId::unhashIndex
static EEDetId unhashIndex(int hi)
Definition: EEDetId.cc:65
EBDetId::unhashIndex
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
Definition: EBDetId.h:110
EcalElectronicsId
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
Definition: EcalElectronicsId.h:18
ecal::raw::ElectronicsMappingGPU::product_
cms::cuda::ESProduct< Product > product_
Definition: ElectronicsMappingGPU.h:41
EEDetId
Definition: EEDetId.h:14
runTauDisplay.eid
eid
Definition: runTauDisplay.py:298
ecal::raw::ElectronicsMappingGPU::eid2did_
std::vector< uint32_t, cms::cuda::HostAllocator< uint32_t > > eid2did_
Definition: ElectronicsMappingGPU.h:39
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
taus_updatedMVAIds_cff.mapping
mapping
Definition: taus_updatedMVAIds_cff.py:29
cms::cuda::copyAsync
void copyAsync(device::unique_ptr< T > &dst, const host::unique_ptr< T > &src, cudaStream_t stream)
Definition: copyAsync.h:20