30 std::unordered_map<uint32_t,
double>& simhits_ee,
31 std::unordered_map<uint32_t,
double>& simhits_fh,
32 std::unordered_map<uint32_t,
double>& simhits_bh);
121 auto withPrefix([&
prefix, &bname](
char const* vname) ->
char const* {
122 bname =
prefix +
"_" + vname;
123 return bname.c_str();
175 std::unordered_map<uint32_t, double> simhits_ee;
176 std::unordered_map<uint32_t, double> simhits_fh;
177 std::unordered_map<uint32_t, double> simhits_bh;
179 simhits(
e, simhits_ee, simhits_fh, simhits_bh);
182 std::unordered_map<uint32_t, unsigned> cell_to_genparticle;
185 for (
auto& keyval : *caloparticles_map_h) {
186 for (
auto& tcref : keyval.val)
187 cell_to_genparticle.emplace(tcref->detId(), keyval.key->g4Tracks().at(0).genpartIndex() - 1);
192 std::unordered_map<uint32_t, uint32_t> cell2cluster;
193 std::unordered_map<uint32_t, l1t::HGCalMulticlusterBxCollection::const_iterator> cell2multicluster;
194 for (
auto mcl_itr = multiclusters.
begin(0); mcl_itr != multiclusters.
end(0); mcl_itr++) {
196 for (
const auto& cl_ptr : mcl_itr->constituents()) {
198 for (
const auto& tc_ptr : cl_ptr.second->constituents()) {
199 cell2cluster.emplace(tc_ptr.second->detId(), cl_ptr.second->detId());
200 cell2multicluster.emplace(tc_ptr.second->detId(), mcl_itr);
208 for (
auto tc_itr = trigger_cells.
begin(0); tc_itr != trigger_cells.
end(0); tc_itr++) {
209 if (tc_itr->hwPt() > 0) {
210 auto cl_itr = cell2cluster.find(tc_itr->detId());
211 auto mcl_itr = cell2multicluster.find(tc_itr->detId());
212 uint32_t cl_id = (cl_itr != cell2cluster.end() ? cl_itr->second : 0);
213 uint32_t mcl_id = (mcl_itr != cell2multicluster.end() ? mcl_itr->second->detId() : 0);
214 float mcl_pt = (mcl_itr != cell2multicluster.end() ? mcl_itr->second->pt() : 0.);
222 int panel_sector = -999;
223 int panel_number = -999;
227 panel_number = panelIdHGCal.
wafer();
234 panel_sector = panelIdSci.
iphi();
235 panel_number = panelIdSci.
ietaAbs();
239 tc_id_.emplace_back(tc_itr->detId());
268 tc_data_.emplace_back(tc_itr->hwPt());
273 tc_pt_.emplace_back(tc_itr->pt());
275 tc_eta_.emplace_back(tc_itr->eta());
276 tc_phi_.emplace_back(tc_itr->phi());
277 tc_x_.emplace_back(tc_itr->position().x());
278 tc_y_.emplace_back(tc_itr->position().y());
279 tc_z_.emplace_back(tc_itr->position().z());
292 auto itr = simhits_ee.find(c_id);
293 if (itr != simhits_ee.end())
296 auto itr = simhits_fh.find(c_id);
297 if (itr != simhits_fh.end())
300 auto itr = simhits_bh.find(c_id);
301 if (itr != simhits_bh.end())
310 auto itr(cell_to_genparticle.find(tc_itr->detId()));
311 if (itr == cell_to_genparticle.end())
323 double TeV2GeV = 1.e3;
328 std::unordered_map<uint32_t, double>& simhits_ee,
329 std::unordered_map<uint32_t, double>& simhits_fh,
330 std::unordered_map<uint32_t, double>& simhits_bh) {
342 for (
const auto& simhit : ee_simhits) {
346 auto itr_insert = simhits_ee.emplace(
id, 0.);
347 itr_insert.first->second += simhit.energy();
350 for (
const auto& simhit : fh_simhits) {
354 auto itr_insert = simhits_fh.emplace(
id, 0.);
355 itr_insert.first->second += simhit.energy();
358 for (
const auto& simhit : bh_simhits) {
363 auto itr_insert = simhits_bh.emplace(
id, 0.);
364 itr_insert.first->second += simhit.energy();