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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache 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.

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 }

References edm::ParameterSet::getParameter().

◆ ~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.

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 }

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

◆ produce()

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

Definition at line 51 of file EcalRecHitConvertGPU2CPUFormat.cc.

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 }

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

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().

EcalRecHitConvertGPU2CPUFormat::recHitsLabelCPUEE_
const std::string recHitsLabelCPUEE_
Definition: EcalRecHitConvertGPU2CPUFormat.cc:25
mps_fire.i
i
Definition: mps_fire.py:428
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
EcalRecHitConvertGPU2CPUFormat::recHitsGPUEE_
const edm::EDGetTokenT< InputProduct > recHitsGPUEE_
Definition: EcalRecHitConvertGPU2CPUFormat.cc:23
DetId
Definition: DetId.h:17
EcalRecHitConvertGPU2CPUFormat::recHitsLabelCPUEB_
const std::string recHitsLabelCPUEB_
Definition: EcalRecHitConvertGPU2CPUFormat.cc:25
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalRecHitConvertGPU2CPUFormat::recHitsGPUEB_
const edm::EDGetTokenT< InputProduct > recHitsGPUEB_
Definition: EcalRecHitConvertGPU2CPUFormat.cc:22
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::InputTag
Definition: InputTag.h:15
edm::ConfigurationDescriptions::addWithDefaultLabel
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:87