58 desc.add<
double>(
"EBtimeFitLimits_Lower", 0.2);
59 desc.add<
double>(
"EBtimeFitLimits_Upper", 1.4);
60 desc.add<
double>(
"EEtimeFitLimits_Lower", 0.2);
61 desc.add<
double>(
"EEtimeFitLimits_Upper", 1.4);
62 desc.add<
double>(
"EBtimeConstantTerm", .6);
63 desc.add<
double>(
"EEtimeConstantTerm", 1.0);
64 desc.add<
double>(
"EBtimeNconst", 28.5);
65 desc.add<
double>(
"EEtimeNconst", 31.8);
66 desc.add<
double>(
"outOfTimeThresholdGain12pEB", 5);
67 desc.add<
double>(
"outOfTimeThresholdGain12mEB", 5);
68 desc.add<
double>(
"outOfTimeThresholdGain61pEB", 5);
69 desc.add<
double>(
"outOfTimeThresholdGain61mEB", 5);
70 desc.add<
double>(
"outOfTimeThresholdGain12pEE", 1000);
71 desc.add<
double>(
"outOfTimeThresholdGain12mEE", 1000);
72 desc.add<
double>(
"outOfTimeThresholdGain61pEE", 1000);
73 desc.add<
double>(
"outOfTimeThresholdGain61mEE", 1000);
74 desc.add<
double>(
"amplitudeThresholdEB", 10);
75 desc.add<
double>(
"amplitudeThresholdEE", 10);
76 desc.addUntracked<std::vector<uint32_t>>(
"kernelMinimizeThreads", {32, 1, 1});
77 desc.add<
bool>(
"shouldRunTimingComputation",
true);
83 digisTokenEE_{consumes(ps.getParameter<
edm::InputTag>(
"digisLabelEE"))},
84 uncalibRecHitsTokenEB_{produces(ps.getParameter<
std::string>(
"recHitsLabelEB"))},
85 uncalibRecHitsTokenEE_{produces(ps.getParameter<
std::string>(
"recHitsLabelEE"))},
88 ebDigisSizeHostBuf_{cms::alpakatools::make_host_buffer<uint32_t>()},
89 eeDigisSizeHostBuf_{cms::alpakatools::make_host_buffer<uint32_t>()} {
91 #ifdef ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED 92 producesTemporarily(
"edm::DeviceProduct<alpaka_cuda_async::EcalUncalibratedRecHitDeviceCollection>",
94 producesTemporarily(
"edm::DeviceProduct<alpaka_cuda_async::EcalUncalibratedRecHitDeviceCollection>",
98 std::pair<double, double> EBtimeFitLimits, EEtimeFitLimits;
99 EBtimeFitLimits.first = ps.getParameter<
double>(
"EBtimeFitLimits_Lower");
100 EBtimeFitLimits.second = ps.getParameter<
double>(
"EBtimeFitLimits_Upper");
101 EEtimeFitLimits.first = ps.getParameter<
double>(
"EEtimeFitLimits_Lower");
102 EEtimeFitLimits.second = ps.getParameter<
double>(
"EEtimeFitLimits_Upper");
106 auto EBtimeNconst = ps.getParameter<
double>(
"EBtimeNconst");
107 auto EEtimeNconst = ps.getParameter<
double>(
"EEtimeNconst");
109 auto outOfTimeThreshG12pEB = ps.getParameter<
double>(
"outOfTimeThresholdGain12pEB");
110 auto outOfTimeThreshG12mEB = ps.getParameter<
double>(
"outOfTimeThresholdGain12mEB");
111 auto outOfTimeThreshG61pEB = ps.getParameter<
double>(
"outOfTimeThresholdGain61pEB");
112 auto outOfTimeThreshG61mEB = ps.getParameter<
double>(
"outOfTimeThresholdGain61mEB");
113 auto outOfTimeThreshG12pEE = ps.getParameter<
double>(
"outOfTimeThresholdGain12pEE");
114 auto outOfTimeThreshG12mEE = ps.getParameter<
double>(
"outOfTimeThresholdGain12mEE");
115 auto outOfTimeThreshG61pEE = ps.getParameter<
double>(
"outOfTimeThresholdGain61pEE");
116 auto outOfTimeThreshG61mEE = ps.getParameter<
double>(
"outOfTimeThresholdGain61mEE");
117 auto amplitudeThreshEB = ps.getParameter<
double>(
"amplitudeThresholdEB");
118 auto amplitudeThreshEE = ps.getParameter<
double>(
"amplitudeThresholdEE");
121 configParameters_.shouldRunTimingComputation = ps.getParameter<
bool>(
"shouldRunTimingComputation");
124 auto threadsMinimize = ps.getUntrackedParameter<std::vector<uint32_t>>(
"kernelMinimizeThreads");
125 configParameters_.kernelMinimizeThreads[0] = threadsMinimize[0];
126 configParameters_.kernelMinimizeThreads[1] = threadsMinimize[1];
127 configParameters_.kernelMinimizeThreads[2] = threadsMinimize[2];
136 configParameters_.timeFitLimitsFirstEB = EBtimeFitLimits.first;
137 configParameters_.timeFitLimitsSecondEB = EBtimeFitLimits.second;
138 configParameters_.timeFitLimitsFirstEE = EEtimeFitLimits.first;
139 configParameters_.timeFitLimitsSecondEE = EEtimeFitLimits.second;
150 configParameters_.amplitudeThreshEB = amplitudeThreshEB;
151 configParameters_.amplitudeThreshEE = amplitudeThreshEE;
154 configParameters_.outOfTimeThreshG12pEB = outOfTimeThreshG12pEB;
155 configParameters_.outOfTimeThreshG12pEE = outOfTimeThreshG12pEE;
156 configParameters_.outOfTimeThreshG61pEB = outOfTimeThreshG61pEB;
157 configParameters_.outOfTimeThreshG61pEE = outOfTimeThreshG61pEE;
158 configParameters_.outOfTimeThreshG12mEB = outOfTimeThreshG12mEB;
159 configParameters_.outOfTimeThreshG12mEE = outOfTimeThreshG12mEE;
160 configParameters_.outOfTimeThreshG61mEB = outOfTimeThreshG61mEB;
161 configParameters_.outOfTimeThreshG61mEE = outOfTimeThreshG61mEE;
165 auto&
queue =
event.queue();
172 auto ebDigisSizeDevConstView =
173 cms::alpakatools::make_device_view<const uint32_t>(alpaka::getDev(
queue), ebDigisDev.const_view().size());
174 auto eeDigisSizeDevConstView =
175 cms::alpakatools::make_device_view<const uint32_t>(alpaka::getDev(
queue), eeDigisDev.const_view().size());
181 auto&
queue =
event.queue();
196 auto uncalibRecHitSizeViewEB =
197 cms::alpakatools::make_device_view<uint32_t>(alpaka::getDev(
queue), uncalibRecHitsDevEB.view().size());
198 auto uncalibRecHitSizeViewEE =
199 cms::alpakatools::make_device_view<uint32_t>(alpaka::getDev(
queue), uncalibRecHitsDevEE.view().size());
200 alpaka::memset(
queue, uncalibRecHitSizeViewEB, 0);
201 alpaka::memset(
queue, uncalibRecHitSizeViewEE, 0);
204 if (ebDigisSize + eeDigisSize > 0) {
217 multifitConditionsDev,
218 multifitParametersDev,
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
T getParameter(std::string const &) const
~EcalUncalibRecHitProducerPortable() override=default
PortableCollection< EcalUncalibratedRecHitSoA > EcalUncalibratedRecHitDeviceCollection
const device::ESGetToken< EcalMultifitConditionsDevice, EcalMultifitConditionsRcd > multifitConditionsToken_
const device::EDGetToken< InputProduct > digisTokenEB_
const device::EDGetToken< InputProduct > digisTokenEE_
const device::EDPutToken< OutputProduct > uncalibRecHitsTokenEB_
void launchKernels(Queue &queue, InputProduct const &digisDevEB, InputProduct const &digisDevEE, OutputProduct &uncalibRecHitsDevEB, OutputProduct &uncalibRecHitsDevEE, EcalMultifitConditionsDevice const &conditionsDev, EcalMultifitParametersDevice const ¶msDev, ConfigurationParameters const &configParams)
EcalUncalibRecHitProducerPortable(edm::ParameterSet const &ps)
static void fillDescriptions(edm::ConfigurationDescriptions &)
cms::alpakatools::host_buffer< uint32_t > eeDigisSizeHostBuf_
EcalDigiDeviceCollection InputProduct
void acquire(device::Event const &, device::EventSetup const &) override
const device::ESGetToken< EcalMultifitParametersDevice, EcalMultifitParametersRcd > multifitParametersToken_
PortableCollection< EcalDigiSoA > EcalDigiDeviceCollection
ecal::multifit::ConfigurationParameters configParameters_
#define DEFINE_FWK_ALPAKA_MODULE(name)
cms::alpakatools::host_buffer< uint32_t > ebDigisSizeHostBuf_
void produce(device::Event &, device::EventSetup const &) override
EcalUncalibratedRecHitDeviceCollection OutputProduct
const device::EDPutToken< OutputProduct > uncalibRecHitsTokenEE_