Skip to content

Commit

Permalink
Merge pull request #45210 from fwyzard/Initialise_EcalElectronicsMapp…
Browse files Browse the repository at this point in the history
…ingHost_140x

Initialise the `EcalElectronicsMappingHost` with null detids [14.0.x]
  • Loading branch information
cmsbuild authored Jun 13, 2024
2 parents 27c652a + 3e7d8d4 commit 06dfa51
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#include <alpaka/alpaka.hpp>

#include "FWCore/Framework/interface/ESTransientHandle.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "CondFormats/DataRecord/interface/EcalMappingElectronicsRcd.h"
Expand Down Expand Up @@ -32,6 +34,10 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE {
int const size = 0x3FFFFF;
auto product = std::make_unique<EcalElectronicsMappingHost>(size, cms::alpakatools::host());

// fill the whole collection with null detids
alpaka::QueueCpuBlocking queue{cms::alpakatools::host()};
alpaka::memset(queue, product->buffer(), 0x00);

// fill in eb
auto const& barrelValues = mapping.barrelItems();
for (unsigned int i = 0; i < barrelValues.size(); ++i) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::ecal::raw {

ElectronicsIdGPU eid{fed2dcc(fed), ttid, stripid, xtalid};
auto const didraw = isBarrel ? compute_ebdetid(eid) : eid2did[eid.linearIndex()].rawid();
// FIXME: what kind of channels are these guys
// skip channels with an invalid detid
if (didraw == 0)
continue;

Expand Down

0 comments on commit 06dfa51

Please sign in to comment.