35 edm4hep::CalorimeterHitCollection tow_col;
39 if (lhcal <= 0)
return;
40 const int nsh =
static_cast<int>(std::lround(ph::Q(lhcal + 2)));
43 int show_ofs = lhcal + 2;
44 for (
int ish = 0; ish < nsh; ++ish) {
45 const int len =
static_cast<int>(std::lround(ph::Q(show_ofs + 1)));
46 const float X = ph::Q(show_ofs + 4);
47 const float Y = ph::Q(show_ofs + 5);
48 const float Z = ph::Q(show_ofs + 6);
49 const int nlay =
static_cast<int>(std::lround(ph::Q(show_ofs + 10)));
51 if (nlay < 1 || nlay > 10 || len < 11 + 2 * nlay + 1) {
57 const int locw = show_ofs + 11 + nlay * 2;
58 const int ntd =
static_cast<int>(std::lround(ph::Q(locw + 1)));
59 if (ntd > 0 && ntd < 1000 &&
60 len >= (locw - show_ofs) + 1 + 2 * ntd) {
61 for (
int k = 0; k < ntd; ++k) {
62 const float tdam = ph::Q(locw + 2 + 2 * k);
63 const int pkd =
static_cast<int>(std::lround(ph::Q(locw + 3 + 2 * k)));
64 const int lay = pkd / 10000;
65 auto hit = tow_col.create();
67 hit.setEnergyError(0.f);
70 hit.setCellID(
static_cast<std::uint64_t
>(pkd));
72 X * kCm2Mm, Y * kCm2Mm, Z * kCm2Mm,