62 std::array<float, 6> x_dphi;
63 std::array<float, 6> x_dphi_sign;
64 std::array<float, 6> x_dtheta;
65 std::array<float, 6> x_dtheta_sign;
66 std::array<float, 1> x_trk_theta;
67 std::array<float, 4> x_csc_pattern;
70 x_csc_pattern.fill(0);
74 const int invalid_dtheta = 127;
75 const int invalid_dphi = 8191;
78 bool st1 = (
track.Mode() >= 8);
79 bool st2 = ((
track.Mode() % 8) >= 4);
80 bool st3 = ((
track.Mode() % 4) >= 2);
81 bool st4 = ((
track.Mode() % 2) == 1);
85 x_csc_pattern[0] =
data.cpattern[0];
87 x_csc_pattern[1] =
data.cpattern[1];
89 x_csc_pattern[2] =
data.cpattern[2];
91 x_csc_pattern[3] =
data.cpattern[3];
93 for (
int i = 0;
i < 6; ++
i) {
95 x_dphi[
i] = (
data.delta_ph[
i] != invalid_dphi) ?
data.delta_ph[
i] : 0;
98 x_dtheta[
i] = (
data.delta_th[
i] != invalid_dtheta) ?
data.delta_th[
i] : 0;
101 x_dphi_sign[
i] =
data.sign_ph[
i];
102 x_dtheta_sign[
i] =
data.sign_th[
i];
143 x_trk_theta[0] =
track.Theta_fp();
146 feature = {{x_dphi[0], x_dphi[1], x_dphi[2], x_dphi[3], x_dphi[4],
147 x_dphi[5], x_dphi_sign[0], x_dphi_sign[1], x_dphi_sign[2], x_dphi_sign[3],
148 x_dphi_sign[4], x_dphi_sign[5], x_dtheta[0], x_dtheta[1], x_dtheta[2],
149 x_dtheta[3], x_dtheta[4], x_dtheta[5], x_dtheta_sign[0], x_dtheta_sign[1],
150 x_dtheta_sign[2], x_dtheta_sign[3], x_dtheta_sign[4], x_dtheta_sign[5], x_csc_pattern[0],
151 x_csc_pattern[1], x_csc_pattern[2], x_csc_pattern[3], x_trk_theta[0]}};
158 std::vector<tensorflow::Tensor>
outputs;
167 prediction.at(0) =
outputs[0].matrix<
float>()(0, 0);
168 prediction.at(1) =
outputs[0].matrix<
float>()(0, 1);
virtual ~PtAssignmentEngineDxy()
static PFTauRenderPlugin instance
GraphDef * loadGraphDef(const std::string &pbFile)
std::vector< std::string > outputNamesDxy_
const PtAssignmentEngineAux2017 & aux() const
virtual void calculate_pt_dxy(const EMTFTrack &track, emtf::Feature &feature, emtf::Prediction &prediction) const
constexpr int NUM_PREDICTIONS
tensorflow::Session * sessionDxy_
void configure(int verbose, const std::string pbFileNameDxy)
static std::string const input
virtual void call_tensorflow_dxy(const emtf::Feature &feature, emtf::Prediction &prediction) const
tensorflow::GraphDef * graphDefDxy_
std::array< float, NUM_PREDICTIONS > Prediction
void run(Session *session, const NamedTensorList &inputs, const std::vector< std::string > &outputNames, std::vector< Tensor > *outputs, const thread::ThreadPoolOptions &threadPoolOptions)
bool closeSession(Session *&session)
Session * createSession()
std::string inputNameDxy_
constexpr int NUM_FEATURES
std::string pbFileNameDxy_
char data[epos_bytes_allocation]
virtual void preprocessing_dxy(const EMTFTrack &track, emtf::Feature &feature) const
std::array< float, NUM_FEATURES > Feature
std::string pbFilePathDxy_