19 for(
const auto& [
key,
p] :
m) {
20 if(
p.first.empty() ||
p.second.empty()) {
21 ATH_MSG_WARNING(
"Invalid HLT TauID score variable names; skipping this entry for the monitoring!");
36 if(
p.first.empty() ||
p.second.empty()) {
37 ATH_MSG_WARNING(
"Invalid Offline TauID score variable names; skipping this entry for the monitoring!");
50 return StatusCode::SUCCESS;
56 constexpr
float threshold_offset = 10.0;
66 if(!
info.isHLTSingleTau()) {
67 ATH_MSG_WARNING(
"Chain \"" << trigger <<
"\" is not a single tau trigger. Skipping...");
72 const bool l1_accept_flag =
passBits & TrigDefs::L1_isPassedAfterVeto;
73 const bool hlt_not_prescaled_flag = (
passBits & TrigDefs::EF_prescaled) == 0;
77 std::vector<const xAOD::TauJet*> offline_taus_1p = offline_taus.first;
78 std::vector<const xAOD::TauJet*> offline_taus_3p = offline_taus.second;
81 std::vector<const xAOD::TauJet*> hlt_taus_all =
getOnlineTausAll(trigger,
true);
83 std::vector<const xAOD::TauJet*> hlt_taus_0p = std::get<0>(hlt_taus);
84 std::vector<const xAOD::TauJet*> hlt_taus_1p = std::get<1>(hlt_taus);
85 std::vector<const xAOD::TauJet*> hlt_taus_mp = std::get<2>(hlt_taus);
105 if(!hlt_taus_0p.empty()) {
114 if(!hlt_taus_1p.empty()) {
123 if(!hlt_taus_mp.empty()) {
138 return StatusCode::SUCCESS;
142 void TrigTauMonitorSingleAlgorithm::fillHLTEfficiencies(
const EventContext& ctx,
const std::string& trigger,
const bool l1_accept_flag,
const std::vector<const xAOD::TauJet*>& offline_tau_vec,
const std::vector<const xAOD::TauJet*>& online_tau_vec,
const std::string& nProng)
const
144 ATH_MSG_DEBUG(
"Fill HLT " << nProng <<
" efficiencies: " << trigger);
163 bool hlt_fires =
m_trigDecTool->isPassed(trigger, TrigDefs::Physics | TrigDefs::allowResurrectedDecision);
166 for(
const auto *offline_tau : offline_tau_vec) {
167 bool L1_match =
false;
171 for(
const TLorentzVector& roi :
rois) {
172 L1_match = offline_tau->p4().DeltaR(roi) <= 0.3;
177 tauEta = offline_tau->eta();
178 tauPhi = offline_tau->phi();
181 bool is_highPt =
tauPt >
info.getHLTTauThreshold() + 20.0;
184 HLT_match =
matchObjects(offline_tau, online_tau_vec, 0.2) && hlt_fires;
188 Total_match =
static_cast<bool>(HLT_match);
192 Total_match_highPt =
static_cast<bool>(HLT_match);
197 if(!L1_match || !l1_accept_flag)
continue;
202 HLT_match_highPt =
static_cast<bool>(HLT_match);
215 auto monGroup =
getGroup(trigger+
"_ID_"+(online ?
"HLT" :
"Offline")+
"_InputScalar_"+nProng);
265 detail = std::log10(std::max(detail, 140.0f));
274 fill(
monGroup,
centFrac,
etOverPtLeadTrk,
dRmax,
absipSigLeadTrk, sumPtTrkFrac, emPOverTrkSysP,
ptRatioEflowApprox,
mEflowApprox,
ptDetectorAxis,
massTrkSys,
trFlightPathSig);
284 auto monGroup =
getGroup(trigger+
"_ID_"+(online ?
"HLT" :
"Offline")+
"_InputTrack");
289 for(
const auto *tau : tau_vec) {
292 bool linksValid =
true;
294 if(!trackEL.isValid()) {
300 ATH_MSG_WARNING(
"Invalid track element links from TauJet in " << trigger);
320 uint8_t inner_pixel_hits, inner_pixel_exp;
324 if(success1_innerPixel_hits && success2_innerPixel_exp) {
detail = inner_pixel_exp ? inner_pixel_hits : 1.; };
328 uint8_t pixel_hits, pixel_dead;
332 if(success1_pixel_hits && success2_pixel_dead) {
detail = pixel_hits + pixel_dead; };
340 if(success1_sct_hits && success2_sct_dead) {
detail = sct_hits + sct_dead; };
344 fill(
monGroup, n_track, track_pt_log, track_eta, track_phi, track_dEta, track_dPhi, track_z0sinthetaTJVA_abs_log, track_d0_abs_log, track_nIBLHitsAndExp, track_nPixelHitsPlusDeadSensors, track_nSCTHitsPlusDeadSensors);
353 ATH_MSG_DEBUG(
"Fill ID input Cluster: " << trigger <<
" for online/offline " << online);
355 auto monGroup =
getGroup(trigger+
"_ID_"+(online ?
"HLT" :
"Offline")+
"_InputCluster");
357 for(
const auto *tau : tau_vec){
360 std::vector<const xAOD::CaloCluster*>
clusters;
385 if(success_SECOND_LAMBDA)
detail = std::log10(
detail + 0.1);
392 if(success_CENTER_LAMBDA)
detail = std::log10(
detail + 1
e-6);
396 fill(
monGroup, n_cluster, cluster_pt_jetseed_log, cluster_et_log, cluster_eta, cluster_phi, cluster_dEta, cluster_dPhi, cluster_SECOND_R_log10, cluster_SECOND_LAMBDA_log10, cluster_CENTER_LAMBDA_log10);
407 auto monGroup =
getGroup(trigger+
"_"+(online ?
"HLT" :
"Offline")+
"_basicVars_"+nProng);
450 const std::string tau_id =
info.getHLTTauID();
451 bool store_all = tau_id ==
"idperf" || tau_id ==
"perf";
461 auto monGroup =
getGroup(trigger+
"_"+(online ?
"HLT" :
"Offline")+
"_IDScores_"+nProng);
463 for(
const auto& [
key,
p] : idAccessors) {
465 if(online && !store_all && tau_id !=
key)
continue;
467 std::vector<float>
score, score_sig_trans;
471 if(!
p.first.isAvailable(*tau) || !
p.second.isAvailable(*tau))
continue;
473 score.push_back(
p.first(*tau));
474 score_sig_trans.push_back(
p.second(*tau));
488 std::vector<TLorentzVector> ret;
493 if(
info.getL1TauType() ==
"eTAU") {
495 v.SetPtEtaPhiM(roi->et(), roi->eta(), roi->phi(), 0);
498 }
else if(
info.getL1TauType() ==
"jTAU") {
500 v.SetPtEtaPhiM(roi->et(), roi->eta(), roi->phi(), 0);
503 }
else if(
info.getL1TauType() ==
"cTAU") {
504 for(
const auto& [eTau_roi, jTau_roi] :
getL1cTAUs(ctx,
info.getL1TauItem())) {
505 v.SetPtEtaPhiM(eTau_roi->et(), eTau_roi->eta(), eTau_roi->phi(), 0);
510 v.SetPtEtaPhiM(roi->eT(), roi->eta(), roi->phi(), 0);