ATLAS Offline Software
TrigInDetTrackSeedingTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
13 
15 
17 
19 
20 #include "GNN_TrackingFilter.h"
21 
22 //for GPU offloading
23 
26 
28  const std::string& n,
29  const IInterface* p ) : SeedingToolBase(t,n,p)
30 {
31 
32 }
33 
35 
37 
38  ATH_CHECK(m_regsel_pix.retrieve());
39  ATH_CHECK(m_regsel_sct.retrieve());
40 
42 
43  if(m_useGPU) {//for GPU offloading
44  ATH_CHECK(m_accelSvc.retrieve());
45  ATH_CHECK(m_accelSvc->isReady());
46  }
47 
49  ATH_MSG_FATAL("Both usePixelSpacePoints and useSctSpacePoints set to False. At least one needs to be True");
50  return StatusCode::FAILURE;
51  }
52 
53  if (!m_useSctSpacePoints) ATH_MSG_INFO("Only using Pixel spacepoints => Pixel seeds only");
54 
55  if (!m_usePixelSpacePoints) ATH_MSG_INFO("Only using SCT spacepoints => Strip seeds only");
56 
57  if (m_usePixelSpacePoints && m_useSctSpacePoints) ATH_MSG_INFO("Using SCT and Pixel spacepoints");
58 
60 
62 
63  ATH_MSG_INFO("TrigInDetTrackSeedingTool initialized with " << m_useGPU);
64 
65  return StatusCode::SUCCESS;
66 }
67 
70 }
71 
72 
73 TrigInDetTrackSeedingResult TrigInDetTrackSeedingTool::findSeeds(const IRoiDescriptor& internalRoI, std::vector<TrigInDetTracklet>& output, const EventContext& ctx) const {
74 
76 
77  output.clear();
78 
80  const Amg::Vector3D &vertex = beamSpotHandle->beamPos();
81  float shift_x = vertex.x() - beamSpotHandle->beamTilt(0)*vertex.z();
82  float shift_y = vertex.y() - beamSpotHandle->beamTilt(1)*vertex.z();
83 
84  std::unique_ptr<GNN_DataStorage> storage = std::make_unique<GNN_DataStorage>(*m_geo);
85 
86  int nPixels = 0;
87  int nStrips = 0;
88 
89  const SpacePointContainer* sctSpacePointsContainer = nullptr;
90  const SpacePointContainer* pixelSpacePointsContainer = nullptr;
91 
92  std::map<short, std::vector<IdentifierHash> > detIdMap;//relates global detector layer ID to constituent detector elements
93 
94  if (m_useSctSpacePoints) {
95 
97 
98  if(!sctHandle.isValid()) {
99  ATH_MSG_WARNING("Invalid Strip Spacepoints handle: "<<sctHandle);
100  return seedStats;
101 
102  }
103 
104  sctSpacePointsContainer = sctHandle.ptr();
105 
106  std::vector<IdentifierHash> listOfSctIds;
107  m_regsel_sct->lookup(ctx)->HashIDList( internalRoI, listOfSctIds );
108 
109  const std::vector<short>* h2l = m_layerNumberTool->sctLayers();
110 
111  for(const auto& hashId : listOfSctIds) {
112 
113  short layerIndex = h2l->at(static_cast<int>(hashId));
114 
115  auto it = detIdMap.find(layerIndex);
116  if(it != detIdMap.end()) (*it).second.push_back(hashId);
117  else {
118  std::vector<IdentifierHash> v = {hashId};
119  detIdMap.insert(std::make_pair(layerIndex,v));
120  }
121  }
122  }
123 
124  if (m_usePixelSpacePoints) {
125 
127 
128  if(!pixHandle.isValid()) {
129  ATH_MSG_WARNING("Invalid Pixel Spacepoints handle: "<<pixHandle);
130  return seedStats;
131  }
132 
133  pixelSpacePointsContainer = pixHandle.ptr();
134 
135  std::vector<IdentifierHash> listOfPixIds;
136 
137  m_regsel_pix->lookup(ctx)->HashIDList( internalRoI, listOfPixIds );
138 
139  const std::vector<short>* h2l = m_layerNumberTool->pixelLayers();
140 
141  for(const auto& hashId : listOfPixIds) {
142 
143  short layerIndex = h2l->at(static_cast<int>(hashId));
144 
145  auto it = detIdMap.find(layerIndex);
146  if(it != detIdMap.end()) (*it).second.push_back(hashId);
147  else {
148  std::vector<IdentifierHash> v = {hashId};
149  detIdMap.insert(std::make_pair(layerIndex,v));
150  }
151  }
152  }
153 
154  if(!m_useGPU) {
155 
156  std::unique_ptr<GNN_DataStorage> storage = std::make_unique<GNN_DataStorage>(*m_geo);
157 
158  std::vector<const Trk::SpacePoint*> vSP;
159 
160  vSP.reserve(m_nMaxEdges);
161 
162  std::vector<std::vector<GNN_Node> > trigSpStorage[2];
163 
164  trigSpStorage[1].resize(m_layerNumberTool->sctLayers()->size());
165 
166  trigSpStorage[0].resize(m_layerNumberTool->pixelLayers()->size());
167 
168  for(const auto& lColl : detIdMap) {
169 
170  short layerIndex = lColl.first;
171 
172  int layerKey = m_geo->getTrigFTF_GNN_LayerByIndex(layerIndex)->m_layer.m_subdet;
173 
174  bool isPixel = layerKey > 20000;
175 
176  auto pCont = isPixel ? pixelSpacePointsContainer : sctSpacePointsContainer;
177 
178  int contIdx= isPixel ? 0 : 1;
179 
180  int nNewNodes = 0;
181 
182  for(const auto& idx : lColl.second) {
183 
184  std::vector<GNN_Node>& tmpColl = trigSpStorage[contIdx].at(static_cast<int>(idx));
185 
186  auto input_coll = pCont->indexFindPtr(idx);
187 
188  if(input_coll == nullptr) continue;
189 
190  createGraphNodes(input_coll, tmpColl, vSP, layerIndex, shift_x, shift_y);//TO-DO: if(m_useBeamTilt) SP full transform functor
191 
192  nNewNodes += (isPixel) ? storage->loadPixelGraphNodes(layerIndex, tmpColl, m_useML) : storage->loadStripGraphNodes(layerIndex, tmpColl);
193  }
194 
195  if(isPixel) nPixels += nNewNodes;
196  else nStrips += nNewNodes;
197  }
198 
199  seedStats.m_nPixelSPs = nPixels;
200  seedStats.m_nStripSPs = nStrips;
201 
202  storage->sortByPhi();
203  storage->initializeNodes(m_useML);
204  storage->generatePhiIndexing(1.5*m_phiSliceWidth);
205 
206  std::vector<GNN_Edge> edgeStorage;
207 
208  std::pair<int, int> graphStats = buildTheGraph(internalRoI, storage, edgeStorage);
209 
210  ATH_MSG_DEBUG("Created graph with "<<graphStats.first<<" edges and "<<graphStats.second<< " edge links");
211 
212  seedStats.m_nGraphEdges = graphStats.first;
213  seedStats.m_nEdgeLinks = graphStats.second;
214 
215  if(graphStats.second == 0) return seedStats;
216 
217  int maxLevel = runCCA(graphStats.first, edgeStorage);
218 
219  ATH_MSG_DEBUG("Reached Level "<<maxLevel<<" after GNN iterations");
220 
221  int minLevel = 3;//a triplet + 1 confirmation
222 
223  if(m_LRTmode) {
224  minLevel = 2;//a triplet
225  }
226 
227  if(maxLevel < minLevel) return seedStats;
228 
229  std::vector<GNN_Edge*> vSeeds;
230 
231  vSeeds.reserve(graphStats.first/2);
232 
233  for(int edgeIndex=0;edgeIndex<graphStats.first;edgeIndex++) {
234  GNN_Edge* pS = &(edgeStorage.at(edgeIndex));
235 
236  if(pS->m_level < minLevel) continue;
237 
238  vSeeds.push_back(pS);
239  }
240 
241  if(vSeeds.empty()) return seedStats;
242 
243  std::sort(vSeeds.begin(), vSeeds.end(), GNN_Edge::CompareLevel());
244 
245  //backtracking
246 
247  TrigFTF_GNN_TrackingFilter tFilter(m_layerGeometry, edgeStorage);
248 
249  output.reserve(vSeeds.size());
250 
251  for(auto pS : vSeeds) {
252 
253  if(pS->m_level == -1) continue;
254 
255  TrigFTF_GNN_EdgeState rs(false);
256 
257  tFilter.followTrack(pS, rs);
258 
259  if(!rs.m_initialized) {
260  continue;
261  }
262 
263  if(static_cast<int>(rs.m_vs.size()) < minLevel) continue;
264 
265  std::vector<const GNN_Node*> vN;
266 
267  for(std::vector<GNN_Edge*>::reverse_iterator sIt=rs.m_vs.rbegin();sIt!=rs.m_vs.rend();++sIt) {
268 
269  (*sIt)->m_level = -1;//mark as collected
270 
271  if(sIt == rs.m_vs.rbegin()) {
272  vN.push_back((*sIt)->m_n1);
273  }
274  vN.push_back((*sIt)->m_n2);
275  }
276 
277  if(vN.size()<3) continue;
278 
279  unsigned int lastIdx = output.size();
280  output.emplace_back(rs.m_J);
281 
282  for(const auto& n : vN) {
283  output[lastIdx].addSpacePoint(vSP[n->m_idx]);
284  }
285  }
286 
287  ATH_MSG_DEBUG("Found "<<output.size()<<" tracklets");
288  }
289  else {//GPU-accelerated graph building
290  //1. data export
291 
292  std::vector<const Trk::SpacePoint*> vSP;
293  std::vector<short> vL;
294 
295  vSP.reserve(TrigAccel::ITk::GBTS_MAX_NUMBER_SPACEPOINTS);
296  vL.reserve(TrigAccel::ITk::GBTS_MAX_NUMBER_SPACEPOINTS);
297 
298  std::unique_ptr<TrigAccel::DATA_EXPORT_BUFFER> dataBuffer = std::unique_ptr<TrigAccel::DATA_EXPORT_BUFFER>(new TrigAccel::DATA_EXPORT_BUFFER(5000));
299 
300  size_t dataTypeSize = sizeof(TrigAccel::ITk::GRAPH_MAKING_INPUT_DATA);
301  const size_t bufferOffset = 256;
302  size_t totalSize = bufferOffset+dataTypeSize;//make room for the header
303  if(!dataBuffer->fit(totalSize)) dataBuffer->reallocate(totalSize);
304 
305  TrigAccel::ITk::GRAPH_MAKING_INPUT_DATA* pJobData = reinterpret_cast<TrigAccel::ITk::GRAPH_MAKING_INPUT_DATA*>(dataBuffer->m_buffer + bufferOffset);
306 
307  unsigned int spIdx = 0;
308  int sp_offset = 0;
309  int nLayers = 0;
310  int MaxEtaBin = 0;
311  int nEtaBins = 0;
312 
313  for(const auto& lColl : detIdMap) {
314 
315  short layerIndex = lColl.first;
316 
317  const TrigFTF_GNN_Layer* pL = m_geo->getTrigFTF_GNN_LayerByIndex(layerIndex);
318 
319  int layerKey = pL->m_layer.m_subdet;
320 
321  bool isPixel = layerKey > 20000;
322  bool isBarrel = (pL->m_layer.m_type == 0);
323 
324  auto pCont = isPixel ? pixelSpacePointsContainer : sctSpacePointsContainer;
325 
326  pJobData->m_layerIdx[nLayers] = layerIndex;
327 
328  pJobData->m_layerInfo[4*nLayers ] = spIdx;//layerInfo.x
329  pJobData->m_layerInfo[4*nLayers + 2] = pL->num_bins();//layerInfo.z
330  pJobData->m_layerInfo[4*nLayers + 3] = pL->m_bins[0];//layerInfo.w
331 
332  pJobData->m_layerGeo[2*nLayers ] = pL->m_minEta;//layerGeo.x
333  pJobData->m_layerGeo[2*nLayers + 1] = pL->m_etaBin;//layerGeo.y
334 
335  nEtaBins += pL->m_bins.size();
336 
337  for(auto b : pL->m_bins) {
338  if(b > MaxEtaBin) MaxEtaBin = b;
339  }
340 
341  for(const auto& idx : lColl.second) {
342 
343  auto input_coll = pCont->indexFindPtr(idx);
344 
345  if(input_coll == nullptr) continue;
346 
347  for(const auto sp : *input_coll) {
348 
349  float cw = -1.0;
350 
351  const InDet::PixelCluster* pCL = dynamic_cast<const InDet::PixelCluster*>(sp->clusterList().first);
352  if(pCL != nullptr) {
353  cw = pCL->width().widthPhiRZ().y();
354  if(!isBarrel && m_useML) {
355  if(cw > 0.2) continue;
356  cw = -1.0;//set it to -1 so that it can be skipped later in the ML code on GPU
357  }
358  }
359 
360  vSP.emplace_back(sp);
361  vL.emplace_back(layerIndex);
362 
363  const auto& p = sp->globalPosition();
364 
365  float params[4] = {(float)(p.x() - shift_x), float(p.y() - shift_y), (float)(p.z()), cw};
366 
367  memcpy(&pJobData->m_params[sp_offset], &params[0], sizeof(params));
368 
369  sp_offset += 4;
370  spIdx++;
371  if(spIdx >= TrigAccel::ITk::GBTS_MAX_NUMBER_SPACEPOINTS) break;
372  }
373  if(spIdx >= TrigAccel::ITk::GBTS_MAX_NUMBER_SPACEPOINTS) break;
374  }
375 
376  pJobData->m_layerInfo[4*nLayers + 1] = spIdx;//layerInfo.y
377 
378  if (isPixel) nPixels += spIdx - pJobData->m_layerInfo[4*nLayers];
379  else nStrips += spIdx - pJobData->m_layerInfo[4*nLayers];
380 
381  nLayers++;
382  }
383 
384  if(spIdx == 0) return seedStats;
385 
386  pJobData->m_nSpacepoints = spIdx;
387  pJobData->m_nLayers = nLayers;
388  pJobData->m_nEtaBins = nEtaBins;
389  pJobData->m_maxEtaBin = MaxEtaBin;
390  pJobData->m_nMaxEdges = static_cast<unsigned int>(7*spIdx);
391 
392  //load bin pairs
393 
394  int pairIdx = 0;
395 
396  for(const auto& bg : m_geo->bin_groups()) {//loop over bin groups
397 
398  int bin1_idx = bg.first;
399 
400  for(const auto& bin2_idx : bg.second) {
401  pJobData->m_bin_pairs[2*pairIdx ] = bin1_idx;
402  pJobData->m_bin_pairs[2*pairIdx+1] = bin2_idx;
403  pairIdx++;
404  }
405  }
406 
407  pJobData->m_nBinPairs = pairIdx;
408 
409  //add algorithm parameters
410 
411  const float ptCoeff = 0.29997*1.9972/2.0;// ~0.3*B/2 - assuming nominal field of 2*T
412 
413  float tripletPtMin = 0.8*m_minPt;//correction due to limited pT resolution
414 
415  float maxCurv = ptCoeff/tripletPtMin;
416 
417  const float pt_scale = 900/m_minPt;
418 
419  const float min_deltaPhi_low_dr = 0.002*pt_scale;
420  const float dphi_coeff_low_dr = 4.33e-4*pt_scale;
421  const float min_deltaPhi = 0.015*pt_scale;
422  const float dphi_coeff = 2.2e-4*pt_scale;
423 
424  const float cut_dphi_max = m_LRTmode ? 0.07 : 0.012;
425  const float cut_dcurv_max = m_LRTmode ? 0.015 : 0.001;
426  const float cut_tau_ratio_max = m_LRTmode ? 0.015f : 0.01;
427  const float min_z0 = m_LRTmode ? -600.0 : internalRoI.zedMinus();
428  const float max_z0 = m_LRTmode ? 600.0 : internalRoI.zedPlus();
429 
430  const float maxOuterRadius = m_LRTmode ? 1050.0 : 550.0;
431  const float minDeltaRadius = 2.0;
432 
433  const float cut_zMinU = min_z0 + maxOuterRadius*internalRoI.dzdrMinus();
434  const float cut_zMaxU = max_z0 + maxOuterRadius*internalRoI.dzdrPlus();
435 
436  const float maxKappa = m_LRTmode ? 1.0*maxCurv : 0.9*maxCurv;
437 
438  pJobData->m_algo_params[0] = min_deltaPhi;
439  pJobData->m_algo_params[1] = dphi_coeff;
440  pJobData->m_algo_params[2] = min_deltaPhi_low_dr;
441  pJobData->m_algo_params[3] = dphi_coeff_low_dr;
442  pJobData->m_algo_params[4] = minDeltaRadius;
443  pJobData->m_algo_params[5] = min_z0;
444  pJobData->m_algo_params[6] = max_z0;
445  pJobData->m_algo_params[7] = maxOuterRadius;
446  pJobData->m_algo_params[8] = cut_zMinU;
447  pJobData->m_algo_params[9] = cut_zMaxU;
448  pJobData->m_algo_params[10] = maxKappa;
449  pJobData->m_algo_params[11] = cut_dphi_max;
450  pJobData->m_algo_params[12] = cut_dcurv_max;
451  pJobData->m_algo_params[13] = cut_tau_ratio_max;
452 
453  int minLevel = 3;//a triplet + 1 confirmation
454 
455  if(m_LRTmode) {
456  minLevel = 2;//a triplet
457  }
458 
459  pJobData->m_minLevel = minLevel;
460 
462 
463  seedStats.m_nPixelSPs = nPixels;
464  seedStats.m_nStripSPs = nStrips;
465 
466  ATH_MSG_DEBUG("Loaded "<<nPixels<< " Pixel Spacepoints and "<<nStrips<< " Strip SpacePoints");
467 
468  std::shared_ptr<TrigAccel::OffloadBuffer> pBuff = std::make_shared<TrigAccel::OffloadBuffer>(dataBuffer.get());
469 
470  std::unique_ptr<TrigAccel::Work> pWork = std::unique_ptr<TrigAccel::Work>(m_accelSvc->createWork(TrigAccel::InDetJobControlCode::RUN_GBTS, pBuff));
471 
472  if(!pWork) {
473  ATH_MSG_WARNING("Failed to create a work item for task "<<TrigAccel::InDetJobControlCode::RUN_GBTS);
474  return seedStats;
475  }
476 
477  bool workSuccess = pWork->run();
478  if(!workSuccess) {
479  ATH_MSG_WARNING("Work item failed to complete");
480  return seedStats;
481  }
482 
483  std::shared_ptr<TrigAccel::OffloadBuffer> pOutput = pWork->getOutput();
484 
486  TrigAccel::ITk::COMPRESSED_GRAPH* pGraph = &pGraphAndSeeds->m_CompressedGraph;
487  TrigAccel::ITk::OUTPUT_SEEDS* pSeeds = &pGraphAndSeeds->m_OutputSeeds;
488 
490  if(pSeeds->m_nSeeds == 0) return seedStats;
491  //converting tracklet into GBTS-CPU format
492  for(unsigned int seed=0; seed<pSeeds->m_nSeeds; seed++) {
493 
494  unsigned int lastIdx = output.size();
495  output.emplace_back(pSeeds->m_seedsArray[seed].m_Q);
496  for(int node=0; node<pSeeds->m_seedsArray[seed].m_size; node++) {
497  output[lastIdx].addSpacePoint(vSP[pSeeds->m_seedsArray[seed].m_nodes[node]]);
498  }
499  }
500  }
501  else {
502 
503  unsigned int nEdges = pGraph->m_nEdges;
504  unsigned int nMaxNei = pGraph->m_nMaxNeighbours;
505 
506  //populating the edgeStorage
507 
508  std::vector<GNN_Node> nodes;
509 
510  nodes.reserve(vSP.size());
511 
512  for(unsigned int idx = 0;idx < vSP.size(); idx++) {
513 
514  nodes.emplace_back(vL[idx]);
515 
516  const auto& pos = vSP[idx]->globalPosition();
517  float xs = pos.x() - shift_x;
518  float ys = pos.y() - shift_y;
519  float zs = pos.z();
520 
521  nodes[idx].m_x = xs;
522  nodes[idx].m_y = ys;
523  nodes[idx].m_z = zs;
524  nodes[idx].m_r = std::sqrt(xs*xs + ys*ys);
525 
526  nodes[idx].m_idx = idx;
527 
528  }
529 
530  std::vector<GNN_Edge> edgeStorage;
531 
532  std::pair<int, int> graphStats(0,0);
533 
534  edgeStorage.resize(nEdges);
535 
536  unsigned int edgeSize = nMaxNei + 1 + 2;//neigbours, num_neighbours, 2 nodes
537 
538  for(unsigned int idx=0;idx<nEdges;idx++) {
539  unsigned int pos = idx*edgeSize;
540 
541  int node1Idx = pGraph->m_graphArray[pos + TrigAccel::ITk::node1];
542  int node2Idx = pGraph->m_graphArray[pos + TrigAccel::ITk::node2];
543  int nNei = pGraph->m_graphArray[pos + TrigAccel::ITk::nNei];
544 
545  if(nNei > N_SEG_CONNS) nNei = N_SEG_CONNS;
546 
547  edgeStorage[idx].m_n1 = &nodes[node1Idx];
548  edgeStorage[idx].m_n2 = &nodes[node2Idx];
549  edgeStorage[idx].m_level = 1;
550  edgeStorage[idx].m_nNei = nNei;
551  for(int k=0;k<nNei;k++) {
552  edgeStorage[idx].m_vNei[k] = pGraph->m_graphArray[pos + TrigAccel::ITk::nei_idx_start + k];
553  }
554  }
555 
556  graphStats.first = nEdges;
557  graphStats.second = pGraph->m_nLinks;
558 
559  //run the rest of the GBTS workflow
560 
561  int maxLevel = runCCA(graphStats.first, edgeStorage);
562 
563  ATH_MSG_DEBUG("Reached Level "<<maxLevel<<" after GNN iterations");
564 
565  if(maxLevel < minLevel) return seedStats;
566 
567  std::vector<GNN_Edge*> vSeeds;
568 
569  vSeeds.reserve(graphStats.first/2);
570 
571  for(int edgeIndex=0;edgeIndex<graphStats.first;edgeIndex++) {
572  GNN_Edge* pS = &(edgeStorage.at(edgeIndex));
573 
574  if(pS->m_level < minLevel) continue;
575 
576  vSeeds.push_back(pS);
577  }
578 
579  if(vSeeds.empty()) return seedStats;
580 
581  std::sort(vSeeds.begin(), vSeeds.end(), GNN_Edge::CompareLevel());
582 
583  //backtracking
584 
585  TrigFTF_GNN_TrackingFilter tFilter(m_layerGeometry, edgeStorage);
586 
587  output.reserve(vSeeds.size());
588 
589  for(auto pS : vSeeds) {
590 
591  if(pS->m_level == -1) continue;
592 
593  TrigFTF_GNN_EdgeState rs(false);
594 
595  tFilter.followTrack(pS, rs);
596 
597  if(!rs.m_initialized) {
598  continue;
599  }
600 
601  if(static_cast<int>(rs.m_vs.size()) < minLevel) continue;
602 
603  std::vector<const GNN_Node*> vN;
604 
605  for(std::vector<GNN_Edge*>::reverse_iterator sIt=rs.m_vs.rbegin();sIt!=rs.m_vs.rend();++sIt) {
606 
607  (*sIt)->m_level = -1;//mark as collected
608 
609  if(sIt == rs.m_vs.rbegin()) {
610  vN.push_back((*sIt)->m_n1);
611  }
612  vN.push_back((*sIt)->m_n2);
613  }
614 
615  if(vN.size()<3) continue;
616 
617  unsigned int lastIdx = output.size();
618  output.emplace_back(rs.m_J);
619 
620  for(const auto& n : vN) {
621  output[lastIdx].addSpacePoint(vSP[n->m_idx]);
622  }
623  }
624  }
625  ATH_MSG_DEBUG("Found "<<output.size()<<" tracklets");
626  }
627  return seedStats;
628 }
629 
630 void TrigInDetTrackSeedingTool::createGraphNodes(const SpacePointCollection* spColl, std::vector<GNN_Node>& tmpColl, std::vector<const Trk::SpacePoint*>& vSP, unsigned short layer, float shift_x, float shift_y) const {
631 
632  tmpColl.resize(spColl->size(), GNN_Node(layer));//all nodes belong to the same layer
633 
634  int idx = 0;
635  int init_size = vSP.size();
636  for(const auto sp : *spColl) {
637  const auto& pos = sp->globalPosition();
638  vSP.emplace_back(sp);
639  float xs = pos.x() - shift_x;
640  float ys = pos.y() - shift_y;
641  float zs = pos.z();
642  tmpColl[idx].m_x = xs;
643  tmpColl[idx].m_y = ys;
644  tmpColl[idx].m_z = zs;
645  tmpColl[idx].m_r = std::sqrt(xs*xs + ys*ys);
646  tmpColl[idx].m_phi = std::atan2(ys,xs);
647  tmpColl[idx].m_idx = init_size + idx;
648 
649  const InDet::PixelCluster* pCL = dynamic_cast<const InDet::PixelCluster*>(sp->clusterList().first);
650  if(pCL != nullptr){
651  tmpColl[idx].m_pcw = pCL->width().z();
652  }
653 
654  idx++;
655  }
656 }
TrigInDetTrackSeedingTool::m_accelSvc
ServiceHandle< ITrigInDetAccelerationSvc > m_accelSvc
Definition: TrigInDetTrackSeedingTool.h:72
PixelID.h
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
SeedingToolBase::m_layerGeometry
std::vector< TrigInDetSiLayer > m_layerGeometry
Definition: TrigInDetPattRecoTools/src/SeedingToolBase.h:72
TrigAccel::ITk::GraphAndSeedsOutput::m_OutputSeeds
OUTPUT_SEEDS m_OutputSeeds
Definition: TrigITkAccelEDM.h:182
TrigInDetTrackSeedingResult::m_nStripSPs
int m_nStripSPs
Definition: TrigInDetTrackSeedingResult.h:12
TrigAccel::ITk::CompressedGraph::m_nEdges
unsigned int m_nEdges
Definition: TrigITkAccelEDM.h:157
IRegSelTool.h
TrigAccel::DataExportBuffer
Definition: DataExportBuffer.h:14
TrigAccel::ITk::GraphMakingInputData
Definition: TrigITkAccelEDM.h:126
TrigAccel::DataExportBuffer::fit
bool fit(size_t s)
Definition: DataExportBuffer.h:26
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
SeedingToolBase::initialize
virtual StatusCode initialize()
Definition: TrigInDetPattRecoTools/src/SeedingToolBase.cxx:19
TrigInDetTrackSeedingTool::m_useSctSpacePoints
BooleanProperty m_useSctSpacePoints
Definition: TrigInDetTrackSeedingTool.h:58
TrigFTF_GNN_Edge::CompareLevel
Definition: GNN_DataStorage.h:109
SeedingToolBase
Definition: TrigInDetPattRecoTools/src/SeedingToolBase.h:26
StandaloneBunchgroupHandler.bg
bg
Definition: StandaloneBunchgroupHandler.py:241
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TCS::KFMET::nEtaBins
constexpr unsigned nEtaBins
Definition: KalmanMETCorrectionConstants.h:18
TrigInDetTrackSeedingTool::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
Definition: TrigInDetTrackSeedingTool.h:55
TrigAccel::DataExportBuffer::reallocate
void reallocate(size_t s)
Definition: DataExportBuffer.h:30
PixelCluster.h
TrigAccel::ITk::GraphMakingInputData::m_layerIdx
int m_layerIdx[GBTS_MAX_SILICON_LAYERS]
Definition: TrigITkAccelEDM.h:133
TrigFTF_GNN_DataStorage::sortByPhi
void sortByPhi()
Definition: GNN_DataStorage.cxx:177
TrigAccel::Work::run
virtual bool run()=0
SG::ReadHandle< SpacePointContainer >
TrigAccel::ITk::OutputSeeds::m_nSeeds
unsigned int m_nSeeds
Definition: TrigITkAccelEDM.h:173
TrigFTF_GNN_EdgeState
Definition: GNN_TrackingFilter.h:11
SeedingToolBase::buildTheGraph
std::pair< int, int > buildTheGraph(const IRoiDescriptor &, const std::unique_ptr< GNN_DataStorage > &, std::vector< GNN_Edge > &) const
Definition: TrigInDetPattRecoTools/src/SeedingToolBase.cxx:71
InDet::SiWidth::widthPhiRZ
const Amg::Vector2D & widthPhiRZ() const
Definition: SiWidth.h:121
TrigInDetAccelCodes.h
SeedingToolBase::m_nMaxEdges
IntegerProperty m_nMaxEdges
Definition: TrigInDetPattRecoTools/src/SeedingToolBase.h:60
TrigAccel::Work::getOutput
virtual std::shared_ptr< OffloadBuffer > getOutput()=0
skel.it
it
Definition: skel.GENtoEVGEN.py:407
TrigFTF_GNN_Layer::m_bins
std::vector< int > m_bins
Definition: GNN_Geometry.h:31
TrigInDetTrackSeedingTool.h
TrigFTF_GNN_EdgeState::m_J
float m_J
Definition: GNN_TrackingFilter.h:31
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
TrigFTF_GNN_Node
Definition: GNN_DataStorage.h:18
IRoiDescriptor::dzdrMinus
virtual double dzdrMinus() const =0
return the gradients
TrigInDetTrackSeedingTool::m_usePixelSpacePoints
BooleanProperty m_usePixelSpacePoints
Definition: TrigInDetTrackSeedingTool.h:57
TrigAccel::RUN_GBTS
@ RUN_GBTS
Definition: TrigInDetAccelCodes.h:31
TrigInDetTrackSeedingTool::m_regsel_pix
ToolHandle< IRegSelTool > m_regsel_pix
region selector tools
Definition: TrigInDetTrackSeedingTool.h:66
TrigInDetTrackSeedingTool::m_useGPU
BooleanProperty m_useGPU
Definition: TrigInDetTrackSeedingTool.h:71
SpacePointContainer.h
TrigFTF_GNN_EdgeState::m_vs
std::vector< TrigFTF_GNN_Edge * > m_vs
Definition: GNN_TrackingFilter.h:33
IRoiDescriptor::dzdrPlus
virtual double dzdrPlus() const =0
TrigFTF_GNN_EdgeState::m_initialized
bool m_initialized
Definition: GNN_TrackingFilter.h:38
TrigAccel::ITk::GraphAndSeedsOutput
Definition: TrigITkAccelEDM.h:179
N_SEG_CONNS
#define N_SEG_CONNS
Definition: GNN_DataStorage.h:14
AtlasDetectorID.h
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
SeedingToolBase::m_useGPUseedExtraction
BooleanProperty m_useGPUseedExtraction
Definition: TrigInDetPattRecoTools/src/SeedingToolBase.h:64
TrigAccel::ITk::GraphAndSeedsOutput::m_CompressedGraph
COMPRESSED_GRAPH m_CompressedGraph
Definition: TrigITkAccelEDM.h:181
SpacePointCollection.h
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
SeedingToolBase::m_LRTmode
BooleanProperty m_LRTmode
Definition: TrigInDetPattRecoTools/src/SeedingToolBase.h:51
TrigFTF_GNN_Edge
Definition: GNN_DataStorage.h:106
TrigFTF_GNN_DataStorage::generatePhiIndexing
void generatePhiIndexing(float)
Definition: GNN_DataStorage.cxx:226
TrigAccel::ITk::GraphMakingInputData::m_nEtaBins
unsigned int m_nEtaBins
Definition: TrigITkAccelEDM.h:129
TrigInDetTrackSeedingTool::m_sctSpacePointsContainerKey
SG::ReadHandleKey< SpacePointContainer > m_sctSpacePointsContainerKey
Definition: TrigInDetTrackSeedingTool.h:61
TrigInDetTrackSeedingTool::m_regsel_sct
ToolHandle< IRegSelTool > m_regsel_sct
Definition: TrigInDetTrackSeedingTool.h:67
TrigAccel::ITk::GRAPH_MAKING_INPUT_DATA
struct TrigAccel::ITk::GraphMakingInputData GRAPH_MAKING_INPUT_DATA
TrigAccel::ITk::OutputSeeds::m_seedsArray
std::unique_ptr< Tracklet[]> m_seedsArray
Definition: TrigITkAccelEDM.h:175
TrigFTF_GNN_Edge::m_level
signed char m_level
Definition: GNN_DataStorage.h:128
SeedingToolBase::m_minPt
FloatProperty m_minPt
Definition: TrigInDetPattRecoTools/src/SeedingToolBase.h:58
TrigInDetTrackSeedingTool::initialize
virtual StatusCode initialize() override
Definition: TrigInDetTrackSeedingTool.cxx:34
beamspotman.n
n
Definition: beamspotman.py:729
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SpacePoint.h
IRoiDescriptor
Describes the API of the Region of Ineterest geometry.
Definition: IRoiDescriptor.h:23
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
TrigAccel::ITk::GraphMakingInputData::m_params
float m_params[4 *GBTS_MAX_NUMBER_SPACEPOINTS]
Definition: TrigITkAccelEDM.h:131
TrigFTF_GNN_Layer::m_layer
const TrigInDetSiLayer & m_layer
Definition: GNN_Geometry.h:30
TrigAccel::ITk::GraphMakingInputData::m_nSpacepoints
unsigned int m_nSpacepoints
Definition: TrigITkAccelEDM.h:129
SeedingToolBase::finalize
virtual StatusCode finalize()
Definition: TrigInDetPattRecoTools/src/SeedingToolBase.cxx:66
TrigAccel::ITk::GraphMakingInputData::m_minLevel
int m_minLevel
Definition: TrigITkAccelEDM.h:149
TrigAccel::ITk::CompressedGraph::m_nLinks
unsigned int m_nLinks
Definition: TrigITkAccelEDM.h:160
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
GNN_TrackingFilter.h
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
TrigAccel::ITk::GraphMakingInputData::m_maxEtaBin
unsigned int m_maxEtaBin
Definition: TrigITkAccelEDM.h:129
TrigFTF_GNN_Layer::m_etaBin
float m_etaBin
Definition: GNN_Geometry.h:37
TrigAccel::ITk::GraphMakingInputData::m_bin_pairs
int m_bin_pairs[2 *GBTS_MAX_ETA_BIN_PAIR]
Definition: TrigITkAccelEDM.h:145
TrigFTF_GNN_DataStorage::loadPixelGraphNodes
int loadPixelGraphNodes(short, const std::vector< TrigFTF_GNN_Node > &, bool)
Definition: GNN_DataStorage.cxx:104
TrigInDetTrackSeedingTool::findSeeds
virtual TrigInDetTrackSeedingResult findSeeds(const IRoiDescriptor &, std::vector< TrigInDetTracklet > &, const EventContext &) const override final
Definition: TrigInDetTrackSeedingTool.cxx:73
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
TrigInDetTrackSeedingTool::finalize
virtual StatusCode finalize() override
Definition: TrigInDetTrackSeedingTool.cxx:68
TrigFTF_GNN_Layer::m_minEta
float m_minEta
Definition: GNN_Geometry.h:37
TrigInDetSiLayer::m_type
int m_type
Definition: TrigInDetSiLayer.h:11
merge.output
output
Definition: merge.py:16
SeedingToolBase::m_layerNumberTool
ToolHandle< ITrigL2LayerNumberTool > m_layerNumberTool
Definition: TrigInDetPattRecoTools/src/SeedingToolBase.h:43
MuonGM::nStrips
int nStrips(const MuonGM::TgcReadoutElement &readoutEle, int layer)
Definition: MuonDetDescr/MuonGeoModelTest/src/GeoModelTgcTest.cxx:46
TrigAccel::ITk::GraphMakingInputData::m_layerInfo
int m_layerInfo[4 *GBTS_MAX_SILICON_LAYERS]
Definition: TrigITkAccelEDM.h:137
TrigFTF_GNN_DataStorage::initializeNodes
void initializeNodes(bool)
Definition: GNN_DataStorage.cxx:182
TrigAccel::ITk::GraphMakingInputData::m_nMaxEdges
unsigned int m_nMaxEdges
Definition: TrigITkAccelEDM.h:129
SeedingToolBase::m_geo
std::unique_ptr< const TrigFTF_GNN_Geometry > m_geo
Definition: TrigInDetPattRecoTools/src/SeedingToolBase.h:73
PathResolver.h
TrigInDetTrackSeedingTool::TrigInDetTrackSeedingTool
TrigInDetTrackSeedingTool(const std::string &, const std::string &, const IInterface *)
Definition: TrigInDetTrackSeedingTool.cxx:27
TrigFTF_GNN_Layer
Definition: GNN_Geometry.h:16
TrigInDetTrackSeedingResult::m_nPixelSPs
int m_nPixelSPs
Definition: TrigInDetTrackSeedingResult.h:10
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:76
TrigAccel::ITk::GraphMakingInputData::m_layerGeo
float m_layerGeo[2 *GBTS_MAX_SILICON_LAYERS]
Definition: TrigITkAccelEDM.h:141
SeedingToolBase::m_phiSliceWidth
float m_phiSliceWidth
Definition: TrigInDetPattRecoTools/src/SeedingToolBase.h:69
TrigInDetTrackSeedingTool::createGraphNodes
void createGraphNodes(const SpacePointCollection *, std::vector< GNN_Node > &, std::vector< const Trk::SpacePoint * > &, unsigned short, float, float) const
Definition: TrigInDetTrackSeedingTool.cxx:630
TrigInDetTrackSeedingResult
Definition: TrigInDetTrackSeedingResult.h:8
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
TrigAccel::ITk::GraphMakingInputData::m_nBinPairs
unsigned int m_nBinPairs
Definition: TrigITkAccelEDM.h:129
TrigInDetTrackSeedingResult::m_nGraphEdges
int m_nGraphEdges
Definition: TrigInDetTrackSeedingResult.h:12
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
TrigAccel::ITk::CompressedGraph::m_graphArray
std::unique_ptr< int[]> m_graphArray
Definition: TrigITkAccelEDM.h:161
TrigITkAccelEDM.h
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:16
TrigAccel::DataExportBuffer::m_buffer
char * m_buffer
Definition: DataExportBuffer.h:57
SG::ReadHandle::ptr
const_pointer_type ptr()
Dereference the pointer.
InDet::PixelCluster
Definition: InnerDetector/InDetRecEvent/InDetPrepRawData/InDetPrepRawData/PixelCluster.h:49
python.PyAthena.v
v
Definition: PyAthena.py:154
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
TrigAccel::ITk::GraphMakingInputData::m_useGPUseedExtraction
bool m_useGPUseedExtraction
Definition: TrigITkAccelEDM.h:151
InDet::SiCluster::width
const InDet::SiWidth & width() const
return width class reference
TrigAccel::OffloadBuffer::m_rawBuffer
unsigned char * m_rawBuffer
Definition: OffloadBuffer.h:39
TrigAccel::ITk::GraphMakingInputData::m_algo_params
float m_algo_params[32]
Definition: TrigITkAccelEDM.h:147
IRoiDescriptor::zedPlus
virtual double zedPlus() const =0
the zed and eta values at the most forward and most rear ends of the RoI
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TrigAccel::ITk::CompressedGraph
Definition: TrigITkAccelEDM.h:155
TrigFTF_GNN_Layer::num_bins
int num_bins() const
Definition: GNN_Geometry.h:26
SpacePointCollection
Definition: SpacePointCollection.h:40
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
python.LArCondContChannels.isBarrel
isBarrel
Definition: LArCondContChannels.py:659
TrigAccel::ITk::OutputSeeds
Definition: TrigITkAccelEDM.h:171
TrigFTF_GNN_DataStorage::loadStripGraphNodes
int loadStripGraphNodes(short, const std::vector< TrigFTF_GNN_Node > &)
Definition: GNN_DataStorage.cxx:142
TrigFTF_GNN_TrackingFilter::followTrack
void followTrack(TrigFTF_GNN_Edge *, TrigFTF_GNN_EdgeState &)
Definition: GNN_TrackingFilter.cxx:82
IRoiDescriptor::zedMinus
virtual double zedMinus() const =0
SeedingToolBase::m_useML
BooleanProperty m_useML
Definition: TrigInDetPattRecoTools/src/SeedingToolBase.h:52
TrigAccel::ITk::GraphMakingInputData::m_nLayers
unsigned int m_nLayers
Definition: TrigITkAccelEDM.h:129
python.copyTCTOutput.totalSize
totalSize
Definition: copyTCTOutput.py:92
SpacePointContainer
Definition: Tracking/TrkEvent/TrkSpacePoint/TrkSpacePoint/SpacePointContainer.h:29
TrigInDetTrackSeedingTool::m_pixelSpacePointsContainerKey
SG::ReadHandleKey< SpacePointContainer > m_pixelSpacePointsContainerKey
Definition: TrigInDetTrackSeedingTool.h:62
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
TrigAccel::ITk::CompressedGraph::m_nMaxNeighbours
unsigned int m_nMaxNeighbours
Definition: TrigITkAccelEDM.h:159
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
SeedingToolBase::runCCA
int runCCA(int, std::vector< GNN_Edge > &) const
Definition: TrigInDetPattRecoTools/src/SeedingToolBase.cxx:318
InDet::SiWidth::z
double z() const
Definition: SiWidth.h:131
node
Definition: node.h:21
TrigInDetSiLayer::m_subdet
int m_subdet
Definition: TrigInDetSiLayer.h:10
fitman.k
k
Definition: fitman.py:528
python.LArMinBiasAlgConfig.float
float
Definition: LArMinBiasAlgConfig.py:65
TrigInDetTrackSeedingResult::m_nEdgeLinks
int m_nEdgeLinks
Definition: TrigInDetTrackSeedingResult.h:12
TrigFTF_GNN_TrackingFilter
Definition: GNN_TrackingFilter.h:44