CMS 3D CMS Logo

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

Public Member Functions

 EcalUncalibRecHitConvertGPU2CPUFormat (edm::ParameterSet const &ps)
 
 ~EcalUncalibRecHitConvertGPU2CPUFormat () 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::UncalibratedRecHit< calo::common::VecStoragePolicy< calo::common::CUDAHostAllocatorAlias > >
 

Private Member Functions

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

Private Attributes

const bool isPhase2_
 
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 12 of file EcalUncalibRecHitConvertGPU2CPUFormat.cc.

Member Typedef Documentation

◆ InputProduct

Definition at line 19 of file EcalUncalibRecHitConvertGPU2CPUFormat.cc.

Constructor & Destructor Documentation

◆ EcalUncalibRecHitConvertGPU2CPUFormat()

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

Definition at line 46 of file EcalUncalibRecHitConvertGPU2CPUFormat.cc.

References edm::ParameterSet::getParameter().

47  : isPhase2_{ps.getParameter<bool>("isPhase2")},
48  recHitsGPUEB_{consumes<InputProduct>(ps.getParameter<edm::InputTag>("recHitsLabelGPUEB"))},
50  : consumes<InputProduct>(ps.getParameter<edm::InputTag>("recHitsLabelGPUEE"))},
51  recHitsLabelCPUEB_{ps.getParameter<std::string>("recHitsLabelCPUEB")},
52  recHitsLabelCPUEE_{isPhase2_ ? std::string{""} : ps.getParameter<std::string>("recHitsLabelCPUEE")} {
53  produces<EBUncalibratedRecHitCollection>(recHitsLabelCPUEB_);
54  if (!isPhase2_)
55  produces<EEUncalibratedRecHitCollection>(recHitsLabelCPUEE_);
56 }
const edm::EDGetTokenT< InputProduct > recHitsGPUEB_
const edm::EDGetTokenT< InputProduct > recHitsGPUEE_

◆ ~EcalUncalibRecHitConvertGPU2CPUFormat()

EcalUncalibRecHitConvertGPU2CPUFormat::~EcalUncalibRecHitConvertGPU2CPUFormat ( )
override

Definition at line 58 of file EcalUncalibRecHitConvertGPU2CPUFormat.cc.

58 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 31 of file EcalUncalibRecHitConvertGPU2CPUFormat.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, ProducerED_cfi::InputTag, or, and AlCaHLTBitMon_QueryRunRegistry::string.

31  {
33 
34  desc.add<edm::InputTag>("recHitsLabelGPUEB", edm::InputTag("ecalUncalibRecHitProducerGPU", "EcalUncalibRecHitsEB"));
35  desc.add<std::string>("recHitsLabelCPUEB", "EcalUncalibRecHitsEB");
36  desc.ifValue(
37  edm::ParameterDescription<bool>("isPhase2", false, true),
38  false >>
40  "recHitsLabelGPUEE", edm::InputTag("ecalUncalibRecHitProducerGPU", "EcalUncalibRecHitsEE"), true) and
41  edm::ParameterDescription<std::string>("recHitsLabelCPUEE", "EcalUncalibRecHitsEE", true)) or
42  true >> edm::EmptyGroupDescription());
43  confDesc.add("ecalUncalibRecHitConvertGPU2CPUFormat", desc);
44 }
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Definition at line 60 of file EcalUncalibRecHitConvertGPU2CPUFormat.cc.

References mps_fire::i, isPhase2_, EcalDataFrame::MAXSAMPLES, eostools::move(), HLT_IsoTrack_cff::offset, recHitsGPUEB_, recHitsGPUEE_, recHitsLabelCPUEB_, recHitsLabelCPUEE_, and ecalGpuTask_cfi::sample.

60  {
61  auto const& recHitsGPUEB = event.get(recHitsGPUEB_);
62  auto recHitsCPUEB = std::make_unique<EBUncalibratedRecHitCollection>();
63  recHitsCPUEB->reserve(recHitsGPUEB.amplitude.size());
64 
65  for (uint32_t i = 0; i < recHitsGPUEB.amplitude.size(); ++i) {
66  recHitsCPUEB->emplace_back(DetId{recHitsGPUEB.did[i]},
67  recHitsGPUEB.amplitude[i],
68  recHitsGPUEB.pedestal[i],
69  recHitsGPUEB.jitter[i],
70  recHitsGPUEB.chi2[i],
71  recHitsGPUEB.flags[i]);
72  if (isPhase2_)
73  (*recHitsCPUEB)[i].setAmplitudeError(recHitsGPUEB.amplitudeError[i]);
74  (*recHitsCPUEB)[i].setJitterError(recHitsGPUEB.jitterError[i]);
75  auto const offset = i * EcalDataFrame::MAXSAMPLES;
76  for (uint32_t sample = 0; sample < EcalDataFrame::MAXSAMPLES; ++sample)
77  (*recHitsCPUEB)[i].setOutOfTimeAmplitude(sample, recHitsGPUEB.amplitudesAll[offset + sample]);
78  }
79  if (!isPhase2_) {
80  auto const& recHitsGPUEE = event.get(recHitsGPUEE_);
81  auto recHitsCPUEE = std::make_unique<EEUncalibratedRecHitCollection>();
82  recHitsCPUEE->reserve(recHitsGPUEE.amplitude.size());
83  for (uint32_t i = 0; i < recHitsGPUEE.amplitude.size(); ++i) {
84  recHitsCPUEE->emplace_back(DetId{recHitsGPUEE.did[i]},
85  recHitsGPUEE.amplitude[i],
86  recHitsGPUEE.pedestal[i],
87  recHitsGPUEE.jitter[i],
88  recHitsGPUEE.chi2[i],
89  recHitsGPUEE.flags[i]);
90  (*recHitsCPUEE)[i].setJitterError(recHitsGPUEE.jitterError[i]);
91  auto const offset = i * EcalDataFrame::MAXSAMPLES;
92  for (uint32_t sample = 0; sample < EcalDataFrame::MAXSAMPLES; ++sample) {
93  (*recHitsCPUEE)[i].setOutOfTimeAmplitude(sample, recHitsGPUEE.amplitudesAll[offset + sample]);
94  }
95  }
96  event.put(std::move(recHitsCPUEE), recHitsLabelCPUEE_);
97  }
98  event.put(std::move(recHitsCPUEB), recHitsLabelCPUEB_);
99 }
const edm::EDGetTokenT< InputProduct > recHitsGPUEB_
Definition: DetId.h:17
const edm::EDGetTokenT< InputProduct > recHitsGPUEE_
static constexpr int MAXSAMPLES
Definition: EcalDataFrame.h:48
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ isPhase2_

const bool EcalUncalibRecHitConvertGPU2CPUFormat::isPhase2_
private

Definition at line 23 of file EcalUncalibRecHitConvertGPU2CPUFormat.cc.

Referenced by produce().

◆ recHitsGPUEB_

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

Definition at line 24 of file EcalUncalibRecHitConvertGPU2CPUFormat.cc.

Referenced by produce().

◆ recHitsGPUEE_

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

Definition at line 25 of file EcalUncalibRecHitConvertGPU2CPUFormat.cc.

Referenced by produce().

◆ recHitsLabelCPUEB_

const std::string EcalUncalibRecHitConvertGPU2CPUFormat::recHitsLabelCPUEB_
private

Definition at line 27 of file EcalUncalibRecHitConvertGPU2CPUFormat.cc.

Referenced by produce().

◆ recHitsLabelCPUEE_

const std::string EcalUncalibRecHitConvertGPU2CPUFormat::recHitsLabelCPUEE_
private

Definition at line 28 of file EcalUncalibRecHitConvertGPU2CPUFormat.cc.

Referenced by produce().