18 std::vector<int> feature_sites = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 6, 7,
19 8, 9, 10, 11, 0, 1, 2, 3, 4, 11, 0, 1, 2, 3, 4, 11, -1, -1, -1, -1};
30 track.rels_address = 0;
31 track.dxy_address = 0;
34 if (
track.valid == 0) {
39 const auto& site_mask =
track.site_mask;
47 <<
" disp " << displaced_en <<
" zone " <<
track.zone <<
" col " <<
track.col <<
" pat " 48 <<
track.pattern <<
" qual " <<
track.quality <<
" phi " <<
track.phi <<
" theta " 49 <<
track.theta <<
" features " << std::endl;
53 float* input_data =
input.flat<
float>().
data();
56 const auto& feature =
features[i_feature];
57 const auto& feature_site = feature_sites[i_feature];
59 bool mask_value =
false;
67 if (feature_site > -1) {
68 mask_value = (site_mask[feature_site] == 0);
79 (*input_data) = feature.to_float();
103 std::vector<tensorflow::Tensor>
outputs;
114 auto rels_address =
outputs[0].matrix<
float>()(0, 1);
115 auto dxy_address =
outputs[0].matrix<
float>()(0, 2);
118 track.rels_address = std::clamp<float>(rels_address, -512, 511);
119 track.dxy_address = std::clamp<float>(dxy_address, -512, 511);
128 auto rels_address =
outputs[0].matrix<
float>()(0, 1);
131 track.rels_address = std::clamp<float>(rels_address, -512, 511);
132 track.dxy_address = 0;
143 <<
" disp " << displaced_en <<
" zone " <<
track.zone <<
" col " <<
track.col <<
" pat " 145 <<
" rels " <<
track.rels <<
" dxy " <<
track.dxy <<
" z0 " <<
track.z0 <<
" phi " 146 <<
track.phi <<
" theta " <<
track.theta <<
" beta " <<
track.beta <<
" pt_address " 147 <<
track.pt_address <<
" rels_address " <<
track.rels_address <<
" dxy_address " 148 <<
track.dxy_address <<
" valid " <<
track.valid << std::endl;
tensorflow::Session * disp_session_ptr_
void apply(const bool &, std::vector< track_t > &) const
ParameterAssignmentLayer(const EMTFContext &)
constexpr int kNumTrackFeatures
static std::string const input
data::ActivationLut activation_lut_
tensorflow::Session * prompt_session_ptr_
const EMTFContext & context_
const trk_pt_t & lookupPromptPt(const trk_nn_address_t &) const
std::vector< float > features(const reco::PreId &ecal, const reco::PreId &hcal, double rho, const reco::BeamSpot &spot, noZS::EcalClusterLazyTools &ecalTools)
void run(Session *session, const NamedTensorList &inputs, const std::vector< std::string > &outputNames, std::vector< Tensor > *outputs, const thread::ThreadPoolOptions &threadPoolOptions)
const trk_pt_t & lookupDispPt(const trk_nn_address_t &) const
const trk_dxy_t & lookupDxy(const trk_nn_address_t &) const
Log< level::Info, false > LogInfo
char data[epos_bytes_allocation]
const trk_rels_t & lookupRels(const trk_nn_address_t &) const
EMTFConfiguration config_