ATLAS Offline Software
TrackFitter.cxx
Go to the documentation of this file.
1 
2 // Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 
4 #include <algorithm>
5 #include <iostream>
6 #include <fstream>
7 #include <cmath>
8 
10 #include "GaudiKernel/MsgStream.h"
12 
13 
15 
16 
17 std::vector<FPGATrackSimTrack>::const_iterator getBestChi2(std::vector<FPGATrackSimTrack> const & tracks);
18 bool hasGoodFit(std::vector<FPGATrackSimTrack> const & track_cands, float minchi2);
19 
20 
22 // Constructor
24 
26  const std::vector<const FPGATrackSimFitConstantBank*>& droppedLayerbanks, bool guessingHits) :
27  AthMessaging (Athena::getMessageSvc(), "FPGATrackSimTrackFitter")
28 {
29  m_guessinghits = guessingHits;
30  m_nominalBank = nominalbank;
31 
32  if (!m_nominalBank) ATH_MSG_FATAL("Constant bank not set");
33  if (!m_guessinghits)
34  for (auto bank : droppedLayerbanks)
35  m_droppedLayerBanks.push_back(bank);
36 }
37 
38 
40 {
41  m_idbase = 0;
42  m_nfits = 0;
43  m_nfits_maj = 0;
44  m_nfits_maj_pix = 0;
45  m_nfits_maj_SCT = 0;
46  m_nfits_rec = 0;
47  m_nfits_addrec = 0;
48 }
49 
50 
52 // fitTracks
54 
55 
56 int TrackFitter::fitTracks(const std::vector<std::shared_ptr<const FPGATrackSimRoad>>& roads, std::vector<FPGATrackSimTrack>& tracks) {
57  resetCounters();
58  for (const std::shared_ptr<const FPGATrackSimRoad>& cur_road : roads) {
59  std::vector<FPGATrackSimTrack> t;
60  int isOK = fitTracks(cur_road, t);
61  if (isOK != FITTRACKS_OK) return isOK;
62  else tracks.insert(tracks.end(), t.begin(), t.end());
63  }
64  return FITTRACKS_OK;
65 }
66 
67 
74  int TrackFitter::fitTracks(const std::shared_ptr<const FPGATrackSimRoad> &road, std::vector<FPGATrackSimTrack>& tracks)
75 {
76  if (not road){
77  ATH_MSG_WARNING("road pointer is null in TrackFitter::fitTracks");
78  return FITTRACKS_BAD;
79  }
80 
82 
83  double y = 0.0;
84  double x = 0.0;
86  y = road->getY();
87  x = road->getX();
88  ATH_MSG_DEBUG("Attempting to fit Hough road with y = " << y << ", x = " << x << ", sector = " << road->getSector() << "and nhits = " << road->getNHits());
89  }
90 
91  int sector = 0;
92  if (!m_fitFromRoad) {
93  // Error checking
94  sector = road->getSector();
95  if (sector < 0) {
96  ATH_MSG_DEBUG("Bad sector " << sector);
97  return FITTRACKS_OK;
98  }
99  else if (sector >= m_nominalBank->getNSectors()) {
100  ATH_MSG_WARNING("Constants for sector " << sector << " don't exist");
101  return FITTRACKS_BAD;
102  }
103  else if (!m_nominalBank->getIsGood(sector)) {
104  ATH_MSG_WARNING("Constants for sector " << sector << " are not valid");
105  return FITTRACKS_BAD;
106  }
107  }
108 
109  // Get info on layers with missing hits
110  int nMissing;
111  bool missPixel;
112  bool missStrip;
113  layer_bitmask_t missing_mask;
114  layer_bitmask_t norecovery_mask; // mask to prevent majority in planes with multiple hits
115  getMissingInfo(*road, nMissing, missPixel, missStrip, missing_mask, norecovery_mask);
116  // Create a template track with common parameters filled already for initializing below
117  FPGATrackSimTrack temp;
118  if(!m_do2ndStage){
120  if (!m_fitFromRoad) temp.setFirstSectorID(road->getSector());
121  }
122  else{
124  if (!m_fitFromRoad) temp.setSecondSectorID(road->getSector());
125  }
127  temp.setBankID(-1); // TODO
128  temp.setPatternID(road->getPID());
129  temp.setHitMap(missing_mask);
130  temp.setNMissing(nMissing);
131  temp.setHoughX(x);
132  temp.setHoughY(y);
133  temp.setQOverPt(y);
136 
137  temp.setSubRegion(road->getSubRegion());
138  temp.setHoughXBin(road->getXBin());
139  temp.setHoughYBin(road->getYBin());
140 
141  temp.setBinIdx(road->getBinIdx());
142 
143  // Create a list of track candidates by taking all possible combinations of hits in road.
144  std::vector<FPGATrackSimTrack> track_cands;
145 
146  // This may not even need to be a class member. Create the vector of possible combinations.
147  std::vector<std::vector<int>> comboIndices = getComboIndices(road->getNHits_layer());
148  ATH_MSG_DEBUG("There are theoretically " << comboIndices.size() << " combinations to process for this road");
149  size_t nFits = 0;
150  for (size_t icomb = 0; icomb < comboIndices.size(); icomb++) {
151  FPGATrackSimTrack track_cand = makeTrackCandidate(*road, temp, comboIndices[icomb]);
152 
153  // Before we start, make sure this track candidate has not been marked as invalid
154  // due to combinatorics issues with spacepoints.
155  bool ok = track_cand.isValidCand();
156  if (!ok) {
157  continue;
158  }
159 
160  // If the "fit from road" flag is set, then just assign track chi2 and parameters from that.
161  if (!m_do2ndStage && m_fitFromRoad) {
162  // Then actually do it using the road values.
163  track_cand.setChi2(road->getFitChi2());
164  track_cand.setPars(road->getFitParams());
165  ATH_MSG_DEBUG("Assigned chi2 = " << track_cand.getChi2() << " and parameters from genscan tool");
166  ATH_MSG_DEBUG("Set q/pt = " << track_cand.getQOverPt());
167  ATH_MSG_DEBUG("Set d0 = " << track_cand.getD0());
168  ATH_MSG_DEBUG("Set z0 = " << track_cand.getZ0());
169  ATH_MSG_DEBUG("Set eta = " << track_cand.getEta());
170  ATH_MSG_DEBUG("Set phi = " << track_cand.getPhi());
171  } else {
172 
173  if (nMissing == 0 || m_guessinghits)
174  {
175  ok = m_nominalBank->linfit(sector, track_cand, m_do2ndStage);
176  }
177  else
178  {
179  unsigned int ic = 0; // this will be the leading coordinate with a missing hit
180  for (unsigned int ic = 0; ic < m_pmap->getNCoords(); ic++) {
181  if (!( (missing_mask >> ic) & 0x1)) break; // if we found one, stop
182  }
183  // banks are indexed by plane, not by coordinate
184  ok = m_droppedLayerBanks[m_pmap->getCoordLayer(ic)]->linfit(sector, track_cand, m_do2ndStage);
185  }
186 
187  if (!ok) {
188  continue;
189  }
190  track_cand.setOrigChi2(track_cand.getChi2());
191  if (getDoMissingHitsCheck()) {
192  if (track_cand.getNMissing() == 0) { // missing 0 hits, drop hits one at a time and refit!
193  for (unsigned icoord = 0; icoord < m_pmap->getNCoords(); icoord++) { // 9 coordinates to refit, nominally
194 
195  FPGATrackSimTrack newtrack = track_cand;
196  newtrack.setNMissing(1);
197  unsigned int bitmask = ( 1 << m_pmap->getNCoords() ) - 1; // all bits set to 1
198  bitmask &= ~(1 << icoord); // remove this coordinate
199  if (m_pmap->getDim(icoord) == 2) { // if we need to do two coordinates at once
200  bitmask &= ~(1 << (icoord+1)); // remove the next coordinate, too
201  newtrack.setNMissing(2);
202  }
203  newtrack.setHitMap(bitmask); // update bitmask
204  m_nominalBank->linfit(sector, newtrack, m_do2ndStage);
205  m_tracks_missinghits_track.push_back(newtrack);
206  if (m_pmap->getDim(icoord) == 2) {
207  icoord++; // skip 2nd of pixel coordinates so we don't do them twice
208  }
209  }
210  }
211  }
212  }
213  tracks.push_back(track_cand);
214 
215  // Enforce m_max_ncomb here, but only for the tracks that we actually fit.
216  // Let's see how often this warning fires.
217  nFits += 1;
218  if (nFits > (size_t)m_max_ncomb) {
219  ATH_MSG_WARNING("Reached " << m_max_ncomb << " fits when processing track combinations for single road, breaking");
220  }
221  }
222  ATH_MSG_DEBUG("Processed " << tracks.size() << " actual/valid tracks for this road");
223 
224  // Increment counters
225  m_nfits += nFits;
226  if (nMissing > 0)
227  {
228  m_nfits_maj += nFits;
229  if (missPixel) m_nfits_maj_pix += nFits;
230  if (missStrip) m_nfits_maj_SCT += nFits;
231  }
232 
233  // Do recovery fits
234  if (nMissing == 0) {
235  // In the case of m_do_majority > 1, we only do majority fits if ALL full fits fail the chi2 cut
236  if (m_do_majority == 1 || (m_do_majority > 1 && !hasGoodFit(tracks, m_Chi2Dof_recovery_min)))
237  {
238  for (FPGATrackSimTrack & t : tracks)
239  if (t.getChi2ndof() > m_Chi2Dof_recovery_min && t.getChi2ndof() < m_Chi2Dof_recovery_max){
240  double y(0);
241  if (road != nullptr && m_IdealCoordFitType != TrackCorrType::None)
242  y = road->getY();
243  t = recoverTrack(t, norecovery_mask, sector, y);
244 
245  }
246  }
247  }
248 
249  // Add truth info
250  for (FPGATrackSimTrack & t : tracks) {
251  compute_truth(t); // match the track to a geant particle using the channel-level geant info in the hit data.
252  }
253 
254  return FITTRACKS_OK;
255 }
256 
257 
259 // fitTracks core helper functions
261 
262 
263 // Given road, populates the supplied variables with info on which layers missed hits
264 void TrackFitter::getMissingInfo(const FPGATrackSimRoad & road, int & nMissing, bool & missPixel, bool & missStrip,
265  layer_bitmask_t & missing_mask, layer_bitmask_t & norecovery_mask)
266 {
267  nMissing = m_pmap->getNCoords(); // init with nCoords and decrement as we find misses
268  missPixel = false;
269  missStrip = false;
270  missing_mask = 0;
271  norecovery_mask = 0;
272  unsigned int wclayers = road.getWCLayers();
273  for (unsigned layer = 0; layer < m_pmap->getNLogiLayers(); layer++)
274  {
275  int nHits = road.getHits(layer).size();
276  if (nHits==0)
277  {
278  if (m_IdealCoordFitType == TrackCorrType::None && ((wclayers >> layer) & 1))
279  {
280  int ix = m_pmap->getCoordOffset(layer);
281  int iy = ix + 1;
282  if (m_pmap->isSCT(layer))
283  {
284  missing_mask |= 1 << ix;
285  nMissing -= 1;
286  }
287  else
288  {
289  missing_mask |= (1<<ix) | (1<<iy);
290  nMissing -= 2;
291  }
292  }
293  else
294  {
295  if (m_pmap->isSCT(layer)) missStrip = true;
296  else missPixel = true;
297  }
298  }
299  else if (!((wclayers >> layer) & 1)) { // we have a hit
300  int ix = m_pmap->getCoordOffset(layer);
301  int iy = ix + 1;
302  if (m_pmap->isSCT(layer))
303  {
304  missing_mask |= 1 << ix;
305  nMissing -= 1;
306  }
307  else
308  {
309  missing_mask |= (1<<ix) | (1<<iy);
310  nMissing -= 2;
311  }
312 
313  // set the mask to avoid recovery in crowded planes
314  if (m_norecovery_nhits != -1 && nHits > m_norecovery_nhits)
315  norecovery_mask |= (1<<layer);
316  }
317  }
318 }
319 
320 
321 
332 void TrackFitter::makeTrackCandidates(const FPGATrackSimRoad & road, const FPGATrackSimTrack & temp, std::vector<FPGATrackSimTrack>& track_cands)
333 {
334  std::vector<std::vector<int>> combs = getComboIndices(road.getNHits_layer());
335  track_cands.resize(combs.size(), temp);
336 
337  //get the WC hits:
338  layer_bitmask_t wcbits= road.getWCLayers();
339  for (size_t icomb = 0; icomb < combs.size(); icomb++)
340  {
341  //Need to set the ID and the hits size of this track
342  track_cands[icomb].setTrackID(m_idbase + icomb);
343  track_cands[icomb].setNLayers(m_pmap->getNLogiLayers());
344 
345  // If this is an idealized coordinate fit; keep references to the idealized radii.
346  track_cands[icomb].setIdealRadii(m_rmap->getAvgRadii(0));
347 
348  std::vector<int> const & hit_indices = m_comboIndices[icomb]; // size nLayers
349  for (unsigned layer = 0; layer < m_pmap->getNLogiLayers(); layer++)
350  {
351  if (hit_indices[layer] < 0) // Set a dummy hit if road has no hits in this layer
352  {
354  newhit.setLayer(layer);
355  newhit.setSection(0);
356  if (m_pmap->getDim(layer) == 2) newhit.setDetType(SiliconTech::pixel);
357  else newhit.setDetType(SiliconTech::strip);
358 
359  if (wcbits & (1 << layer ) ) {
361  newhit.setLayer(layer);
362  }
363 
364  track_cands[icomb].setFPGATrackSimHit(layer, newhit);
365  }
366  else
367  {
368  const std::shared_ptr<const FPGATrackSimHit> hit = road.getHits(layer)[hit_indices[layer]];
369  // If this is an outer spacepoint, and it is not the same as the inner spacepoint, reject it.
370  // Here we "reject" it by marking the candidate as "invalid", to be rejected later.
371  // That require another field on the track object, but it avoids having to change the sizes
372  // of arrays computed above.
373  if (hit->getHitType() == HitType::spacepoint && hit->getSide() == 1 && layer > 0) {
374  const FPGATrackSimHit inner_hit = track_cands[icomb].getFPGATrackSimHits().at(layer - 1);//avoid negative index
375  if ((hit->getX() != inner_hit.getX()) || (hit->getY() != inner_hit.getY()) || (hit->getZ() != inner_hit.getZ())) {
376  track_cands[icomb].setValidCand(false);
377  }
378  }
379  track_cands[icomb].setFPGATrackSimHit(layer, *hit);
380  }
381  }
382  }
383 
384  m_idbase += combs.size();
385 }
386 
387 // This is a version of the above that produces a single track candidate on demand.
388 FPGATrackSimTrack TrackFitter::makeTrackCandidate(const FPGATrackSimRoad & road, const FPGATrackSimTrack & temp, const std::vector<int>& hit_indices)
389 {
390  m_idbase += 1;
391 
392  FPGATrackSimTrack track_cand(temp);
393 
394  //get the WC hits:
395  layer_bitmask_t wcbits= road.getWCLayers();
396 
397  //Need to set the ID and the hits size of this track
398  track_cand.setTrackID(m_idbase);
399  track_cand.setNLayers(m_pmap->getNLogiLayers());
400 
401  // If this is an idealized coordinate fit; keep references to the idealized radii.
402  track_cand.setIdealRadii(m_rmap->getAvgRadii(0));
403 
404  for (unsigned layer = 0; layer < m_pmap->getNLogiLayers(); layer++)
405  {
406  if (hit_indices[layer] < 0) // Set a dummy hit if road has no hits in this layer
407  {
409  newhit.setLayer(layer);
410  newhit.setSection(0);
411  if (m_pmap->getDim(layer) == 2) newhit.setDetType(SiliconTech::pixel);
412  else newhit.setDetType(SiliconTech::strip);
413 
414  if (wcbits & (1 << layer ) ) {
416  newhit.setLayer(layer);
417  }
418 
419  track_cand.setFPGATrackSimHit(layer, newhit);
420  }
421  else
422  {
423  const std::shared_ptr<const FPGATrackSimHit> hit = road.getHits(layer)[hit_indices[layer]];
424  // If this is an outer spacepoint, and it is not the same as the inner spacepoint, reject it.
425  // Here we "reject" it by marking the candidate as "invalid", to be rejected later.
426  // That require another field on the track object, but it avoids having to change the sizes
427  // of arrays computed above.
428  if (hit->getHitType() == HitType::spacepoint && hit->getSide() == 1 && layer > 0) {
429  const FPGATrackSimHit inner_hit = track_cand.getFPGATrackSimHits().at(layer - 1);//avoid negative index
430  if ((hit->getX() != inner_hit.getX()) || (hit->getY() != inner_hit.getY()) || (hit->getZ() != inner_hit.getZ())) {
431  track_cand.setValidCand(false);
432  break;
433  }
434  }
435  track_cand.setFPGATrackSimHit(layer, *hit);
436  }
437  }
438 
439  return track_cand;
440 }
441 
450 {
451  m_nfits_rec += 1;
452 
453  std::vector<FPGATrackSimTrack> recovered_tracks(m_pmap->getNLogiLayers(),t); // start with the complete track in all layers
454 
455  float best_chi2ndof = t.getChi2ndof();
456  int best_i = -1;
457 
458  // Remove a hit from each layer and do a fit
459  for (unsigned layer = (m_require_first ? 1 : 0); layer < recovered_tracks.size(); ++layer)
460  {
461  // Skip planes with multiple hits
462  if (norecovery_mask & (1<<layer)) continue;
463  m_nfits_addrec += 1;
464  // Zero the cluster for the missing layer, make sure to set the number of dimensions for it
465 
467  newhit.setLayer(layer);
468  newhit.setSection(0);
470  recovered_tracks[layer].setFPGATrackSimHit(layer,newhit);
471  // Set the number of missing points and the related bitmask
472  int ix = m_pmap->getCoordOffset(layer);
473 
474  unsigned int missing_mask = t.getHitMap();
475  missing_mask &= ~(1 << ix);
476 
477  if (m_pmap->isPixel(layer)) missing_mask &= ~(1 << (ix + 1));
478 
479  recovered_tracks[layer].setHitMap(missing_mask);
480  recovered_tracks[layer].setNMissing(t.getNMissing() + m_pmap->getDim(layer));
481 
482  // reset the pt
483  recovered_tracks[layer].setQOverPt(qoverpt);
484  recovered_tracks[layer].setTrackCorrType(m_IdealCoordFitType);
485 
486 
487  // If not guessing do the fit using layer+1 since 1st set of constants are the 8/8
488  if (m_guessinghits) m_nominalBank->linfit(sector, recovered_tracks[layer], m_do2ndStage);
489  else m_droppedLayerBanks[layer]->linfit(sector, recovered_tracks[layer], m_do2ndStage);
490 
491 
492  // Check if the chi2ndof is better
493  if (recovered_tracks[layer].getChi2ndof() < best_chi2ndof)
494  {
495  best_chi2ndof = recovered_tracks[layer].getChi2ndof();
496  best_i = layer;
497  }
498  }
499 
500  if (best_i >= 0) {// a better track was found
501  return recovered_tracks[best_i];
502  } else
503  return t;
504 }
505 
506 
507 
508 
509 // compute the best geant match, the barcode with the largest number of hits contributing to the track,
510 // and store in the track.
512 {
513  std::vector<FPGATrackSimMultiTruth> mtv;
514 
515  for (unsigned layer = 0; layer < m_pmap->getNLogiLayers(); layer++)
516  {
517  if (t.getHitMap() & (1 << m_pmap->getCoordOffset(layer))) continue; // no hit in this plane
518  //Sanity check that we have enough hits.
519  if (layer < t.getFPGATrackSimHits().size()) mtv.push_back(t.getFPGATrackSimHits().at(layer).getTruth());
520 
521  // adjust weight for hits without (and also with) a truth match, so that each is counted with the same weight.
522  mtv.back().assign_equal_normalization();
523  }
524 
526  // frac is then the fraction of the total number of hits on the track attributed to the barcode.
527 
530  const bool ok = mt.best(tbarcode, tfrac);
531  if (ok)
532  {
533  t.setEventIndex(tbarcode.first);
534  t.setBarcode(tbarcode.second);
535  t.setBarcodeFrac(tfrac);
536  }
537 }
538 
539 
541 // findTracks utility helper functions
543 
544 // Returns true if there is a fit in track_cands with chi2ndof < minchi2ndof
545 bool hasGoodFit(std::vector<FPGATrackSimTrack> const & track_cands, float minchi2ndof)
546 {
547  for (FPGATrackSimTrack const & t: track_cands)
548  {
549  if (t.getChi2ndof() > 0 && t.getChi2ndof() < minchi2ndof)
550  return true;
551  }
552  return false;
553 }
FPGATrackSimTrack::setHitMap
void setHitMap(unsigned int v)
Definition: FPGATrackSimTrack.h:101
TrackFitter::compute_truth
void compute_truth(FPGATrackSimTrack &newtrk) const
Definition: TrackFitter.cxx:511
TrackFitter::m_idbase
int m_idbase
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:142
FPGATrackSimTrack::getEta
float getEta() const
Definition: FPGATrackSimTrack.h:41
FPGATrackSimHit::getSide
unsigned getSide() const
Definition: FPGATrackSimHit.h:83
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:215
FPGATrackSimHit::setSection
void setSection(unsigned v)
Definition: FPGATrackSimHit.h:93
FPGATrackSimTrack::setBinIdx
void setBinIdx(std::vector< unsigned > x)
Definition: FPGATrackSimTrack.h:116
TrackFitter::m_max_ncomb
const int m_max_ncomb
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:101
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
FPGATrackSimPlaneMap::getNLogiLayers
uint32_t getNLogiLayers() const
Definition: FPGATrackSimPlaneMap.h:75
FPGATrackSimTrack::setPars
void setPars(FPGATrackSimTrackPars const &pars)
Definition: FPGATrackSimTrack.h:122
SiliconTech::strip
@ strip
FPGATrackSimTrack::setBankID
void setBankID(int v)
Definition: FPGATrackSimTrack.h:84
FPGATrackSimTrack::getNMissing
int getNMissing() const
Definition: FPGATrackSimTrack.h:52
getMessageSvc.h
singleton-like access to IMessageSvc via open function and helper
getBestChi2
std::vector< FPGATrackSimTrack >::const_iterator getBestChi2(std::vector< FPGATrackSimTrack > const &tracks)
TrackFitter::m_Chi2Dof_recovery_max
float m_Chi2Dof_recovery_max
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:110
TrackFitter::m_nfits_maj_pix
int m_nfits_maj_pix
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:146
FPGATrackSimTrack
Definition: FPGATrackSimTrack.h:18
FPGATrackSimTrack::setPatternID
void setPatternID(int v)
Definition: FPGATrackSimTrack.h:85
TrackFitter::makeTrackCandidates
void makeTrackCandidates(const FPGATrackSimRoad &road, const FPGATrackSimTrack &temp, std::vector< FPGATrackSimTrack > &track_cands)
Creates a list of track candidates by taking all possible combination of hits in road.
Definition: TrackFitter.cxx:332
FPGATrackSimMultiTruth::Weight
float Weight
Definition: FPGATrackSimMultiTruth.h:50
FPGATrackSimRoad::getHits
const std::vector< std::shared_ptr< const FPGATrackSimHit > > & getHits(size_t layer) const
Definition: FPGATrackSimRoad.h:102
FPGATrackSimTrack::getPhi
float getPhi() const
Definition: FPGATrackSimTrack.h:39
runITkAlign.accumulate
accumulate
Update flags based on parser line args.
Definition: runITkAlign.py:62
TrackFitter::m_require_first
bool m_require_first
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:103
FPGATrackSimHit::getX
float getX() const
Definition: FPGATrackSimHit.h:149
FPGATrackSimTrack::setNMissing
void setNMissing(int v)
Definition: FPGATrackSimTrack.h:99
TrackFitter::m_Chi2Dof_recovery_min
float m_Chi2Dof_recovery_min
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:109
FPGATrackSimTrack::getD0
float getD0() const
Definition: FPGATrackSimTrack.h:38
FPGATrackSimTrack::setHoughXBin
void setHoughXBin(unsigned v)
Definition: FPGATrackSimTrack.h:109
FPGATrackSimPlaneMap::getNCoords
uint32_t getNCoords() const
Definition: FPGATrackSimPlaneMap.h:76
FPGATrackSimTrack::setFirstSectorID
void setFirstSectorID(int v)
Definition: FPGATrackSimTrack.h:86
HitType::spacepoint
@ spacepoint
FPGATrackSimMultiTruth.h
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
FITTRACKS_OK
#define FITTRACKS_OK
Definition: FPGATrackSimTypes.h:15
x
#define x
TrackFitter::recoverTrack
FPGATrackSimTrack recoverTrack(FPGATrackSimTrack const &t, sector_t sector, layer_bitmask_t norecovery_mask, double qoverpt)
Given a N/N track that has a bad chi2, try to refit the track by taking away a single hit,...
Definition: TrackFitter.cxx:449
FPGATrackSimTrack::setFPGATrackSimHit
void setFPGATrackSimHit(unsigned i, const FPGATrackSimHit &hit)
Definition: FPGATrackSimTrack.cxx:98
HitType::guessed
@ guessed
FPGATrackSimRoad::getNHits_layer
std::vector< size_t > getNHits_layer() const
Definition: FPGATrackSimRoad.cxx:27
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
TrackFitter::m_tracks_missinghits_track
std::vector< FPGATrackSimTrack > m_tracks_missinghits_track
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:139
FPGATrackSimTrack::setOrigChi2
void setOrigChi2(float v)
Definition: FPGATrackSimTrack.h:98
FPGATrackSimPlaneMap::getCoordLayer
uint32_t getCoordLayer(uint32_t coord) const
Definition: FPGATrackSimPlaneMap.h:98
FPGATrackSimMultiTruth::best
bool best(FPGATrackSimMultiTruth::Barcode &code, FPGATrackSimMultiTruth::Weight &weight) const
Definition: FPGATrackSimMultiTruth.h:86
FPGATrackSimTrack::getQOverPt
float getQOverPt() const
Definition: FPGATrackSimTrack.h:36
FPGATrackSimHit
Definition: FPGATrackSimHit.h:41
TrackFitter.h
FPGATrackSimPlaneMap::getDim
uint32_t getDim(size_t logiLayer) const
Definition: FPGATrackSimPlaneMap.h:78
TrackFitter::fitTracks
int fitTracks(const std::vector< std::shared_ptr< const FPGATrackSimRoad >> &roads, std::vector< FPGATrackSimTrack > &tracks)
Definition: TrackFitter.cxx:56
FPGATrackSimTrack::setSecondSectorID
void setSecondSectorID(int v)
Definition: FPGATrackSimTrack.h:87
TrackFitter::m_nfits_maj
int m_nfits_maj
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:144
HitType::wildcard
@ wildcard
TrackFitter::m_doDeltaGPhis
bool m_doDeltaGPhis
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:98
FPGATrackSimPlaneMap::getCoordOffset
uint32_t getCoordOffset(size_t logiLayer) const
Definition: FPGATrackSimPlaneMap.h:92
FPGATrackSimTrack::getFPGATrackSimHits
const std::vector< FPGATrackSimHit > & getFPGATrackSimHits() const
Definition: FPGATrackSimTrack.h:63
TrackFitter::m_do2ndStage
bool m_do2ndStage
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:95
FPGATrackSimPlaneMap::isPixel
bool isPixel(int pl) const
Definition: FPGATrackSimPlaneMap.h:107
FPGATrackSimHit::setDetType
void setDetType(SiliconTech detType)
Definition: FPGATrackSimHit.h:55
FPGATrackSimTrack::setHoughYBin
void setHoughYBin(unsigned v)
Definition: FPGATrackSimTrack.h:110
FPGATrackSimTrack::getChi2
float getChi2() const
Definition: FPGATrackSimTrack.h:43
FITTRACKS_BAD
#define FITTRACKS_BAD
Definition: FPGATrackSimTypes.h:16
FPGATrackSimTrack::getZ0
float getZ0() const
Definition: FPGATrackSimTrack.h:40
TrackFitter::m_guessinghits
bool m_guessinghits
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:96
FPGATrackSimTrack::setValidCand
void setValidCand(bool v)
Definition: FPGATrackSimTrack.h:112
Athena
Some weak symbol referencing magic...
Definition: AthLegacySequence.h:21
TrackFitter::m_do_majority
unsigned m_do_majority
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:102
TrackFitter::m_pmap
FPGATrackSimPlaneMap const * m_pmap
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:121
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
TrackStage::FIRST
@ FIRST
FPGATrackSimTrack::setDoDeltaGPhis
void setDoDeltaGPhis(bool v)
Definition: FPGATrackSimTrack.h:83
FPGATrackSimMultiTruth::Barcode
std::pair< unsigned long, unsigned long > Barcode
Definition: FPGATrackSimMultiTruth.h:49
TrackFitter::m_nfits_addrec
int m_nfits_addrec
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:148
TrackFitter::m_nfits_maj_SCT
int m_nfits_maj_SCT
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:145
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
TrackFitter::m_comboIndices
std::vector< std::vector< int > > m_comboIndices
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:127
TrackStage::SECOND
@ SECOND
TrackFitter::m_IdealCoordFitType
TrackCorrType m_IdealCoordFitType
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:97
TrackFitter::m_norecovery_nhits
int m_norecovery_nhits
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:104
FPGATrackSimHit::getY
float getY() const
Definition: FPGATrackSimHit.h:150
FPGATrackSimTrack::setTrackCorrType
void setTrackCorrType(TrackCorrType v)
Definition: FPGATrackSimTrack.h:81
FPGATrackSimHit::getZ
float getZ() const
Definition: FPGATrackSimHit.h:151
getComboIndices
std::vector< std::vector< int > > getComboIndices(std::vector< size_t > const &sizes)
Given a vector of sizes (of arrays), generates a vector of all combinations of indices to index one e...
Definition: FPGATrackSimFunctions.cxx:21
grepfile.ic
int ic
Definition: grepfile.py:33
FPGATrackSimTrack::setTrackStage
void setTrackStage(TrackStage v)
Definition: FPGATrackSimTrack.h:82
sector_t
int32_t sector_t
Definition: FPGATrackSimTypes.h:21
FPGATrackSimTrack::setIdealRadii
void setIdealRadii(const std::vector< double > &v)
Definition: FPGATrackSimTrack.h:113
TrackFitter::m_rmap
FPGATrackSimRegionMap const * m_rmap
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:122
FPGATrackSimMultiTruth
Definition: FPGATrackSimMultiTruth.h:46
FPGATrackSimMultiTruth::AddAccumulator
Definition: FPGATrackSimMultiTruth.h:57
TrackFitter::getMissingInfo
void getMissingInfo(const FPGATrackSimRoad &road, int &nMissing, bool &missPixel, bool &missStrip, layer_bitmask_t &missing_mask, layer_bitmask_t &norecovery_mask)
Definition: TrackFitter.cxx:264
TrackCorrType::None
@ None
FPGATrackSimFitConstantBank
Definition: FPGATrackSimFitConstantBank.h:24
FPGATrackSimPlaneMap::isSCT
bool isSCT(int pl) const
Definition: FPGATrackSimPlaneMap.h:106
FPGATrackSimRoad::getWCLayers
layer_bitmask_t getWCLayers() const
Definition: FPGATrackSimRoad.h:98
FPGATrackSimTrack::setHoughY
void setHoughY(float v)
Definition: FPGATrackSimTrack.h:91
FPGATrackSimTrack::setTrackID
void setTrackID(int v)
Definition: FPGATrackSimTrack.h:88
FPGATrackSimTrack::setQOverPt
void setQOverPt(float v)
Definition: FPGATrackSimTrack.h:92
FPGATrackSimRegionMap::getAvgRadii
const std::vector< double > & getAvgRadii(unsigned region) const
Definition: FPGATrackSimRegionMap.h:104
TrackFitter::m_nfits
int m_nfits
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:143
FPGATrackSimFitConstantBank::getIsGood
bool getIsGood(sector_t sector) const
Definition: FPGATrackSimFitConstantBank.h:41
FPGATrackSimFitConstantBank::linfit
bool linfit(sector_t sector, FPGATrackSimTrack &track, bool isSecondStage) const
Definition: FPGATrackSimFitConstantBank.cxx:304
FPGATrackSimFitConstantBank::getNSectors
int getNSectors() const
Definition: FPGATrackSimFitConstantBank.h:37
FPGATrackSimHit::setLayer
void setLayer(unsigned v)
Definition: FPGATrackSimHit.h:92
y
#define y
FPGATrackSimTrack::setChi2
void setChi2(float v)
Definition: FPGATrackSimTrack.h:97
TrackFitter::m_nominalBank
const FPGATrackSimFitConstantBank * m_nominalBank
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:132
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
layer_bitmask_t
uint32_t layer_bitmask_t
Definition: FPGATrackSimTypes.h:22
FPGATrackSimTrack::isValidCand
bool isValidCand() const
Definition: FPGATrackSimTrack.h:79
TrackFitter::makeTrackCandidate
FPGATrackSimTrack makeTrackCandidate(const FPGATrackSimRoad &road, const FPGATrackSimTrack &temp, const std::vector< int > &hit_indices)
Definition: TrackFitter.cxx:388
FPGATrackSimTrack::setSubRegion
void setSubRegion(unsigned v)
Definition: FPGATrackSimTrack.h:107
TrackFitter::resetCounters
void resetCounters()
Definition: TrackFitter.cxx:39
FPGATrackSimTrack::setNLayers
void setNLayers(int)
set the number of layers in the track.
Definition: FPGATrackSimTrack.cxx:107
TrackFitter::getDoMissingHitsCheck
bool getDoMissingHitsCheck() const
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:62
TrackFitter::m_fitFromRoad
bool m_fitFromRoad
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:115
SiliconTech::pixel
@ pixel
TrackFitter::TrackFitter
TrackFitter(void)
FPGATrackSimRoad
Definition: FPGATrackSimRoad.h:31
FPGATrackSimTrack::setHoughX
void setHoughX(float v)
Definition: FPGATrackSimTrack.h:90
FPGATrackSimHit::getHitType
HitType getHitType() const
Definition: FPGATrackSimHit.h:57
FPGATrackSimHit::setHitType
void setHitType(HitType type)
Definition: FPGATrackSimHit.h:54
hasGoodFit
bool hasGoodFit(std::vector< FPGATrackSimTrack > const &track_cands, float minchi2)
Definition: TrackFitter.cxx:545
TrackFitter::m_droppedLayerBanks
std::vector< const FPGATrackSimFitConstantBank * > m_droppedLayerBanks
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:136
TrackFitter::m_nfits_rec
int m_nfits_rec
Definition: EFTracking/FPGATrackSim/FPGATrackSimAlgorithms/FPGATrackSimAlgorithms/TrackFitter.h:147