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>()} {
90 std::pair<double, double> EBtimeFitLimits, EEtimeFitLimits;
91 EBtimeFitLimits.first = ps.getParameter<
double>(
"EBtimeFitLimits_Lower");
92 EBtimeFitLimits.second = ps.getParameter<
double>(
"EBtimeFitLimits_Upper");
93 EEtimeFitLimits.first = ps.getParameter<
double>(
"EEtimeFitLimits_Lower");
94 EEtimeFitLimits.second = ps.getParameter<
double>(
"EEtimeFitLimits_Upper");
98 auto EBtimeNconst = ps.getParameter<
double>(
"EBtimeNconst");
99 auto EEtimeNconst = ps.getParameter<
double>(
"EEtimeNconst");
101 auto outOfTimeThreshG12pEB = ps.getParameter<
double>(
"outOfTimeThresholdGain12pEB");
102 auto outOfTimeThreshG12mEB = ps.getParameter<
double>(
"outOfTimeThresholdGain12mEB");
103 auto outOfTimeThreshG61pEB = ps.getParameter<
double>(
"outOfTimeThresholdGain61pEB");
104 auto outOfTimeThreshG61mEB = ps.getParameter<
double>(
"outOfTimeThresholdGain61mEB");
105 auto outOfTimeThreshG12pEE = ps.getParameter<
double>(
"outOfTimeThresholdGain12pEE");
106 auto outOfTimeThreshG12mEE = ps.getParameter<
double>(
"outOfTimeThresholdGain12mEE");
107 auto outOfTimeThreshG61pEE = ps.getParameter<
double>(
"outOfTimeThresholdGain61pEE");
108 auto outOfTimeThreshG61mEE = ps.getParameter<
double>(
"outOfTimeThresholdGain61mEE");
109 auto amplitudeThreshEB = ps.getParameter<
double>(
"amplitudeThresholdEB");
110 auto amplitudeThreshEE = ps.getParameter<
double>(
"amplitudeThresholdEE");
113 configParameters_.shouldRunTimingComputation = ps.getParameter<
bool>(
"shouldRunTimingComputation");
116 auto threadsMinimize = ps.getUntrackedParameter<std::vector<uint32_t>>(
"kernelMinimizeThreads");
117 configParameters_.kernelMinimizeThreads[0] = threadsMinimize[0];
118 configParameters_.kernelMinimizeThreads[1] = threadsMinimize[1];
119 configParameters_.kernelMinimizeThreads[2] = threadsMinimize[2];
128 configParameters_.timeFitLimitsFirstEB = EBtimeFitLimits.first;
129 configParameters_.timeFitLimitsSecondEB = EBtimeFitLimits.second;
130 configParameters_.timeFitLimitsFirstEE = EEtimeFitLimits.first;
131 configParameters_.timeFitLimitsSecondEE = EEtimeFitLimits.second;
142 configParameters_.amplitudeThreshEB = amplitudeThreshEB;
143 configParameters_.amplitudeThreshEE = amplitudeThreshEE;
146 configParameters_.outOfTimeThreshG12pEB = outOfTimeThreshG12pEB;
147 configParameters_.outOfTimeThreshG12pEE = outOfTimeThreshG12pEE;
148 configParameters_.outOfTimeThreshG61pEB = outOfTimeThreshG61pEB;
149 configParameters_.outOfTimeThreshG61pEE = outOfTimeThreshG61pEE;
150 configParameters_.outOfTimeThreshG12mEB = outOfTimeThreshG12mEB;
151 configParameters_.outOfTimeThreshG12mEE = outOfTimeThreshG12mEE;
152 configParameters_.outOfTimeThreshG61mEB = outOfTimeThreshG61mEB;
153 configParameters_.outOfTimeThreshG61mEE = outOfTimeThreshG61mEE;
157 auto&
queue =
event.queue();
164 auto ebDigisSizeDevConstView =
165 cms::alpakatools::make_device_view<const uint32_t>(
queue, ebDigisDev.const_view().size());
166 auto eeDigisSizeDevConstView =
167 cms::alpakatools::make_device_view<const uint32_t>(
queue, eeDigisDev.const_view().size());
173 auto&
queue =
event.queue();
188 auto uncalibRecHitSizeViewEB =
189 cms::alpakatools::make_device_view<uint32_t>(
queue, uncalibRecHitsDevEB.view().size());
190 auto uncalibRecHitSizeViewEE =
191 cms::alpakatools::make_device_view<uint32_t>(
queue, uncalibRecHitsDevEE.view().size());
192 alpaka::memset(
queue, uncalibRecHitSizeViewEB, 0);
193 alpaka::memset(
queue, uncalibRecHitSizeViewEE, 0);
196 if (ebDigisSize + eeDigisSize > 0) {
209 multifitConditionsDev,
210 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_