File indexing completed on 2025-03-23 16:00:15
0001 #ifndef L1Trigger_L1TGlobal_AXOL1TLCondition_h
0002 #define L1Trigger_L1TGlobal_AXOL1TLCondition_h
0003
0004
0005
0006
0007
0008
0009
0010 #include <iosfwd>
0011 #include <string>
0012 #include <utility>
0013
0014 #include "L1Trigger/L1TGlobal/interface/ConditionEvaluation.h"
0015 #include "DataFormats/L1Trigger/interface/L1Candidate.h"
0016
0017 #include "hls4ml/emulator.h"
0018
0019
0020 class GlobalCondition;
0021 class AXOL1TLTemplate;
0022
0023 namespace l1t {
0024
0025 class L1Candidate;
0026 class GlobalBoard;
0027
0028
0029 class AXOL1TLCondition : public ConditionEvaluation {
0030 public:
0031
0032
0033 AXOL1TLCondition();
0034
0035
0036 AXOL1TLCondition(const GlobalCondition*, const GlobalBoard*);
0037
0038
0039 AXOL1TLCondition(const AXOL1TLCondition&);
0040
0041 ~AXOL1TLCondition() override;
0042
0043
0044 AXOL1TLCondition& operator=(const AXOL1TLCondition&);
0045
0046
0047 const bool evaluateCondition(const int bxEval) const override;
0048
0049
0050 void print(std::ostream& myCout) const override;
0051
0052
0053 inline const AXOL1TLTemplate* gtAXOL1TLTemplate() const { return m_gtAXOL1TLTemplate; }
0054
0055 void setGtAXOL1TLTemplate(const AXOL1TLTemplate*);
0056
0057
0058 inline const GlobalBoard* gtGTB() const { return m_gtGTB; }
0059
0060 void setuGtB(const GlobalBoard*);
0061
0062
0063 void setScore(const float scoreval) const;
0064
0065 inline float getScore() const { return m_savedscore; }
0066
0067 void loadModel();
0068
0069 inline hls4mlEmulator::ModelLoader const& model_loader() const { return m_model_loader; }
0070
0071 private:
0072
0073 void copy(const AXOL1TLCondition& cp);
0074
0075
0076 const AXOL1TLTemplate* m_gtAXOL1TLTemplate;
0077
0078
0079 const GlobalBoard* m_gtGTB;
0080
0081 static constexpr char const* kModelNamePrefix = "GTADModel_";
0082
0083 hls4mlEmulator::ModelLoader m_model_loader;
0084 std::shared_ptr<hls4mlEmulator::Model> m_model;
0085
0086
0087 mutable float m_savedscore;
0088 };
0089
0090 }
0091 #endif