ATLAS Offline Software
Loading...
Searching...
No Matches
GNNR3_DataStorage.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIGINDETPATTRECOTOOLS_GNNR3_DATA_STORAGE_H
6#define TRIGINDETPATTRECOTOOLS_GNNR3_DATA_STORAGE_H
7
8#include<vector>
9#include<map>
10#include<algorithm>
11#include<array>
12#include<limits>
13#define MAX_SEG_PER_NODE 1000 //was 30
14#define N_SEG_CONNS 6 //was 6
15
17
19
20 TrigFTF_GNNR3_Node(unsigned short l) : m_x(0), m_y(0), m_z(0), m_r(0), m_phi(0), m_layer(l), m_pcw(0) {};
21
22 inline float x() const {return m_x;}
23 inline float y() const {return m_y;}
24
25 inline float phi() const {return m_phi;}
26 inline float z() const {return m_z;}
27 inline float r() const {return m_r;}
28 inline unsigned short layer() const {return m_layer;}
29 inline float pixelClusterWidth() const {return m_pcw;}
30
31 inline int sp_idx() const {return m_idx;}
32
33 float m_x, m_y, m_z, m_r, m_phi;
34 unsigned short m_layer{10000};
35 unsigned int m_idx{std::numeric_limits<unsigned int>::max()};
36 float m_pcw;
37};
38
39
41public:
42
44
46 return n1->phi() < n2->phi();
47 }
48
49 };
50
53
54 void sortByPhi();
55 void initializeNodes();
56 bool empty() const {
57 return m_vn.empty();
58 }
59
60 void generatePhiIndexing(float);
61
62 float getMinBinRadius() const {
63 return m_minRadius;
64 }
65
66 float getMaxBinRadius() const {
67 return m_maxRadius;
68 }
69
70 std::vector<const TrigFTF_GNNR3_Node*> m_vn;//nodes of the graph
71 std::vector<std::pair<float, unsigned int> > m_vPhiNodes;
72 std::vector<std::vector<unsigned int> > m_in;//vectors of incoming edges, stores indicies of edges in the edge vector
73 std::vector<std::array<float,5> > m_params;//node attributes: m_minCutOnTau, m_maxCutOnTau, m_phi, m_r, m_z;
74
76
77};
78
80public:
83
84 int loadPixelGraphNodes(short, const std::vector<TrigFTF_GNNR3_Node>&, bool);
85 int loadStripGraphNodes(short, const std::vector<TrigFTF_GNNR3_Node>&);
86
87 unsigned int numberOfNodes() const;
88 void sortByPhi();
89 void initializeNodes(bool);
90 void generatePhiIndexing(float);
91
92
94 if(idx >= static_cast<int>(m_etaBins.size())) idx = idx-1;
95 return m_etaBins.at(idx);
96 }
97
98protected:
99
101
102 std::vector<TrigFTF_GNNR3_EtaBin> m_etaBins;
103
104};
105
107public:
108
110 public:
111 bool operator()(const TrigFTF_GNNR3_Edge* pE1, const TrigFTF_GNNR3_Edge* pE2) {
112 return pE1->m_level > pE2->m_level;
113 }
114 };
115
116 TrigFTF_GNNR3_Edge(const TrigFTF_GNNR3_Node* n1, const TrigFTF_GNNR3_Node* n2, float p1, float p2, float p3) : m_n1(n1), m_n2(n2), m_level(1), m_next(1), m_nNei(0) {
117 m_p[0] = p1;
118 m_p[1] = p2;
119 m_p[2] = p3;
120 }
121
122 TrigFTF_GNNR3_Edge() : m_n1(nullptr), m_n2(nullptr), m_level(-1), m_next(-1), m_nNei(0) {};
123
124
125 const TrigFTF_GNNR3_Node* m_n1{nullptr};
126 const TrigFTF_GNNR3_Node* m_n2{nullptr};
127
128 signed char m_level{-1}, m_next{-1};
129
130 unsigned char m_nNei{0};
131 float m_p[3]{};
132
133 unsigned int m_vNei[N_SEG_CONNS]{};//global indices of the connected edges
134
135};
136
137#endif
138
#define N_SEG_CONNS
TrigFTF_GNNR3_DataStorage(const TrigFTF_GNNR3_Geometry &)
int loadStripGraphNodes(short, const std::vector< TrigFTF_GNNR3_Node > &)
TrigFTF_GNNR3_EtaBin & getEtaBin(int idx)
const TrigFTF_GNNR3_Geometry & m_geo
unsigned int numberOfNodes() const
std::vector< TrigFTF_GNNR3_EtaBin > m_etaBins
int loadPixelGraphNodes(short, const std::vector< TrigFTF_GNNR3_Node > &, bool)
const TrigFTF_GNNR3_Node * m_n2
TrigFTF_GNNR3_Edge(const TrigFTF_GNNR3_Node *n1, const TrigFTF_GNNR3_Node *n2, float p1, float p2, float p3)
unsigned int m_vNei[N_SEG_CONNS]
const TrigFTF_GNNR3_Node * m_n1
float getMaxBinRadius() const
std::vector< std::array< float, 5 > > m_params
float getMinBinRadius() const
std::vector< const TrigFTF_GNNR3_Node * > m_vn
std::vector< std::pair< float, unsigned int > > m_vPhiNodes
std::vector< std::vector< unsigned int > > m_in
bool operator()(const TrigFTF_GNNR3_Edge *pE1, const TrigFTF_GNNR3_Edge *pE2)
bool operator()(const TrigFTF_GNNR3_Node *n1, const TrigFTF_GNNR3_Node *n2)
TrigFTF_GNNR3_Node(unsigned short l)
unsigned short layer() const
float pixelClusterWidth() const
unsigned short m_layer