ATLAS Offline Software
Loading...
Searching...
No Matches
FPGATrackSimNNTrackTool.h
Go to the documentation of this file.
1// Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3#ifndef FPGATrackSimNNTRACKTOOL_H
4#define FPGATrackSimNNTRACKTOOL_H
5
13
14#include "GaudiKernel/ServiceHandle.h"
16
18
25
26#include "GaudiKernel/ITHistSvc.h"
27
29
33
34
36
38{
40
41 public:
42
44 // AthAlgTool
45
46 FPGATrackSimNNTrackTool(const std::string&, const std::string&, const IInterface*);
47
48 virtual StatusCode initialize() override;
49 StatusCode getTracks_1st(std::vector<std::shared_ptr<const FPGATrackSimRoad>> &roads, std::vector<FPGATrackSimTrack> &tracks);
50 StatusCode getTracks_2nd(std::vector<std::shared_ptr<const FPGATrackSimRoad>> &roads, std::vector<FPGATrackSimTrack> &tracks);
51 StatusCode getTracks_GNN(std::vector<std::shared_ptr<const FPGATrackSimRoad>> &roads, std::vector<FPGATrackSimTrack> &tracks);
52 StatusCode setTrackParameters(std::vector<FPGATrackSimTrack> &tracks, bool isFirst, const FPGATrackSimTrackPars& min, const FPGATrackSimTrackPars& max);
53
54 static float getXScale() { return 1015.;};
55 static float getYScale() { return 1015.;};
56 static float getZScale() { return 3000.;};
57 static float getQoverPtScale() { return 0.001;};
58 static float getEtaScale() { return 5.0;};
59 static float getPhiScale() { return 3.15;};
60 static float getD0Scale() { return 2.0;};
61 static float getZ0Scale() { return 200.;};
62 static float getRScale() {return 1015.;};
63
64 // Flags
65 Gaudi::Property <unsigned int> m_minNumberOfRealHitsInATrack{ this, "MinNumberOfRealHitsInATrack", 4, "Minimum number of real hits in a track candidate to process" };
66 Gaudi::Property <bool> m_doGNNTracking{ this, "doGNNTracking", false, "Flag to turn on GNN Tracking configuration for road-to-track" };
67 Gaudi::Property <int> m_nInputsGNN{ this, "nInputsGNN", 9, "Number of Hit Inputs for NN for GNN configuration. Depends on which model is chosen."};
68 Gaudi::Property <bool> m_useCartesian { this, "useCartesian", true, "If true, NNs use Cartestian coordinates. If false,they use cylindrical coordiantes"};
69
70 private:
71
73 ServiceHandle<ITHistSvc> m_tHistSvc{this, "THistSvc","THistSvc"};
74
79
80 bool m_useParamNN_1st = true;
81 bool m_useParamNN_2nd = true;
82
83 std::vector<float> m_x; // x position of hit in road
84 std::vector<float> m_y; // y pos
85 std::vector<float> m_z; // z pos
86 std::vector<float> m_barcodefrac; // truth barcode fraction for the hit
87 std::vector<int> m_barcode; // truth barcode for the hit
88 std::vector<int> m_eventindex; // event index for the hit
89 std::vector<unsigned int> m_isPixel; // is hit pixel? if 0 it is strip
90 std::vector<unsigned int> m_layer; // layer ID
91 std::vector<unsigned int> m_isBarrel; // is hit in barrel? if 0 it is endcap
92 std::vector<unsigned int> m_etawidth;
93 std::vector<unsigned int> m_phiwidth;
94 std::vector<unsigned int> m_etamodule;
95 std::vector<unsigned int> m_phimodule;
96 std::vector<unsigned int> m_ID; // ID hash for hit
97
98 std::vector<float> m_truth_d0;
99 std::vector<float> m_truth_z0;
100 std::vector<float> m_truth_pt;
101 std::vector<float> m_truth_eta;
102 std::vector<float> m_truth_phi;
103 std::vector<float> m_truth_pdg;
104 std::vector<int> m_truth_q;
105 std::vector<int> m_truth_barcode;
106 std::vector<int> m_truth_eventindex;
107
109 // NN stuff
110 std::vector<const char*> m_input_node_names;
111 std::vector<int64_t> m_input_node_dims;
112 std::vector<const char*> m_output_node_names;
113
114 void compute_truth(FPGATrackSimTrack & newtrk) const;
115
116};
117
118
119#endif // FPGATrackSimNNTRACKTOOL_H
: FPGATrackSim-specific class to represent an hit in the detector.
Maps physical layers to logical layers.
Defines a class for roads.
This file declares a class that stores the module IDs of the sectors.
#define min(a, b)
Definition cfImp.cxx:40
#define max(a, b)
Definition cfImp.cxx:41
std::vector< const char * > m_output_node_names
Gaudi::Property< int > m_nInputsGNN
std::vector< unsigned int > m_isPixel
std::vector< int > m_truth_eventindex
OnnxRuntimeBase(TString fileName)
FPGATrackSimNNTrackTool(const std::string &, const std::string &, const IInterface *)
std::vector< unsigned int > m_layer
StatusCode getTracks_2nd(std::vector< std::shared_ptr< const FPGATrackSimRoad > > &roads, std::vector< FPGATrackSimTrack > &tracks)
std::vector< float > m_barcodefrac
Gaudi::Property< bool > m_doGNNTracking
virtual StatusCode initialize() override
std::vector< unsigned int > m_etawidth
std::vector< unsigned int > m_isBarrel
std::vector< int64_t > m_input_node_dims
std::vector< unsigned int > m_etamodule
StatusCode getTracks_GNN(std::vector< std::shared_ptr< const FPGATrackSimRoad > > &roads, std::vector< FPGATrackSimTrack > &tracks)
Gaudi::Property< unsigned int > m_minNumberOfRealHitsInATrack
std::vector< float > m_truth_d0
ServiceHandle< IFPGATrackSimMappingSvc > m_FPGATrackSimMapping
std::vector< const char * > m_input_node_names
StatusCode getTracks_1st(std::vector< std::shared_ptr< const FPGATrackSimRoad > > &roads, std::vector< FPGATrackSimTrack > &tracks)
std::vector< unsigned int > m_phimodule
ServiceHandle< ITHistSvc > m_tHistSvc
std::vector< unsigned int > m_ID
Gaudi::Property< bool > m_useCartesian
void compute_truth(FPGATrackSimTrack &newtrk) const
std::vector< float > m_truth_z0
std::vector< unsigned int > m_phiwidth
StatusCode setTrackParameters(std::vector< FPGATrackSimTrack > &tracks, bool isFirst, const FPGATrackSimTrackPars &min, const FPGATrackSimTrackPars &max)
FPGATrackSimTrackingToolBase(const std::string &type, const std::string &name, const IInterface *parent)
OnnxRuntimeBase(TString fileName)