8#include "GaudiKernel/SystemOfUnits.h"
16 : base_class(
type, name, parent),
42 return StatusCode::FAILURE;
47 return StatusCode::FAILURE;
50 return StatusCode::FAILURE;
52 ATH_MSG_ERROR(
"IDMethod=0 must be set together with IDWP=-1");
53 return StatusCode::FAILURE;
55 ATH_MSG_ERROR(
"There need to be 4 TauID WPs passed to IDWPNames if using IDMethod=2 (Decorator)");
56 return StatusCode::FAILURE;
65 if(p.first.empty() || p.second.empty()) {
66 ATH_MSG_ERROR(
"Invalid score variable names; skipping this entry for the monitoring!");
73 return StatusCode::SUCCESS;
87 std::map<std::string, Monitored::Scalar<float>> monitoredIdVariables;
89 monitoredIdVariables.emplace(key +
"_TauJetScoreAccepted_0p",
Monitored::Scalar<float>(key +
"_TauJetScoreAccepted_0p", -1));
90 monitoredIdVariables.emplace(key +
"_TauJetScoreTransAccepted_0p",
Monitored::Scalar<float>(key +
"_TauJetScoreTransAccepted_0p", -1));
91 monitoredIdVariables.emplace(key +
"_TauJetScoreAccepted_1p",
Monitored::Scalar<float>(key +
"_TauJetScoreAccepted_1p", -1));
92 monitoredIdVariables.emplace(key +
"_TauJetScoreTransAccepted_1p",
Monitored::Scalar<float>(key +
"_TauJetScoreTransAccepted_1p", -1));
93 monitoredIdVariables.emplace(key +
"_TauJetScoreAccepted_mp",
Monitored::Scalar<float>(key +
"_TauJetScoreAccepted_mp", -1));
94 monitoredIdVariables.emplace(key +
"_TauJetScoreTransAccepted_mp",
Monitored::Scalar<float>(key +
"_TauJetScoreTransAccepted_mp", -1));
97 std::vector<std::reference_wrapper<Monitored::IMonitoredVariable>> monVars = {
98 std::ref(NInputTaus), std::ref(passedCuts), std::ref(PtAccepted), std::ref(NTracksAccepted), std::ref(NIsoTracksAccepted)
100 for(
auto& [key, var] : monitoredIdVariables) monVars.push_back(std::ref(var));
109 ATH_MSG_DEBUG(
"AcceptAll property is set: taking all events");
113 ATH_MSG_DEBUG(
"Input RoI eta: " << input.roi->eta() <<
", phi: " << input.roi->phi() <<
", z: " << input.roi->zed());
116 NInputTaus = TauContainer->
size();
121 float pT =
Tau->pt();
130 PtAccepted = pT / Gaudi::Units::GeV;
136 int numTrack = 0, numIsoTrack = 0;
148 numTrack =
Tau->nTracks();
149 numIsoTrack =
Tau->nTracksIsolation();
170 NTracksAccepted = numTrack;
171 NIsoTracksAccepted = numIsoTrack;
187 ATH_MSG_WARNING(
" RNNJetScoreSigTrans not available. Make sure the TauWPDecorator is run for the RNN Tau ID!");
209 ATH_MSG_WARNING(
"The TauID WP variables for the current configuration are missing! Make sure the correct inferences are included in the chain reconstruction sequence!");
228 if(!p.first.isAvailable(*
Tau))
229 ATH_MSG_WARNING(
"TauID Score " <<
m_monitoredIdScores.value().at(key).first <<
" is not available. Make sure the correct inferences are included in the chain reconstruction sequence!");
231 if(!p.second.isAvailable(*
Tau))
232 ATH_MSG_WARNING(
"TauID ScoreSigTrans " <<
m_monitoredIdScores.value().at(key).second <<
" is not available. Make sure the correct inferences are included in the chain reconstruction sequence!");
234 ATH_MSG_DEBUG(
" TauID \"" << key <<
"\" ScoreSigTrans: " << p.second(*
Tau));
237 if(
Tau->nTracks() == 0) {
238 monitoredIdVariables.at(key +
"_TauJetScoreAccepted_0p") = p.first(*
Tau);
239 monitoredIdVariables.at(key +
"_TauJetScoreTransAccepted_0p") = p.second(*
Tau);
240 }
else if(
Tau->nTracks() == 1) {
241 monitoredIdVariables.at(key +
"_TauJetScoreAccepted_1p") = p.first(*
Tau);
242 monitoredIdVariables.at(key +
"_TauJetScoreTransAccepted_1p") = p.second(*
Tau);
244 monitoredIdVariables.at(key +
"_TauJetScoreAccepted_mp") = p.first(*
Tau);
245 monitoredIdVariables.at(key +
"_TauJetScoreTransAccepted_mp") = p.second(*
Tau);
273 return StatusCode::SUCCESS;
#define ATH_MSG_WARNING(x)
Header file to be included by clients of the Monitored infrastructure.
size_type size() const noexcept
Returns the number of elements in the collection.
Group of local monitoring quantities and retain correlation when filling histograms
Declare a monitored scalar variable.
Helper class to provide constant type-safe access to aux data.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
@ RNNJetScoreSigTrans
RNN score which is signal transformed/flattened.
TauJet_v3 TauJet
Definition of the current "tau version".
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".