ATLAS Offline Software
Loading...
Searching...
No Matches
SeedingToolBase Class Reference

#include <SeedingToolBase.h>

Inheritance diagram for SeedingToolBase:

Public Member Functions

 SeedingToolBase (const std::string &t, const std::string &n, const IInterface *p)
 SeedingToolBase (const std::string &t, const std::string &n, const IInterface *p)
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Types

typedef TrigFTF_GNN_Node GNN_Node
typedef TrigFTF_GNN_DataStorage GNN_DataStorage
typedef TrigFTF_GNN_Edge GNN_Edge
typedef TrigFTF_GNNR3_Node GNNR3_Node
typedef TrigFTF_GNNR3_DataStorage GNNR3_DataStorage
typedef TrigFTF_GNNR3_Edge GNNR3_Edge

Protected Member Functions

virtual StatusCode initialize ()
virtual StatusCode finalize ()
std::pair< int, int > buildTheGraph (const IRoiDescriptor &, const std::unique_ptr< GNN_DataStorage > &, std::vector< GNN_Edge > &) const
int runCCA (int, std::vector< GNN_Edge > &) const
void extractSeedsFromTheGraph (int, int, int, std::vector< GNN_Edge > &, std::vector< std::pair< float, std::vector< unsigned int > > > &) const
bool check_z0_bitmask (const unsigned short &, const float &, const float &, const float &) const
float estimate_curvature (const std::array< const GNN_Node *, 3 > &) const
virtual StatusCode initialize ()
virtual StatusCode finalize ()
std::pair< int, int > buildTheGraph (const IRoiDescriptor &, const std::unique_ptr< GNNR3_DataStorage > &, std::vector< GNNR3_Edge > &) const
int runCCA (int, std::vector< GNNR3_Edge > &) const
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Protected Attributes

ToolHandle< ITrigL2LayerNumberToolm_layerNumberTool {this, "layerNumberTool", "TrigL2LayerNumberToolITk"}
const AtlasDetectorIDm_atlasId = nullptr
const SCT_IDm_sctId = nullptr
const PixelIDm_pixelId = nullptr
BooleanProperty m_filter_phi {this, "DoPhiFiltering", true}
BooleanProperty m_useBeamTilt {this, "UseBeamTilt", false}
BooleanProperty m_LRTmode {this, "LRTMode",false}
BooleanProperty m_useML {this, "useML", true}
UnsignedIntegerProperty m_nMaxPhiSlice {this, "nMaxPhiSlice", 53}
BooleanProperty m_doubletFilterRZ {this, "Doublet_FilterRZ", true}
BooleanProperty m_useEtaBinning {this, "UseEtaBinning", true}
BooleanProperty m_matchBeforeCreate {this, "MatchBeforeCreate", true}
FloatProperty m_minPt {this, "pTmin", 1000.0}
FloatProperty m_etaBinOverride {this, "etaBin", 0.0f, "specify non-zero to override eta bin width from connection file (default 0.2 in createLinkingScheme.py)"}
IntegerProperty m_nMaxEdges {this, "MaxGraphEdges", 2000000}
IntegerProperty m_nBufferEdges {this, "BufferEdges", 200000}
StringProperty m_connectionFile {this, "ConnectionFileName", "binTables_ITK_RUN4.txt"}
StringProperty m_lutFile {this, "MLpredictorLutFileName", "gbts_ml_pixel_barrel_loose.lut"}
BooleanProperty m_useGPUseedExtraction {this, "UseGPUseedExtraction", true}
BooleanProperty m_useOldTunings {this, "UseOldTunings", false}
FloatProperty m_tau_ratio_cut {this, "tau_ratio_cut", 0.007}
float m_phiSliceWidth = 0.
std::unique_ptr< GNN_FasTrackConnectorm_connector = nullptr
std::vector< TrigInDetSiLayerm_layerGeometry
std::unique_ptr< const TrigFTF_GNN_Geometrym_geo = nullptr
std::vector< std::array< float, 5 > > m_mlLUT
std::unique_ptr< GNNR3_FasTrackConnectorm_connector = nullptr
std::unique_ptr< const TrigFTF_GNNR3_Geometrym_geo = nullptr

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 29 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

Member Typedef Documentation

◆ GNN_DataStorage

◆ GNN_Edge

◆ GNN_Node

◆ GNNR3_DataStorage

◆ GNNR3_Edge

◆ GNNR3_Node

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ SeedingToolBase() [1/2]

SeedingToolBase::SeedingToolBase ( const std::string & t,
const std::string & n,
const IInterface * p )
inline

Definition at line 31 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

31: AthAlgTool(t,n,p){}
AthAlgTool()
Default constructor:

◆ SeedingToolBase() [2/2]

SeedingToolBase::SeedingToolBase ( const std::string & t,
const std::string & n,
const IInterface * p )
inline

Definition at line 28 of file TrigInDetR3PattRecoTools/src/SeedingToolBase.h.

28: AthAlgTool(t,n,p){}

Member Function Documentation

◆ buildTheGraph() [1/2]

std::pair< int, int > SeedingToolBase::buildTheGraph ( const IRoiDescriptor & roi,
const std::unique_ptr< GNN_DataStorage > & storage,
std::vector< GNN_Edge > & edgeStorage ) const
protected

Definition at line 98 of file TrigInDetPattRecoTools/src/SeedingToolBase.cxx.

98 {
99
100
101 struct GBTS_SlidingWindow {
102
103 GBTS_SlidingWindow() : m_first_it(0), m_deltaPhi(0.0), m_has_nodes(false), m_bin(nullptr) {};
104
105 unsigned int m_first_it;// sliding window position
106 float m_deltaPhi; // window half-width;
107 bool m_has_nodes; // active or not
108
109 const TrigFTF_GNN_EtaBin* m_bin;//associated eta bin
110 };
111
112 constexpr float M_2PI = 2.0*M_PI;
113
114 const float cut_dphi_max = m_LRTmode ? 0.07f : 0.012f;
115 const float cut_dcurv_max = m_LRTmode ? 0.015f : 0.001f;
116 const float cut_tau_ratio_max = m_LRTmode ? 0.015f : static_cast<float>(m_tau_ratio_cut);
117 const float min_z0 = m_LRTmode ? -600.0 : roi.zedMinus();
118 const float max_z0 = m_LRTmode ? 600.0 : roi.zedPlus();
119 const float min_deltaPhi = m_LRTmode ? 0.01f : 0.001f;
120 const float tau_ratio_precut = 0.009f;
121
122 const float maxOuterRadius = m_LRTmode ? 1050.0 : 550.0;
123
124 const float cut_zMinU = min_z0 + maxOuterRadius*roi.dzdrMinus();
125 const float cut_zMaxU = max_z0 + maxOuterRadius*roi.dzdrPlus();
126
127 constexpr float ptCoeff = 0.29997*1.9972/2.0;// ~0.3*B/2 - assuming nominal field of 2*T
128
129 float tripletPtMin = 0.8f*m_minPt;//correction due to limited pT resolution
130 const float pt_scale = 900.0f/m_minPt;//to re-scale original tunings done for the 900 MeV pT cut
131
132 float maxCurv = ptCoeff/tripletPtMin;
133
134 float maxKappa_high_eta = m_LRTmode ? 1.0f*maxCurv : std::sqrt(0.8f)*maxCurv;
135 float maxKappa_low_eta = m_LRTmode ? 1.0f*maxCurv : std::sqrt(0.6f)*maxCurv;
136
137 if(!m_useOldTunings && !m_LRTmode) {//new settings for curvature cuts
138 maxKappa_high_eta = 4.75e-4f*pt_scale;
139 maxKappa_low_eta = 3.75e-4f*pt_scale;
140 }
141
142 const float dphi_coeff = m_LRTmode ? 1.0f*maxCurv : 0.68f*maxCurv;
143
144 const float minDeltaRadius = 2.0;
145
146 float deltaPhi0 = 0.5f*m_phiSliceWidth;//the default sliding window along phi
147
148 unsigned int nConnections = 0;
149
150 edgeStorage.reserve(m_nMaxEdges);
151
152 int nEdges = 0;
153
154 float z0_histo_coeff = 16/(max_z0 - min_z0 + 1e-6);//assuming 16-bit z0 bitmask
155
156 for(const auto& bg : m_geo->bin_groups()) {//loop over bin groups
157
158 TrigFTF_GNN_EtaBin& B1 = storage->getEtaBin(bg.first);
159
160 if(B1.empty()) continue;
161
162 float rb1 = B1.getMinBinRadius();
163
164 const unsigned int lk1 = B1.m_layerKey;
165
166 //prepare a sliding window for each bin2 in the group
167
168 std::vector<GBTS_SlidingWindow> vSLW;
169
170 vSLW.resize(bg.second.size());//initialization using default ctor
171
172 int win_idx = 0;
173
174 for(const auto& b2_idx : bg.second) { //loop over n2 eta-bins in L2 layers
175
176 const TrigFTF_GNN_EtaBin& B2 = storage->getEtaBin(b2_idx);
177
178 if(B2.empty()) {
179 win_idx++;
180 continue;
181 }
182
183 float rb2 = B2.getMaxBinRadius();
184
185 float deltaPhi = deltaPhi0;//the default
186
187 if(m_useEtaBinning) { //override the default window width
188 float abs_dr = std::fabs(rb2-rb1);
189 if (m_useOldTunings) {
190 deltaPhi = min_deltaPhi + dphi_coeff*abs_dr;
191 }
192 else {
193 if(abs_dr < 60.0) {
194 deltaPhi = 0.002f + 4.33e-4f*pt_scale*abs_dr;
195 } else {
196 deltaPhi = 0.015f + 2.2e-4f*pt_scale*abs_dr;
197 }
198 }
199 }
200
201 vSLW[win_idx].m_bin = &B2;
202 vSLW[win_idx].m_has_nodes = true;
203 vSLW[win_idx].m_deltaPhi = deltaPhi;
204 win_idx++;
205 }
206
207 for(unsigned int n1Idx = 0;n1Idx<B1.m_vn.size();n1Idx++) {//in GBTSv3 the outer loop goes over n1 nodes in the Layer 1 bin
208
209 B1.m_vFirstEdge[n1Idx] = nEdges;//initialization using the top watermark of the edge storage
210
211 unsigned short num_created_edges = 0;//the counter for the incoming graph edges created for n1
212
213 bool is_connected = false;
214
215 std::array<unsigned char, 16> z0_histo = {};
216
217 const std::array<float, 5>& n1pars = B1.m_params[n1Idx];
218
219 float phi1 = n1pars[2];
220 float r1 = n1pars[3];
221 float z1 = n1pars[4];
222
223 for(unsigned int winIdx = 0; winIdx < vSLW.size(); winIdx++) {//the intermediate loop over sliding windows
224
225 GBTS_SlidingWindow& slw = vSLW[winIdx];
226
227 if (!slw.m_has_nodes) continue;
228
229 const TrigFTF_GNN_EtaBin& B2 = *slw.m_bin;
230
231 float deltaPhi = slw.m_deltaPhi;
232
233 //sliding window phi1 +/- deltaPhi
234
235 float minPhi = phi1 - deltaPhi;
236 float maxPhi = phi1 + deltaPhi;
237
238 for(unsigned int n2PhiIdx = slw.m_first_it; n2PhiIdx<B2.m_vPhiNodes.size();n2PhiIdx++) {//the inner loop over n2 nodes using sliding window
239
240 float phi2 = B2.m_vPhiNodes[n2PhiIdx].first;
241
242 if(phi2 < minPhi) {
243 slw.m_first_it = n2PhiIdx; //update the window position
244 continue;
245 }
246 if(phi2 > maxPhi) break; //break and go to the next window
247
248 unsigned int n2Idx = B2.m_vPhiNodes[n2PhiIdx].second;
249
250 unsigned short node_info = B2.m_vIsConnected[n2Idx];
251
252 if ((lk1 == 80000) && (node_info == 0) ) continue;//skip isolated nodes as their incoming edges lead to nowhere
253
254 unsigned int n2_first_edge = B2.m_vFirstEdge[n2Idx];
255 unsigned short n2_num_edges = B2.m_vNumEdges[n2Idx];
256 unsigned int n2_last_edge = n2_first_edge + n2_num_edges;
257
258 const std::array<float, 5>& n2pars = B2.m_params[n2Idx];
259
260 float r2 = n2pars[3];
261
262 float dr = r2 - r1;
263
264 if(dr < minDeltaRadius) {
265 continue;
266 }
267
268 float z2 = n2pars[4];
269
270 float dz = z2 - z1;
271 float tau = dz/dr;
272 float ftau = std::fabs(tau);
273 if (ftau > 36.0) {
274 continue;
275 }
276
277 if(ftau < n1pars[0]) continue;
278 if(ftau > n1pars[1]) continue;
279
280 if(ftau < n2pars[0]) continue;
281 if(ftau > n2pars[1]) continue;
282
283 float z0 = z1 - r1*tau;
284
285 if (lk1 == 80000) {//check against non-empty z0 histogram
286
287 if ( !check_z0_bitmask(node_info, z0, min_z0, z0_histo_coeff) ) {
288
289 continue;
290
291 }
292
293 }
294
295 if (m_doubletFilterRZ) {
296
297 if(z0 < min_z0 || z0 > max_z0) continue;
298
299 float zouter = z0 + maxOuterRadius*tau;
300
301 if(zouter < cut_zMinU || zouter > cut_zMaxU) continue;
302 }
303
304 float curv = (phi2-phi1)/dr;
305 float abs_curv = std::abs(curv);
306
307 if(ftau < 4.0) {//eta = 2.1
308 if(abs_curv > maxKappa_low_eta) {
309 continue;
310 }
311 }
312 else {
313 if(abs_curv > maxKappa_high_eta) {
314 continue;
315 }
316 }
317
318 float exp_eta = std::sqrt(1.f+tau*tau) - tau;
319
320 if (m_matchBeforeCreate && (lk1 == 80000 || lk1 == 81000) ) {//match edge candidate against edges incoming to n2
321
322 bool isGood = n2_num_edges <= 2;//we must have enough incoming edges to decide
323
324 if(!isGood) {
325
326 float uat_1 = 1.0f/exp_eta;
327
328 for(unsigned int n2_in_idx = n2_first_edge; n2_in_idx < n2_last_edge; n2_in_idx++) {
329
330 float tau2 = edgeStorage.at(n2_in_idx).m_p[0];
331 float tau_ratio = tau2*uat_1 - 1.0f;
332
333 if(std::fabs(tau_ratio) > tau_ratio_precut){//bad match
334 continue;
335 }
336 isGood = true;//good match found
337 break;
338 }
339 }
340
341 if(!isGood) {//no match found, skip creating [n1 <- n2] edge
342 continue;
343 }
344 }
345
346 float dPhi2 = curv*r2;
347 float dPhi1 = curv*r1;
348
349 if(nEdges < m_nMaxEdges) {
350
351 edgeStorage.emplace_back(B1.m_vn[n1Idx], B2.m_vn[n2Idx], exp_eta, curv, phi1 + dPhi1);
352
353 num_created_edges++;
354
355 int outEdgeIdx = nEdges;
356
357 float uat_2 = 1.f/exp_eta;
358 float Phi2 = phi2 + dPhi2;
359 float curv2 = curv;
360
361 for(unsigned int inEdgeIdx = n2_first_edge; inEdgeIdx < n2_last_edge; inEdgeIdx++) {//looking for neighbours of the new edge
362
363 TrigFTF_GNN_Edge* pS = &(edgeStorage.at(inEdgeIdx));
364
365 if(pS->m_nNei >= N_SEG_CONNS) continue;
366
367 float tau_ratio = pS->m_p[0]*uat_2 - 1.0f;
368
369 if(std::abs(tau_ratio) > cut_tau_ratio_max){//bad match
370 continue;
371 }
372
373 float dPhi = Phi2 - pS->m_p[2];
374
375 if(dPhi<-M_PI) dPhi += M_2PI;
376 else if(dPhi>M_PI) dPhi -= M_2PI;
377
378 if(std::abs(dPhi) > cut_dphi_max) {
379 continue;
380 }
381
382 float dcurv = curv2 - pS->m_p[1];
383
384 if(dcurv < -cut_dcurv_max || dcurv > cut_dcurv_max) {
385 continue;
386 }
387
388 pS->m_vNei[pS->m_nNei++] = outEdgeIdx;
389
390 is_connected = true;//there is at least one good match
391
392 //edge confirmed - update z0 histogram
393
394 int z0_bin_index = z0_histo_coeff*(z0 - min_z0);
395
396 ++z0_histo[z0_bin_index];
397
398 nConnections++;
399
400 }
401 nEdges++;
402 }
403 } //loop over n2 (outer) nodes inside a sliding window on n2 bin
404 } //loop over sliding windows associated with n2 bins
405
406 //updating the n1 node attributes
407
408 B1.m_vNumEdges[n1Idx] = num_created_edges;
409
410 if (is_connected) {
411
412 unsigned short z0_bitmask = 0x0;
413
414 for(unsigned int bIdx = 0; bIdx < 16; bIdx++) {
415
416 if (z0_histo[bIdx] == 0) continue;
417
418 z0_bitmask |= (1 << bIdx);
419 }
420
421 B1.m_vIsConnected[n1Idx] = z0_bitmask;//non-zero mask indicates that there is at least one connected edge
422 }
423
424 } //loop over n1 (inner) nodes
425 } //loop over bin groups: a single n1 bin and multiple n2 bins
426
427 if(nEdges >= m_nMaxEdges) {
428 ATH_MSG_WARNING("Maximum number of graph edges exceeded - possible efficiency loss "<< nEdges);
429 }
430
431 return std::make_pair(nEdges, nConnections);
432}
#define M_PI
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
#define ATH_MSG_WARNING(x)
#define M_2PI
#define N_SEG_CONNS
virtual double zedPlus() const =0
the zed and eta values at the most forward and most rear ends of the RoI
virtual double dzdrMinus() const =0
return the gradients
virtual double zedMinus() const =0
virtual double dzdrPlus() const =0
bool check_z0_bitmask(const unsigned short &, const float &, const float &, const float &) const
std::unique_ptr< const TrigFTF_GNN_Geometry > m_geo
unsigned int m_vNei[N_SEG_CONNS]
unsigned char m_nNei
std::vector< const TrigFTF_GNN_Node * > m_vn
float getMinBinRadius() const
std::vector< unsigned short > m_vIsConnected
float getMaxBinRadius() const
std::vector< unsigned int > m_vFirstEdge
std::vector< std::pair< float, unsigned int > > m_vPhiNodes
std::vector< std::array< float, 5 > > m_params
unsigned int m_layerKey
std::vector< unsigned short > m_vNumEdges
bool dPhi(const xAOD::TauJet &tau, const xAOD::CaloVertexedTopoCluster &cluster, float &out)
@ deltaPhi0
difference between the cluster phi (presampler) and the eta of the track extrapolated to the presampl...

◆ buildTheGraph() [2/2]

std::pair< int, int > SeedingToolBase::buildTheGraph ( const IRoiDescriptor & roi,
const std::unique_ptr< GNNR3_DataStorage > & storage,
std::vector< GNNR3_Edge > & edgeStorage ) const
protected

Definition at line 71 of file TrigInDetR3PattRecoTools/src/SeedingToolBase.cxx.

71 {
72
73 const float M_2PI = 2.0*M_PI;
74
75 const float cut_dphi_max = m_LRTmode ? 0.07 : 0.012;
76 const float cut_dcurv_max = m_LRTmode ? 0.015 : 0.001;
77 const float cut_tau_ratio_max = m_LRTmode ? 0.015 : 0.007;
78 const float min_z0 = m_LRTmode ? -600.0 : roi.zedMinus();
79 const float max_z0 = m_LRTmode ? 600.0 : roi.zedPlus();
80 const float min_deltaPhi = m_LRTmode ? 0.01f : 0.001f;
81
82 const float maxOuterRadius = m_LRTmode ? 1050.0 : 550.0;
83
84 const float cut_zMinU = min_z0 + maxOuterRadius*roi.dzdrMinus();
85 const float cut_zMaxU = max_z0 + maxOuterRadius*roi.dzdrPlus();
86
87 const float ptCoeff = 0.29997*1.9972/2.0;// ~0.3*B/2 - assuming nominal field of 2*T
88
89 float tripletPtMin = 0.8*m_minPt;//correction due to limited pT resolution
90
91 float maxCurv = ptCoeff/tripletPtMin;
92
93 const float maxKappa_high_eta = m_LRTmode ? 1.0*maxCurv : std::sqrt(0.8)*maxCurv;
94 const float maxKappa_low_eta = m_LRTmode ? 1.0*maxCurv : std::sqrt(0.6)*maxCurv;
95 const float dphi_coeff = m_LRTmode ? 1.0*maxCurv : 0.68*maxCurv;
96
97 const float minDeltaRadius = 2.0;
98
99 float deltaPhi = 0.5f*m_phiSliceWidth;//the default sliding window along phi
100
101 unsigned int nConnections = 0;
102
103 edgeStorage.reserve(m_nMaxEdges);
104
105 int nEdges = 0;
106
107 for(const auto& bg : m_geo->bin_groups()) {//loop over bin groups
108
109 TrigFTF_GNNR3_EtaBin& B1 = storage->getEtaBin(bg.first);
110
111 if(B1.empty()) continue;
112
113 float rb1 = B1.getMinBinRadius();
114
115 for(const auto& b2_idx : bg.second) {
116
117 const TrigFTF_GNNR3_EtaBin& B2 = storage->getEtaBin(b2_idx);
118
119 if(B2.empty()) continue;
120
121 float rb2 = B2.getMaxBinRadius();
122
123 if(m_useEtaBinning) {
124 deltaPhi = min_deltaPhi + dphi_coeff*std::fabs(rb2-rb1);
125 }
126
127 unsigned int first_it = 0;
128
129 for(unsigned int n1Idx = 0;n1Idx<B1.m_vn.size();n1Idx++) {//loop over nodes in Layer 1
130
131 std::vector<unsigned int>& v1In = B1.m_in[n1Idx];
132
133 if(v1In.size() >= MAX_SEG_PER_NODE) continue;
134
135 const std::array<float, 5>& n1pars = B1.m_params[n1Idx];
136
137 float phi1 = n1pars[2];
138 float r1 = n1pars[3];
139 float z1 = n1pars[4];
140
141 //sliding window phi1 +/- deltaPhi
142
143 float minPhi = phi1 - deltaPhi;
144 float maxPhi = phi1 + deltaPhi;
145
146 for(unsigned int n2PhiIdx = first_it; n2PhiIdx<B2.m_vPhiNodes.size();n2PhiIdx++) {//sliding window over nodes in Layer 2
147
148 float phi2 = B2.m_vPhiNodes[n2PhiIdx].first;
149
150 if(phi2 < minPhi) {
151 first_it = n2PhiIdx;
152 continue;
153 }
154 if(phi2 > maxPhi) break;
155
156 unsigned int n2Idx = B2.m_vPhiNodes[n2PhiIdx].second;
157
158 const std::vector<unsigned int>& v2In = B2.m_in[n2Idx];
159
160 if(v2In.size() >= MAX_SEG_PER_NODE) continue;
161
162 const std::array<float, 5>& n2pars = B2.m_params[n2Idx];
163
164 float r2 = n2pars[3];
165
166 float dr = r2 - r1;
167
168 if(dr < minDeltaRadius) {
169 continue;
170 }
171
172 float z2 = n2pars[4];
173
174 float dz = z2 - z1;
175 float tau = dz/dr;
176 float ftau = std::fabs(tau);
177 if (ftau > 36.0) {
178 continue;
179 }
180
181 if(ftau < n1pars[0]) continue;
182 if(ftau > n1pars[1]) continue;
183
184 if(ftau < n2pars[0]) continue;
185 if(ftau > n2pars[1]) continue;
186
187 if (m_doubletFilterRZ) {
188
189 float z0 = z1 - r1*tau;
190
191 if(z0 < min_z0 || z0 > max_z0) continue;
192
193 float zouter = z0 + maxOuterRadius*tau;
194
195 if(zouter < cut_zMinU || zouter > cut_zMaxU) continue;
196 }
197
198 float curv = (phi2-phi1)/dr;
199 float abs_curv = std::abs(curv);
200
201 if(ftau < 4.0) {//eta = 2.1
202 if(abs_curv > maxKappa_low_eta) {
203 continue;
204 }
205 }
206 else {
207 if(abs_curv > maxKappa_high_eta) {
208 continue;
209 }
210 }
211
212 float exp_eta = std::sqrt(1+tau*tau)-tau;
213
214 if (m_matchBeforeCreate) {//match edge candidate against edges incoming to n2
215
216 bool isGood = v2In.size() <= 2;//we must have enough incoming edges to decide
217
218 if(!isGood) {
219
220 float uat_1 = 1.0f/exp_eta;
221
222 for(const auto& n2_in_idx : v2In) {
223
224 float tau2 = edgeStorage.at(n2_in_idx).m_p[0];
225 float tau_ratio = tau2*uat_1 - 1.0f;
226
227 if(std::fabs(tau_ratio) > cut_tau_ratio_max){//bad match
228 continue;
229 }
230 isGood = true;//good match found
231 break;
232 }
233 }
234
235 if(!isGood) {//no match found, skip creating [n1 <- n2] edge
236 continue;
237 }
238 }
239
240 float dPhi2 = curv*r2;
241 float dPhi1 = curv*r1;
242
243 if(nEdges < m_nMaxEdges) {
244
245 edgeStorage.emplace_back(B1.m_vn[n1Idx], B2.m_vn[n2Idx], exp_eta, curv, phi1 + dPhi1);
246
247 if(v1In.size() < MAX_SEG_PER_NODE) v1In.push_back(nEdges);
248
249 int outEdgeIdx = nEdges;
250
251 float uat_2 = 1/exp_eta;
252 float Phi2 = phi2 + dPhi2;
253 float curv2 = curv;
254
255 for(const auto& inEdgeIdx : v2In) {//looking for neighbours of the new edge
256
257 TrigFTF_GNNR3_Edge* pS = &(edgeStorage.at(inEdgeIdx));
258
259 if(pS->m_nNei >= N_SEG_CONNS) continue;
260
261 float tau_ratio = pS->m_p[0]*uat_2 - 1.0f;
262
263 if(std::abs(tau_ratio) > cut_tau_ratio_max){//bad match
264 continue;
265 }
266
267 float dPhi = Phi2 - pS->m_p[2];
268
269 if(dPhi<-M_PI) dPhi += M_2PI;
270 else if(dPhi>M_PI) dPhi -= M_2PI;
271
272 if(dPhi < -cut_dphi_max || dPhi > cut_dphi_max) {
273 continue;
274 }
275
276 float dcurv = curv2 - pS->m_p[1];
277
278 if(dcurv < -cut_dcurv_max || dcurv > cut_dcurv_max) {
279 continue;
280 }
281
282 pS->m_vNei[pS->m_nNei++] = outEdgeIdx;
283
284 nConnections++;
285
286 }
287 nEdges++;
288 }
289 } //loop over n2 (outer) nodes
290 } //loop over n1 (inner) nodes
291 } //loop over bins in Layer 2
292 } //loop over bin groups
293
294 return std::make_pair(nEdges, nConnections);
295}
#define MAX_SEG_PER_NODE
unsigned int m_vNei[N_SEG_CONNS]
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

◆ check_z0_bitmask()

bool SeedingToolBase::check_z0_bitmask ( const unsigned short & z0_bitmask,
const float & z0,
const float & min_z0,
const float & z0_histo_coeff ) const
protected

Definition at line 752 of file TrigInDetPattRecoTools/src/SeedingToolBase.cxx.

752 {
753
754 if (z0_bitmask == 0) return true;
755
756 float dz = z0 - min_z0;
757 int z0_bin_index = z0_histo_coeff*dz;
758
759 if ((z0_bitmask >> z0_bin_index) & 1) return true;
760
761 //check adjacent bins as well
762
763 const float z0_resolution = 2.5;
764
765 float dzm = dz - z0_resolution;
766
767 int next_bin = z0_histo_coeff*dzm;
768
769 if (next_bin >= 0 && next_bin != z0_bin_index) {
770
771 if ((z0_bitmask >> next_bin) & 1) return true;
772
773 }
774
775 float dzp = dz + z0_resolution;
776
777 next_bin = z0_histo_coeff*dzp;
778
779 if (next_bin < 16 && next_bin != z0_bin_index) {
780
781 if ((z0_bitmask >> next_bin) & 1) return true;
782
783 }
784
785 return false;
786}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ estimate_curvature()

float SeedingToolBase::estimate_curvature ( const std::array< const GNN_Node *, 3 > & sps) const
protected

Definition at line 789 of file TrigInDetPattRecoTools/src/SeedingToolBase.cxx.

789 {
790
791 //conformal mapping with the center at the last spacepoint
792
793 float u[2], v[2];
794
795 float x0 = sps[2]->x();
796 float y0 = sps[2]->y();
797
798 float r0 = sps[2]->r();
799
800 float cosA = x0/r0;
801
802 float sinA = y0/r0;
803
804
805 for(unsigned int k=0;k<2;k++) {
806
807 float dx = sps[k]->x() - x0;
808
809 float dy = sps[k]->y() - y0;
810
811 float r2_inv = 1.0/(dx*dx+dy*dy);
812
813 float xn = dx*cosA + dy*sinA;
814
815 float yn =-dx*sinA + dy*cosA;
816
817 u[k] = xn*r2_inv;
818 v[k] = yn*r2_inv;
819 }
820
821 float du = u[0] - u[1];
822
823 if(du==0.0) return 0.0;
824
825 float A = (v[0] - v[1])/du;
826
827 float B = v[1] - A*u[1];
828
829 float R = std::sqrt(1 + A*A)/B; //signed radius in mm
830
831 return 1000.0/R; //inverse meters
832
833}
double R(const INavigable4Momentum *p1, const double v_eta, const double v_phi)
const double r0
electron radius{cm}
@ u
Enums for curvilinear frames.
Definition ParamDefs.h:77

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extractSeedsFromTheGraph()

void SeedingToolBase::extractSeedsFromTheGraph ( int maxLevel,
int nEdges,
int nHits,
std::vector< GNN_Edge > & edgeStorage,
std::vector< std::pair< float, std::vector< unsigned int > > > & vOutputSeeds ) const
protected

Definition at line 502 of file TrigInDetPattRecoTools/src/SeedingToolBase.cxx.

502 {
503
504 const float edge_mask_min_eta = 1.5;
505 const float hit_share_threshold = 0.49;
506 const float max_eta_for_seed_split = 0.6;
507 const float max_inv_rad_diff = 0.7e-2;//in inverse meters
508
509 int minLevel = 3;//a triplet + 2 confirmation
510
511 if(m_LRTmode) {
512 minLevel = 2;//a triplet + 1 confirmation
513 }
514
515 if(maxLevel < minLevel) return;
516
517 std::vector<GNN_Edge*> vSeeds;
518
519 vSeeds.reserve(nEdges/2);
520
521 for(int edgeIndex = 0; edgeIndex < nEdges; edgeIndex++) {
522
523 GNN_Edge* pS = &(edgeStorage.at(edgeIndex));
524
525 if(pS->m_level < minLevel) continue;
526
527 vSeeds.push_back(pS);
528 }
529
530 if(vSeeds.empty()) return;
531
532 std::sort(vSeeds.begin(), vSeeds.end(), GNN_Edge::CompareLevel());
533
534 //backtracking
535
536 std::vector<std::tuple<float, int, std::vector<const GNN_Node*>, int > > vSeedCandidates;
537
538 vSeedCandidates.reserve(vSeeds.size());
539
540 std::vector<std::pair<float, unsigned int> > vArgSort;
541
542 vArgSort.reserve(vSeeds.size());
543
544 unsigned int seed_counter = 0;
545
546 auto tFilter = std::make_unique<TrigFTF_GNN_TrackingFilter>(m_layerGeometry, edgeStorage);
547
548 for(auto pS : vSeeds) {
549
550 if(pS->m_level == -1) continue;
551
552 TrigFTF_GNN_EdgeState rs(false);
553
554 tFilter->followTrack(pS, rs);
555
556 if(!rs.m_initialized) {
557 continue;
558 }
559
560 if(static_cast<int>(rs.m_vs.size()) < minLevel) continue;
561
562 float seed_eta = std::abs(-std::log(pS->m_p[0]));
563
564 std::vector<const GNN_Node*> vN;
565
566 for(std::vector<GNN_Edge*>::reverse_iterator sIt=rs.m_vs.rbegin();sIt!=rs.m_vs.rend();++sIt) {
567
568 if (seed_eta > edge_mask_min_eta) {
569 (*sIt)->m_level = -1;//mark as collected
570 }
571
572 if(sIt == rs.m_vs.rbegin()) {
573 vN.push_back((*sIt)->m_n1);
574 }
575
576 vN.push_back((*sIt)->m_n2);
577
578 }
579
580 if(vN.size()<3) continue;
581
582 unsigned int orig_seed_size = vN.size();
583
584 float orig_seed_quality = -rs.m_J/orig_seed_size;
585
586 int seed_split_flag = (seed_eta < max_eta_for_seed_split) && (orig_seed_size <= 5) ? 1 : 0;
587
588 if (seed_split_flag == 1) {//split the seed by dropping spacepoints
589
590 std::array< std::array<const GNN_Node*, 3>, 3> triplets;//2 "drop-outs" and the original seed candidate
591
592 std::array<float, 3> inv_rads;//triplet parameter estimate
593
594 triplets[0] = {vN[0], vN[orig_seed_size/2], vN[orig_seed_size-1]};
595
596 std::vector<const GNN_Node*> drop_out1 = {vN.begin()+1, vN.end()}; //all but the first one
597
598 triplets[1] = {drop_out1[0], drop_out1[(orig_seed_size-1)/2], drop_out1[orig_seed_size-2]};
599
600 std::vector<const GNN_Node*> drop_out2;
601
602 drop_out2.reserve(orig_seed_size-1);
603
604 for(unsigned int k = 0; k < orig_seed_size; k++) {
605
606 if (k == orig_seed_size/2) continue;//drop the middle SP in the original seed
607
608 drop_out2.emplace_back(vN[k]);
609 }
610
611 triplets[2] = {drop_out2[0], drop_out2[(orig_seed_size-1)/2], drop_out2[orig_seed_size-2]};
612
613 for (unsigned int k = 0; k < inv_rads.size(); k++) {
614
615 inv_rads[k] = estimate_curvature(triplets[k]);
616
617 }
618
619 float diffs[3] = {std::abs(inv_rads[1] - inv_rads[0]), std::abs(inv_rads[2] - inv_rads[0]), std::abs(inv_rads[2] - inv_rads[1])};
620
621 bool confirmed = diffs[0] < max_inv_rad_diff && diffs[1] < max_inv_rad_diff && diffs[2] < max_inv_rad_diff;
622
623 if (confirmed) {
624 seed_split_flag = 0;//reset the flag
625 }
626
627 }
628
629 vSeedCandidates.emplace_back(orig_seed_quality, 0, vN, seed_split_flag);
630
631 vArgSort.emplace_back(orig_seed_quality, seed_counter);
632
633 ++seed_counter;
634
635 }
636
637 //clone removal code goes below ...
638
639 std::sort(vArgSort.begin(), vArgSort.end());
640
641 std::vector<int> H2T(nHits + 1, 0);//hit to track associations
642
643 int trackId = 0;
644
645
646 for(const auto& ags : vArgSort) {
647
648 const auto& seed = vSeedCandidates[ags.second];
649
650 trackId++;
651
652 for(const auto& h : std::get<2>(seed) ) {//loop over spacepoints indices
653
654 unsigned int hit_id = h->sp_idx() + 1;
655
656 int tid = H2T[hit_id];
657
658 if(tid == 0 || tid > trackId) {//unused hit or used by a lesser track
659
660 H2T[hit_id] = trackId;//overwrite
661
662 }
663 }
664 }
665
666 unsigned int trackIdx = 0;
667
668 for(const auto& ags : vArgSort) {
669
670 const auto& seed = std::get<2>(vSeedCandidates[ags.second]);
671
672 int nTotal = seed.size();
673
674 int nOther = 0;
675
676 int trackId = trackIdx + 1;
677
678 ++trackIdx;
679
680 for(const auto& h : seed ) {
681
682 unsigned int hit_id = h->sp_idx() + 1;
683
684 int tid = H2T[hit_id];
685
686 if(tid != trackId) {//taken by a better candidate
687 nOther++;
688 }
689 }
690
691 if (nOther > hit_share_threshold*nTotal) {
692 std::get<1>(vSeedCandidates[ags.second]) = -1;//reject
693 }
694
695 }
696
697 vOutputSeeds.reserve(vSeedCandidates.size());
698
699 //drop the clones and split seeds if need be
700
701 for (const auto& seed : vSeedCandidates) {
702
703 if (std::get<1>(seed) != 0) continue;//identified as a clone of a better candidate
704
705 const auto& vN = std::get<2>(seed);
706
707 if (std::get<3>(seed) == 0) {
708
709 //add seed to output
710
711 std::vector<unsigned int> vSpIdx;
712
713 vSpIdx.resize(vN.size());
714
715 for(unsigned int k = 0; k < vSpIdx.size(); k++) {
716 vSpIdx[k] = vN[k]->sp_idx();
717 }
718
719 vOutputSeeds.emplace_back(std::get<0>(seed), vSpIdx);
720
721 continue;
722
723 }
724
725 //seed split into "drop-out" seeds
726
727 unsigned int seedSize = vN.size();
728
729 std::array<std::size_t, 2> indices2drop = {0, seedSize / 2ul};//the first and the middle
730
731 for(const auto& skipIdx : indices2drop) {
732
733 std::vector<unsigned int> new_seed;
734
735 new_seed.reserve(seedSize-1);
736
737 for (unsigned int k = 0; k < seedSize; k++) {
738
739 if (k == skipIdx) continue;
740
741 new_seed.emplace_back(vN[k]->sp_idx());
742
743 }
744
745 vOutputSeeds.emplace_back(std::get<0>(seed), new_seed);
746
747 }
748 }
749
750}
static Double_t rs
static const uint32_t nHits
std::vector< TrigInDetSiLayer > m_layerGeometry
float estimate_curvature(const std::array< const GNN_Node *, 3 > &) const
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ finalize() [1/2]

StatusCode SeedingToolBase::finalize ( )
protectedvirtual

Reimplemented in Gbts2ActsSeedingTool, TrigInDetR3TrackSeedingTool, and TrigInDetTrackSeedingTool.

Definition at line 93 of file TrigInDetPattRecoTools/src/SeedingToolBase.cxx.

93 {
94 StatusCode sc = AthAlgTool::finalize();
95 return sc;
96}
static Double_t sc
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ finalize() [2/2]

virtual StatusCode SeedingToolBase::finalize ( )
protectedvirtual

◆ initialize() [1/2]

StatusCode SeedingToolBase::initialize ( )
protectedvirtual

Reimplemented in Gbts2ActsSeedingTool, TrigInDetR3TrackSeedingTool, and TrigInDetTrackSeedingTool.

Definition at line 24 of file TrigInDetPattRecoTools/src/SeedingToolBase.cxx.

24 {
25 ATH_CHECK(AthAlgTool::initialize());
26
27 ATH_CHECK(m_layerNumberTool.retrieve());
28
29
30 ATH_CHECK(detStore()->retrieve(m_atlasId, "AtlasID"));
31
32 ATH_CHECK(detStore()->retrieve(m_pixelId, "PixelID"));
33
34 ATH_CHECK(detStore()->retrieve(m_sctId, "SCT_ID"));
35
36 std::string conn_fileName = PathResolver::find_file(m_connectionFile, "DATAPATH");
37 if (conn_fileName.empty()) {
38 ATH_MSG_FATAL("Cannot find layer connections file " << conn_fileName);
39 return StatusCode::FAILURE;
40 }
41 else {
42
43 std::ifstream ifs(conn_fileName.c_str());
44
45 m_connector = std::make_unique<GNN_FASTRACK_CONNECTOR>(ifs, m_LRTmode);
46 if (m_etaBinOverride != 0.0f) {
47 m_connector->m_etaBin = m_etaBinOverride;
48 }
49
50 ATH_MSG_INFO("Layer connections are initialized from file " << conn_fileName);
51 }
52
53 const std::vector<TrigInDetSiLayer>* pVL = m_layerNumberTool->layerGeometry();
54
55 std::copy(pVL->begin(),pVL->end(), std::back_inserter(m_layerGeometry));
56
57 m_geo = std::make_unique<TrigFTF_GNN_Geometry>(m_layerGeometry, m_connector);
58
59
60 if (m_useML) {
61 std::string lut_fileName = PathResolver::find_file(m_lutFile, "DATAPATH");
62 if (lut_fileName.empty()) {
63 ATH_MSG_FATAL("Cannot find ML predictor LUT file " << lut_fileName);
64 return StatusCode::FAILURE;
65 }
66 else {
67 m_mlLUT.reserve(100);
68 std::ifstream ifs(lut_fileName.c_str());
69 while (!ifs.eof()) {
70 float cl_width, min1, max1, min2, max2;
71 ifs >> cl_width >> min1 >> max1 >> min2 >> max2;
72 if (ifs.eof()) break;
73 std::array<float, 5> lut_line = {cl_width, min1, max1, min2, max2};
74 m_mlLUT.emplace_back(lut_line);
75 }
76 ifs.close();
77 ATH_MSG_INFO("ML predictor is initialized from file " << lut_fileName<<" LUT has "<<m_mlLUT.size()<<" entries");
78 }
79 }
80
82
83 ATH_MSG_INFO("SeedingToolBase initialized ");
84
85 ATH_MSG_DEBUG("Property useML "<< m_useML);
86 ATH_MSG_DEBUG("Property DoPhiFiltering "<<m_filter_phi);
87 ATH_MSG_DEBUG("Property pTmin "<<m_minPt);
88 ATH_MSG_DEBUG("Property LRTmode "<<m_LRTmode);
89
90 return StatusCode::SUCCESS;
91}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
const ServiceHandle< StoreGateSvc > & detStore() const
static std::string find_file(const std::string &logical_file_name, const std::string &search_path)
ToolHandle< ITrigL2LayerNumberTool > m_layerNumberTool
std::vector< std::array< float, 5 > > m_mlLUT
std::unique_ptr< GNN_FasTrackConnector > m_connector

◆ initialize() [2/2]

virtual StatusCode SeedingToolBase::initialize ( )
protectedvirtual

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ runCCA() [1/2]

int SeedingToolBase::runCCA ( int nEdges,
std::vector< GNN_Edge > & edgeStorage ) const
protected

Definition at line 434 of file TrigInDetPattRecoTools/src/SeedingToolBase.cxx.

434 {
435
436 constexpr int maxIter = 15;
437
438 int maxLevel = 0;
439
440 int iter = 0;
441
442 std::vector<TrigFTF_GNN_Edge*> v_old;
443
444 for(int edgeIndex=0;edgeIndex<nEdges;edgeIndex++) {
445
446 TrigFTF_GNN_Edge* pS = &(edgeStorage[edgeIndex]);
447 if(pS->m_nNei == 0) continue;
448
449 v_old.push_back(pS);//TO-DO: increment level for segments as they already have at least one neighbour
450 }
451
452 std::vector<TrigFTF_GNN_Edge*> v_new;
453 v_new.reserve(v_old.size());
454
455 for(;iter<maxIter;iter++) {
456
457 //generate proposals
458 v_new.clear();
459
460 for(auto pS : v_old) {
461
462 int next_level = pS->m_level;
463
464 for(int nIdx=0;nIdx<pS->m_nNei;nIdx++) {
465
466 unsigned int nextEdgeIdx = pS->m_vNei[nIdx];
467
468 TrigFTF_GNN_Edge* pN = &(edgeStorage[nextEdgeIdx]);
469
470 if(pS->m_level == pN->m_level) {
471 next_level = pS->m_level + 1;
472 v_new.push_back(pS);
473 break;
474 }
475 }
476
477 pS->m_next = next_level;//proposal
478 }
479
480 //update
481
482 int nChanges = 0;
483
484 for(auto pS : v_new) {
485 if(pS->m_next != pS->m_level) {
486 nChanges++;
487 pS->m_level = pS->m_next;
488 if(maxLevel < pS->m_level) maxLevel = pS->m_level;
489 }
490 }
491
492 if(nChanges == 0) break;
493
494
495 v_old.swap(v_new);
496 v_new.clear();
497 }
498
499 return maxLevel;
500}

◆ runCCA() [2/2]

int SeedingToolBase::runCCA ( int nEdges,
std::vector< GNNR3_Edge > & edgeStorage ) const
protected

Definition at line 297 of file TrigInDetR3PattRecoTools/src/SeedingToolBase.cxx.

297 {
298
299 const int maxIter = 15;
300
301 int maxLevel = 0;
302
303 int iter = 0;
304
305 std::vector<TrigFTF_GNNR3_Edge*> v_old;
306
307 for(int edgeIndex=0;edgeIndex<nEdges;edgeIndex++) {
308
309 TrigFTF_GNNR3_Edge* pS = &(edgeStorage[edgeIndex]);
310 if(pS->m_nNei == 0) continue;
311
312 v_old.push_back(pS);//TO-DO: increment level for segments as they already have at least one neighbour
313 }
314
315 for(;iter<maxIter;iter++) {
316
317 //generate proposals
318 std::vector<TrigFTF_GNNR3_Edge*> v_new;
319 v_new.clear();
320 v_new.reserve(v_old.size());
321
322 for(auto pS : v_old) {
323
324 int next_level = pS->m_level;
325
326 for(int nIdx=0;nIdx<pS->m_nNei;nIdx++) {
327
328 unsigned int nextEdgeIdx = pS->m_vNei[nIdx];
329
330 TrigFTF_GNNR3_Edge* pN = &(edgeStorage[nextEdgeIdx]);
331
332 if(pS->m_level == pN->m_level) {
333 next_level = pS->m_level + 1;
334 v_new.push_back(pS);
335 break;
336 }
337 }
338
339 pS->m_next = next_level;//proposal
340 }
341
342 //update
343
344 int nChanges = 0;
345
346 for(auto pS : v_new) {
347 if(pS->m_next != pS->m_level) {
348 nChanges++;
349 pS->m_level = pS->m_next;
350 if(maxLevel < pS->m_level) maxLevel = pS->m_level;
351 }
352 }
353
354 if(nChanges == 0) break;
355
356
357 v_old = std::move(v_new);
358 v_new.clear();
359 }
360
361 return maxLevel;
362}

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_atlasId

const AtlasDetectorID * SeedingToolBase::m_atlasId = nullptr
protected

Definition at line 54 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

◆ m_connectionFile

StringProperty SeedingToolBase::m_connectionFile {this, "ConnectionFileName", "binTables_ITK_RUN4.txt"}
protected

Definition at line 71 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

71{this, "ConnectionFileName", "binTables_ITK_RUN4.txt"};

◆ m_connector [1/2]

std::unique_ptr<GNN_FasTrackConnector> SeedingToolBase::m_connector = nullptr
protected

Definition at line 81 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

◆ m_connector [2/2]

std::unique_ptr<GNNR3_FasTrackConnector> SeedingToolBase::m_connector = nullptr
protected

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doubletFilterRZ

BooleanProperty SeedingToolBase::m_doubletFilterRZ {this, "Doublet_FilterRZ", true}
protected

Definition at line 64 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

64{this, "Doublet_FilterRZ", true};

◆ m_etaBinOverride

FloatProperty SeedingToolBase::m_etaBinOverride {this, "etaBin", 0.0f, "specify non-zero to override eta bin width from connection file (default 0.2 in createLinkingScheme.py)"}
protected

Definition at line 68 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

68{this, "etaBin", 0.0f, "specify non-zero to override eta bin width from connection file (default 0.2 in createLinkingScheme.py)"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_filter_phi

BooleanProperty SeedingToolBase::m_filter_phi {this, "DoPhiFiltering", true}
protected

Definition at line 58 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

58{this, "DoPhiFiltering", true};

◆ m_geo [1/2]

std::unique_ptr<const TrigFTF_GNN_Geometry> SeedingToolBase::m_geo = nullptr
protected

Definition at line 83 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

◆ m_geo [2/2]

std::unique_ptr<const TrigFTF_GNNR3_Geometry> SeedingToolBase::m_geo = nullptr
protected

◆ m_layerGeometry

std::vector< TrigInDetSiLayer > SeedingToolBase::m_layerGeometry
protected

Definition at line 82 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

◆ m_layerNumberTool

ToolHandle< ITrigL2LayerNumberTool > SeedingToolBase::m_layerNumberTool {this, "layerNumberTool", "TrigL2LayerNumberToolITk"}
protected

Definition at line 52 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

52{this, "layerNumberTool", "TrigL2LayerNumberToolITk"};

◆ m_LRTmode

BooleanProperty SeedingToolBase::m_LRTmode {this, "LRTMode",false}
protected

Definition at line 60 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

60{this, "LRTMode",false};

◆ m_lutFile

StringProperty SeedingToolBase::m_lutFile {this, "MLpredictorLutFileName", "gbts_ml_pixel_barrel_loose.lut"}
protected

Definition at line 72 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

72{this, "MLpredictorLutFileName", "gbts_ml_pixel_barrel_loose.lut"};

◆ m_matchBeforeCreate

BooleanProperty SeedingToolBase::m_matchBeforeCreate {this, "MatchBeforeCreate", true}
protected

Definition at line 66 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

66{this, "MatchBeforeCreate", true};

◆ m_minPt

FloatProperty SeedingToolBase::m_minPt {this, "pTmin", 1000.0}
protected

Definition at line 67 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

67{this, "pTmin", 1000.0};

◆ m_mlLUT

std::vector<std::array<float, 5> > SeedingToolBase::m_mlLUT
protected

Definition at line 84 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

◆ m_nBufferEdges

IntegerProperty SeedingToolBase::m_nBufferEdges {this, "BufferEdges", 200000}
protected

Definition at line 70 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

70{this, "BufferEdges", 200000};

◆ m_nMaxEdges

IntegerProperty SeedingToolBase::m_nMaxEdges {this, "MaxGraphEdges", 2000000}
protected

Definition at line 69 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

69{this, "MaxGraphEdges", 2000000};

◆ m_nMaxPhiSlice

UnsignedIntegerProperty SeedingToolBase::m_nMaxPhiSlice {this, "nMaxPhiSlice", 53}
protected

Definition at line 63 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

63{this, "nMaxPhiSlice", 53};

◆ m_phiSliceWidth

float SeedingToolBase::m_phiSliceWidth = 0.
protected

Definition at line 79 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

◆ m_pixelId

const PixelID * SeedingToolBase::m_pixelId = nullptr
protected

Definition at line 56 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

◆ m_sctId

const SCT_ID * SeedingToolBase::m_sctId = nullptr
protected

Definition at line 55 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

◆ m_tau_ratio_cut

FloatProperty SeedingToolBase::m_tau_ratio_cut {this, "tau_ratio_cut", 0.007}
protected

Definition at line 77 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

77{this, "tau_ratio_cut", 0.007};

◆ m_useBeamTilt

BooleanProperty SeedingToolBase::m_useBeamTilt {this, "UseBeamTilt", false}
protected

Definition at line 59 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

59{this, "UseBeamTilt", false};

◆ m_useEtaBinning

BooleanProperty SeedingToolBase::m_useEtaBinning {this, "UseEtaBinning", true}
protected

Definition at line 65 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

65{this, "UseEtaBinning", true};

◆ m_useGPUseedExtraction

BooleanProperty SeedingToolBase::m_useGPUseedExtraction {this, "UseGPUseedExtraction", true}
protected

Definition at line 74 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

74{this, "UseGPUseedExtraction", true};

◆ m_useML

BooleanProperty SeedingToolBase::m_useML {this, "useML", true}
protected

Definition at line 61 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

61{this, "useML", true};

◆ m_useOldTunings

BooleanProperty SeedingToolBase::m_useOldTunings {this, "UseOldTunings", false}
protected

Definition at line 75 of file TrigInDetPattRecoTools/src/SeedingToolBase.h.

75{this, "UseOldTunings", false};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: