24 return StatusCode::FAILURE;
28 ATH_MSG_INFO(
"Initialized DVInferenceAlg with ScoreThreshold=" << scoreThreshold
30 <<
", DecorateEventInfo=" << decorateEventInfo);
31 if (decorateEventInfo) {
32 ATH_MSG_INFO(
"EventInfo DV decorations are enabled for validation/debug output only");
34 return StatusCode::SUCCESS;
42 ATH_MSG_WARNING(
"DV event classifier did not produce a finite score for event "
43 << ctx.eventID().event_number());
46 const float decisionValue =
m_useRawThreshold ? result.rawOutput : result.probability;
48 const bool pass = result.valid && decisionValue >= cutValue;
50 ATH_MSG_INFO(
"DV event classifier: event=" << ctx.eventID().event_number()
51 <<
" score=" << result.probability
52 <<
" raw=" << result.rawOutput
53 <<
" decisionValue=" << decisionValue
54 <<
" cutValue=" << cutValue
57 <<
" nodes=" << result.nNodes
58 <<
" edges=" << result.nEdges);
60 ATH_MSG_DEBUG(
"DV event classifier: event=" << ctx.eventID().event_number()
61 <<
" score=" << result.probability
62 <<
" raw=" << result.rawOutput
63 <<
" decisionValue=" << decisionValue
64 <<
" cutValue=" << cutValue
67 <<
" nodes=" << result.nNodes
68 <<
" edges=" << result.nEdges);
81 scoreDecor(*eventInfo) = result.valid ? result.probability : -1.f;
82 rawDecor(*eventInfo) = result.valid ? result.rawOutput : -1.f;
83 passDecor(*eventInfo) = pass ? 1 : 0;
84 nNodesDecor(*eventInfo) =
static_cast<unsigned int>(result.nNodes);
85 nEdgesDecor(*eventInfo) =
static_cast<unsigned int>(result.nEdges);
88 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Handle class for reading from StoreGate.
Handle class for adding a decoration to an object.
Gaudi::Property< std::string > m_thresholdMode
SG::WriteDecorHandleKey< xAOD::EventInfo > m_nNodesDecorKey
Gaudi::Property< bool > m_decorateEventInfo
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_scoreDecorKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_passDecorKey
ToolHandle< MuonML::DVInferenceToolBase > m_inferenceTool
Gaudi::Property< bool > m_printEveryEvent
std::string m_thresholdModeName
StatusCode initialize() override
SG::WriteDecorHandleKey< xAOD::EventInfo > m_rawDecorKey
SG::WriteDecorHandleKey< xAOD::EventInfo > m_nEdgesDecorKey
StatusCode execute(const EventContext &ctx) const override
Gaudi::Property< float > m_scoreThreshold
Handle class for adding a decoration to an object.
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
EventInfo_v1 EventInfo
Definition of the latest event info version.