File indexing completed on 2025-04-30 22:24:27
0001 #ifndef L1TRIGGER_PHASE2L1PARTICLEFLOWS_L1TSC4NGJetID_H
0002 #define L1TRIGGER_PHASE2L1PARTICLEFLOWS_L1TSC4NGJetID_H
0003
0004 #include <string>
0005 #include "PhysicsTools/TensorFlow/interface/TensorFlow.h"
0006 #include "DataFormats/L1TParticleFlow/interface/PFCandidate.h"
0007 #include "DataFormats/L1TParticleFlow/interface/PFJet.h"
0008 #include "DataFormats/L1TParticleFlow/interface/datatypes.h"
0009 #include "L1Trigger/Phase2L1ParticleFlow/interface/jetmet/L1SeedConePFJetEmulator.h"
0010
0011
0012 #include "ap_fixed.h"
0013 #include "hls4ml/emulator.h"
0014
0015 class L1TSC4NGJetID {
0016 public:
0017 L1TSC4NGJetID(const std::shared_ptr<hls4mlEmulator::Model> model, int iNParticles, bool debug);
0018
0019 typedef ap_fixed<24, 12, AP_RND, AP_SAT, 0> inputtype;
0020 typedef std::array<ap_ufixed<24, 12, AP_RND, AP_SAT, 0>, 8> classtype;
0021 typedef std::array<ap_fixed<16, 6>, 1> regressiontype;
0022 typedef std::pair<regressiontype, classtype> pairtype;
0023
0024 void setNNVectorVar();
0025 std::vector<float> EvaluateNNFixed();
0026 std::vector<float> computeFixed(const l1t::PFJet &iJet, bool useRawPt);
0027
0028 private:
0029 std::vector<inputtype> NNvectorVar_;
0030 int fNParticles_;
0031 unique_ptr<float[]> fPt_;
0032 unique_ptr<float[]> fPt_rel_;
0033 unique_ptr<float[]> fDEta_;
0034 unique_ptr<float[]> fDPhi_;
0035 unique_ptr<float[]> fPt_log_;
0036 unique_ptr<float[]> fMass_;
0037 unique_ptr<float[]> fZ0_;
0038 unique_ptr<float[]> fDxy_;
0039 unique_ptr<int[]> fIs_filled_;
0040 unique_ptr<float[]> fPuppi_weight_;
0041 unique_ptr<int[]> fEmID_;
0042 unique_ptr<float[]> fQuality_;
0043
0044 unique_ptr<int[]> fCharge_;
0045 unique_ptr<int[]> fId_;
0046 std::shared_ptr<hls4mlEmulator::Model> modelRef_;
0047
0048 bool isDebugEnabled_;
0049 };
0050 #endif