22 return StatusCode::SUCCESS;
28 std::vector<const xAOD::Electron*> el_vec;
52 std::vector<const xAOD::Muon*> mu_vec;
76 std::vector<const xAOD::Electron*> el_vec;
79 for(
auto &featLinkInfo :
vec) {
80 const auto *feat = *(featLinkInfo.link);
82 el_vec.push_back(feat);
91 std::vector<const xAOD::Muon*> mu_vec;
94 for(
auto &featLinkInfo :
vec) {
95 const auto *feat = *(featLinkInfo.link);
97 mu_vec.push_back(feat);
106 constexpr
float threshold_offset = 10.0;
113 for(
const std::string& trigger :
m_triggers) {
116 if(!
info.isHLTTandP()) {
117 ATH_MSG_WARNING(
"Chain \"" << trigger <<
"\" is not a Tag and Probe trigger. Skipping...");
122 const bool l1_accept_flag =
passBits & TrigDefs::L1_isPassedAfterVeto;
123 const bool hlt_not_prescaled_flag = (
passBits & TrigDefs::EF_prescaled) == 0;
126 std::vector<const xAOD::TauJet*> offline_taus =
classifyTausAll(offline_taus_all,
info.getHLTTauThreshold() - threshold_offset);
129 std::vector<const xAOD::TauJet*> hlt_taus =
getOnlineTausAll(trigger,
true);
131 if(
info.hasHLTElectronLeg()) {
133 std::vector<const xAOD::IParticle*> offline_electrons;
137 for(
int i = offline_taus.size()-1;
i >= 0;
i--) {
138 bool is_match =
matchObjects(offline_taus.at(
i), offline_electrons, 0.2);
139 if(is_match) offline_taus.erase(offline_taus.begin() +
i);
143 std::vector<const xAOD::IParticle*> hlt_electrons;
149 }
else if(
info.hasHLTMuonLeg()) {
151 std::vector<const xAOD::IParticle*> offline_muons;
155 for(
int i = offline_taus.size()-1;
i >= 0;
i--) {
156 bool is_match =
matchObjects(offline_taus.at(
i), offline_muons, 0.2);
157 if(is_match) offline_taus.erase(offline_taus.begin() +
i);
161 std::vector<const xAOD::IParticle*> hlt_muons;
169 return StatusCode::SUCCESS;
173 void TrigTauMonitorTandPAlgorithm::fillTAndPHLTEfficiencies(
const EventContext& ctx,
const std::string& trigger,
const std::vector<const xAOD::IParticle*>& offline_lep_vec,
const std::vector<const xAOD::IParticle*>& online_lep_vec,
const std::vector<const xAOD::TauJet*>& offline_tau_vec,
const std::vector<const xAOD::TauJet*>& online_tau_vec)
const
175 ATH_MSG_DEBUG(
"Fill Tag and Probe HLT efficiencies: " << trigger);
178 if(online_tau_vec.size() != 1 || offline_tau_vec.size() != 1)
return;
180 if(online_lep_vec.size() != 1 || offline_lep_vec.size() != 1)
return;
196 bool hlt_fires =
m_trigDecTool->isPassed(trigger, TrigDefs::Physics);
197 bool tau1_match =
matchObjects(offline_tau_vec[0], online_tau_vec, 0.2);
198 bool lep1_match =
matchObjects(offline_lep_vec[0], online_lep_vec, 0.2);
201 tauEta = offline_tau_vec[0]->eta();
202 tauPhi = offline_tau_vec[0]->phi();
203 dR = offline_tau_vec[0]->p4().DeltaR(offline_lep_vec[0]->p4());
204 dEta = std::abs(offline_tau_vec[0]->
eta() - offline_lep_vec[0]->
eta());
205 dPhi = offline_tau_vec[0]->p4().DeltaPhi(offline_lep_vec[0]->p4());
207 HLT_match = hlt_fires && tau1_match && lep1_match;
213 HLT_match_highPt =
static_cast<bool>(HLT_match);
218 ATH_MSG_DEBUG(
"After fill Tag and Probe HLT efficiencies: " << trigger);
229 if(tau_vec.empty() || lep_vec.empty())
return;
245 for(
uint i=0;
i < tau_vec.size();
i++) {
246 for(
uint j=0; j< lep_vec.size(); j++) {
247 if(tau_vec[
i]->p4().
DeltaR(lep_vec[j]->p4()) >= 0.3) {
254 dR = tau_vec[index_tau]->p4().DeltaR(lep_vec[index_lep]->p4());
255 dEta = std::abs(tau_vec[index_tau]->
eta() - lep_vec[index_lep]->
eta());
256 dPhi = tau_vec[index_tau]->p4().DeltaPhi(lep_vec[index_lep]->p4());
259 TLorentzVector diTau4V = tau_vec[index_tau]->p4() + lep_vec[index_lep]->p4();
268 ATH_MSG_DEBUG(
"After fill Tag & Probe variables: " << trigger);