19 ATH_MSG_FATAL(
"ERROR! No Module Map provided. Please provide a valid path to a ROOT file.");
20 return StatusCode::FAILURE;
32 return StatusCode::SUCCESS;
47 return StatusCode::SUCCESS;
53 std::unique_ptr<TTree>
tree(
static_cast<TTree*
>(
file->Get(
"TreeModuleDoublet")));
55 unsigned int mid1_value = 0;
56 unsigned int mid2_value = 0;
57 float z0min_12_value = 0.0;
58 float dphimin_12_value = 0.0;
59 float phislopemin_12_value = 0.0;
60 float detamin_12_value = 0.0;
61 float z0max_12_value = 0.0;
62 float dphimax_12_value = 0.0;
63 float phislopemax_12_value = 0.0;
64 float detamax_12_value = 0.0;
66 tree->SetBranchAddress(
"Module1", &mid1_value);
67 tree->SetBranchAddress(
"Module2", &mid2_value);
68 tree->SetBranchAddress(
"z0min_12", &z0min_12_value);
69 tree->SetBranchAddress(
"dphimin_12", &dphimin_12_value);
70 tree->SetBranchAddress(
"phiSlopemin_12", &phislopemin_12_value);
71 tree->SetBranchAddress(
"detamin_12", &detamin_12_value);
72 tree->SetBranchAddress(
"z0max_12", &z0max_12_value);
73 tree->SetBranchAddress(
"dphimax_12", &dphimax_12_value);
74 tree->SetBranchAddress(
"phiSlopemax_12", &phislopemax_12_value);
75 tree->SetBranchAddress(
"detamax_12", &detamax_12_value);
80 m_mid1.emplace_back(mid1_value);
81 m_mid2.emplace_back(mid2_value);
110 for (
size_t i = 0;
i <
m_mid2.size();
i++) {
111 std::vector<std::shared_ptr<FPGATrackSimGNNHit>> hit1_matches;
112 std::vector<std::shared_ptr<FPGATrackSimGNNHit>> hit2_matches;
114 std::vector<int> hit1_indices;
115 std::vector<int> hit2_indices;
117 for (
size_t j = 0; j <
hits.size(); j++) {
119 hit1_matches.emplace_back(
hits[j]);
120 hit1_indices.emplace_back(j);
123 hit2_matches.emplace_back(
hits[j]);
124 hit2_indices.emplace_back(j);
128 for (
size_t h1 = 0;
h1 < hit1_matches.size();
h1++) {
129 for (
size_t h2 = 0; h2 < hit2_matches.size(); h2++) {
146 float dz = hit2->
getZ() - hit1->
getZ();
156 float phislope =
dr==0. ? 0. : dphi /
dr;
160 std::shared_ptr<FPGATrackSimGNNEdge> edge = std::make_shared<FPGATrackSimGNNEdge>();
163 edges.emplace_back(edge);
190 if(feature < 0.0) {
return -1.0; }
191 else if(feature > 0.0) {
return 1.0; }
200 std::vector<float> gEmbedded =
embed(
hits);
206 std::vector<float> gNodeFeatures;
208 for(
auto hit :
hits) {
209 std::map<std::string, float> features;
210 features[
"r"] = hit->getR();
211 features[
"phi"] = hit->getPhi();
212 features[
"z"] = hit->getZ();
215 gNodeFeatures.push_back(
219 return gNodeFeatures;
226 std::vector<float> gEmbedded;
228 std::vector<Ort::Value> gInputTensor;
230 std::vector<Ort::Value> gOutputTensor;
238 std::vector<float> & gEmbedded)
249 std::vector<float>
start(n_dim);
255 for(
int j = 0; j < n_dim; ++j){
256 start[j] = gEmbedded[
k*n_dim + j];
261 for(
int d = 0;
d < n_dim; ++
d){
266 std::shared_ptr<FPGATrackSimGNNEdge> edge = std::make_shared<FPGATrackSimGNNEdge>();
270 if (d_i_sq < d_k_sq){
280 edges.emplace_back(edge);