ATLAS Offline Software
Loading...
Searching...
No Matches
TrigADComboHypoTool.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIGADCOMBOHYPO_TRIGADCOMBOHYPOTOOL_H
6#define TRIGADCOMBOHYPO_TRIGADCOMBOHYPOTOOL_H
7
11
12#include "xAODJet/Jet.h"
13#include "xAODMuon/Muon.h"
14#include "xAODEgamma/Electron.h"
15#include "xAODEgamma/Photon.h"
16#include "xAODTau/TauJet.h"
19
21
22#include <iostream>
23#include <cmath>
24#include <numbers>
25
27
28public:
29 TrigADComboHypoTool(const std::string& type, const std::string& name, const IInterface* parent);
30 virtual StatusCode initialize() override;
31 //need to see all jets at once not a series of combinations
32 virtual StatusCode decide(Combo::LegDecisionsMap& passingLegs, const EventContext& context) const override;
33
34private:
35 Gaudi::Property<unsigned int> m_maxjs{this, "max_jets",{6}, "Maximum number of jets allowed in the event"};
36 Gaudi::Property<unsigned int> m_maxes{this, "max_electrons",{3}, "Maximum number of electrons allowed in the event"};
37 Gaudi::Property<unsigned int> m_maxms{this, "max_muons",{3}, "Maximum number of muons allowed in the event"};
38 Gaudi::Property<unsigned int> m_maxgs{this, "max_photons",{3}, "Maximum number of photons allowed in the event"};
39
40 Gaudi::Property<double> m_adScoreThres{this, "adScoreThres", {0.}, "HLT AD score threshold"};
41
43 ToolHandle<GenericMonitoringTool> m_monTool{this, "monTool", "", "Monitoring tool"};
44 Gaudi::Property<bool> m_monFlag{this, "monFlag", false, "Monitoring flag"};
45
46 float getAdScore(
47 const std::vector<const xAOD::Jet*> &input_jets,
48 const std::vector<const xAOD::Muon*> &input_muons,
49 const std::vector<const xAOD::Electron*> &input_electrons,
50 const std::vector<const xAOD::Photon*> &input_photons,
51 const std::vector<const xAOD::TauJet*> &input_taus,
52 const std::vector<const xAOD::TrigMissingET*> &input_mets) const;
53
54 float runInference(std::vector<float> &tensor) const;
55
56 ServiceHandle<AthOnnx::IOnnxRuntimeSvc> m_svc{this, "ONNXRuntimeSvc", "AthOnnx::OnnxRuntimeSvc", "TrigADComboHypoTool ONNXRuntimeSvc"};
57
58 std::unique_ptr<Ort::Session> m_session;
59
60 std::vector<const char *> m_input_node_names;
61
62 std::vector<const char *> m_output_node_names;
63
64 std::vector<int64_t> m_input_node_dims;
65
66 // This path needs to point to the ATLAS calibration area (https://atlas-groupdata.web.cern.ch/atlas-groupdata/, /cvmfs/atlas.cern.ch/repo/sw/database/GroupData/)
67 Gaudi::Property<std::string> m_modelFileName{this, "ModelFileName", "TrigAnomalyDetectionHypo/2025-03-10/HLT_AD_v1.onnx"}; // main area v1 (2025.03.10)
68
69};
70
71#endif
Header file to be included by clients of the Monitored infrastructure.
ComboHypoToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Property holding a SG store/key/clid from which a WriteHandle is made.
float runInference(std::vector< float > &tensor) const
Gaudi::Property< double > m_adScoreThres
Gaudi::Property< unsigned int > m_maxgs
ServiceHandle< AthOnnx::IOnnxRuntimeSvc > m_svc
TrigADComboHypoTool(const std::string &type, const std::string &name, const IInterface *parent)
SG::WriteHandleKey< xAOD::TrigCompositeContainer > m_adScoreKey
Gaudi::Property< std::string > m_modelFileName
Gaudi::Property< unsigned int > m_maxjs
std::vector< const char * > m_output_node_names
float getAdScore(const std::vector< const xAOD::Jet * > &input_jets, const std::vector< const xAOD::Muon * > &input_muons, const std::vector< const xAOD::Electron * > &input_electrons, const std::vector< const xAOD::Photon * > &input_photons, const std::vector< const xAOD::TauJet * > &input_taus, const std::vector< const xAOD::TrigMissingET * > &input_mets) const
Gaudi::Property< unsigned int > m_maxms
std::unique_ptr< Ort::Session > m_session
std::vector< const char * > m_input_node_names
Gaudi::Property< bool > m_monFlag
Gaudi::Property< unsigned int > m_maxes
virtual StatusCode initialize() override
std::vector< int64_t > m_input_node_dims
ToolHandle< GenericMonitoringTool > m_monTool
virtual StatusCode decide(Combo::LegDecisionsMap &passingLegs, const EventContext &context) const override
retrieves the decisions associated to this decId, make their combinations and apply the algorithm