ATLAS Offline Software
FPGATrackSimClusteringTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 #include <algorithm>
9 #include <cmath>
10 
11 
12 namespace{
13  //For deciding eta || phi columns in modules
14  constexpr unsigned int ETA = 1;
15  constexpr unsigned int PHI = 0;
16 }
17 
18 FPGATrackSimClusteringTool::FPGATrackSimClusteringTool(const std::string& algname, const std::string &name, const IInterface *ifc) :
19  base_class(algname, name, ifc)
20 {
21 }
22 
23 
25 {
26  for (int i = 0; i<header.nTowers(); i++)
27  {
28  // Retreive the hits from the tower
29  FPGATrackSimTowerInputHeader& tower = *header.getTower(i);
30  std::vector<FPGATrackSimHit> hits = tower.hits();
31 
32  std::vector<std::vector<FPGATrackSimHit>> hitsPerModule;
33  std::vector<FPGATrackSimCluster> towerClusters;
34  splitAndSortHits(hits, hitsPerModule);
35  SortedClustering(hitsPerModule, towerClusters);
36  normaliseClusters(towerClusters);
37 
38  //remove the old hits from the tower...
39  tower.clearHits();
40  tower.reserveHits(towerClusters.size());
41  clusters.clear();
42  clusters.reserve(towerClusters.size());
43  if(i > 1)
44  ATH_MSG_WARNING("more than one tower, m_clusters is only going to contain those from the last one");
45  unsigned cluster_count = 0;
46  for ( auto &cluster: towerClusters){
47  FPGATrackSimHit cluster_as_FPGATrackSimhit = cluster.getClusterEquiv();
48  cluster_as_FPGATrackSimhit.setHitType(HitType::clustered);
49  cluster_as_FPGATrackSimhit.setParentageMask(cluster_count); // making use of unused m_parentageMask to keep track of cluster index
50  tower.addHit(cluster_as_FPGATrackSimhit);
51  //send back a copy for monitoring and to check when writing out hits in each road
52  clusters.push_back(cluster);
53  cluster_count++;
54  }
55  }
56  ATH_MSG_DEBUG("Produced "<< clusters.size()<< " clusters");
57  return StatusCode::SUCCESS;
58 }
59 
60 //Attempt to implement clustering using FPGATrackSim objects.
61 void FPGATrackSimClusteringTool::SortedClustering(const std::vector<std::vector<FPGATrackSimHit> >& sorted_hits, std::vector<FPGATrackSimCluster> &clusters) const {
62  std::vector<FPGATrackSimCluster> moduleClusters;
63  //Loop over the sorted modules that we have
64  for( auto& moduleHits:sorted_hits){
65  //Make the clusters for this module
66  Clustering(moduleHits, moduleClusters);
67  //Put these clusters into the output list
68  clusters.insert(clusters.end(), moduleClusters.begin(), moduleClusters.end());
69  //Clear the vector or this will get messy
70  moduleClusters.clear();
71  }
72 }
73 
74 void FPGATrackSimClusteringTool::Clustering(std::vector<FPGATrackSimHit> moduleHits, std::vector<FPGATrackSimCluster> &moduleClusters) const {
75  //To hold the current cluster vars for comparison
76  //loop over the hits that we have been passed for this module
77  for( auto& hit: moduleHits){
78  int is_clustered_hit =0;
79  // int nclustered =0;
80  //Loop over the clusters we have already made, check if this hit should be added to them?
81  for( auto& cluster: moduleClusters){
82  if(hit.isPixel()){
83  is_clustered_hit = FPGATrackSimCLUSTERING::updatePixelCluster(cluster, hit, false);
84  }
85  if(hit.isStrip()){
86  is_clustered_hit = FPGATrackSimCLUSTERING::updateStripCluster(cluster, hit, false);
87  }
88  }
89  //If it is the first hit or a not clustered hit, then start a new cluster and add it to the output vector
90  if((is_clustered_hit==0) or (moduleClusters.size()==0)){
91  FPGATrackSimCluster cluster;
92  if(hit.isPixel()){
93  is_clustered_hit = FPGATrackSimCLUSTERING::updatePixelCluster(cluster, hit, true);
94  } else if(hit.isStrip()){
95  is_clustered_hit = FPGATrackSimCLUSTERING::updateStripCluster(cluster, hit, true);
96  }
97  //Put this cluster into the output hits. Will update it in place.
98  moduleClusters.push_back(cluster);
99  }
100  }
101 }
102 
103 void FPGATrackSimClusteringTool::splitAndSortHits(std::vector<FPGATrackSimHit> &hits, std::vector<std::vector<FPGATrackSimHit> > &hitsPerModule, int &eta_phi) const {
104  splitHitsToModules(hits, hitsPerModule);
105  sortHitsOnModules(hitsPerModule, eta_phi);
106 }
107 
108 void FPGATrackSimClusteringTool::splitAndSortHits(std::vector<FPGATrackSimHit> &hits, std::vector<std::vector<FPGATrackSimHit> > &hitsPerModule) const{
109  splitHitsToModules(hits, hitsPerModule);
110  sortHitsOnModules(hitsPerModule);
111 }
112 
113 /*Temporarilly sort the hits into module by module packets
114  */
115 void FPGATrackSimClusteringTool::splitHitsToModules(std::vector<FPGATrackSimHit> &hits, std::vector<std::vector<FPGATrackSimHit> > &hitsPerModule) const{
116  //To hold the current module
117  std::vector<FPGATrackSimHit> currentModule;
118  uint hashing = 0;
119  //Split the incoming hits into hits by module
120  for ( auto& hit:hits){
121  if(hashing == 0){
122  currentModule.push_back(hit);
123  hashing = hit.getIdentifierHash();
124  } else if (hit.getIdentifierHash() == hashing) {
125  currentModule.push_back(hit);
126  } else {
127  hitsPerModule.push_back(currentModule);
128  currentModule.clear();
129  hashing = hit.getIdentifierHash();
130  currentModule.push_back(hit);
131  }
132  }
133 
134  // Now push that last one
135  if (currentModule.size() > 0) hitsPerModule.push_back(currentModule);
136 }
137 
138 void FPGATrackSimClusteringTool::sortHitsOnModules(std::vector<std::vector<FPGATrackSimHit> > &hitsPerModule, int &eta_phi) const{
139  //Loop over the module separated hits
140  for ( auto& module:hitsPerModule){
141  //Work out if columns are ETA (1) || PHI (0)
142  if(etaOrPhi(module.at(0)) == true){
143  //Sort by ETA first
144  eta_phi = ETA;
145  if (module.size() > 1) std::stable_sort(module.begin(), module.end(), FPGATrackSimCLUSTERING::sortITkInputEta);
146  if (module.size() > 1) std::stable_sort(module.begin(), module.end(), FPGATrackSimCLUSTERING::sortITkInputPhi);
147  } else {
148  //Sort by PHI first
149  eta_phi = PHI;
150  if (module.size() > 1) std::stable_sort(module.begin(), module.end(), FPGATrackSimCLUSTERING::sortITkInputPhi);
151  if (module.size() > 1) std::stable_sort(module.begin(), module.end(), FPGATrackSimCLUSTERING::sortITkInputEta);
152  }
153  }
154 }
155 
156 void FPGATrackSimClusteringTool::sortHitsOnModules(std::vector<std::vector<FPGATrackSimHit> > &hitsPerModule) const{
157  //Loop over the module separated hits
158  for ( auto& module:hitsPerModule){
159  if (module.size() > 1) std::stable_sort(module.begin(), module.end(), FPGATrackSimCLUSTERING::sortITkInputEta);
160  if (module.size() > 1) std::stable_sort(module.begin(), module.end(), FPGATrackSimCLUSTERING::sortITkInputPhi);
161  }
162 }
163 
164 
165 
166 //Need to remove the fpgatracksim::scaleHitFactor and normalise the widths
167 void FPGATrackSimClusteringTool::normaliseClusters(std::vector<FPGATrackSimCluster> &clusters) const {
168  for( auto &cluster:clusters){
169  //Grab the cluster equiv
170  FPGATrackSimHit clusterEquiv = cluster.getClusterEquiv();
171  //Update the clusterEquiv's position and width
172  if(clusterEquiv.isStrip()){
173  //Clear the groupsize, set this to be one as we are only clustering one row.
174  clusterEquiv.setEtaWidth(1);
175  clusterEquiv.setPhiCoord(clusterEquiv.getPhiCoord()/fpgatracksim::scaleHitFactor);
176  clusterEquiv.setPhiWidth(clusterEquiv.getPhiWidth()+1);
177  } else {
178  clusterEquiv.setEtaCoord(clusterEquiv.getEtaCoord()/fpgatracksim::scaleHitFactor);
179  clusterEquiv.setEtaWidth(clusterEquiv.getEtaWidth()+1);
180  clusterEquiv.setPhiCoord(clusterEquiv.getPhiCoord()/fpgatracksim::scaleHitFactor);
181  clusterEquiv.setPhiWidth(clusterEquiv.getPhiWidth()+1);
182  }
183  cluster.setClusterEquiv(clusterEquiv);
184  }
185 }
186 
187 
188 /*Function to work out if we need to sort by eta or phi first.
189  *Depends on the position and orientation of the module in the detector.
190  * Currently backwards engineered from the MC. Need to ask ITk people to confirm.
191  */
193 
194  /*This currently might get complicated as eta/phi ordering varies depending on the position in the detector.
195  * For ITK-20-00-00 Step 2.2 inclined duals layout, worked out by Naoki.
196  * Detector position | Module Type (# chip) | Column | Row |
197  * =============================================================================
198  * Barrel Layer 0 Eta module 1-6 | 2 (double) | eta | phi |
199  * Barrel Layer 0 Eta module 7-22 | 1 (single) | phi | eta |
200  * Barrel Layer 1 Eta module 1-6 | 3 (quad) | eta | phi |
201  * Barrel Layer 1 Eta module 7-19 | 3 | phi | eta |
202  * Barrel Layer 2 Eta module 1-11 | 3 | eta | phi |
203  * Barrel Layer 2 Eta module 12-22 | 2 | phi | eta |
204  * Barrel Layer 3 Eta module 1-12 | 3 | eta | phi |
205  * Barrel Layer 3 Eta module 13-25 | 2 | phi | eta |
206  * Barrel Layer 4 Eta module 1-13 | 3 | eta | phi |
207  * Barrel Layer 4 Eta module 14-26 | 2 | phi | eta |
208  * All Endcap modules | 3 | eta | phi |
209  * =============================================================================
210  * Module Type 1 = Single, 2, Dual, 3 Quad
211  * 328x400 blocks
212  * Hit type is essentially isPixel
213  * DetectorZone 0 = Barrel, -ive/+ive = endcaps
214  */
215 
216  //Check if the two hits are from the same module
217  //If it is not a barrel module then sort eta as column
219  return ETA;
220  }
221  //Otherwise it is a barrel module and now things get more complicated
222  else {
223  //Start by looking at what layer it is in
224  if (hit.getPhysLayer() == 0 || hit.getPhysLayer() == 1) {
225  if (hit.getEtaModule() <=6) {
226  return ETA;
227  } else {
228  return PHI;
229  }
230  } else if (hit.getPhysLayer() == 2) {
231  if (hit.getEtaModule() <=11) {
232  return ETA;
233  } else {
234  return PHI;
235  }
236  } else if (hit.getPhysLayer() == 3) {
237  if (hit.getEtaModule() <=12) {
238  return ETA;
239  } else {
240  return PHI;
241  }
242  } else if (hit.getPhysLayer() == 4) {
243  if (hit.getEtaModule() <=13) {
244  return ETA;
245  } else {
246  return PHI;
247  }
248  }
249  }
250  //Default to ETA, but shouldn't reach here
251  return ETA;
252 }
253 
254 
255 
256 void FPGATrackSimCLUSTERING::attachTruth(std::vector<FPGATrackSimHit> &hits){
257  for( auto& hit : hits) {
259  // record highest pt contribution to the combination (cluster
260  if(!hit.getTruth().isEmpty()) {
261  mt.add(hit.getTruth());
262  hit.setTruth(mt);
263  } else {
264  FPGATrackSimMultiTruth::Barcode uniquecode(hit.getEventIndex(), hit.getBarcode());
265  mt.maximize(uniquecode, hit.getBarcodePt());
266  hit.setTruth(mt);
267  }
268  }
269 } //record truth for each raw channel in the cluster
270 
271 /*
272  * This function is used in the FPGATrackSimClusteringTools to see if a new hit should be added to the current cluster under construction. It assumes double precision hits.
273  * It checks if the hit is in a number of positions w.r.t. the cluster being formed: up/right, down/right, above, right, or inside a cluster that has formed a horseshoe.
274  */
275 bool FPGATrackSimCLUSTERING::updatePixelCluster(FPGATrackSimCluster &currentCluster, FPGATrackSimHit &incomingHit, bool newCluster){
276 
277  if(newCluster){
278  FPGATrackSimHit newHit = incomingHit;
279  //Double the precision on the positions
280  //By doing this the hardware is able to handle clusters where the centre of the cluster is on a boundary between two clusters without needing a float
283  //Set the initial clusterEquiv to be the incoming hit with double precision
284  currentCluster.setClusterEquiv(newHit);
285  //Add the current hit to the list of hits
286  currentCluster.push_backHitList(incomingHit);
287  //It doesn't really matter, as we will be at the end of the hit loop, but we did technically "cluster" this hit
288  return true;
289  } else {
290  int hitRow = incomingHit.getEtaIndex();
291  int hitCol = incomingHit.getPhiIndex();
292 
293  FPGATrackSimHit clusterEquiv = currentCluster.getClusterEquiv();
294  int clusterRow = clusterEquiv.getEtaIndex();
295  int clusterRowWidth = clusterEquiv.getEtaWidth();
296  int clusterCol = clusterEquiv.getPhiIndex();
297  int clusterColWidth = clusterEquiv.getPhiWidth();
298 
299  //Looking for a neighbour in up/right position to the currentCluster
300  if((hitRow*fpgatracksim::scaleHitFactor == clusterRow+clusterRowWidth+fpgatracksim::scaleHitFactor) &&
301  (hitCol*fpgatracksim::scaleHitFactor == clusterCol+clusterColWidth+fpgatracksim::scaleHitFactor) ){
302  clusterRow++;
303  clusterRowWidth++;
304  clusterCol++;
305  clusterColWidth++;
306  FPGATrackSimCLUSTERING::updateClusterContents(currentCluster, clusterRow, clusterRowWidth, clusterCol, clusterColWidth, incomingHit);
307  return true;
308  }
309 
310  //Looking for a neighbour in down right
311  else if((hitRow*fpgatracksim::scaleHitFactor == clusterRow-clusterRowWidth-fpgatracksim::scaleHitFactor) && //because row then col sorted data, i.e. col sorted.
312  (hitCol*fpgatracksim::scaleHitFactor == clusterCol+clusterColWidth+fpgatracksim::scaleHitFactor) ){
313  clusterRow--; // important
314  clusterRowWidth++;
315  clusterCol++;
316  clusterColWidth++;
317  FPGATrackSimCLUSTERING::updateClusterContents(currentCluster, clusterRow, clusterRowWidth, clusterCol, clusterColWidth, incomingHit);
318  return true;
319  }
320 
321  //Looking for a neighbour above
322  else if((hitRow*fpgatracksim::scaleHitFactor == clusterRow+clusterRowWidth+fpgatracksim::scaleHitFactor) &&
323  (hitCol*fpgatracksim::scaleHitFactor == clusterCol+clusterColWidth) ){
324  clusterRow++;
325  clusterRowWidth++;
326  FPGATrackSimCLUSTERING::updateClusterContents(currentCluster, clusterRow, clusterRowWidth, clusterCol, clusterColWidth, incomingHit);
327  return true;
328  }
329 
330  //Looking for a neighbour to the right
331  else if(((hitRow*fpgatracksim::scaleHitFactor > clusterRow-clusterRowWidth-fpgatracksim::scaleHitFactor) && (hitRow*fpgatracksim::scaleHitFactor < clusterRow+clusterRowWidth+fpgatracksim::scaleHitFactor)) &&
332  (hitCol*fpgatracksim::scaleHitFactor == clusterCol+clusterColWidth+fpgatracksim::scaleHitFactor) ){
333  clusterCol++;
334  clusterColWidth++;
335  FPGATrackSimCLUSTERING::updateClusterContents(currentCluster, clusterRow, clusterRowWidth, clusterCol, clusterColWidth, incomingHit);
336  return true;
337  }
338 
339  //Checking for hits inside the box
340  else if((hitRow*fpgatracksim::scaleHitFactor > clusterRow-clusterRowWidth-fpgatracksim::scaleHitFactor) &&
341  (hitRow*fpgatracksim::scaleHitFactor < clusterRow+clusterRowWidth+fpgatracksim::scaleHitFactor) &&
342  (hitCol*fpgatracksim::scaleHitFactor < clusterCol+clusterColWidth+fpgatracksim::scaleHitFactor) ){
343  //We still want to do this as we are not changing the position of the cluster, but we are adding to its hitlist
344  FPGATrackSimCLUSTERING::updateClusterContents(currentCluster, clusterRow, clusterRowWidth, clusterCol, clusterColWidth, incomingHit);
345  return true;
346  }
347  //if we made it here then this cluster then start again
348  else return false;
349  }
350 }
351 
352 /*
353  * This function is used in the FPGATrackSimClusteringTools to see if a new hit should be added to the current cluster under construction. It assumes double precision hits.
354  * It checks if the hit is in a number of positions w.r.t. the cluster being formed: up/right, down/right, above, right, or inside a cluster that has formed a horseshoe.
355  */
356 bool FPGATrackSimCLUSTERING::updateStripCluster(FPGATrackSimCluster &currentCluster, FPGATrackSimHit &incomingHit, bool newCluster){
357 
358  // Shift initial widths 1->0, 2->2, 3->4, 4->6 etc...
359  //The groupSize is stored in the EtaWidth
361  // Now shift to pixel width equivalents, 0->0, 2->1, 4->2, 6->3 etc...
362  if(tempWidth > 0) tempWidth = tempWidth/fpgatracksim::scaleHitFactor;
363  if(newCluster){
364  FPGATrackSimHit newHit = incomingHit;
365  //Double the precision of the strip positions.
366  int tempCentroid = incomingHit.getPhiCoord()*fpgatracksim::scaleHitFactor;
367  // Now shift the centroid phi+phiWidth, and store the width (put it back in the PhiWidth)
368  newHit.setPhiCoord(tempCentroid+tempWidth);
369  newHit.setPhiWidth(tempWidth);
370  //Set the initial clusterEquiv to be the incoming hit with double precision
371  currentCluster.setClusterEquiv(newHit);
372  //Add the current hit to the list of hits
373  currentCluster.push_backHitList(incomingHit);
374  //It doesn't really matter, as we will be at the end of the hit loop, but we did technically "cluster" this hit
375  return true;
376  } else {
377  //Now get the --START-- of the new strip cluster
378  int hitRow = incomingHit.getEtaCoord();
379  int hitCol = incomingHit.getPhiCoord()*fpgatracksim::scaleHitFactor;
380 
381  FPGATrackSimHit clusterEquiv = currentCluster.getClusterEquiv();
382  int clusterRow = clusterEquiv.getEtaCoord();
383  int clusterRowWidth = clusterEquiv.getEtaWidth();
384  int clusterCol = clusterEquiv.getPhiCoord();
385  int clusterColWidth = clusterEquiv.getPhiWidth();
386 
387  //Looking for a neighbour to the right. i.e. find the end of the current cluster (Col+width) and look in the next cell (+2). Compare this to the start of the new cluster. This is unlikely/impossible(?) to happen due to preclustering.
388  if(hitCol == clusterCol+clusterColWidth+fpgatracksim::scaleHitFactor && hitRow == clusterRow) {
389  //The new centroid will be the original column position, minus its width, plus the new width
390  //So subtract the original width...
391  clusterCol = clusterCol - clusterColWidth;
392  //The new width will be the combination of the current widths, ++
393  clusterColWidth = clusterColWidth+tempWidth+1;
394  //And add on the new width
395  clusterCol = clusterCol + clusterColWidth;
396  FPGATrackSimCLUSTERING::updateClusterContents(currentCluster, clusterRow, clusterRowWidth, clusterCol, clusterColWidth, incomingHit);
397  return true;
398  } else return false;
399  }
400 }
401 
402 
403 void FPGATrackSimCLUSTERING::updateClusterContents(FPGATrackSimCluster &currentCluster, int &clusterRow, int &clusterRowWidth, int &clusterCol, int &clusterColWidth, FPGATrackSimHit &incomingHit) {
404  //Grab the cluster equiv
405  FPGATrackSimHit clusterEquiv = currentCluster.getClusterEquiv();
406 
407  //Update the clusterEquiv's position and width
408  clusterEquiv.setEtaIndex(clusterRow);
409  clusterEquiv.setEtaWidth(clusterRowWidth);
410  clusterEquiv.setPhiIndex(clusterCol);
411  clusterEquiv.setPhiWidth(clusterColWidth);
412 
413 
414  float xOld = clusterEquiv.getX();
415  float yOld = clusterEquiv.getY();
416  float zOld = clusterEquiv.getZ();
417  float xNew = incomingHit.getX();
418  float yNew = incomingHit.getY();
419  float zNew = incomingHit.getZ();
420  //As strips arrive pre-clustered, this is different for pixels/strips
421  if(incomingHit.isPixel()){
422  int n = currentCluster.getHitList().size();
423  // n+1 because that is old + new now
424  clusterEquiv.setX((xOld*n + xNew) / (n+1));
425  clusterEquiv.setY((yOld*n + yNew) / (n+1));
426  clusterEquiv.setZ((zOld*n + zNew) / (n+1));
427  } else {
428  //Phi width + 1 for the seed is the width of the current cluster
429  int N = currentCluster.getClusterEquiv().getPhiWidth()+1;
430  //Phi width of an incoming strip is the width of the cluster
431  int newN = incomingHit.getPhiWidth();
432  //Now as above, N+newN
433  clusterEquiv.setX((xOld*N + xNew*newN) / (N+newN));
434  clusterEquiv.setY((yOld*N + yNew*newN) / (N+newN));
435  clusterEquiv.setZ((zOld*N + zNew*newN) / (N+newN));
436  }
437  //Put it back
438  currentCluster.setClusterEquiv(clusterEquiv);
439 
440  //Pushback the hit into the hitlist
441  currentCluster.push_backHitList(incomingHit);
442 }
443 
444 /* Sort for the ordering of ITk modules: Sort by ETA.
445  */
447 {
448  return hitA.getEtaIndex() < hitB.getEtaIndex();
449 }
450 
451 /* Sort for the ordering of ITk modules: Sort by PHI.
452  */
454 {
455  return hitA.getPhiIndex() < hitB.getPhiIndex();
456 }
457 
FPGATrackSimTowerInputHeader::clearHits
void clearHits()
Definition: FPGATrackSimTowerInputHeader.h:49
FPGATrackSimClusteringTool::sortHitsOnModules
void sortHitsOnModules(std::vector< std::vector< FPGATrackSimHit > > &hitsPerModule, int &eta_phi) const
Definition: FPGATrackSimClusteringTool.cxx:138
getMenu.algname
algname
Definition: getMenu.py:54
FPGATrackSimLogicalEventInputHeader
Definition: FPGATrackSimLogicalEventInputHeader.h:21
FPGATrackSimCluster::getHitList
hitVector const & getHitList() const
Definition: FPGATrackSimCluster.h:30
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
FPGATrackSimHit::isStrip
bool isStrip() const
Definition: FPGATrackSimHit.h:65
header
Definition: hcg.cxx:526
FPGATrackSimHit::getPhysLayer
unsigned getPhysLayer() const
Definition: FPGATrackSimHit.cxx:66
FPGATrackSimCLUSTERING::sortITkInputPhi
bool sortITkInputPhi(const FPGATrackSimHit &hitA, const FPGATrackSimHit &HitB)
Definition: FPGATrackSimClusteringTool.cxx:453
FPGATrackSimCLUSTERING::attachTruth
void attachTruth(std::vector< FPGATrackSimHit > &)
Definition: FPGATrackSimClusteringTool.cxx:256
FPGATrackSimCluster
Definition: FPGATrackSimCluster.h:24
FPGATrackSimHit::setEtaIndex
void setEtaIndex(unsigned v)
Definition: FPGATrackSimHit.h:103
FPGATrackSimCLUSTERING::updateStripCluster
bool updateStripCluster(FPGATrackSimCluster &currentCluster, FPGATrackSimHit &incomingHit, bool newCluster)
Definition: FPGATrackSimClusteringTool.cxx:356
FPGATrackSimTowerInputHeader::addHit
void addHit(FPGATrackSimHit s)
Definition: FPGATrackSimTowerInputHeader.h:48
FPGATrackSimHit::setPhiCoord
void setPhiCoord(float v)
Definition: FPGATrackSimHit.h:104
FPGATrackSimHit::getX
float getX() const
Definition: FPGATrackSimHit.h:130
FPGATrackSimHit::setEtaWidth
void setEtaWidth(unsigned v)
Definition: FPGATrackSimHit.h:78
FPGATrackSimMultiTruth.h
JetTiledMap::N
@ N
Definition: TiledEtaPhiMap.h:44
FPGATrackSimHit::getEtaModule
int getEtaModule() const
Definition: FPGATrackSimHit.h:87
RoiUtil::PHI
@ PHI
Definition: RoiSerialise.cxx:31
FPGATrackSimHit::setY
void setY(float v)
Definition: FPGATrackSimHit.h:128
FPGATrackSimCluster::setClusterEquiv
void setClusterEquiv(const FPGATrackSimHit &input)
Definition: FPGATrackSimCluster.h:35
FPGATrackSimConstants.h
FPGATrackSimCLUSTERING::updateClusterContents
void updateClusterContents(FPGATrackSimCluster &currentCluster, int &clusterRow, int &clusterRowWidth, int &clusterCol, int &clusterColWidth, FPGATrackSimHit &incomingHit)
Definition: FPGATrackSimClusteringTool.cxx:403
FPGATrackSimHit
Definition: FPGATrackSimHit.h:41
FPGATrackSimClusteringTool::etaOrPhi
bool etaOrPhi(const FPGATrackSimHit &hit) const
Definition: FPGATrackSimClusteringTool.cxx:192
FPGATrackSimHit::getPhiCoord
float getPhiCoord() const
Definition: FPGATrackSimHit.h:108
python.PyAthena.module
module
Definition: PyAthena.py:131
FPGATrackSimHit::setX
void setX(float v)
Definition: FPGATrackSimHit.h:127
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
FPGATrackSimHit::setPhiIndex
void setPhiIndex(unsigned v)
Definition: FPGATrackSimHit.h:102
FPGATrackSimHit::getPhiIndex
unsigned getPhiIndex() const
Definition: FPGATrackSimHit.h:106
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
FPGATrackSimMultiTruth::add
void add(const FPGATrackSimMultiTruth::Barcode &code, const FPGATrackSimMultiTruth::Weight &weight)
Definition: FPGATrackSimMultiTruth.cxx:22
FPGATrackSimHit::setEtaCoord
void setEtaCoord(float v)
Definition: FPGATrackSimHit.h:105
FPGATrackSimMultiTruth::Barcode
std::pair< unsigned long, unsigned long > Barcode
Definition: FPGATrackSimMultiTruth.h:49
FPGATrackSimClusteringTool::normaliseClusters
void normaliseClusters(std::vector< FPGATrackSimCluster > &clusters) const
Definition: FPGATrackSimClusteringTool.cxx:167
FPGATrackSimCLUSTERING::sortITkInputEta
bool sortITkInputEta(const FPGATrackSimHit &hitA, const FPGATrackSimHit &hitB)
Definition: FPGATrackSimClusteringTool.cxx:446
FPGATrackSimHit::getY
float getY() const
Definition: FPGATrackSimHit.h:131
FPGATrackSimHit::getEtaIndex
unsigned getEtaIndex() const
Definition: FPGATrackSimHit.h:107
FPGATrackSimHit::isPixel
bool isPixel() const
Definition: FPGATrackSimHit.h:64
FPGATrackSimClusteringTool::FPGATrackSimClusteringTool
FPGATrackSimClusteringTool(const std::string &, const std::string &, const IInterface *)
Definition: FPGATrackSimClusteringTool.cxx:18
FPGATrackSimHit::getZ
float getZ() const
Definition: FPGATrackSimHit.h:132
FPGATrackSimCLUSTERING::updatePixelCluster
bool updatePixelCluster(FPGATrackSimCluster &currentCluster, FPGATrackSimHit &incomingHit, bool newCluster)
Definition: FPGATrackSimClusteringTool.cxx:275
FPGATrackSimHit::getDetectorZone
DetectorZone getDetectorZone() const
Definition: FPGATrackSimHit.h:59
FPGATrackSimMultiTruth::maximize
void maximize(const FPGATrackSimMultiTruth::Barcode &code, const FPGATrackSimMultiTruth::Weight &weight)
Definition: FPGATrackSimMultiTruth.cxx:36
FPGATrackSimMultiTruth
Definition: FPGATrackSimMultiTruth.h:46
FPGATrackSimCluster::getClusterEquiv
FPGATrackSimHit const & getClusterEquiv() const
Definition: FPGATrackSimCluster.h:31
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
FPGATrackSimClusteringTool::SortedClustering
void SortedClustering(const std::vector< std::vector< FPGATrackSimHit > > &sorted_hits, std::vector< FPGATrackSimCluster > &) const
Definition: FPGATrackSimClusteringTool.cxx:61
HitType::clustered
@ clustered
FPGATrackSimHit::setPhiWidth
void setPhiWidth(unsigned v)
Definition: FPGATrackSimHit.h:79
RoiUtil::ETA
@ ETA
Definition: RoiSerialise.cxx:30
FPGATrackSimClusteringTool::splitAndSortHits
void splitAndSortHits(std::vector< FPGATrackSimHit > &hits, std::vector< std::vector< FPGATrackSimHit > > &hitsPerModule, int &eta_phi) const
Definition: FPGATrackSimClusteringTool.cxx:103
FPGATrackSimHit::getEtaCoord
float getEtaCoord() const
Definition: FPGATrackSimHit.h:109
FPGATrackSimHit::setZ
void setZ(float v)
Definition: FPGATrackSimHit.h:129
fpgatracksim::scaleHitFactor
constexpr float scaleHitFactor
Definition: FPGATrackSimConstants.h:18
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
FPGATrackSimClusteringTool::splitHitsToModules
void splitHitsToModules(std::vector< FPGATrackSimHit > &hits, std::vector< std::vector< FPGATrackSimHit > > &hitsPerModule) const
Definition: FPGATrackSimClusteringTool.cxx:115
FPGATrackSimTowerInputHeader::reserveHits
void reserveHits(size_t size)
Definition: FPGATrackSimTowerInputHeader.h:50
FPGATrackSimClusteringTool.h
RunTileMonitoring.clusters
clusters
Definition: RunTileMonitoring.py:133
DetectorZone::barrel
@ barrel
FPGATrackSimHit::getEtaWidth
unsigned getEtaWidth() const
Definition: FPGATrackSimHit.h:85
FPGATrackSimClusteringTool::DoClustering
virtual StatusCode DoClustering(FPGATrackSimLogicalEventInputHeader &, std::vector< FPGATrackSimCluster > &) const override
Definition: FPGATrackSimClusteringTool.cxx:24
FPGATrackSimTowerInputHeader::hits
const std::vector< FPGATrackSimHit > & hits() const
Definition: FPGATrackSimTowerInputHeader.h:46
FPGATrackSimHit::setParentageMask
void setParentageMask(unsigned long v)
Definition: FPGATrackSimHit.h:143
FPGATrackSimTowerInputHeader
Definition: FPGATrackSimTowerInputHeader.h:18
FPGATrackSimHit::getPhiWidth
unsigned getPhiWidth() const
Definition: FPGATrackSimHit.h:86
FPGATrackSimCluster::push_backHitList
void push_backHitList(const FPGATrackSimHit &input)
Definition: FPGATrackSimCluster.h:38
FPGATrackSimHit::setHitType
void setHitType(HitType type)
Definition: FPGATrackSimHit.h:54
FPGATrackSimClusteringTool::Clustering
void Clustering(std::vector< FPGATrackSimHit >, std::vector< FPGATrackSimCluster > &) const
Definition: FPGATrackSimClusteringTool.cxx:74