163 const auto& ped = &iSetup.getData(
pedToken_);
164 const auto& geo = &iSetup.getData(
geomToken_);
177 nPart_ = particles_->size();
189 unsigned nHitsECAL = 0, nHitsES = 0;
191 for (
auto&
part : *particles_) {
197 nHitsECAL += sc->hitsAndFractions().size();
199 for (
auto iES = sc->preshowerClustersBegin(); iES != sc->preshowerClustersEnd(); ++iES) {
200 nHitsES += (*iES)->hitsAndFractions().size();
214 auto& inputxECAL = iInput.at(
"xECAL");
215 inputxECAL.setShape(0, nHitsECAL);
216 auto dataxECAL = inputxECAL.allocate<
float>();
217 auto& vdataxECAL = (*dataxECAL)[0];
219 auto& inputfECAL = iInput.at(
"fECAL");
220 inputfECAL.setShape(0, nHitsECAL);
221 auto datafECAL = inputfECAL.allocate<int64_t>();
222 auto& vdatafECAL = (*datafECAL)[0];
224 auto& inputGainECAL = iInput.at(
"gainECAL");
225 inputGainECAL.setShape(0, nHitsECAL);
226 auto dataGainECAL = inputGainECAL.allocate<int64_t>();
227 auto& vdataGainECAL = (*dataGainECAL)[0];
229 auto& inputGx = iInput.at(
"gx");
231 auto dataGx = inputGx.allocate<
float>();
232 auto& vdataGx = (*dataGx)[0];
234 auto& inputBatchECAL = iInput.at(
"batchECAL");
235 inputBatchECAL.setShape(0, nHitsECAL);
236 auto dataBatchECAL = inputBatchECAL.allocate<int64_t>();
237 auto& vdataBatchECAL = (*dataBatchECAL)[0];
239 auto& inputxES = iInput.at(
"xES");
240 inputxES.setShape(0, nHitsES);
241 auto dataxES = inputxES.allocate<
float>();
242 auto& vdataxES = (*dataxES)[0];
244 auto& inputfES = iInput.at(
"fES");
245 inputfES.setShape(0, nHitsES);
246 auto datafES = inputfES.allocate<int64_t>();
247 auto& vdatafES = (*datafES)[0];
249 auto& inputBatchES = iInput.at(
"batchES");
250 inputBatchES.setShape(0, nHitsES);
251 auto dataBatchES = inputBatchES.allocate<int64_t>();
252 auto& vdataBatchES = (*dataBatchES)[0];
258 std::shared_ptr<const CaloCellGeometry>
geom;
259 for (
auto&
part : *particles_) {
265 std::vector<std::pair<DetId, float>> hitsAndFractions = sc->hitsAndFractions();
269 for (
const auto& detitr : hitsAndFractions) {
280 auto pos =
geom->getPosition();
281 vdataxECAL.push_back(rescale(
pos.x(), XY_MIN, XY_RANGE));
282 vdataxECAL.push_back(rescale(
pos.y(), XY_MIN, XY_RANGE));
283 vdataxECAL.push_back(rescale(
pos.z(), Z_MIN,
Z_RANGE));
284 vdataxECAL.push_back(rescale(
hit->energy() * detitr.second, ECAL_MIN, ECAL_RANGE));
285 vdataxECAL.push_back(rescale(ped->find(detitr.first)->rms(1),
NOISE_MIN, NOISE_RANGE));
296 vdatafECAL.push_back(flagVal);
307 vdataGainECAL.push_back(gainVal);
310 vdataBatchECAL.push_back(partNum);
314 for (
auto iES = sc->preshowerClustersBegin(); iES != sc->preshowerClustersEnd(); ++iES) {
315 for (
const auto& ESitr : (*iES)->hitsAndFractions()) {
316 hit = recHitsES.find(ESitr.first);
318 auto&
pos =
geom->getPosition();
321 vdataxES.push_back(rescale(
pos.x(), XY_MIN, XY_RANGE));
322 vdataxES.push_back(rescale(
pos.y(), XY_MIN, XY_RANGE));
323 vdataxES.push_back(rescale(
pos.z(), Z_MIN,
Z_RANGE));
324 vdataxES.push_back(rescale(
hit->energy(), ES_MIN, ES_RANGE));
331 vdatafES.push_back(flagVal);
334 vdataBatchES.push_back(partNum);
339 vdataGx.push_back(rescale(
rho, RHO_MIN, RHO_RANGE));
340 vdataGx.push_back(rescale(
part.hadronicOverEm(), HOE_MIN, HOE_RANGE));
349 inputxECAL.toServer(dataxECAL);
350 inputfECAL.toServer(datafECAL);
351 inputGainECAL.toServer(dataGainECAL);
352 inputBatchECAL.toServer(dataBatchECAL);
354 inputGx.toServer(dataGx);
356 inputxES.toServer(dataxES);
357 inputfES.toServer(datafES);
358 inputBatchES.toServer(dataBatchES);
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > geomToken_
std::vector< EcalRecHit >::const_iterator const_iterator
edm::EDGetTokenT< EcalRecHitCollection > EBRecHitsToken_
edm::EDGetTokenT< double > rhoToken_
static const float Z_RANGE
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
constexpr uint32_t rawId() const
get the raw id
edm::ESGetToken< EcalPedestals, EcalPedestalsRcd > pedToken_
edm::EDGetTokenT< EcalRecHitCollection > EERecHitsToken_
edm::EDGetTokenT< EcalRecHitCollection > ESRecHitsToken_
edm::EDGetTokenT< edm::View< T > > particleToken_
std::unique_ptr< TritonClient > client_