19 return StatusCode::SUCCESS;
27 std::vector<float> edge_scores;
31 std::vector<float> gEdgeFeatures =
getEdgeFeatures(edges, gNodeFeatures);
33 std::vector<Ort::Value> gInputTensor;
38 std::vector<float> gOutputData;
39 std::vector<Ort::Value> gOutputTensor;
44 for(
auto&
v : edge_scores) {
48 for (
size_t i = 0;
i < edges.size();
i++) {
49 edges[
i]->setEdgeScore(edge_scores[
i]);
52 return StatusCode::SUCCESS;
57 std::vector<float> gNodeFeatures;
59 for(
const auto& hit :
hits) {
60 std::map<std::string, float> features;
61 features[
"r"] = hit->getR();
62 features[
"phi"] = hit->getPhi();
63 features[
"z"] = hit->getZ();
64 features[
"eta"] = hit->getEta();
65 features[
"cluster_r_1"] = hit->getCluster1R();
66 features[
"cluster_phi_1"] = hit->getCluster1Phi();
67 features[
"cluster_z_1"] = hit->getCluster1Z();
68 features[
"cluster_eta_1"] = hit->getCluster1Eta();
69 features[
"cluster_r_2"] = hit->getCluster2R();
70 features[
"cluster_phi_2"] = hit->getCluster2Phi();
71 features[
"cluster_z_2"] = hit->getCluster2Z();
72 features[
"cluster_eta_2"] = hit->getCluster2Eta();
75 gNodeFeatures.push_back(
85 std::vector<int64_t> rowIndices;
86 std::vector<int64_t> colIndices;
87 std::vector<int64_t> edgesList(edges.size() * 2);
89 for(
const auto& edge : edges) {
90 rowIndices.push_back(edge->getEdgeIndex1());
91 colIndices.push_back(edge->getEdgeIndex2());
94 std::copy(rowIndices.begin(), rowIndices.end(), edgesList.begin());
95 std::copy(colIndices.begin(), colIndices.end(), edgesList.begin() + edges.size());
102 std::vector<float> gEdgeFeatures;
104 for (
auto& edge : edges) {
107 gEdgeFeatures.push_back(edge->getEdgeDR());
108 gEdgeFeatures.push_back(edge->getEdgeDPhi());
109 gEdgeFeatures.push_back(edge->getEdgeDZ());
110 gEdgeFeatures.push_back(edge->getEdgeDEta());
111 gEdgeFeatures.push_back(edge->getEdgePhiSlope());
112 gEdgeFeatures.push_back(edge->getEdgeRPhiSlope());
115 return gEdgeFeatures;
122 std::map<std::string, float> hit1_features;
123 std::map<std::string, float> hit2_features;
125 for(
size_t i = 0;
i < num_features;
i++){
130 float deta = hit2_features[
"eta"] - hit1_features[
"eta"];
131 float dz = hit2_features[
"z"] - hit1_features[
"z"];
132 float dr = hit2_features[
"r"] - hit1_features[
"r"];
134 float phislope =
dr==0. ? 0. : dphi /
dr;
135 float rphislope = 0.5 * (hit2_features[
"r"] + hit1_features[
"r"]) * phislope;