3#ifndef FPGATrackPATHFINDEREXTENSION_H
4#define FPGATrackPATHFINDEREXTENSION_H
13#include "GaudiKernel/ServiceHandle.h"
30#include "GaudiKernel/ITHistSvc.h"
32#include "GaudiKernel/IChronoStatSvc.h"
44 std::vector<std::shared_ptr<const FPGATrackSimHit>>
m_hits;
47 std::shared_ptr<const FPGATrackSimHit>
getHit(
size_t layer)
const {
50 return std::make_shared<const FPGATrackSimHit>(dummyHit);
53 std::vector<std::shared_ptr<const FPGATrackSimHit>>&
getHits() {
57 std::vector<std::vector<std::shared_ptr<const FPGATrackSimHit>>>
getVecHits()
const {
58 std::vector<std::vector<std::shared_ptr<const FPGATrackSimHit>>> vecHits;
59 vecHits.resize(
m_hits.size());
60 for (
unsigned layer = 0; layer <
m_hits.size(); layer++) {
61 std::vector<std::shared_ptr<const FPGATrackSimHit>> thislayerVec;
62 thislayerVec.push_back(
m_hits[layer]);
63 vecHits[layer] = std::move(thislayerVec);
79 if (!hit->isReal()) nwc++;
86 for (
unsigned layer = 0; layer <
m_hits.size(); layer++)
87 if (!((*
m_hits[layer]).isReal()))
88 wcLayers |= (0x1 << layer);
94 for (
unsigned layer = 0; layer <
m_hits.size(); layer++)
95 if ((*
m_hits[layer]).isReal())
96 hitLayers |= (0x1 << layer);
103 void setHits(std::vector<std::shared_ptr<const FPGATrackSimHit>> &hits) {
106 void addHits(
const std::vector<std::shared_ptr<const FPGATrackSimHit>> &hits) {
110 void setHit(
unsigned layer,
const std::shared_ptr<const FPGATrackSimHit> & hit) {
115 void addHit(
const std::shared_ptr<const FPGATrackSimHit> & hit) {
132 using base_class::base_class;
136 virtual StatusCode
extendTracks(
const std::vector<std::shared_ptr<const FPGATrackSimHit>> & hits,
138 std::vector<FPGATrackSimRoad> & roads)
override;
143 return StatusCode::SUCCESS;
152 Gaudi::Property<unsigned>
m_maxMiss {
this,
"threshold", 2,
"Maximum number of missing hits to reject a road"};
153 Gaudi::Property <std::string>
m_region {
this,
"OutputRegion",
"",
"region ID"};
159 Gaudi::Property<std::vector<float>>
m_windowR {
this,
"windowR", {20.0},
"Window Size to search in for r, either pass one value for all layers or use the number of layers"};
160 Gaudi::Property<std::vector<float>>
m_windowZ {
this,
"windowZ", {20.0},
"Window Size to search in for z, either pass one value for all layers or use the number of layers"};
161 Gaudi::Property<std::vector<float>>
m_windowPhi {
this,
"windowPhi", {0.4},
"Window Size to search in for phi, either pass one value for all layers or use the number of layers"};
162 Gaudi::Property<std::vector<int>>
m_windowFineID {
this,
"windowFineID", {0},
"Fine ID indexing for windows"};
170 Gaudi::Property <float>
m_missedHitRScaling {
this,
"missedHitRScaling", -1,
"Amount to scale R window if previous hit was missed. Negative means this is disabled"};
171 Gaudi::Property <float>
m_missedHitZScaling {
this,
"missedHitZScaling", -1,
"Amount to scale Z window if previous hit was missed. Negative means this is disabled"};
172 Gaudi::Property <float>
m_missedHitPhiScaling {
this,
"missedHitPhiScaling", -1,
"Amount to scale Phi window if previous hit was missed. Negative means this is disabled"};
173 Gaudi::Property <int>
m_maxBranches {
this,
"maxBranches", -1,
"Max number of branches before we stop, if negative this is disabled"};
174 Gaudi::Property <bool>
m_doOutsideIn {
this,
"doOutsideIn",
true,
"Setup the tool so it's doing outside in extrap"};
176 Gaudi::Property <bool>
m_useCartesian {
this,
"useCartesian",
true,
"If true, NNs use Cartestian coordinates. If false,they use cylindrical coordiantes"};
177 Gaudi::Property <unsigned int>
m_batchSize {
this,
"batchSize", 1,
"Batch size for NN inference (1 = sequential, >1 for true batching on GPU)"};
200 StatusCode
getPredictedHit(std::vector<float>& inputTensorValues, std::vector<float>& outputTensorValues,
long& fineID);
202 std::vector<std::vector<float>>& batchOutputTensors,
203 std::vector<long>& batchFineIDs);
205 StatusCode
getFakeHit(
miniRoad& currentRoad, std::vector<float>& predhit,
const long& fineID, std::vector<std::shared_ptr<const FPGATrackSimHit>>& hits);
206 StatusCode
getLastLayer(
miniRoad& currentRoad,
unsigned& lastHitLayer, std::shared_ptr<const FPGATrackSimHit>& lastHit);
208 StatusCode
findHitinNextStripLayer(std::shared_ptr<const FPGATrackSimHit> hit,
const std::vector<std::shared_ptr<const FPGATrackSimHit>>& hitList, std::vector<std::shared_ptr<const FPGATrackSimHit>>& hits);
: FPGATrackSim-specific class to represent an hit in the detector.
Maps physical layers to logical layers.
Maps ITK module indices to FPGATrackSim regions.
Defines a class for roads.
std::vector< FPGATrackSimTrack > FPGATrackSimTrackCollection
void setHit(unsigned layer, const std::shared_ptr< const FPGATrackSimHit > &hit)
size_t getNHitLayers() const
layer_bitmask_t getHitLayers() const
void addHits(const std::vector< std::shared_ptr< const FPGATrackSimHit > > &hits)
miniRoad(unsigned nLayers)
size_t getNLayers() const
void addHit(const std::shared_ptr< const FPGATrackSimHit > &hit)
std::vector< std::shared_ptr< const FPGATrackSimHit > > & getHits()
std::vector< std::shared_ptr< const FPGATrackSimHit > > m_hits
std::shared_ptr< const FPGATrackSimHit > getHit(size_t layer) const
unsigned getNHits() const
size_t getNWCLayers() const
std::vector< std::vector< std::shared_ptr< const FPGATrackSimHit > > > getVecHits() const
void setNLayers(unsigned layers)
layer_bitmask_t getWCLayers() const
void setHits(std::vector< std::shared_ptr< const FPGATrackSimHit > > &hits)