7 const std::shared_ptr<hls4mlEmulator::Model>
model,
27 : sessionRef_(
cache->session) {
46 if (
fPt_.get()[i0] == 0) {
47 for (
int i1 = 0;
i1 < 13;
i1++)
71 std::vector<tensorflow::Tensor>
outputs;
73 return outputs[0].matrix<
float>()(0, 0);
77 ap_fixed<16, 6> modelInput[140] = {};
81 ap_fixed<16, 6> modelResult[1] = {-1};
86 ap_fixed<16, 6> modelResult_ = modelResult[0];
103 return (
i->pt() >
j->pt());
105 float jetpt = useRawPt ? iJet.
rawPt() : iJet.
pt();
106 for (
unsigned int i0 = 0; i0 < iParts.size(); i0++) {
109 fPt_.get()[i0] = iParts[i0]->pt() / jetpt;
110 fEta_.get()[i0] = iParts[i0]->eta() - iJet.
eta();
112 fId_.get()[i0] = iParts[i0]->id();
113 fCharge_.get()[i0] = iParts[i0]->charge();
114 if (iParts[i0]->pfTrack().isNonnull()) {
115 fDX_.get()[i0] = iParts[i0]->pfTrack()->vx();
116 fDY_.get()[i0] = iParts[i0]->pfTrack()->vy();
117 fDZ_.get()[i0] = iParts[i0]->pfTrack()->vz() -
vz;
137 return (
i->pt() >
j->pt());
139 float jetpt = useRawPt ? iJet.
rawPt() : iJet.
pt();
140 for (
unsigned int i0 = 0; i0 < iParts.size(); i0++) {
143 fPt_.get()[i0] = iParts[i0]->pt() / jetpt;
144 fEta_.get()[i0] = iParts[i0]->eta() - iJet.
eta();
146 fId_.get()[i0] = iParts[i0]->id();
147 fCharge_.get()[i0] = iParts[i0]->charge();
148 if (iParts[i0]->pfTrack().isNonnull()) {
149 fDX_.get()[i0] = iParts[i0]->pfTrack()->vx();
150 fDY_.get()[i0] = iParts[i0]->pfTrack()->vy();
151 fDZ_.get()[i0] = iParts[i0]->pfTrack()->vz() -
vz;
ap_fixed< 16, 6 > EvaluateNNFixed()
unique_ptr< float[]> fDZ_
MPlex< T, D1, D2, N > hypot(const MPlex< T, D1, D2, N > &a, const MPlex< T, D1, D2, N > &b)
double pt() const final
transverse momentum
unique_ptr< float[]> fDX_
ap_fixed< 16, 6 > computeFixed(const l1t::PFJet &iJet, float vz, bool useRawPt)
JetId(const std::string &iInput, const std::string &iOutput, const std::shared_ptr< hls4mlEmulator::Model > model, int iNParticles)
std::vector< float > NNvectorVar_
float compute(const l1t::PFJet &iJet, float vz, bool useRawPt)
static std::string const input
unique_ptr< float[]> fPhi_
unique_ptr< float[]> fEta_
void run(Session *session, const NamedTensorList &inputs, const std::vector< std::string > &outputNames, std::vector< Tensor > *outputs, const thread::ThreadPoolOptions &threadPoolOptions)
const Constituents & constituents() const
constituent information. note that this is not going to be available in the hardware! ...
unique_ptr< int[]> fCharge_
unique_ptr< float[]> fPt_
unique_ptr< float[]> fDY_
std::shared_ptr< hls4mlEmulator::Model > modelRef_
double phi() const final
momentum azimuthal angle
tensorflow::Session * sessionRef_
double eta() const final
momentum pseudorapidity