48 return StatusCode::SUCCESS;
52 if (! hltCluster_readHandle.
isValid() ) {
54 return StatusCode::FAILURE;
59 if (! offCluster_readHandle.
isValid() ) {
61 return StatusCode::FAILURE;
65 int bcid = ctx.eventID().bunch_crossing_id();
70 ATH_MSG_ERROR(
"Unable to retrieve BunchCrossing conditions object" );
71 return StatusCode::FAILURE;
84 std::vector<clus_kin<const xAOD::TrigEMCluster*> > vec_hlt_clusters;
89 for (
const auto hlt_cluster : *hltCluster_readHandle) {
90 auto hlt_clus_et = hlt_cluster->et();
92 vec_hlt_clusters.push_back({hlt_clus_et*0.001, hlt_cluster->eta(), hlt_cluster->phi(), hlt_cluster});
96 else if (accepted_hlt_clusters.size()>0){
97 for (
const auto* hlt_cluster : accepted_hlt_clusters) {
98 auto hlt_clus_et = hlt_cluster->et();
100 vec_hlt_clusters.push_back({hlt_clus_et*0.001, hlt_cluster->eta(), hlt_cluster->phi(), hlt_cluster});
104 std::vector<clus_kin<const xAOD::CaloCluster*> > vec_off_clusters;
105 for (
const auto off_cluster : *offCluster_readHandle) {
106 auto off_clus_et = off_cluster->et();
109 bool OFF_type_match =
false;
112 if (off_cluster->clusterSize() ==
m_OFF_types[
n]) { OFF_type_match =
true;
break; }
115 if (!
m_OFF_types.empty() && !OFF_type_match)
continue;
117 vec_off_clusters.push_back({off_clus_et*0.001, off_cluster->eta(), off_cluster->phi(), off_cluster});
124 unsigned int n_hlt_clusters = 0;
125 unsigned int n_hlt_barrel_high_et_clusters = 0;
126 unsigned int n_hlt_clusters_no_match = 0;
127 unsigned int n_hlt_clusters_with_match = 0;
137 std::vector<char> vec_hlt_barrel_high_et, vec_hlt_no_off_match, vec_hlt_with_off_match;
147 std::vector<float> vec_hlt_vs_off_minimum_delta_r, vec_hlt_vs_off_delta_eta, vec_hlt_vs_off_delta_phi, vec_hlt_vs_off_resolution, vec_off_match_et;
150 auto HLT_vs_OFF_minimum_delta_r =
Monitored::Collection(
"HLT_vs_OFF_minimum_delta_r", vec_hlt_vs_off_minimum_delta_r);
151 auto HLT_vs_OFF_minimum_delta_eta =
Monitored::Collection(
"HLT_vs_OFF_minimum_delta_eta", vec_hlt_vs_off_delta_eta);
152 auto HLT_vs_OFF_minimum_delta_phi =
Monitored::Collection(
"HLT_vs_OFF_minimum_delta_phi", vec_hlt_vs_off_delta_phi);
153 auto HLT_vs_OFF_resolution =
Monitored::Collection(
"HLT_vs_OFF_resolution", vec_hlt_vs_off_resolution);
160 for (
const auto& hlt_cluster : vec_hlt_clusters) {
165 if (hlt_cluster.et > (
m_HLT_high_et*0.001) && fabs(hlt_cluster.eta) < 2.5) {
167 ++n_hlt_barrel_high_et_clusters;
169 vec_hlt_barrel_high_et.push_back(1);
171 else vec_hlt_barrel_high_et.push_back(0);
175 float min_delta_r = 999999.9;
177 for (
const auto& off_cluster : vec_off_clusters) {
181 if (delta_r < min_delta_r) {
183 min_delta_r = delta_r;
184 off_match = &off_cluster;
189 vec_hlt_vs_off_minimum_delta_r.push_back(min_delta_r);
194 ++n_hlt_clusters_no_match;
196 vec_off_match_et.push_back(0.);
197 vec_hlt_vs_off_resolution.push_back(0.);
198 vec_hlt_vs_off_delta_eta.push_back(0.);
199 vec_hlt_vs_off_delta_phi.push_back(0.);
201 vec_hlt_no_off_match.push_back(1);
202 vec_hlt_with_off_match.push_back(0);
208 ++n_hlt_clusters_with_match;
210 vec_off_match_et.push_back(off_match->
et);
211 vec_hlt_vs_off_resolution.push_back(((off_match->
et - hlt_cluster.et) / off_match->
et) * 100);
212 vec_hlt_vs_off_delta_eta.push_back(off_match->
eta - hlt_cluster.eta);
215 vec_hlt_no_off_match.push_back(0);
216 vec_hlt_with_off_match.push_back(1);
221 HLT_num = n_hlt_clusters;
222 HLT_barrel_high_et_num = n_hlt_barrel_high_et_clusters;
223 HLT_no_OFF_match_num = n_hlt_clusters_no_match;
224 HLT_with_OFF_match_num = n_hlt_clusters_with_match;
225 if (n_hlt_clusters>0) {
226 HLT_matched_fraction =
static_cast<float>(n_hlt_clusters_with_match) / n_hlt_clusters;
233 unsigned int n_off_clusters = 0;
234 unsigned int n_off_clusters_no_match = 0;
235 unsigned int n_off_clusters_with_match = 0;
245 std::vector<char> vec_off_no_hlt_match, vec_off_with_hlt_match;
253 std::vector<float> vec_off_vs_hlt_minimum_delta_r, vec_off_vs_hlt_delta_eta, vec_off_vs_hlt_delta_phi, vec_off_vs_hlt_resolution, vec_hlt_match_et;
256 auto OFF_vs_HLT_minimum_delta_r =
Monitored::Collection(
"OFF_vs_HLT_minimum_delta_r", vec_off_vs_hlt_minimum_delta_r);
257 auto OFF_vs_HLT_minimum_delta_eta =
Monitored::Collection(
"OFF_vs_HLT_minimum_delta_eta", vec_off_vs_hlt_delta_eta);
258 auto OFF_vs_HLT_minimum_delta_phi =
Monitored::Collection(
"OFF_vs_HLT_minimum_delta_phi", vec_off_vs_hlt_delta_phi);
259 auto OFF_vs_HLT_resolution =
Monitored::Collection(
"OFF_vs_HLT_resolution", vec_off_vs_hlt_resolution);
266 for (
const auto& off_cluster : vec_off_clusters) {
272 float min_delta_r = 999999.9;
274 for (
const auto& hlt_cluster : vec_hlt_clusters) {
278 if (delta_r < min_delta_r) {
280 min_delta_r = delta_r;
281 hlt_match = &hlt_cluster;
286 vec_off_vs_hlt_minimum_delta_r.push_back(min_delta_r);
291 ++n_off_clusters_no_match;
293 vec_hlt_match_et.push_back(0.);
295 vec_off_vs_hlt_resolution.push_back(0.);
296 vec_off_vs_hlt_delta_eta.push_back(0.);
297 vec_off_vs_hlt_delta_phi.push_back(0.);
299 vec_off_no_hlt_match.push_back(1);
300 vec_off_with_hlt_match.push_back(0);
306 ++n_off_clusters_with_match;
308 vec_hlt_match_et.push_back(hlt_match->
et);
310 vec_off_vs_hlt_resolution.push_back(((off_cluster.et - hlt_match->
et) / off_cluster.et) * 100);
311 vec_off_vs_hlt_delta_eta.push_back(off_cluster.eta - hlt_match->
eta);
314 vec_off_no_hlt_match.push_back(0);
315 vec_off_with_hlt_match.push_back(1);
320 OFF_num = n_off_clusters;
321 OFF_no_HLT_match_num = n_off_clusters_no_match;
322 OFF_with_HLT_match_num = n_off_clusters_with_match;
323 if (n_off_clusters>0) {
324 OFF_matched_fraction =
static_cast<float>(n_off_clusters_with_match) / n_off_clusters;
331 HLT_num, HLT_et, HLT_eta, HLT_phi, HLT_size, HLT_barrel_high_et_num, HLT_bc,
334 HLT_barrel_high_et, HLT_no_OFF_match, HLT_with_OFF_match,
337 OFF_num, OFF_et, OFF_eta, OFF_phi, OFF_type,
340 OFF_no_HLT_match, OFF_with_HLT_match,
343 HLT_matched_fraction, HLT_no_OFF_match_num, HLT_vs_OFF_minimum_delta_r, HLT_with_OFF_match_num,
344 OFF_match_et, HLT_vs_OFF_resolution, HLT_vs_OFF_minimum_delta_eta, HLT_vs_OFF_minimum_delta_phi,
347 OFF_matched_fraction, OFF_no_HLT_match_num, OFF_vs_HLT_minimum_delta_r, OFF_with_HLT_match_num,
348 HLT_match_et, OFF_vs_HLT_resolution, OFF_vs_HLT_minimum_delta_eta, OFF_vs_HLT_minimum_delta_phi
351 else if(accepted_hlt_clusters.size()>0){
355 HLT_num, HLT_et, HLT_eta, HLT_phi, HLT_size, HLT_barrel_high_et_num, HLT_bc,
358 HLT_barrel_high_et, HLT_no_OFF_match, HLT_with_OFF_match,
361 OFF_num, OFF_et, OFF_eta, OFF_phi, OFF_type,
364 OFF_no_HLT_match, OFF_with_HLT_match,
367 HLT_matched_fraction, HLT_no_OFF_match_num, HLT_vs_OFF_minimum_delta_r, HLT_with_OFF_match_num,
368 OFF_match_et, HLT_vs_OFF_resolution, HLT_vs_OFF_minimum_delta_eta, HLT_vs_OFF_minimum_delta_phi,
371 OFF_matched_fraction, OFF_no_HLT_match_num, OFF_vs_HLT_minimum_delta_r, OFF_with_HLT_match_num,
372 HLT_match_et, OFF_vs_HLT_resolution, OFF_vs_HLT_minimum_delta_eta, OFF_vs_HLT_minimum_delta_phi
375 return StatusCode::SUCCESS;
381 if (fabs(eta_1-eta_2) > max_deltar)
return 99.9;
383 if (DeltaPhi > max_deltar)
return 99.9;
384 return sqrt( ((eta_1-eta_2)*(eta_1-eta_2)) + (DeltaPhi*DeltaPhi) );
390 featureRequestDescriptor.
setCondition(TrigDefs::includeFailedDecisions);
392 std::vector<const xAOD::TrigEMCluster*> clustersToMonitorForChain;
395 clustersToMonitorForChain.
push_back( *(
f.link) );
398 ATH_MSG_DEBUG(
"clustersToMonitorForChain.size(): "<<clustersToMonitorForChain.size());
399 for(
auto &
p: clustersToMonitorForChain)
401 return clustersToMonitorForChain;