CMS 3D CMS Logo

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

Public Member Functions

 EcalRecHitConvertGPU2CPUFormat (edm::ParameterSet const &ps)
 
 ~EcalRecHitConvertGPU2CPUFormat () 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
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 

Private Types

using InputProduct = ecal::RecHit< calo::common::VecStoragePolicy< calo::common::CUDAHostAllocatorAlias > >
 

Private Member Functions

void produce (edm::Event &, edm::EventSetup const &) override
 

Private Attributes

const edm::EDGetTokenT< InputProductrecHitsGPUEB_
 
const edm::EDGetTokenT< InputProductrecHitsGPUEE_
 
const std::string recHitsLabelCPUEB_
 
const std::string recHitsLabelCPUEE_
 

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 11 of file EcalRecHitConvertGPU2CPUFormat.cc.

Member Typedef Documentation

◆ InputProduct

Definition at line 18 of file EcalRecHitConvertGPU2CPUFormat.cc.

Constructor & Destructor Documentation

◆ EcalRecHitConvertGPU2CPUFormat()

EcalRecHitConvertGPU2CPUFormat::EcalRecHitConvertGPU2CPUFormat ( edm::ParameterSet const &  ps)
explicit

Definition at line 40 of file EcalRecHitConvertGPU2CPUFormat.cc.

References edm::ParameterSet::getParameter().

41  : recHitsGPUEB_{consumes<InputProduct>(ps.getParameter<edm::InputTag>("recHitsLabelGPUEB"))},
42  recHitsGPUEE_{consumes<InputProduct>(ps.getParameter<edm::InputTag>("recHitsLabelGPUEE"))},
43  recHitsLabelCPUEB_{ps.getParameter<std::string>("recHitsLabelCPUEB")},
44  recHitsLabelCPUEE_{ps.getParameter<std::string>("recHitsLabelCPUEE")} {
45  produces<EBRecHitCollection>(recHitsLabelCPUEB_);
46  produces<EERecHitCollection>(recHitsLabelCPUEE_);
47 }
const edm::EDGetTokenT< InputProduct > recHitsGPUEB_
const edm::EDGetTokenT< InputProduct > recHitsGPUEE_

◆ ~EcalRecHitConvertGPU2CPUFormat()

EcalRecHitConvertGPU2CPUFormat::~EcalRecHitConvertGPU2CPUFormat ( )
override

Definition at line 49 of file EcalRecHitConvertGPU2CPUFormat.cc.

49 {}

Member Function Documentation

◆ fillDescriptions()

void EcalRecHitConvertGPU2CPUFormat::fillDescriptions ( edm::ConfigurationDescriptions confDesc)
static

Definition at line 28 of file EcalRecHitConvertGPU2CPUFormat.cc.

References edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, HLT_2022v11_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

28  {
30 
31  desc.add<edm::InputTag>("recHitsLabelGPUEB", edm::InputTag("ecalRecHitProducerGPU", "EcalRecHitsGPUEB"));
32  desc.add<edm::InputTag>("recHitsLabelGPUEE", edm::InputTag("ecalRecHitProducerGPU", "EcalRecHitsGPUEE"));
33 
34  desc.add<std::string>("recHitsLabelCPUEB", "EcalRecHitsEB");
35  desc.add<std::string>("recHitsLabelCPUEE", "EcalRecHitsEE");
36 
37  confDesc.addWithDefaultLabel(desc);
38 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ produce()

void EcalRecHitConvertGPU2CPUFormat::produce ( edm::Event event,
edm::EventSetup const &  setup 
)
overrideprivate

Definition at line 51 of file EcalRecHitConvertGPU2CPUFormat.cc.

References mps_fire::i, eostools::move(), recHitsGPUEB_, recHitsGPUEE_, recHitsLabelCPUEB_, and recHitsLabelCPUEE_.

51  {
52  auto const& hRecHitsGPUEB = event.get(recHitsGPUEB_);
53  auto const& hRecHitsGPUEE = event.get(recHitsGPUEE_);
54 
55  auto recHitsCPUEB = std::make_unique<EBRecHitCollection>();
56  auto recHitsCPUEE = std::make_unique<EERecHitCollection>();
57  recHitsCPUEB->reserve(hRecHitsGPUEB.energy.size());
58  recHitsCPUEE->reserve(hRecHitsGPUEE.energy.size());
59 
60  for (uint32_t i = 0; i < hRecHitsGPUEB.energy.size(); ++i) {
61  //
62  // Save only if energy is >= 0 !
63  // This is extremely important because the channels that were supposed
64  // to be excluded get "-1" as energy
65  //
66 
67  if (hRecHitsGPUEB.energy[i] >= 0) {
68  recHitsCPUEB->emplace_back(DetId{hRecHitsGPUEB.did[i]},
69  hRecHitsGPUEB.energy[i],
70  hRecHitsGPUEB.time[i],
71  hRecHitsGPUEB.extra[i],
72  hRecHitsGPUEB.flagBits[i]);
73  }
74  }
75 
76  for (uint32_t i = 0; i < hRecHitsGPUEE.energy.size(); ++i) {
77  //
78  // Save only if energy is >= 0 !
79  // This is extremely important because the channels that were supposed
80  // to be excluded get "-1" as energy
81  //
82 
83  if (hRecHitsGPUEE.energy[i] >= 0) {
84  recHitsCPUEE->emplace_back(DetId{hRecHitsGPUEE.did[i]},
85  hRecHitsGPUEE.energy[i],
86  hRecHitsGPUEE.time[i],
87  hRecHitsGPUEE.extra[i],
88  hRecHitsGPUEE.flagBits[i]);
89  }
90  }
91 
92  event.put(std::move(recHitsCPUEB), recHitsLabelCPUEB_);
93  event.put(std::move(recHitsCPUEE), recHitsLabelCPUEE_);
94 }
const edm::EDGetTokenT< InputProduct > recHitsGPUEB_
Definition: DetId.h:17
const edm::EDGetTokenT< InputProduct > recHitsGPUEE_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ recHitsGPUEB_

const edm::EDGetTokenT<InputProduct> EcalRecHitConvertGPU2CPUFormat::recHitsGPUEB_
private

Definition at line 22 of file EcalRecHitConvertGPU2CPUFormat.cc.

Referenced by produce().

◆ recHitsGPUEE_

const edm::EDGetTokenT<InputProduct> EcalRecHitConvertGPU2CPUFormat::recHitsGPUEE_
private

Definition at line 23 of file EcalRecHitConvertGPU2CPUFormat.cc.

Referenced by produce().

◆ recHitsLabelCPUEB_

const std::string EcalRecHitConvertGPU2CPUFormat::recHitsLabelCPUEB_
private

Definition at line 25 of file EcalRecHitConvertGPU2CPUFormat.cc.

Referenced by produce().

◆ recHitsLabelCPUEE_

const std::string EcalRecHitConvertGPU2CPUFormat::recHitsLabelCPUEE_
private

Definition at line 25 of file EcalRecHitConvertGPU2CPUFormat.cc.

Referenced by produce().