19 return StatusCode::SUCCESS;
24 constexpr float threshold_offset = 10.0;
32 const std::vector<const xAOD::eFexTauRoI*> xtob_etau_rois =
getL1xTOBeTAUs();
37 if(!info.isL1TauOnly()) {
38 ATH_MSG_WARNING(
"Chain \"" << trigger <<
"\" is not an L1 tau trigger. Skipping...");
47 auto offline_taus =
classifyOfflineTaus(ctx, offline_taus_with_id, info.getL1TauThreshold() - threshold_offset);
48 std::vector<const xAOD::TauJet*> offline_taus_1p = offline_taus.first;
49 std::vector<const xAOD::TauJet*> offline_taus_3p = offline_taus.second;
51 if(info.getL1TauType() ==
"eTAU") {
52 std::vector<const xAOD::eFexTauRoI*> rois =
getL1eTAUs(ctx, info.getL1TauItem());
60 }
else if(info.getL1TauType() ==
"cTAU") {
61 std::vector<std::pair<const xAOD::eFexTauRoI*, const xAOD::jFexTauRoI*>> rois =
getL1cTAUs(ctx, info.getL1TauItem());
63 std::vector<const xAOD::eFexTauRoI*> eTau_rois;
64 eTau_rois.reserve(rois.size());
65for(
const auto& [eTau_roi, jTau_roi] : rois) eTau_rois.push_back(eTau_roi);
76 return StatusCode::SUCCESS;
84 auto monGroup =
getGroup(trigger+
"_L1Vars");
92 fill(monGroup, L1RoIEt, L1RoIEta, L1RoIPhi, L1RoIRCore, L1RoIRHad, L1RoIBDTScore);
98void TrigTauMonitorL1Algorithm::fillL1cTauVars(
const std::string& trigger,
const std::vector<std::pair<const xAOD::eFexTauRoI*, const xAOD::jFexTauRoI*>>& rois,
const std::vector<const xAOD::eFexTauRoI*>& xtob_rois)
const
102 auto monGroup =
getGroup(trigger+
"_L1Vars");
104 auto L1RoIEt =
Monitored::Collection(
"L1RoIEt" , rois, [](
const auto L1roi){
return L1roi.first->et()/Gaudi::Units::GeV; });
105 auto L1RoIEta =
Monitored::Collection(
"L1RoIEta" , rois, [](
const auto L1roi){
return L1roi.first->eta(); });
106 auto L1RoIPhi =
Monitored::Collection(
"L1RoIPhi" , rois, [](
const auto L1roi){
return L1roi.first->phi(); });
107 auto L1eFexRoIRCore =
Monitored::Collection(
"L1eFexRoIRCore", rois, [](
const auto L1roi){
return L1roi.first->rCore(); });
108 auto L1eFexRoIRHad =
Monitored::Collection(
"L1eFexRoIRHad" , rois, [](
const auto L1roi){
return L1roi.first->rHad(); });
109 auto L1RoIBDTScore =
Monitored::Collection(
"L1eFexRoIBDTScore" , rois, [
this, &xtob_rois](
const auto L1roi){
return getBDTScore(L1roi.first, xtob_rois); });
111 std::vector<bool> jFex_isMatched;
112 std::vector<float> jFex_eFex_et_ratio;
113 std::vector<float> jFex_isolation;
114 std::vector<float> cTau_isolation;
115 for(
const auto& [eFexRoI, jFexRoI] : rois) {
117 jFex_isMatched.push_back(
false);
121 jFex_isMatched.push_back(
true);
122 jFex_eFex_et_ratio.push_back(jFexRoI->et()/eFexRoI->et());
123 jFex_isolation.push_back(jFexRoI->iso()/Gaudi::Units::GeV);
124 cTau_isolation.push_back(jFexRoI->iso()/eFexRoI->et());
131 fill(monGroup, L1RoIEt, L1RoIEta, L1RoIPhi, L1eFexRoIRCore, L1eFexRoIRHad, L1cTauRoITopoMatch, L1jFexRoIIso, L1cTauRoIIso, L1RoIcTauEtRatio, L1RoIBDTScore );
138 std::vector<const xAOD::eFexTauRoI*> roi_vec;
144 ATH_MSG_WARNING(
"The L1_eTauxRoI container is not available! No e/cTAU BDT score will be retrieved");
154 if(xtob_rois.empty())
return 0;
157 if(xroi->eta() == roi->
eta() && xroi->phi() == roi->
phi())
return xroi->bdtScore();
159 ATH_MSG_DEBUG(
"Unmatched RoI! et=" << roi->
et() <<
", eta=" << roi->
eta() <<
", phi=" << roi->
phi());
161 ATH_MSG_DEBUG(
" - xRoI et=" << xroi->et() <<
", eta=" << xroi->eta() <<
", phi=" << xroi->phi());
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
const ToolHandle< GenericMonitoringTool > & getGroup(const std::string &name) const
Get a specific monitoring tool from the tool handle array.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
std::vector< const xAOD::eFexTauRoI * > getL1eTAUs(const EventContext &ctx, const std::string &l1_item) const
Gaudi::Property< bool > m_do_efficiency_plots
virtual StatusCode initialize() override
initialize
std::pair< std::vector< const xAOD::TauJet * >, std::vector< const xAOD::TauJet * > > classifyOfflineTaus(const EventContext &ctx, const std::vector< const xAOD::TauJet * > &taus, const float threshold=0.0, const TauID tau_id=TauID::None) const
TrigTauMonitorBaseAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
std::vector< const xAOD::TauJet * > getOfflineTausAll(const EventContext &ctx, const float threshold=20.0) const
Gaudi::Property< std::vector< std::string > > m_triggers
const TrigTauInfo & getTrigInfo(const std::string &trigger) const
std::vector< const xAOD::TauJet * > classifyTausAll(const EventContext &ctx, const std::vector< const xAOD::TauJet * > &taus, const float threshold=0.0, const TauID tau_id=TauID::None) const
std::vector< std::pair< const xAOD::eFexTauRoI *, const xAOD::jFexTauRoI * > > getL1cTAUs(const EventContext &ctx, const std::string &l1_item) const
Gaudi::Property< bool > m_do_variable_plots
Gaudi::Property< unsigned int > m_offline_tau_id
virtual StatusCode processEvent(const EventContext &ctx) const override
void fillL1Efficiencies(const EventContext &ctx, const std::vector< const xAOD::TauJet * > &offline_tau_vec, const std::string &nProng, const std::string &trigger, const std::vector< const T * > &rois) const
void fillL1eTauVars(const std::string &trigger, const std::vector< const xAOD::eFexTauRoI * > &rois, const std::vector< const xAOD::eFexTauRoI * > &xtob_rois) const
void fillL1cTauVars(const std::string &trigger, const std::vector< std::pair< const xAOD::eFexTauRoI *, const xAOD::jFexTauRoI * > > &rois, const std::vector< const xAOD::eFexTauRoI * > &xtob_rois) const
SG::ReadHandleKey< xAOD::eFexTauRoIContainer > m_phase1l1eTauxRoIKey
TrigTauMonitorL1Algorithm(const std::string &name, ISvcLocator *pSvcLocator)
std::vector< const xAOD::eFexTauRoI * > getL1xTOBeTAUs() const
unsigned int getBDTScore(const xAOD::eFexTauRoI *roi, const std::vector< const xAOD::eFexTauRoI * > &xtob_rois) const
Gaudi::Property< bool > m_requireOfflineTaus
virtual StatusCode initialize() override
initialize
float et() const
TOB ET (decoded from TOB, stored for convenience).
float phi() const
Seed supercell index within central tower (0 -> 3).
float rCore() const
Jet Discriminants Derived floating point values (not used in actual algorithm).
float eta() const
setter for the above
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > &&variables) const
Fills a vector of variables to a group by reference.
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
eFexTauRoI_v1 eFexTauRoI
Define the latest version of the eFexTauRoI class.