ATLAS Offline Software
FPGATrackSimGenScanTool.cxx
Go to the documentation of this file.
1 // Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
19 
20 #include <sstream>
21 #include <cmath>
22 #include <algorithm>
23 
24 #include "TH1.h"
25 
27 // Debug Print Tools
28 template<class T>
29 static inline std::string to_string(const std::vector<T>& v)
30 {
31  std::ostringstream oss;
32  oss << "[";
33  if (!v.empty())
34  {
35  std::copy(v.begin(), v.end() - 1, std::ostream_iterator<T>(oss, ", "));
36  oss << v.back();
37  }
38  oss << "]";
39  return oss.str();
40 }
41 
42 
43 std::ostream& operator<<(std::ostream &os, const FPGATrackSimGenScanTool::StoredHit &hit)
44 {
45  os << "lyr: " << hit.layer << " ";
46  os << "(" << hit.hitptr->getR() << ", " << hit.hitptr->getGPhi() << ", " << hit.hitptr->getZ() << ") ";
47  os << "[" << hit.phiShift << ", " << hit.etaShift << "]";
48  return os;
49 }
50 
51 
53 // AthAlgTool
54 
55 FPGATrackSimGenScanTool::FPGATrackSimGenScanTool(const std::string& algname, const std::string &name, const IInterface *ifc) :
56  base_class(algname, name, ifc)
57 {
58  declareInterface<IFPGATrackSimRoadFinderTool>(this);
59 }
60 
61 
63 {
64  // Dump the configuration to make sure it propagated through right
65  const std::vector<Gaudi::Details::PropertyBase*> props = this->getProperties();
66  for( Gaudi::Details::PropertyBase* prop : props ) {
67  if (prop->ownerTypeName()==this->type()) {
68  ATH_MSG_DEBUG("Property:\t" << prop->name() << "\t : \t" << prop->toString());
69  }
70  }
71 
72  // Retrieve info
73  ATH_CHECK(m_FPGATrackSimBankSvc.retrieve());
74  ATH_CHECK(m_FPGATrackSimMapping.retrieve());
75  ATH_MSG_INFO("Map specifies :" << m_nLayers);
76  ATH_CHECK(m_monitoring.retrieve());
77  ATH_MSG_INFO("Monitoring Dir :" << m_monitoring->dir());
78  ATH_CHECK(m_binning.retrieve());
79 
80  // Setup layer configuration
81  m_nLayers = m_FPGATrackSimMapping->PlaneMap_1st(getSubRegion())->getNLogiLayers();
82 
83  // This is the layers they get paired with previous layers
84  for (unsigned lyr = 0; lyr < m_nLayers; ++lyr) m_pairingLayers.push_back(lyr);
85  if (m_reversePairDir) {
87  }
88  ATH_MSG_INFO("Pairing Layers: " << m_pairingLayers);
89 
90  // Check inputs
91  bool ok = false;
92  if (m_pairFilterDeltaPhiCut.size() != m_nLayers - 1)
93  ATH_MSG_FATAL("initialize() pairFilterDeltaPhiCut must have size nLayers-1=" << m_nLayers - 1 << " found " << m_pairFilterDeltaPhiCut.size());
94  else if (m_pairFilterDeltaEtaCut.size() != m_nLayers - 1)
95  ATH_MSG_FATAL("initialize() pairFilterDeltaEtaCut must have size nLayers-1=" << m_nLayers - 1 << " found " << m_pairFilterDeltaEtaCut.size());
96  else if (m_pairFilterPhiExtrapCut.size() != 2)
97  ATH_MSG_FATAL("initialize() pairFilterPhiExtrapCut must have size 2 found " << m_pairFilterPhiExtrapCut.size());
98  else if (m_pairFilterEtaExtrapCut.size() != 2)
99  ATH_MSG_FATAL("initialize() pairFilterEtaExtrapCut must have size 2 found " << m_pairFilterEtaExtrapCut.size());
100  else if (m_pairSetPhiExtrapCurvedCut.size() != 2)
101  ATH_MSG_FATAL("initialize() PairSetPhiExtrapCurvedCut must have size 2found " << m_pairSetPhiExtrapCurvedCut.size());
102  else if ((m_rin < 0.0) || (m_rout < 0.0))
103  ATH_MSG_FATAL("Radii not set");
104  else
105  ok = true;
106  if (!ok)
107  return StatusCode::FAILURE;
108 
109 
110  // Dump Binning
111  for (unsigned par : m_binning->slicePars()) { ATH_MSG_INFO("Slice Par: " << m_binning->parNames(par)); }
112  for (unsigned par : m_binning->scanPars()) { ATH_MSG_INFO("Scan Par: " << m_binning->parNames(par)); }
113  ATH_MSG_INFO("Row Par: " << m_binning->parNames(m_binning->rowParIdx()));
114 
115  // Configure Binning
116  for (unsigned par = 0; par < FPGATrackSimGenScanBinningBase::NPars; par++)
117  {
118  m_binning->m_parMin[par] = m_parMin[par];
119  m_binning->m_parMax[par] = m_parMax[par];
120  m_binning->m_parBins[par] = m_parBins[par];
121  if (m_parBins[par] <= 0)
122  {
123  ATH_MSG_FATAL("Every dimension must be at least one bin");
124  return StatusCode::FAILURE;
125  }
126  m_binning->m_parStep[par] = (m_parMax[par] - m_parMin[par]) / m_parBins[par];
127  }
128 
129  // Build Image
130  m_image.setsize(m_binning->m_parBins, BinEntry());
131  ATH_MSG_INFO("Final Image Size: " << m_image.size());
132  // make sure image is starts reset
133  // (reusing saves having to reallocate memory for each event)
135  {
136  bin.data().reset();
137  }
138 
139  // Compute which bins correspond to track parameters that are in the region
140  // i.e. the pT, eta, phi, z0 and d0 bounds
142 
143  // register histograms
144  ATH_CHECK(m_monitoring->registerHistograms(m_nLayers, m_binning.get(), m_rin, m_rout));
145 
146  return StatusCode::SUCCESS;
147 }
148 
150 // Internal Storage Classes
151 
153 {
154  hitCnt = 0;
155  lyrhit = 0;
156  hits.clear();
157 }
158 
160 {
161  hitCnt++;
162  if (((lyrhit >> hit.layer) & 0x1) == 0x0)
163  {
164  lyrhit |= (0x1 << hit.layer);
165  }
166  hits.push_back(hit);
167 }
168 
170 // Main Algorithm
171 
172 StatusCode FPGATrackSimGenScanTool::getRoads(const std::vector<std::shared_ptr<const FPGATrackSimHit>> &hits,
173  std::vector<std::shared_ptr<const FPGATrackSimRoad>> &roads)
174 {
175  ATH_MSG_DEBUG("In getRoads, Processing Event# " << ++m_evtsProcessed << " hit size = " << hits.size());
176 
177  roads.clear();
178  m_roads.clear();
179  m_monitoring->resetDataFlowCounters();
180 
181  // Currently assume that if less than 100 hits its a single track MC
182  m_monitoring->parseTruthInfo(getTruthTracks(),(hits.size() < 100),m_validBin);
183 
184  // do the binning...
186 
187  // scan over image building pairs for bins over threshold
189  {
190  // apply threshold
191  if (bin.data().lyrCnt() < m_threshold) continue;
192  ATH_MSG_DEBUG("newRoad " << bin.data().lyrCnt() << " " << bin.idx());
193 
194  // pass hits for bin to filterRoad and get back pairs of hits grouped into pairsets
195  std::vector<HitPairSet> pairsets;
196  if (m_binFilter=="PairThenGroup") {
197  ATH_CHECK(pairThenGroupFilter(bin.data(), bin.idx(), pairsets));
198  } else if (m_binFilter=="IncrementalBuild") {
199  ATH_CHECK(incrementalBuildFilter(bin.data(), bin.idx(), pairsets));
200  } else {
201  ATH_MSG_FATAL("Unknown bin filter" << m_binFilter);
202  }
203  ATH_MSG_DEBUG("grouped PairSets " << pairsets.size());
204 
205  // convert the group pairsets to FPGATrackSimRoads
206  for (const FPGATrackSimGenScanTool::HitPairSet& pairset: pairsets)
207  {
208  addRoad(pairset.hitlist, bin.idx());
209 
210  // debug statement if more than one road found in bin
211  // not necessarily a problem
212  if (pairsets.size() >1) {
213  std::string s = "";
214  for (const FPGATrackSimGenScanTool::StoredHit* const hit : pairset.hitlist)
215  {
216  s += "(" + std::to_string(hit->hitptr->getLayer()) + "," + std::to_string(hit->hitptr->getR()) + "), ";
217  }
218  ATH_MSG_DEBUG("Duplicate Group " << s);
219  }
220  }
221  }
222 
223  // copy roads to output vector
224  roads.reserve(m_roads.size());
225  for (FPGATrackSimRoad & r : m_roads) roads.emplace_back(std::make_shared<const FPGATrackSimRoad>(r));
226  ATH_MSG_DEBUG("Roads = " << roads.size());
227  m_monitoring->fillOutputSummary(m_validSlice, m_validSliceAndScan);
228 
229  // clear previous event
230  // (reusing saves having to reallocate memory for each event)
232  {
233  bin.data().reset();
234  }
235 
236  m_evtsProcessed++;
237  return StatusCode::SUCCESS;
238 }
239 
240 // Put hits in all track parameter bins they could be a part of (binning is defined
241 // by m_binning object)
242 StatusCode FPGATrackSimGenScanTool::fillImage(const std::vector<std::shared_ptr<const FPGATrackSimHit>> &hits)
243 {
244  ATH_MSG_DEBUG("In fillImage");
245 
246  for (const std::shared_ptr<const FPGATrackSimHit>& hit : hits)
247  {
248  m_monitoring->fillHitLevelInput(hit.get());
249 
250  // The following code loops sequentially of the slice, then scan, then row parameters
251  // skipping invalid slices/scans/row/bins and adding hits if the hits are in the bin
252  // according to the m_binning class
253 
254  // this will contain current bin idx as it is built from slices and scans
256 
257  // iterate over slices
259  {
260  // if slice is not valid continue
261  if (!slicebin.data()) continue;
262 
263  // set the slice bins in the current bin idx object
264  ATH_CHECK(m_binning->setIdxSubVec(idx, m_binning->slicePars(), slicebin.idx()));
265 
266  // if hit is not in slice skip slice (continue)
267  if (!m_binning->hitInSlice(idx, hit.get()))
268  {
269  m_monitoring->sliceCheck(slicebin.idx());
270  continue;
271  }
272 
273  m_monitoring->incrementInputPerSlice(slicebin.idx());
274 
275  // iterate over scan bins
277 
278  // if scan bin is not valid continue
279  if (!scanbin.data()) continue; // scan bin not valid
280 
281  // set the scan bins in the current bin idx object
282  ATH_CHECK(m_binning->setIdxSubVec(idx, m_binning->scanPars(), scanbin.idx()));
283 
284  // Find the min/max bins for hit in the row
285  std::pair<unsigned, unsigned> rowRange = m_binning->idxsetToRowParBinRange(idx, hit.get());
286 
287  // put hit in row bins according to row range
288  for (unsigned rowbin = rowRange.first; rowbin < rowRange.second; rowbin++)
289  {
290  idx[m_binning->rowParIdx()] = rowbin;
291 
292  // if full bin is not valid continue
293  if (!m_validBin[idx]) continue;
294 
295  // make a stored hit and fill it with the eta/phishifts as
296  // speficied by the Binning class
297  StoredHit s_hit;
298  s_hit.hitptr = hit;
299  s_hit.layer = hit->getLayer();
300  s_hit.phiShift = m_binning->phiShift(idx, hit.get());
301  s_hit.etaShift = m_binning->etaShift(idx, hit.get());
302 
303  // add hit to the BinEntry for the bin
304  m_image[idx].addHit(s_hit);
305  }
306  }
307  }
308  }
309 
310  m_monitoring->fillInputSummary(hits, m_validSlice, m_validSliceAndScan);
311 
312  return StatusCode::SUCCESS;
313 }
314 
315 // Filter the bins above threshold into pairsets which output roads
318  std::vector<HitPairSet> &output_pairsets)
319 {
320  ATH_MSG_VERBOSE("In pairThenGroupFilter");
321 
322  // Organize Hits by Layer
323  std::vector<std::vector<const StoredHit *>> hitsByLayer(m_nLayers);
324  ATH_CHECK(sortHitsByLayer(bindata, hitsByLayer));
325 
326  // This is monitoring for each bin over threshold
327  // It's here so it can get the hitsByLayer
328  m_monitoring->fillBinLevelOutput(idx, bindata, hitsByLayer);
329 
330  // Make Pairs
332  ATH_CHECK(makePairs(hitsByLayer, pairs));
333 
334  // Filter Pairs
335  HitPairSet filteredpairs;
336  ATH_CHECK(filterPairs(pairs, filteredpairs));
337 
338  // Require road is still over threshold
339  bool passedPairFilter = (filteredpairs.lyrCnt() >= m_threshold);
340  m_monitoring->pairFilterCheck(pairs, filteredpairs, passedPairFilter);
341 
342  // if passed Pair Filter proceed to group the filtered pairs into pairsets
343  if (passedPairFilter)
344  {
345  // Pair Set Grouping
346  std::vector<HitPairSet> pairsets;
347  ATH_CHECK(groupPairs(filteredpairs, pairsets, false));
348 
349  // loop over pairsets and find those that are over thresold
350  for (const FPGATrackSimGenScanTool::HitPairSet& pairset : pairsets)
351  {
352  // if over threshold add it to the output
353  if (pairset.lyrCnt() >= m_threshold)
354  {
355  if (m_applyPairSetFilter) {
356  output_pairsets.push_back(pairset);
357  }
358  }
359  }
360  }
361 
362  // set outputs if not all filters applied
363  if (!m_applyPairFilter) {
364  // output is just the filtered pairs
365  output_pairsets.push_back(pairs);
366  }
367  else if (passedPairFilter && !m_applyPairSetFilter)
368  {
369  // output is just the filtered pairs
370  output_pairsets.push_back(filteredpairs);
371  }
372 
373  return StatusCode::SUCCESS;
374 }
375 
376 
377 
379  IntermediateState &outputstate,
380  unsigned lyridx,
381  const std::vector<const StoredHit *>& newhits)
382 {
383  unsigned int allowed_missed_hits = m_nLayers - m_threshold;
384 
385  std::vector<bool> pairset_used(inputstate.pairsets.size(),false);
386 
387  for (auto &newhit : newhits) {
388 
389  // don't make new pairs with hits that the new hit is already paired with in a group
390  std::set<const StoredHit *> vetoList;
391 
392  // try adding hit to existing pair sets
393  for (auto &pairset : inputstate.pairsets) {
394  HitPair nextpair(pairset.lastpair().second, newhit, m_reversePairDir);
395  if (pairMatchesPairSet(pairset, nextpair, false)) {
396  HitPairSet newset(pairset);
397  newset.addPair(nextpair);
398  outputstate.pairsets.push_back(newset);
399  // put inpair hits in list of hits not to pair again with the new hits
400  for (auto vetohit : pairset.hitlist) {
401  vetoList.insert(vetohit);
402  }
403  }
404  }
405 
406  // make new pairsets with unpaired hits
407  for (auto prevhit : inputstate.unpairedHits) {
408  if (vetoList.count(prevhit) == 0) {
409  HitPair newpair(prevhit, newhit, m_reversePairDir);
410  if (pairPassesFilter(newpair)) {
411  HitPairSet newset;
412  newset.addPair(newpair);
413  outputstate.pairsets.push_back(newset);
414  }
415  }
416  }
417 
418  // if this can be the start of a the start of a track and still
419  // have enough hits to make a track, add it to the unpaired hits list
420  if (lyridx <= allowed_missed_hits) {
421  outputstate.unpairedHits.push_back(newhit);
422  }
423  }
424 
425  // Add groups to output without new hit if they have enough hits to skip
426  // this layer. Note expected hits at this point is lyridx+1, since we start
427  // counting lyridx from zero. Logic is then keep the pairset if
428  // expected hits <= hits in set + allows misses
429  for (auto &pairset : inputstate.pairsets) {
430  if (lyridx < (pairset.hitlist.size() + allowed_missed_hits)) {
431  outputstate.pairsets.push_back(pairset);
432  }
433  }
434 
435  // Add hits to unpaired list if hits are still allowed to start a track
436  // ---------------------------------------------------------------------
437  // If you start a new track with a pair whose second element is
438  // layer N (layer numbering starting from zero), then you'll have missed N-1
439  // layers Minus 1 because the first hit was one of the N layers already
440  // passed.
441  //
442  // The next pass will be layer N=lyridx+1 where lyridx is the current value
443  // at this point in the code. You will have then missed lyridx layers, so...
444  // E.g. if you allow one missed layer then this stops putting hits in the
445  // unpairedHits list if lyridx>1, so tracks must start with layer 0 or 1,
446  // which makes sense
447  if (lyridx > allowed_missed_hits) {
448  // make no new track starts
449  outputstate.unpairedHits.clear();
450  } else {
451  // copy in any previous unpairedHits as well
452  for (auto prevhit : inputstate.unpairedHits) {
453  outputstate.unpairedHits.push_back(prevhit);
454  }
455  }
456 }
457 
458 // Filter the bins above threshold into pairsets which output roads
461  std::vector<HitPairSet> &output_pairsets)
462 {
463  ATH_MSG_VERBOSE("In buildGroupsWithPairs");
464 
465  // Organize Hits by Layer
466  std::vector<std::vector<const StoredHit *>> hitsByLayer(m_nLayers);
467  ATH_CHECK(sortHitsByLayer(bindata, hitsByLayer));
468 
469  // This is monitoring for each bin over threshold
470  // It's here so it can get the hitsByLayer
471  m_monitoring->fillBinLevelOutput(idx, bindata, hitsByLayer);
472 
473  std::vector<IntermediateState> states{m_nLayers+1};
474  for (unsigned lyridx = 0; lyridx < m_nLayers; lyridx++) {
475  unsigned lyr = m_pairingLayers[lyridx];
476  updateState(states[lyridx] , states[lyridx+1], lyridx, hitsByLayer[lyr]);
477  }
478 
479  // this is a little ugly because it requires copying the output pairsets right now
480  output_pairsets=states[m_nLayers].pairsets;
481 
482  m_monitoring->fillBuildGroupsWithPairs(states,m_nLayers-m_threshold);
483 
484  return StatusCode::SUCCESS;
485 }
486 
487 
488 // 1st step of filter: sort hits by layer
490  std::vector<std::vector<const StoredHit *>>& hitsByLayer)
491 {
492  ATH_MSG_VERBOSE("In fillHitsByLayer");
493 
494  for (const FPGATrackSimGenScanTool::StoredHit& hit : bindata.hits)
495  {
496  hitsByLayer[hit.hitptr->getLayer()].push_back(&hit);
497  }
498 
499  return StatusCode::SUCCESS;
500 }
501 
502 
503 
504 
505 
506 // 2nd step of filter: make pairs of hits from adjacent and next-to-adjacent layers
507 StatusCode FPGATrackSimGenScanTool::makePairs(const std::vector<std::vector<const StoredHit *>>& hitsByLayer,
508  HitPairSet &pairs)
509 {
510  ATH_MSG_VERBOSE("In makePairs");
511 
512  std::vector<const FPGATrackSimGenScanTool::StoredHit *> const * lastlyr = 0;
513  std::vector<const FPGATrackSimGenScanTool::StoredHit *> const * lastlastlyr = 0;
514 
515  // order here is designed so lower radius hits come first
516  for (unsigned lyr : m_pairingLayers) {
517  for (const FPGATrackSimGenScanTool::StoredHit *const &ptr1 :
518  hitsByLayer[lyr]) {
519  if (lastlyr) {
520  for (const FPGATrackSimGenScanTool::StoredHit *const &ptr2 : *lastlyr) {
521  pairs.addPair(HitPair(ptr2, ptr1,m_reversePairDir));
522  }
523  // Add Pairs that skip one layer
524  if (lastlastlyr) {
525  for (const FPGATrackSimGenScanTool::StoredHit *const &ptr2 : *lastlastlyr) {
526  pairs.addPair(HitPair(ptr2, ptr1,m_reversePairDir));
527  }
528  }
529  }
530  }
531  lastlastlyr = lastlyr;
532  lastlyr = &hitsByLayer[lyr];
533  m_monitoring->fillPairingHits(lastlyr,lastlastlyr);
534  }
535 
536  return StatusCode::SUCCESS;
537 }
538 
539 // 3rd step of filter: make cuts on the pairs to ensure that are consisten with
540 // the bin they are in
541 
543  m_monitoring->fillPairFilterCuts(pair);
544  int lyr = std::min(pair.first->hitptr->getLayer(),pair.second->hitptr->getLayer());
545  return (std::abs(pair.dPhi()) < m_pairFilterDeltaPhiCut[lyr]) &&
546  (std::abs(pair.dEta()) < m_pairFilterDeltaEtaCut[lyr]) &&
547  (std::abs(pair.PhiInExtrap(m_rin)) < m_pairFilterPhiExtrapCut[0]) &&
548  (std::abs(pair.PhiOutExtrap(m_rout)) < m_pairFilterPhiExtrapCut[1]) &&
549  (std::abs(pair.EtaInExtrap(m_rin)) < m_pairFilterEtaExtrapCut[0]) &&
550  (std::abs(pair.EtaOutExtrap(m_rout)) < m_pairFilterEtaExtrapCut[1]);
551 }
552 
554 {
555  ATH_MSG_VERBOSE("In filterPairs");
556 
557  for (const FPGATrackSimGenScanTool::HitPair &pair : pairs.pairList) {
558  if (pairPassesFilter(pair)) {
559  filteredpairs.addPair(pair);
560  }
561  }
562  return StatusCode::SUCCESS;
563 }
564 
565 
566 // 4th step of filter: group pairs into sets where they are all consistent with being from the same track
568  std::vector<HitPairSet> &pairsets,
569  bool verbose)
570 {
571  ATH_MSG_VERBOSE("In groupPairs");
572  for (const FPGATrackSimGenScanTool::HitPair & pair : filteredpairs.pairList)
573  {
574  bool added = false;
575  for (FPGATrackSimGenScanTool::HitPairSet &pairset : pairsets)
576  {
577  // Only add skip pairs if skipped layer is not already hit
578  if ((std::abs(pair.second->layer - pair.first->layer) > 1) // gives if is a skip pair
579  && (pairset.hasLayer(std::min(pair.first->layer,pair.second->layer) + 1))) // gives true if skipped layer already in set
580  {
581  // if it matches mark as added so it doesn't start a new pairset
582  // false here is so it doesn't plot these either
583  if (pairMatchesPairSet(pairset, pair, verbose))
584  added = true;
585  if (!added) {
586  ATH_MSG_VERBOSE("Skip pair does not match non-skip pair");
587  }
588  }
589  else
590  {
591  if (pairMatchesPairSet(pairset, pair, verbose))
592  {
593  int size = pairset.addPair(pair);
594  if (verbose)
595  ATH_MSG_VERBOSE("addPair " << pairsets.size() << " " << pairset.pairList.size() << " " << size);
596  added = true;
597  }
598  }
599 
600  }
601 
602  if (!added)
603  {
604  HitPairSet newpairset;
605  newpairset.addPair(pair);
606  pairsets.push_back(newpairset);
607  }
608  }
609 
610  return StatusCode::SUCCESS;
611 
612 }
613 
614 // used to determine if a pair is consistend with a pairset
616  const HitPair &pair,
617  bool verbose) {
618  // In order to make it easy to have a long list of possible cuts,
619  // a vector of cutvar structs is used to represent each cut
620  // then apply the AND of all the cuts is done with a std::count_if function
621 
622  // define the struct (effectively mapping because variable, configured cut value,
623  // and histograms for plotting
624  struct cutvar {
625  cutvar(std::string name, double val, double cut, std::vector<TH1D *>& histset) :
626  m_name(std::move(name)), m_val(val), m_cut(cut), m_histset(histset) {}
627  bool passed() { return std::abs(m_val) < m_cut; }
628  void fill(unsigned cat) { m_histset[cat]->Fill(m_val); }
629  std::string m_name;
630  double m_val;
631  double m_cut;
632  std::vector<TH1D *> &m_histset;
633  };
634 
635  // add the cuts to the list of all cuts
636  std::vector<cutvar> allcuts;
637  allcuts.push_back(cutvar("MatchPhi", pairset.MatchPhi(pair),
639  m_monitoring->m_pairSetMatchPhi));
640  allcuts.push_back(cutvar("MatchEta", pairset.MatchEta(pair),
642  m_monitoring->m_pairSetMatchEta));
643  allcuts.push_back(cutvar("DeltaDeltaPhi", pairset.DeltaDeltaPhi(pair),
645  m_monitoring->m_deltaDeltaPhi));
646  allcuts.push_back(cutvar("DeltaDeltaEta", pairset.DeltaDeltaEta(pair),
648  m_monitoring->m_deltaDeltaEta));
649  allcuts.push_back(cutvar("PhiCurvature", pairset.PhiCurvature(pair),
651  m_monitoring->m_phiCurvature));
652  allcuts.push_back(cutvar("EtaCurvature", pairset.EtaCurvature(pair),
654  m_monitoring->m_etaCurvature));
655  if (pairset.pairList.size() > 1) {
656  allcuts.push_back(cutvar(
657  "DeltaPhiCurvature", pairset.DeltaPhiCurvature(pair),
658  m_pairSetDeltaPhiCurvatureCut, m_monitoring->m_deltaPhiCurvature));
659  allcuts.push_back(cutvar(
660  "DeltaEtaCurvature", pairset.DeltaEtaCurvature(pair),
661  m_pairSetDeltaEtaCurvatureCut, m_monitoring->m_deltaEtaCurvature));
662  }
663  allcuts.push_back(cutvar(
664  "PhiInExtrapCurved", pairset.PhiInExtrapCurved(pair, m_rin),
665  m_pairSetPhiExtrapCurvedCut[0], m_monitoring->m_phiInExtrapCurved));
666  allcuts.push_back(cutvar(
667  "PhiOutExtrapCurved", pairset.PhiOutExtrapCurved(pair, m_rout),
668  m_pairSetPhiExtrapCurvedCut[1], m_monitoring->m_phiOutExtrapCurved));
669 
670  // count number of cuts passed
671  unsigned passedCuts = std::count_if(allcuts.begin(), allcuts.end(),
672  [](cutvar& cut) { return cut.passed(); });
673  bool passedAll = (passedCuts == allcuts.size());
674 
675  // monitoring
676  bool passedAllButOne = (passedCuts == allcuts.size() - 1);
677  for (cutvar& cut: allcuts) {
678  // the last value computes if an n-1 histogram should be filled
679  m_monitoring->fillPairSetFilterCut(cut.m_histset, cut.m_val, pair,
680  pairset.lastpair(),
681  (passedAll || (passedAllButOne && !cut.passed())));
682  }
683 
684  if (verbose)
685  {
686  std::string s = "";
687  for (cutvar &cut : allcuts)
688  {
689  s += cut.m_name + " : (" + cut.passed() + ", " + cut.m_val + "), ";
690  }
691  ATH_MSG_DEBUG("PairSet test " << passedAll << " " << s);
692  ATH_MSG_DEBUG("Hits: \n " << *pairset.lastpair().first << "\n "
693  << *pairset.lastpair().second << "\n "
694  << *pair.first << "\n "
695  << *pair.second);
696  }
697 
698  return passedAll;
699 }
700 
701 // format final pairsets into expected output of getRoads
702 void FPGATrackSimGenScanTool::addRoad(std::vector<const StoredHit *> const &hits, const FPGATrackSimGenScanBinningBase::IdxSet &idx)
703 {
704  layer_bitmask_t hitLayers = 0;
705  std::vector<std::shared_ptr<const FPGATrackSimHit>> outhits;
706  for (const FPGATrackSimGenScanTool::StoredHit* hit : hits)
707  {
708  hitLayers |= 1 << hit->hitptr->getLayer();
709  outhits.push_back(hit->hitptr);
710  }
711 
712  std::vector<std::vector<std::shared_ptr<const FPGATrackSimHit>>> sorted_hits = ::sortByLayer(outhits);
713  sorted_hits.resize(m_nLayers); // If no hits in last layer, return from sortByLayer will be too short
714 
715  m_roads.emplace_back();
716  FPGATrackSimRoad &r = m_roads.back();
717 
718  r.setRoadID(m_roads.size() - 1);
719  // r.setPID(y * m_imageSize_y + x);
720  r.setHits(std::move(sorted_hits));
721  FPGATrackSimTrackPars trackpars = m_binning->parSetToTrackPars(m_binning->binCenter(idx));
722  r.setX(trackpars[FPGATrackSimTrackPars::IPHI]);
723  r.setY(trackpars[FPGATrackSimTrackPars::IHIP]);
724  r.setXBin(idx[3]);
725  r.setYBin(idx[4]);
726  r.setHitLayers(hitLayers);
727  r.setSubRegion(0);
728 }
729 
730 
732 // HitPair and HitPairSet Storage
733 
735 {for (const FPGATrackSimGenScanTool::StoredHit* hit : hitlist)
736  {
737  if (hit == newhit)
738  return true;
739  }
740  return false;
741 }
742 
744 {
745  if (pairList.size() > 0)
746  {
747  // these need to be done before the pair is added
748  LastPhiCurvature = PhiCurvature(pair);
749  LastEtaCurvature = EtaCurvature(pair);
750  }
751 
752  pairList.push_back(pair);
753 
754  hitLayers |= (0x1 << pair.first->hitptr->getLayer());
755  hitLayers |= (0x1 << pair.second->hitptr->getLayer());
756  if (!hasHit(pair.first))
757  hitlist.push_back(pair.first);
758  if (!hasHit(pair.second))
759  hitlist.push_back(pair.second);
760  return this->pairList.size();
761 }
762 
763 
765 {
766  if ((lastpair().first->hitptr==pair.first->hitptr)||
767  (lastpair().first->hitptr==pair.second->hitptr)||
768  (lastpair().second->hitptr==pair.first->hitptr)||
769  (lastpair().second->hitptr==pair.second->hitptr))
770  return 0.0;
771 
772  double dr = (lastpair().second->hitptr->getR() - pair.first->hitptr->getR()) / 2.0;
773  double lastpairextrap = lastpair().second->phiShift - lastpair().dPhi() / lastpair().dR() * dr;
774  double newpairextrap = pair.first->phiShift + pair.dPhi() / pair.dR() * dr;
775  return lastpairextrap - newpairextrap;
776 }
777 
779 {
780  if ((lastpair().first->hitptr==pair.first->hitptr)||
781  (lastpair().first->hitptr==pair.second->hitptr)||
782  (lastpair().second->hitptr==pair.first->hitptr)||
783  (lastpair().second->hitptr==pair.second->hitptr))
784  return 0.0;
785 
786  double dr = (lastpair().second->hitptr->getR() - pair.first->hitptr->getR()) / 2.0;
787  double lastpairextrap = lastpair().second->etaShift - lastpair().dEta() / lastpair().dR() * dr;
788  double newpairextrap = pair.first->etaShift + pair.dEta() / pair.dR() * dr;
789  return lastpairextrap - newpairextrap;
790 }
791 
792 double
794  return (pair.dPhi() * lastpair().dR() - lastpair().dPhi() * pair.dR()) / (lastpair().dR() * pair.dR());
795 }
796 
798 {
799  return (pair.dEta() * lastpair().dR() - lastpair().dEta() * pair.dR()) / (lastpair().dR() * pair.dR());
800 }
801 
803 {
804  return 2 * DeltaDeltaPhi(pair) / (lastpair().dR() + pair.dR());
805 }
807 {
808  return 2 * DeltaDeltaEta(pair) / (lastpair().dR() + pair.dR());
809 }
811 {
812  return PhiCurvature(pair) - LastPhiCurvature;
813 }
815 {
816  return EtaCurvature(pair) - LastEtaCurvature;
817 }
819 {
820  double r = std::min(lastpair().first->hitptr->getR(),lastpair().second->hitptr->getR());
821  return lastpair().PhiInExtrap(r_in) + 0.5 * PhiCurvature(pair) * (r_in - r) * (r_in - r);
822 }
824 {
825  double r = std::max(lastpair().first->hitptr->getR(),lastpair().second->hitptr->getR());
826  return pair.PhiOutExtrap(r_out) + 0.5 * PhiCurvature(pair) * (r_out - r) * (r_out - r);
827 }
828 
829 
830 
831 // Compute which bins correspond to track parameters that are in the region
832 // i.e. the pT, eta, phi, z0 and d0 bounds
834  // determine which bins are valid
835  m_validBin.setsize(m_binning->m_parBins,false);
836  m_validSlice.setsize(m_binning->sliceBins(),false);
837  m_validScan.setsize(m_binning->scanBins(),false);
838  m_validSliceAndScan.setsize(m_binning->sliceAndScanBins(),false);
839 
840  FPGATrackSimTrackPars min_padded;
841  FPGATrackSimTrackPars max_padded;
848  for (unsigned par = 0; par < FPGATrackSimTrackPars::NPARS; par++)
849  {
850  min_padded[par] = m_EvtSel->getMin()[par] - padding[par] * (m_EvtSel->getMax()[par]-m_EvtSel->getMin()[par]);
851  max_padded[par] = m_EvtSel->getMax()[par] + padding[par] * (m_EvtSel->getMax()[par]-m_EvtSel->getMin()[par]);
853  // working in units of GeV internally
854  min_padded[par] *= 1000;
855  max_padded[par] *= 1000;
856  }
857  ATH_MSG_INFO("Padded Parameter Range: " << FPGATrackSimTrackPars::parName(par)
858  << " min=" << min_padded[par] << " max=" << max_padded[par]);
859  }
860 
861 
863  {
864  // this finds the parameters at all 2^5 corners of the bin and then finds the min and max of those
865  std::vector<FPGATrackSimGenScanBinningBase::ParSet> parsets = m_binning->makeVariationSet(std::vector<unsigned>({0,1,2,3,4}),bin.idx());
866  FPGATrackSimTrackPars minvals = m_binning->parSetToTrackPars(m_binning->binCenter(bin.idx()));
867  FPGATrackSimTrackPars maxvals = m_binning->parSetToTrackPars(m_binning->binCenter(bin.idx()));
868  for (FPGATrackSimGenScanBinningBase::ParSet & parset : parsets) {
869  FPGATrackSimTrackPars trackpars = m_binning->parSetToTrackPars(parset);
870  for (unsigned par =0; par < FPGATrackSimTrackPars::NPARS; par++) {
871  minvals[par] = std::min(minvals[par],trackpars[par]);
872  maxvals[par] = std::max(maxvals[par],trackpars[par]);
873  }
874  }
875 
876  // make sure bin overlaps with active region
877  bool inRange = true;
878  for (unsigned par =0; par < FPGATrackSimTrackPars::NPARS; par++) {
879  inRange = inRange && (minvals[par] < max_padded[par]) && (maxvals[par] > min_padded[par]);
880  }
881  if (inRange)
882  {
883  bin.data() = true;
884  m_validSlice[m_binning->sliceIdx(bin.idx())] = true;
885  m_validScan[m_binning->scanIdx(bin.idx())] = true;
886  m_validSliceAndScan[m_binning->sliceAndScanIdx(bin.idx())] = true;
887  }
888 
889  if (bin.data() == false)
890  {
891  ATH_MSG_VERBOSE("Invalid bin: " << bin.idx() << " :" << m_binning->parSetToTrackPars(m_binning->binCenter(bin.idx()))
892  << " minvals: " << minvals << " maxvals: " << maxvals );
893  }
894  }
895 
896  // count valid bins
897  int validBins = 0;
898  for (FPGATrackSimGenScanArray<int>::Iterator bin : m_validBin) { if(bin.data()) validBins++;}
899 
900  int validSlices = 0;
901  for (FPGATrackSimGenScanArray<int>::Iterator bin : m_validSlice) { if(bin.data()) validSlices++;}
902 
903  int validScans = 0;
904  for (FPGATrackSimGenScanArray<int>::Iterator bin : m_validScan) { if(bin.data()) validScans++;}
905 
906  ATH_MSG_INFO("Valid Bins: " << validBins
907  << " valid slices: " << validSlices
908  << " valid scans: " << validScans);
909 }
910 
911 
912 
FPGATrackSimGenScanTool::BinEntry::lyrhit
layer_bitmask_t lyrhit
Definition: FPGATrackSimGenScanTool.h:212
FPGATrackSimGenScanTool::m_pairFilterEtaExtrapCut
Gaudi::Property< std::vector< double > > m_pairFilterEtaExtrapCut
Definition: FPGATrackSimGenScanTool.h:126
FPGATrackSimGenScanTool::m_parMin
Gaudi::Property< std::vector< float > > m_parMin
Definition: FPGATrackSimGenScanTool.h:104
FPGATrackSimGenScanTool::IntermediateState::unpairedHits
std::vector< const StoredHit * > unpairedHits
Definition: FPGATrackSimGenScanTool.h:300
FPGATrackSimTrackPars::IHIP
@ IHIP
Definition: FPGATrackSimTrackPars.h:49
beamspotman.r
def r
Definition: beamspotman.py:676
FPGATrackSimGenScanArray
Definition: FPGATrackSimGenScanArray.h:41
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
FPGATrackSimGenScanTool::pairMatchesPairSet
bool pairMatchesPairSet(const HitPairSet &pairset, const HitPair &pair, bool verbose)
Definition: FPGATrackSimGenScanTool.cxx:615
FPGATrackSimTrackPars::ID0
@ ID0
Definition: FPGATrackSimTrackPars.h:49
FPGATrackSimGenScanBinningBase::IdxSet
Definition: FPGATrackSimGenScanBinning.h:100
FPGATrackSimGenScanTool::m_pairSetPhiCurvatureCut
Gaudi::Property< double > m_pairSetPhiCurvatureCut
Definition: FPGATrackSimGenScanTool.h:133
getMenu.algname
algname
Definition: getMenu.py:54
FPGATrackSimGenScanTool::HitPair::PhiInExtrap
double PhiInExtrap(double r_in) const
Definition: FPGATrackSimGenScanTool.h:238
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
FPGATrackSimGenScanTool::initialize
virtual StatusCode initialize() override
Definition: FPGATrackSimGenScanTool.cxx:62
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
FPGATrackSimGenScanTool::filterPairs
StatusCode filterPairs(HitPairSet &pairs, HitPairSet &filteredpairs)
Definition: FPGATrackSimGenScanTool.cxx:553
TrigCompositeUtils::passed
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
Definition: TrigCompositeUtilsRoot.cxx:117
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
FPGATrackSimGenScanTool::m_binFilter
Gaudi::Property< std::string > m_binFilter
Definition: FPGATrackSimGenScanTool.h:119
FPGATrackSimGenScanTool::updateState
void updateState(const IntermediateState &inputstate, IntermediateState &outputstate, unsigned lyridx, const std::vector< const StoredHit * > &newhits)
Definition: FPGATrackSimGenScanTool.cxx:378
FPGATrackSimGenScanTool.h
Implements a generalized 5d scan which filters pair of hits in bins linearized about nominal trajecto...
AthMsgStreamMacros.h
FPGATrackSimGenScanTool::m_rin
Gaudi::Property< double > m_rin
Definition: FPGATrackSimGenScanTool.h:108
FPGATrackSimGenScanTool::addRoad
void addRoad(std::vector< const StoredHit * > const &hits, const FPGATrackSimGenScanBinningBase::IdxSet &idx)
Definition: FPGATrackSimGenScanTool.cxx:702
FPGATrackSimPlaneMap.h
Maps physical layers to logical layers.
FPGATrackSimGenScanTool::pairThenGroupFilter
StatusCode pairThenGroupFilter(const BinEntry &bindata, const FPGATrackSimGenScanBinningBase::IdxSet &bin, std::vector< HitPairSet > &output_pairset)
Definition: FPGATrackSimGenScanTool.cxx:316
FPGATrackSimTrackPars
Definition: FPGATrackSimTrackPars.h:22
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
FPGATrackSimGenScanTool::m_roads
std::vector< FPGATrackSimRoad > m_roads
Definition: FPGATrackSimGenScanTool.h:323
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
FPGATrackSimTrackPars::IZ0
@ IZ0
Definition: FPGATrackSimTrackPars.h:49
IFPGATrackSimMappingSvc.h
FPGATrackSimGenScanTool::fillImage
StatusCode fillImage(const std::vector< std::shared_ptr< const FPGATrackSimHit >> &hits)
Definition: FPGATrackSimGenScanTool.cxx:242
FPGATrackSimGenScanBinningBase::ParSet
Definition: FPGATrackSimGenScanBinning.h:90
FPGATrackSimGenScanTool::StoredHit
Definition: FPGATrackSimGenScanTool.h:196
FPGATrackSimGenScanTool::HitPairSet::PhiOutExtrapCurved
double PhiOutExtrapCurved(const HitPair &pair, double r_out) const
Definition: FPGATrackSimGenScanTool.cxx:823
FPGATrackSimGenScanTool::BinEntry::addHit
void addHit(StoredHit hit)
Definition: FPGATrackSimGenScanTool.cxx:159
FPGATrackSimGenScanMonitoring.h
This is the monitoring for the FPGATrackSimGenScanTool.
FPGATrackSimGenScanTool::m_z0FractionalPadding
Gaudi::Property< double > m_z0FractionalPadding
Definition: FPGATrackSimGenScanTool.h:112
FPGATrackSimGenScanTool::makePairs
StatusCode makePairs(const std::vector< std::vector< const StoredHit * >> &hitsByLayer, HitPairSet &pairs)
Definition: FPGATrackSimGenScanTool.cxx:507
FPGATrackSimGenScanTool::FPGATrackSimGenScanTool
FPGATrackSimGenScanTool(const std::string &, const std::string &, const IInterface *)
Definition: FPGATrackSimGenScanTool.cxx:55
bin
Definition: BinsDiffFromStripMedian.h:43
FPGATrackSimGenScanTool::HitPairSet::MatchEta
double MatchEta(const HitPair &pair) const
Definition: FPGATrackSimGenScanTool.cxx:778
FPGATrackSimGenScanTool::sortHitsByLayer
StatusCode sortHitsByLayer(const BinEntry &bindata, std::vector< std::vector< const StoredHit * >> &hitsByLayer)
Definition: FPGATrackSimGenScanTool.cxx:489
FPGATrackSimGenScanTool::StoredHit::etaShift
double etaShift
Definition: FPGATrackSimGenScanTool.h:199
FPGATrackSimGenScanTool::HitPairSet::DeltaDeltaPhi
double DeltaDeltaPhi(const HitPair &pair) const
Definition: FPGATrackSimGenScanTool.cxx:793
FPGATrackSimGenScanTool::HitPair::EtaOutExtrap
double EtaOutExtrap(double r_out) const
Definition: FPGATrackSimGenScanTool.h:241
FPGATrackSimGenScanTool::m_image
FPGATrackSimGenScanArray< BinEntry > m_image
Definition: FPGATrackSimGenScanTool.h:314
python.TurnDataReader.dr
dr
Definition: TurnDataReader.py:112
FPGATrackSimGenScanTool::m_qOverPtFractionalPadding
Gaudi::Property< double > m_qOverPtFractionalPadding
Definition: FPGATrackSimGenScanTool.h:115
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
FPGATrackSimGenScanTool::m_evtsProcessed
int m_evtsProcessed
Definition: FPGATrackSimGenScanTool.h:306
FPGATrackSimGenScanTool::HitPairSet::hasHit
bool hasHit(const StoredHit *hit) const
Definition: FPGATrackSimGenScanTool.cxx:734
FPGATrackSimGenScanTool::IntermediateState
Definition: FPGATrackSimGenScanTool.h:299
dqutils::padding
std::atomic< int > padding
Definition: MonitoringFile_MoveVertexMonitoring.cxx:20
FPGATrackSimGenScanTool::m_EvtSel
ServiceHandle< IFPGATrackSimEventSelectionSvc > m_EvtSel
Definition: FPGATrackSimGenScanTool.h:95
FPGATrackSimGenScanTool::StoredHit::layer
int layer
Definition: FPGATrackSimGenScanTool.h:200
DeMoUpdate.reverse
reverse
Definition: DeMoUpdate.py:563
python.CreateTierZeroArgdict.pairs
pairs
Definition: CreateTierZeroArgdict.py:201
FPGATrackSimGenScanTool::HitPair::dR
double dR() const
Definition: FPGATrackSimGenScanTool.h:226
FPGATrackSimRegionMap.h
Maps ITK module indices to FPGATrackSim regions.
FPGATrackSimGenScanTool::m_pairFilterPhiExtrapCut
Gaudi::Property< std::vector< double > > m_pairFilterPhiExtrapCut
Definition: FPGATrackSimGenScanTool.h:125
FPGATrackSimGenScanTool::m_binning
ToolHandle< FPGATrackSimGenScanBinningBase > m_binning
Definition: FPGATrackSimGenScanTool.h:99
FPGATrackSimGenScanTool::getSubRegion
virtual int getSubRegion() const override
Definition: FPGATrackSimGenScanTool.h:87
FPGATrackSimGenScanTool::m_validScan
FPGATrackSimGenScanArray< int > m_validScan
Definition: FPGATrackSimGenScanTool.h:319
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
FPGATrackSimGenScanTool::IntermediateState::pairsets
std::vector< HitPairSet > pairsets
Definition: FPGATrackSimGenScanTool.h:301
FPGATrackSimGenScanBinningBase::NPars
static constexpr unsigned NPars
Definition: FPGATrackSimGenScanBinning.h:232
FPGATrackSimGenScanTool::m_parBins
Gaudi::Property< std::vector< unsigned > > m_parBins
Definition: FPGATrackSimGenScanTool.h:106
FPGATrackSimGenScanTool::m_pairSetDeltaDeltaEtaCut
Gaudi::Property< double > m_pairSetDeltaDeltaEtaCut
Definition: FPGATrackSimGenScanTool.h:132
FPGATrackSimGenScanTool::m_pairSetDeltaEtaCurvatureCut
Gaudi::Property< double > m_pairSetDeltaEtaCurvatureCut
Definition: FPGATrackSimGenScanTool.h:136
FPGATrackSimGenScanTool::m_FPGATrackSimBankSvc
ServiceHandle< IFPGATrackSimBankSvc > m_FPGATrackSimBankSvc
Definition: FPGATrackSimGenScanTool.h:96
FPGATrackSimGenScanTool::m_validSlice
FPGATrackSimGenScanArray< int > m_validSlice
Definition: FPGATrackSimGenScanTool.h:318
FPGATrackSimGenScanTool::HitPairSet::PhiCurvature
double PhiCurvature(const HitPair &pair) const
Definition: FPGATrackSimGenScanTool.cxx:802
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
urldecode::states
states
Definition: urldecode.h:39
TauGNNUtils::Variables::Track::dPhi
bool dPhi(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:538
FPGATrackSimGenScanTool::m_threshold
Gaudi::Property< unsigned > m_threshold
Definition: FPGATrackSimGenScanTool.h:117
FPGATrackSimGenScanTool::incrementalBuildFilter
StatusCode incrementalBuildFilter(const BinEntry &bindata, const FPGATrackSimGenScanBinningBase::IdxSet &bin, std::vector< HitPairSet > &output_pairset)
Definition: FPGATrackSimGenScanTool.cxx:459
operator<<
std::ostream & operator<<(std::ostream &os, const FPGATrackSimGenScanTool::StoredHit &hit)
Definition: FPGATrackSimGenScanTool.cxx:43
FPGATrackSimGenScanTool::HitPairSet
Definition: FPGATrackSimGenScanTool.h:254
BindingsTest.cut
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.
Definition: BindingsTest.py:13
FPGATrackSimGenScanTool::HitPairSet::DeltaDeltaEta
double DeltaDeltaEta(const HitPair &pair) const
Definition: FPGATrackSimGenScanTool.cxx:797
FPGATrackSimGenScanTool::m_pairSetDeltaPhiCurvatureCut
Gaudi::Property< double > m_pairSetDeltaPhiCurvatureCut
Definition: FPGATrackSimGenScanTool.h:135
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
FPGATrackSimGenScanTool::m_pairSetEtaCurvatureCut
Gaudi::Property< double > m_pairSetEtaCurvatureCut
Definition: FPGATrackSimGenScanTool.h:134
FPGATrackSimGenScanTool::HitPairSet::DeltaPhiCurvature
double DeltaPhiCurvature(const HitPair &pair) const
Definition: FPGATrackSimGenScanTool.cxx:810
FPGATrackSimGenScanTool::m_d0FractionalPadding
Gaudi::Property< double > m_d0FractionalPadding
Definition: FPGATrackSimGenScanTool.h:111
FPGATrackSimGenScanTool::HitPairSet::addPair
int addPair(const HitPair &pair)
Definition: FPGATrackSimGenScanTool.cxx:743
FPGATrackSimGenScanTool::m_monitoring
ToolHandle< FPGATrackSimGenScanMonitoring > m_monitoring
Definition: FPGATrackSimGenScanTool.h:98
FPGATrackSimGenScanTool::BinEntry::hitCnt
unsigned int hitCnt
Definition: FPGATrackSimGenScanTool.h:211
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
inRange
bool inRange(const double *boundaries, const double value, const double tolerance=0.02)
Definition: LArSCIdVsIdTest.cxx:5
fill
void fill(H5::Group &out_file, size_t iterations)
Definition: test-hdf5-writer.cxx:95
FPGATrackSimGenScanTool::computeValidBins
void computeValidBins()
Definition: FPGATrackSimGenScanTool.cxx:833
FPGATrackSimGenScanTool::m_pairSetDeltaDeltaPhiCut
Gaudi::Property< double > m_pairSetDeltaDeltaPhiCut
Definition: FPGATrackSimGenScanTool.h:131
FPGATrackSimGenScanTool::pairPassesFilter
bool pairPassesFilter(const HitPair &pair)
Definition: FPGATrackSimGenScanTool.cxx:542
FPGATrackSimGenScanTool::BinEntry::reset
void reset()
Definition: FPGATrackSimGenScanTool.cxx:152
FPGATrackSimGenScanTool::getRoads
virtual StatusCode getRoads(const std::vector< std::shared_ptr< const FPGATrackSimHit >> &hits, std::vector< std::shared_ptr< const FPGATrackSimRoad >> &road) override
Definition: FPGATrackSimGenScanTool.cxx:172
FPGATrackSimGenScanTool::groupPairs
StatusCode groupPairs(HitPairSet &filteredpairs, std::vector< HitPairSet > &clusters, bool verbose)
Definition: FPGATrackSimGenScanTool.cxx:567
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:29
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
FPGATrackSimGenScanTool::m_pairSetMatchPhiCut
Gaudi::Property< double > m_pairSetMatchPhiCut
Definition: FPGATrackSimGenScanTool.h:129
FPGATrackSimGenScanTool::HitPair::dPhi
double dPhi() const
Definition: FPGATrackSimGenScanTool.h:224
FPGATrackSimHit.h
: FPGATrackSim-specific class to represent an hit in the detector.
FPGATrackSimGenScanTool::HitPairSet::DeltaEtaCurvature
double DeltaEtaCurvature(const HitPair &pair) const
Definition: FPGATrackSimGenScanTool.cxx:814
FPGATrackSimGenScanTool::m_pairFilterDeltaEtaCut
Gaudi::Property< std::vector< double > > m_pairFilterDeltaEtaCut
Definition: FPGATrackSimGenScanTool.h:124
FPGATrackSimTrackPars::parName
static std::string parName(unsigned i)
Definition: FPGATrackSimTrackPars.cxx:72
FPGATrackSimTrackPars::IPHI
@ IPHI
Definition: FPGATrackSimTrackPars.h:49
FPGATrackSimGenScanTool::HitPairSet::pairList
std::vector< HitPair > pairList
Definition: FPGATrackSimGenScanTool.h:259
FPGATrackSimGenScanTool::m_applyPairSetFilter
Gaudi::Property< bool > m_applyPairSetFilter
Definition: FPGATrackSimGenScanTool.h:128
FPGATrackSimGenScanTool::StoredHit::phiShift
double phiShift
Definition: FPGATrackSimGenScanTool.h:198
python.PyAthena.v
v
Definition: PyAthena.py:154
FPGATrackSimGenScanTool::HitPair::dEta
double dEta() const
Definition: FPGATrackSimGenScanTool.h:225
FPGATrackSimGenScanTool::m_phiFractionalPadding
Gaudi::Property< double > m_phiFractionalPadding
Definition: FPGATrackSimGenScanTool.h:114
FPGATrackSimGenScanTool::HitPair
Definition: FPGATrackSimGenScanTool.h:221
IFPGATrackSimEventSelectionSvc.h
FPGATrackSimGenScanTool::HitPairSet::lastpair
const HitPair & lastpair() const
Definition: FPGATrackSimGenScanTool.h:274
FPGATrackSimGenScanTool::m_nLayers
unsigned m_nLayers
Definition: FPGATrackSimGenScanTool.h:307
FPGATrackSimGenScanTool::StoredHit::hitptr
std::shared_ptr< const FPGATrackSimHit > hitptr
Definition: FPGATrackSimGenScanTool.h:197
FPGATrackSimGenScanTool::HitPairSet::EtaCurvature
double EtaCurvature(const HitPair &pair) const
Definition: FPGATrackSimGenScanTool.cxx:806
FPGATrackSimGenScanTool::m_FPGATrackSimMapping
ServiceHandle< IFPGATrackSimMappingSvc > m_FPGATrackSimMapping
Definition: FPGATrackSimGenScanTool.h:97
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
layer_bitmask_t
uint32_t layer_bitmask_t
Definition: FPGATrackSimTypes.h:22
FPGATrackSimGenScanArray::Iterator
Definition: FPGATrackSimGenScanArray.h:127
FPGATrackSimGenScanTool::m_applyPairFilter
Gaudi::Property< bool > m_applyPairFilter
Definition: FPGATrackSimGenScanTool.h:121
python.TriggerHandler.verbose
verbose
Definition: TriggerHandler.py:297
DeMoScan.first
bool first
Definition: DeMoScan.py:536
FPGATrackSimGenScanTool::HitPairSet::lyrCnt
unsigned int lyrCnt() const
Definition: FPGATrackSimGenScanTool.h:279
FPGATrackSimTrackPars::NPARS
@ NPARS
Definition: FPGATrackSimTrackPars.h:49
FPGATrackSimGenScanTool::BinEntry::hits
std::vector< StoredHit > hits
Definition: FPGATrackSimGenScanTool.h:213
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
FPGATrackSimGenScanTool::m_rout
Gaudi::Property< double > m_rout
Definition: FPGATrackSimGenScanTool.h:109
FPGATrackSimGenScanTool::m_pairSetPhiExtrapCurvedCut
Gaudi::Property< std::vector< double > > m_pairSetPhiExtrapCurvedCut
Definition: FPGATrackSimGenScanTool.h:137
FPGATrackSimGenScanTool::HitPairSet::PhiInExtrapCurved
double PhiInExtrapCurved(const HitPair &pair, double r_in) const
Definition: FPGATrackSimGenScanTool.cxx:818
calibdata.copy
bool copy
Definition: calibdata.py:27
FPGATrackSimGenScanTool::HitPairSet::MatchPhi
double MatchPhi(const HitPair &pair) const
Definition: FPGATrackSimGenScanTool.cxx:764
TauGNNUtils::Variables::Track::dEta
bool dEta(const xAOD::TauJet &tau, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:527
FPGATrackSimGenScanTool::m_validSliceAndScan
FPGATrackSimGenScanArray< int > m_validSliceAndScan
Definition: FPGATrackSimGenScanTool.h:320
FPGATrackSimGenScanTool::BinEntry
Definition: FPGATrackSimGenScanTool.h:206
FPGATrackSimGenScanTool::m_reversePairDir
Gaudi::Property< bool > m_reversePairDir
Definition: FPGATrackSimGenScanTool.h:122
FPGATrackSimGenScanTool::m_pairFilterDeltaPhiCut
Gaudi::Property< std::vector< double > > m_pairFilterDeltaPhiCut
Definition: FPGATrackSimGenScanTool.h:123
FPGATrackSimGenScanTool::m_pairSetMatchEtaCut
Gaudi::Property< double > m_pairSetMatchEtaCut
Definition: FPGATrackSimGenScanTool.h:130
FPGATrackSimTypes.h
FPGATrackSimGenScanArray::setsize
void setsize(const std::vector< unsigned int > &dims, const T &initval)
Definition: FPGATrackSimGenScanArray.h:51
FPGATrackSimGenScanTool::m_pairingLayers
std::vector< unsigned int > m_pairingLayers
Definition: FPGATrackSimGenScanTool.h:308
FPGATrackSimGenScanTool::m_etaFractionalPadding
Gaudi::Property< double > m_etaFractionalPadding
Definition: FPGATrackSimGenScanTool.h:113
FPGATrackSimGenScanTool::m_validBin
FPGATrackSimGenScanArray< int > m_validBin
Definition: FPGATrackSimGenScanTool.h:317
FPGATrackSimGenScanTool::m_parMax
Gaudi::Property< std::vector< float > > m_parMax
Definition: FPGATrackSimGenScanTool.h:105
FPGATrackSimRoad
Definition: FPGATrackSimRoad.h:30
FPGATrackSimGenScanTool::HitPair::EtaInExtrap
double EtaInExtrap(double r_in) const
Definition: FPGATrackSimGenScanTool.h:244
sortByLayer
std::vector< std::vector< std::shared_ptr< const FPGATrackSimHit > > > sortByLayer(Container const &hits)
Definition: FPGATrackSimHit.h:270
FPGATrackSimTrackPars::IETA
@ IETA
Definition: FPGATrackSimTrackPars.h:49
FPGATrackSimGenScanTool::HitPair::PhiOutExtrap
double PhiOutExtrap(double r_out) const
Definition: FPGATrackSimGenScanTool.h:234