34 ATH_MSG_ERROR(
"Path to NN-based fake track removal ONNX file is empty! If you want to run this pipeline, you need to provide an input file.");
35 return StatusCode::FAILURE;
42 ATH_MSG_INFO(
"Path to NN-based track parameter estimation ONNX file is empty! Estimation is not run...");
46 return StatusCode::SUCCESS;
51 ATH_MSG_DEBUG(
"Running NN-based track parameter estimation!");
55 for (
unsigned int i = 0;
i < paramNNoutput.size();
i++) {
59 track.setQOverPt(paramNNoutput[0]);
60 track.setEta(paramNNoutput[1]);
61 track.setPhi(paramNNoutput[2]);
62 track.setD0(paramNNoutput[3]);
63 track.setZ0(paramNNoutput[4]);
72 for (
auto const &iroad : roads) {
74 double y = iroad->getY();
77 int sector = iroad->getSector();
80 return StatusCode::SUCCESS;
113 std::vector<std::vector<int>> combs =
117 for (
size_t icomb = 0; icomb < combs.size(); icomb++) {
120 std::vector<int>
const &hit_indices = combs[icomb];
121 std::vector<std::shared_ptr<const FPGATrackSimHit>> hit_list;
127 if (hit_indices[
layer] >= 0) {
129 std::shared_ptr<const FPGATrackSimHit> hit = iroad->getHits(
layer)[hit_indices[
layer]];
132 hit_list.push_back(hit);
138 if (hit_list.size() < 9)
continue;
141 std::sort(hit_list.begin(), hit_list.end(),
142 [](std::shared_ptr<const FPGATrackSimHit> &hit1, std::shared_ptr<const FPGATrackSimHit> &hit2) {
143 double rho1 = std::hypot(hit1->getX(), hit1->getY());
144 double rho2 = std::hypot(hit2->getX(), hit2->getY());
148 std::vector<float> inputTensorValues;
153 double rotateAngle = 0;
154 bool gotSecondSP =
false;
160 for (
const auto &hit : hit_list) {
163 float x0 = hit->getX();
164 float y0 = hit->getY();
165 float z0 = hit->getZ();
178 if (flipZ)
zf =
z0 * -1;
182 if (hit->isStrip()) {
191 float xf_scaled = (xf + tmp_xf) / (2.*
getXScale());
192 float yf_scaled = (yf + tmp_yf) / (2.*
getYScale());
193 float zf_scaled = (
zf + tmp_zf) / (2.*
getZScale());
196 inputTensorValues.push_back(xf_scaled);
197 inputTensorValues.push_back(yf_scaled);
198 inputTensorValues.push_back(zf_scaled);
207 inputTensorValues.push_back(xf_scaled);
208 inputTensorValues.push_back(yf_scaled);
209 inputTensorValues.push_back(zf_scaled);
220 float nn_val = NNoutput[0];
230 for (
const auto &ihit : hit_list) {
231 unsigned int layer = ihit->getLayer();
243 tracks.push_back(track_cand);
248 for (
auto&
track : tracks) {
262 return StatusCode::SUCCESS;
267 std::vector<FPGATrackSimMultiTruth> mtv;
277 if (
layer <
t.getFPGATrackSimHits().size())
278 mtv.push_back(
t.getFPGATrackSimHits().at(
layer).getTruth());
282 mtv.back().assign_equal_normalization();
292 const bool ok = mt.
best(tbarcode, tfrac);
294 t.setEventIndex(tbarcode.first);
295 t.setBarcode(tbarcode.second);
296 t.setBarcodeFrac(tfrac);