ATLAS Offline Software
Typedefs | Functions
ActsTrk::ScoreBasedSolverCutsImpl Namespace Reference

Typedefs

using trackProxy_t = ActsTrk::MutableTrackContainer::ConstTrackProxy
 

Functions

ActsTrk::MutableTrackContainer addSummaryInformation (ActsTrk::TrackContainer trackContainer)
 Adds summary information to the track container. More...
 
bool doubleHolesFilter (const trackProxy_t &track)
 Filter for tracks based on double holes. More...
 
void innermostPixelLayerHitsScore (const trackProxy_t &track, double &score)
 Score modifier for tracks based on innermost pixel layer hits. More...
 
void ContribPixelLayersScore (const trackProxy_t &track, double &score)
 Score modifier for tracks based on contributing pixel layers. More...
 
bool etaDependentCuts (const trackProxy_t &track, ServiceHandle< InDet::IInDetEtaDependentCutsSvc > etaDependentCutsSvc)
 Filter for tracks based on eta dependent cuts. More...
 
void patternTrackHitSelection (const trackProxy_t &track, const trackProxy_t::ConstTrackStateProxy &ts, Acts::ScoreBasedAmbiguityResolution::TrackStateTypes &trackStateType)
 Hit selection for tracks based on pattern track hits. More...
 

Typedef Documentation

◆ trackProxy_t

using ActsTrk::ScoreBasedSolverCutsImpl::trackProxy_t = typedef ActsTrk::MutableTrackContainer::ConstTrackProxy

Definition at line 27 of file ScoreBasedSolverCutsImpl.h.

Function Documentation

◆ addSummaryInformation()

ActsTrk::MutableTrackContainer ActsTrk::ScoreBasedSolverCutsImpl::addSummaryInformation ( ActsTrk::TrackContainer  trackContainer)

Adds summary information to the track container.

Definition at line 31 of file ScoreBasedSolverCutsImpl.cxx.

32  {
33 
34  ActsTrk::MutableTrackContainer updatedTracks;
35  updatedTracks.ensureDynamicColumns(trackContainer);
36 
37  updatedTracks.addColumn<unsigned int>("nInnermostPixelLayerHits");
38  updatedTracks.addColumn<unsigned int>("nSCTDoubleHoles");
39  updatedTracks.addColumn<unsigned int>("nContribPixelLayers");
40 
41  for (auto track : trackContainer) {
42  auto iTrack = track.index();
43  auto destProxy = updatedTracks.getTrack(updatedTracks.addTrack());
44  destProxy.copyFrom(trackContainer.getTrack(iTrack));
45  }
46 
47  unsigned int pixelVoulmeIds[] = {8, 9, 10, 13, 14, 15, 16, 17, 18, 19, 20};
48 
49  for (auto track : updatedTracks) {
50  bool doubleFlag = false;
51  int nDoubleHoles = 0;
52  int nInnermostPixelLayerHits = 0;
53  int nContribPixelLayers = 0;
54  for (const auto &ts : track.trackStatesReversed()) {
55  if (!ts.hasReferenceSurface()) {
56  continue;
57  }
58  // Check if the volume is the innermost pixel layer
59  // Compute the number of hits in the innermost pixel layer
60  auto iVolume = ts.referenceSurface().geometryId().volume();
61  if (iVolume == 8) {
62  nInnermostPixelLayerHits++;
63  }
64  if (std::find(std::begin(pixelVoulmeIds), std::end(pixelVoulmeIds),
65  iVolume) != std::end(pixelVoulmeIds)) {
66  nContribPixelLayers++;
67  }
68 
69  // Check if the track state has a hole flag
70  // Compute the number of double holes
71  auto iTypeFlags = ts.typeFlags();
72  if (!iTypeFlags.test(Acts::TrackStateFlag::HoleFlag)) {
73  doubleFlag = false;
74  }
75  if (iTypeFlags.test(Acts::TrackStateFlag::HoleFlag)) {
76  if (doubleFlag) {
77  nDoubleHoles++;
78  doubleFlag = false;
79  } else {
80  doubleFlag = true;
81  }
82  }
83  }
84  track.template component<unsigned int>(Acts::hashString(
85  "nInnermostPixelLayerHits")) = nInnermostPixelLayerHits;
86  track.template component<unsigned int>(
87  Acts::hashString("nSCTDoubleHoles")) = nDoubleHoles;
88  track.template component<unsigned int>(
89  Acts::hashString("nContribPixelLayers")) = nContribPixelLayers;
90  }
91 
92  return updatedTracks;
93 }

◆ ContribPixelLayersScore()

void ActsTrk::ScoreBasedSolverCutsImpl::ContribPixelLayersScore ( const trackProxy_t track,
double &  score 
)

Score modifier for tracks based on contributing pixel layers.

Definition at line 143 of file ScoreBasedSolverCutsImpl.cxx.

143  {
144 
145  const int maxPixelLayITk = 16;
146  auto maxPixLay = maxPixelLayITk;
147  double maxScore = 30.0;
148  double minScore = 5.00;
149  int maxBarrel = 10;
150  int minBarrel = 3;
151  int minEnd = 5;
152 
153  double step[2] = {(maxScore - minScore) / (maxBarrel - minBarrel),
154  (maxScore - minScore) / (maxPixelLayITk - minEnd)};
155 
156  std::vector<double> factorPixLay;
157  for (int i = 0; i <= maxPixelLayITk; i++) {
158  if (i < minEnd)
159  factorPixLay.push_back(0.01 + (i * 0.33));
160  else
161  factorPixLay.push_back(minScore + ((i - minEnd) * step[1]));
162  }
163 
164  int iPixLay = 0;
165  Acts::HashedString hash_nMeasSubDet =
166  Acts::hashString("nContribPixelLayers");
167  if (track.container().hasColumn(hash_nMeasSubDet)) {
168  iPixLay = track.component<unsigned int>(hash_nMeasSubDet);
169  } else {
170  return;
171  }
172 
173  if (iPixLay > -1 && maxPixLay > 0) {
174  if (iPixLay > maxPixLay) {
175  score *= (iPixLay - maxPixLay + 1); // layers are good !
176  iPixLay = maxPixLay;
177  }
178  score *= factorPixLay[iPixLay];
179  }
180 }

◆ doubleHolesFilter()

bool ActsTrk::ScoreBasedSolverCutsImpl::doubleHolesFilter ( const trackProxy_t track)

Filter for tracks based on double holes.

Definition at line 96 of file ScoreBasedSolverCutsImpl.cxx.

96  {
97 
98  int n_doubleHoles = 0;
99  int max_doubleHoles = 2;
100  Acts::HashedString hash_nMeasSubDet =
101  Acts::hashString("nSCTDoubleHoles");
102  if (track.container().hasColumn(hash_nMeasSubDet)) {
103  n_doubleHoles = track.component<unsigned int>(hash_nMeasSubDet);
104  } else {
105  return false;
106  }
107  if (n_doubleHoles > max_doubleHoles) {
108  return true;
109  }
110  return false;
111 }

◆ etaDependentCuts()

bool ActsTrk::ScoreBasedSolverCutsImpl::etaDependentCuts ( const trackProxy_t track,
ServiceHandle< InDet::IInDetEtaDependentCutsSvc etaDependentCutsSvc 
)

Filter for tracks based on eta dependent cuts.

Definition at line 184 of file ScoreBasedSolverCutsImpl.cxx.

184  {
185  auto trackEta = Acts::VectorHelpers::eta(track.momentum());
186  auto parm = track.parameters();
187 
188  double maxEta = etaDependentCutsSvc->getMaxEta();
189  if (std::abs(trackEta) > maxEta) {
190  return true;
191  }
192 
193  double maxZ0 = etaDependentCutsSvc->getMaxZImpactAtEta(trackEta);
194  if (std::abs(parm[Acts::BoundIndices::eBoundLoc1]) > maxZ0) {
195  return true;
196  }
197 
198  double maxD0 = etaDependentCutsSvc->getMaxPrimaryImpactAtEta(trackEta);
199 
200  if (std::abs(parm[Acts::BoundIndices::eBoundLoc0]) > maxD0) {
201  return true;
202  }
203 
204  return false;
205 }

◆ innermostPixelLayerHitsScore()

void ActsTrk::ScoreBasedSolverCutsImpl::innermostPixelLayerHitsScore ( const trackProxy_t track,
double &  score 
)

Score modifier for tracks based on innermost pixel layer hits.

Definition at line 114 of file ScoreBasedSolverCutsImpl.cxx.

114  {
115  int bLayerHits = 0;
116  const int maxB_LayerHitsITk = 8;
117  auto maxB_LayerHits = maxB_LayerHitsITk;
118  const double blayModi[maxB_LayerHitsITk + 1] = {0.25, 4.0, 4.5, 5.0, 5.5,
119  6.0, 6.5, 7.0, 7.5};
120 
121  std::vector<double> factorB_LayerHits;
122 
123  for (int i = 0; i <= maxB_LayerHits; ++i)
124  factorB_LayerHits.push_back(blayModi[i]);
125  Acts::HashedString hash_nMeasSubDet =
126  Acts::hashString("nInnermostPixelLayerHits");
127  if (track.container().hasColumn(hash_nMeasSubDet)) {
128  bLayerHits = track.component<unsigned int>(hash_nMeasSubDet);
129  } else {
130  return;
131  }
132 
133  if (bLayerHits > -1 && maxB_LayerHits > 0) {
134  if (bLayerHits > maxB_LayerHits) {
135  score *= (bLayerHits - maxB_LayerHits + 1); // hits are good !
136  bLayerHits = maxB_LayerHits;
137  }
138  score *= factorB_LayerHits[bLayerHits];
139  }
140 }

◆ patternTrackHitSelection()

void ActsTrk::ScoreBasedSolverCutsImpl::patternTrackHitSelection ( const trackProxy_t track,
const trackProxy_t::ConstTrackStateProxy &  ts,
Acts::ScoreBasedAmbiguityResolution::TrackStateTypes &  trackStateType 
)

Hit selection for tracks based on pattern track hits.

Definition at line 209 of file ScoreBasedSolverCutsImpl.cxx.

211  {
212  bool ispatternTrack = false;
213  Acts::HashedString hash_nMeasSubDet = Acts::hashString("ispatternTrack");
214  if (track.container().hasColumn(hash_nMeasSubDet)) {
215  ispatternTrack = track.component<unsigned int>(hash_nMeasSubDet);
216  }
217  if (ts.typeFlags().test(Acts::TrackStateFlag::OutlierFlag) &&
218  ispatternTrack) {
219  trackStateType =
220  Acts::ScoreBasedAmbiguityResolution::TrackStateTypes::RejectedHit;
221  } else if (ts.typeFlags().test(Acts::TrackStateFlag::OutlierFlag) &&
222  !ispatternTrack) {
223  // Copy the hit to the track
224  trackStateType =
225  Acts::ScoreBasedAmbiguityResolution::TrackStateTypes::Outlier;
226  }
227 }
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
PUfitVar::maxEta
constexpr float maxEta
Definition: GepMETPufitAlg.cxx:13
lumiFormat.i
int i
Definition: lumiFormat.py:85
xAOD::score
@ score
Definition: TrackingPrimitives.h:513
LArCellBinning.step
step
Definition: LArCellBinning.py:158
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
python.CaloScaleNoiseConfig.ts
ts
Definition: CaloScaleNoiseConfig.py:86
ActsTrk::MutableTrackContainer
Definition: TrackContainer.h:122
TauGNNUtils::Variables::Track::trackEta
bool trackEta(const xAOD::TauJet &, const xAOD::TauTrack &track, double &out)
Definition: TauGNNUtils.cxx:477