54 for (
unsigned int i = 0;
i <
hits.size(); ++
i) {
62 if (thickness_index == -1) {
65 double storedThreshold =
thresholds_[layerOnSide][thickness_index];
66 if (hgrh.
energy() < storedThreshold)
73 auto cellsView =
cells.view();
79 for (
unsigned int i = 0;
i <
hits.size(); ++
i) {
86 float sigmaNoise = 1.f;
88 if (thickness_index == -1) {
91 double storedThreshold =
thresholds_[layerOnSide][thickness_index];
95 sigmaNoise =
v_sigmaNoise_.at(layerOnSide).at(thickness_index);
97 if (hgrh.
energy() < storedThreshold)
103 int layer = layerOnSide +
offset;
104 auto entryInSoA = cellsView[
index];
114 entryInSoA.weight() = hgrh.
energy();
115 entryInSoA.sigmaNoise() = sigmaNoise;
116 entryInSoA.layer() = layer;
117 entryInSoA.recHitIndex() =
i;
118 entryInSoA.detid() =
detid.rawId();
119 entryInSoA.time() = hgrh.
time();
120 entryInSoA.timeError() = hgrh.
timeError();
125 <<
" i.e. " <<
cells->metadata().size() << std::endl;
128 if constexpr (!std::is_same_v<Device, alpaka_common::DevHost>) {
132 alpaka::memcpy(
iEvent.queue(), deviceProduct.buffer(),
cells.const_buffer());
142 desc.add<
std::string>(
"detector",
"EE")->setComment(
"options EE, FH, BH, HFNose; other value defaults to EE");
144 desc.add<
unsigned int>(
"maxNumberOfThickIndices", 6);
145 desc.add<
double>(
"fcPerEle", 0.00016020506);
146 desc.add<std::vector<double>>(
"fcPerMip");
147 desc.add<std::vector<double>>(
"thicknessCorrection");
148 desc.add<std::vector<double>>(
"noises");
149 desc.add<std::vector<double>>(
"dEdXweights");
150 desc.add<
double>(
"ecut", 3.);
190 std::vector<double>
dummy;
196 for (
unsigned ilayer = 1; ilayer <=
maxlayer_; ++ilayer) {
206 <<
" sigmaNoise: " << sigmaNoise <<
"\n";
device::EDPutToken< HGCalSoARecHitsDeviceCollection > const deviceToken_
std::vector< double > fcPerMip_
HGCalSoARecHitsProducer(edm::ParameterSet const &config)
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
std::vector< HGCRecHit > HGCRecHitCollection
constexpr const DetId & detid() const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< std::vector< double > > thresholds_
T const * product() const
edm::ESHandle< T > getHandle(edm::ESGetToken< T, R > const &iToken) const
std::vector< std::vector< double > > v_sigmaNoise_
std::vector< double > nonAgedNoises_
constexpr float energy() const
PortableCollection< HGCalSoARecHits > HGCalSoARecHitsDeviceCollection
std::vector< double > thicknessCorrection_
int deltasi_index_regemfac_
std::vector< double > dEdXweights_
double sciThicknessCorrection_
void produce(device::Event &iEvent, device::EventSetup const &iSetup) override
~HGCalSoARecHitsProducer() override=default
hgcal::RecHitTools rhtools_
constexpr float time() const
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeomToken_
static int position[264][3]
auto produces(std::string instanceName) noexcept
declare what type of product will make and with which optional label
#define DEFINE_FWK_ALPAKA_MODULE(name)
edm::EDGetTokenT< HGCRecHitCollection > hits_token_
unsigned maxNumberOfThickIndices_