56 return StatusCode::SUCCESS;
59 if (! hltCluster_readHandle.
isValid() ) {
61 return StatusCode::FAILURE;
66 if (! offCluster_readHandle.
isValid() ) {
68 return StatusCode::FAILURE;
72 int bcid = ctx.eventID().bunch_crossing_id();
77 ATH_MSG_ERROR(
"Unable to retrieve BunchCrossing conditions object" );
78 return StatusCode::FAILURE;
89 std::vector<clus_kin> vec_hlt_clusters;
93 if (accepted_hlt_clusters.size()>0){
94 for (
const auto* hlt_cluster : accepted_hlt_clusters) {
95 auto hlt_clus_et = hlt_cluster->et();
98 bool HLT_type_match =
false;
101 if (hlt_cluster->clusterSize() ==
m_HLT_types[
n]) { HLT_type_match =
true;
break; }
104 if (!
m_HLT_types.empty() && !HLT_type_match)
continue;
105 vec_hlt_clusters.push_back({hlt_clus_et*0.001, hlt_cluster->eta(), hlt_cluster->phi(), hlt_cluster});
109 for (
const auto hlt_cluster : *hltCluster_readHandle) {
110 auto hlt_clus_et = hlt_cluster->et();
113 bool HLT_type_match =
false;
116 if (hlt_cluster->clusterSize() ==
m_HLT_types[
n]) { HLT_type_match =
true;
break; }
119 if (!
m_HLT_types.empty() && !HLT_type_match)
continue;
120 vec_hlt_clusters.push_back({hlt_clus_et*0.001, hlt_cluster->eta(), hlt_cluster->phi(), hlt_cluster});
125 float off_clus_eta = 0;
126 float off_clus_phi = 0;
127 float off_clus_et = 0;
128 std::vector<clus_kin> vec_off_clusters;
129 for (
const auto off_cluster : *offCluster_readHandle) {
131 off_clus_et = off_cluster->et();
132 off_clus_eta = off_cluster->eta();
133 off_clus_phi = off_cluster->phi();
136 off_clus_et = off_cluster->rawE()/std::cosh(std::abs(off_cluster->rawEta()));
137 off_clus_eta = off_cluster->rawEta();
138 off_clus_phi = off_cluster->rawPhi();
142 bool OFF_type_match =
false;
145 if (off_cluster->clusterSize() ==
m_OFF_types[
n]) { OFF_type_match =
true;
break; }
148 if (!
m_OFF_types.empty() && !OFF_type_match)
continue;
149 vec_off_clusters.push_back({off_clus_et*0.001, off_clus_eta, off_clus_phi, off_cluster});
157 unsigned int n_hlt_clusters = 0;
158 unsigned int n_hlt_barrel_high_et_clusters = 0;
159 unsigned int n_hlt_clusters_no_match = 0;
160 unsigned int n_hlt_clusters_with_match = 0;
176 std::vector<char> vec_hlt_barrel_high_et, vec_hlt_no_off_match, vec_hlt_with_off_match;
186 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_delta_time, vec_hlt_vs_off_resolution, vec_off_match_et;
189 auto HLT_vs_OFF_minimum_delta_r =
Monitored::Collection(
"HLT_vs_OFF_minimum_delta_r", vec_hlt_vs_off_minimum_delta_r);
192 auto HLT_vs_OFF_delta_time =
Monitored::Collection(
"HLT_vs_OFF_delta_time", vec_hlt_vs_off_delta_time);
193 auto HLT_vs_OFF_resolution =
Monitored::Collection(
"HLT_vs_OFF_resolution", vec_hlt_vs_off_resolution);
196 const clus_kin *off_match =
nullptr;
200 for (
const auto& hlt_cluster : vec_hlt_clusters) {
205 if (hlt_cluster.et > (
m_HLT_high_et * 0.001) && std::abs(hlt_cluster.eta) < 2.5) {
206 ++n_hlt_barrel_high_et_clusters;
207 vec_hlt_barrel_high_et.push_back(1);
209 else vec_hlt_barrel_high_et.push_back(0);
213 float min_delta_r = 999999.9;
215 for (
const auto& off_cluster : vec_off_clusters) {
218 if (delta_r < min_delta_r) {
220 min_delta_r = delta_r;
221 off_match = &off_cluster;
226 vec_hlt_vs_off_minimum_delta_r.push_back(min_delta_r);
231 ++n_hlt_clusters_no_match;
233 vec_off_match_et.push_back(0.);
235 vec_hlt_vs_off_resolution.push_back(0.);
236 vec_hlt_vs_off_delta_eta.push_back(0.);
237 vec_hlt_vs_off_delta_phi.push_back(0.);
238 vec_hlt_vs_off_delta_time.push_back(0.);
240 vec_hlt_no_off_match.push_back(1);
241 vec_hlt_with_off_match.push_back(0);
247 ++n_hlt_clusters_with_match;
249 vec_off_match_et.push_back(off_match->
et);
251 vec_hlt_vs_off_resolution.push_back(((off_match->
et - hlt_cluster.et) / off_match->
et) * 100);
252 vec_hlt_vs_off_delta_eta.push_back(off_match->
eta - hlt_cluster.eta);
254 vec_hlt_vs_off_delta_time.push_back(off_match->
parent->time() - hlt_cluster.parent->time());
256 vec_hlt_no_off_match.push_back(0);
257 vec_hlt_with_off_match.push_back(1);
262 HLT_num = n_hlt_clusters;
263 HLT_barrel_high_et_num = n_hlt_barrel_high_et_clusters;
264 HLT_no_OFF_match_num = n_hlt_clusters_no_match;
265 HLT_with_OFF_match_num = n_hlt_clusters_with_match;
266 if (n_hlt_clusters>0) {
267 HLT_matched_fraction =
static_cast<float>(n_hlt_clusters_with_match) / n_hlt_clusters;
274 unsigned int n_off_clusters = 0;
275 unsigned int n_off_clusters_no_match = 0;
276 unsigned int n_off_clusters_with_match = 0;
279 std::vector<float> vec_off_et, vec_off_eta, vec_off_phi, vec_off_time;
280 std::vector<int> vec_off_type;
290 std::vector<char> vec_off_no_hlt_match, vec_off_with_hlt_match;
298 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_delta_time, vec_off_vs_hlt_resolution, vec_hlt_match_et;
301 auto OFF_vs_HLT_minimum_delta_r =
Monitored::Collection(
"OFF_vs_HLT_minimum_delta_r", vec_off_vs_hlt_minimum_delta_r);
304 auto OFF_vs_HLT_delta_time =
Monitored::Collection(
"OFF_vs_HLT_delta_time", vec_off_vs_hlt_delta_time);
305 auto OFF_vs_HLT_resolution =
Monitored::Collection(
"OFF_vs_HLT_resolution", vec_off_vs_hlt_resolution);
308 const clus_kin *hlt_match =
nullptr;
312 for (
const auto& off_cluster: vec_off_clusters) {
318 float min_delta_r = 999999.9;
320 for (
const auto& hlt_cluster : vec_hlt_clusters) {
324 if (delta_r < min_delta_r) {
326 min_delta_r = delta_r;
327 hlt_match = &hlt_cluster;
332 vec_off_vs_hlt_minimum_delta_r.push_back(min_delta_r);
337 ++n_off_clusters_no_match;
339 vec_hlt_match_et.push_back(0.);
341 vec_off_vs_hlt_resolution.push_back(0.);
342 vec_off_vs_hlt_delta_eta.push_back(0.);
343 vec_off_vs_hlt_delta_phi.push_back(0.);
344 vec_off_vs_hlt_delta_time.push_back(0.);
346 vec_off_no_hlt_match.push_back(1);
347 vec_off_with_hlt_match.push_back(0);
352 ++n_off_clusters_with_match;
354 vec_hlt_match_et.push_back(hlt_match->
et);
356 vec_off_vs_hlt_resolution.push_back(((off_cluster.et - hlt_match->
et) / off_cluster.et) * 100);
357 vec_off_vs_hlt_delta_eta.push_back(off_cluster.eta - hlt_match->
eta);
359 vec_off_vs_hlt_delta_time.push_back(off_cluster.parent->time() - hlt_match->
parent->time());
361 vec_off_no_hlt_match.push_back(0);
362 vec_off_with_hlt_match.push_back(1);
368 OFF_num = n_off_clusters;
369 OFF_no_HLT_match_num = n_off_clusters_no_match;
370 OFF_with_HLT_match_num = n_off_clusters_with_match;
371 if (n_off_clusters>0) {
372 OFF_matched_fraction =
static_cast<float>(n_off_clusters_with_match) / n_off_clusters;
377 if(accepted_hlt_clusters.size()>0){
382 HLT_num, HLT_et, HLT_eta, HLT_phi, HLT_time, HLT_type, HLT_size, HLT_barrel_high_et_num, HLT_bc,
385 HLT_barrel_high_et, HLT_no_OFF_match, HLT_with_OFF_match,
388 OFF_num, OFF_et, OFF_eta, OFF_phi, OFF_time, OFF_type,
391 OFF_no_HLT_match, OFF_with_HLT_match,
394 HLT_matched_fraction, HLT_no_OFF_match_num, HLT_vs_OFF_minimum_delta_r, HLT_with_OFF_match_num,
395 OFF_match_et, HLT_vs_OFF_resolution, HLT_vs_OFF_delta_eta, HLT_vs_OFF_delta_phi, HLT_vs_OFF_delta_time,
398 OFF_matched_fraction, OFF_no_HLT_match_num, OFF_vs_HLT_minimum_delta_r, OFF_with_HLT_match_num,
399 HLT_match_et, OFF_vs_HLT_resolution, OFF_vs_HLT_delta_eta, OFF_vs_HLT_delta_phi, OFF_vs_HLT_delta_time
407 HLT_num, HLT_et, HLT_eta, HLT_phi, HLT_time, HLT_type, HLT_size, HLT_barrel_high_et_num, HLT_bc,
410 HLT_barrel_high_et, HLT_no_OFF_match, HLT_with_OFF_match,
413 OFF_num, OFF_et, OFF_eta, OFF_phi, OFF_time, OFF_type,
416 OFF_no_HLT_match, OFF_with_HLT_match,
419 HLT_matched_fraction, HLT_no_OFF_match_num, HLT_vs_OFF_minimum_delta_r, HLT_with_OFF_match_num,
420 OFF_match_et, HLT_vs_OFF_resolution, HLT_vs_OFF_delta_eta, HLT_vs_OFF_delta_phi, HLT_vs_OFF_delta_time,
423 OFF_matched_fraction, OFF_no_HLT_match_num, OFF_vs_HLT_minimum_delta_r, OFF_with_HLT_match_num,
424 HLT_match_et, OFF_vs_HLT_resolution, OFF_vs_HLT_delta_eta, OFF_vs_HLT_delta_phi, OFF_vs_HLT_delta_time
432 HLT_num, HLT_et, HLT_eta, HLT_phi, HLT_time, HLT_type, HLT_size, HLT_barrel_high_et_num, HLT_bc,
435 HLT_barrel_high_et, HLT_no_OFF_match, HLT_with_OFF_match,
438 OFF_num, OFF_et, OFF_eta, OFF_phi, OFF_time, OFF_type,
441 OFF_no_HLT_match, OFF_with_HLT_match,
444 HLT_matched_fraction, HLT_no_OFF_match_num, HLT_vs_OFF_minimum_delta_r, HLT_with_OFF_match_num,
445 OFF_match_et, HLT_vs_OFF_resolution, HLT_vs_OFF_delta_eta, HLT_vs_OFF_delta_phi, HLT_vs_OFF_delta_time,
448 OFF_matched_fraction, OFF_no_HLT_match_num, OFF_vs_HLT_minimum_delta_r, OFF_with_HLT_match_num,
449 HLT_match_et, OFF_vs_HLT_resolution, OFF_vs_HLT_delta_eta, OFF_vs_HLT_delta_phi, OFF_vs_HLT_delta_time
453 return StatusCode::SUCCESS;
459 if (std::abs(eta_1-eta_2) > max_deltar)
return 99.9;
461 if (DeltaPhi > max_deltar)
return 99.9;
462 return sqrt( ((eta_1-eta_2)*(eta_1-eta_2)) + (DeltaPhi*DeltaPhi) );
466 return std::abs( std::abs( std::abs( phi_1 - phi_2 ) - TMath::Pi() ) - TMath::Pi() );
472 featureRequestDescriptor.
setCondition(TrigDefs::includeFailedDecisions);
474 std::vector<const xAOD::CaloCluster*> clustersToMonitorForChain;
477 clustersToMonitorForChain.
push_back( *(
f.link) );
480 ATH_MSG_DEBUG(
"clustersToMonitorForChain.size(): "<<clustersToMonitorForChain.size());
481 for(
auto &
p: clustersToMonitorForChain)
483 return clustersToMonitorForChain;