61 return StatusCode::SUCCESS;
67 if (!
parts.isValid()) {
69 return StatusCode::FAILURE;
74 return StatusCode::FAILURE;
76 std::map<int, std::vector<const xAOD::TruthParticle*>> truth_map_calo;
77 std::map<int, std::vector<const xAOD::TruthParticle*>> truth_map_track;
81 for (
size_t parti = 0; parti <
event->nTruthParticles(); ++parti) {
84 const int sector = sector_mapping.getSector(tpart->
phi());
85 truth_map_calo[sector].push_back(tpart);
87 truth_map_track[sector].push_back(tpart);
96 std::vector<int> sectors;
97 sector_mapping.getSectors(
part->phi(), sectors);
99 float new_topoetcone20{0}, new_ptcone20{0}, new_ptvarcone20{0}, new_ptvarcone30{0},
100 new_ptcone20_pt500{0}, new_ptvarcone20_pt500{0}, new_ptvarcone30_pt500{0};
102 for (
const int sector : sectors) {
103 const std::vector<const xAOD::TruthParticle*>& calo_container = truth_map_calo[sector];
108 if (dR < 0.05 || dR > 0.2)
continue;
109 new_topoetcone20 += calo_part->pt();
112 const std::vector<const xAOD::TruthParticle*>& truth_container = truth_map_track[sector];
116 const float pt = trk_part->pt();
117 if (dR > 0.3)
continue;
118 new_ptcone20_pt500 += (dR < 0.2) *
pt;
119 new_ptvarcone20_pt500 += (dR < varradius20) *
pt;
120 new_ptvarcone30_pt500 += (dR < varradius30) *
pt;
121 if (
pt < 1000)
continue;
122 new_ptcone20 += (dR < 0.2) *
pt;
123 new_ptvarcone20 += (dR < varradius20) *
pt;
124 new_ptvarcone30 += (dR < varradius30) *
pt;
128 decorator_topoetcone20(*
part) = new_topoetcone20;
129 decorator_ptcone20(*
part) = new_ptcone20;
130 decorator_ptvarcone20(*
part) = new_ptvarcone20;
131 decorator_ptvarcone30(*
part) = new_ptvarcone30;
132 decorator_ptcone20_pt500(*
part) = new_ptcone20_pt500;
133 decorator_ptvarcone20_pt500(*
part) = new_ptvarcone20_pt500;
134 decorator_ptvarcone30_pt500(*
part) = new_ptvarcone30_pt500;
136 return StatusCode::SUCCESS;