Skip to content

Commit 16a78da

Browse files
committed
use named constants for the special hit indices
1 parent 043863c commit 16a78da

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

RecoTracker/MkFitCore/interface/Track.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ namespace mkfit {
437437
void addHitIdx(int hitIdx, int hitLyr, float chi2) {
438438
hitsOnTrk_.push_back({hitIdx, hitLyr});
439439
++lastHitIdx_;
440-
if (hitIdx >= 0 || hitIdx == -9) {
440+
if (hitIdx >= 0 || hitIdx == Hit::kHitCCCFilterIdx) {
441441
++nFoundHits_;
442442
chi2_ += chi2;
443443
}
@@ -503,7 +503,7 @@ namespace mkfit {
503503
void countAndSetNFoundHits() {
504504
nFoundHits_ = 0;
505505
for (int i = 0; i <= lastHitIdx_; i++) {
506-
if (hitsOnTrk_[i].index >= 0 || hitsOnTrk_[i].index == -9)
506+
if (hitsOnTrk_[i].index >= 0 || hitsOnTrk_[i].index == Hit::kHitCCCFilterIdx)
507507
nFoundHits_++;
508508
}
509509
}
@@ -553,7 +553,7 @@ namespace mkfit {
553553
const auto& hot = tmp_hitsOnTrk[ihit];
554554
const auto lyr = hot.layer;
555555
const auto idx = hot.index;
556-
if (lyr >= 0 && (idx >= 0 || idx == -9) && lyr != prev_lyr) {
556+
if (lyr >= 0 && (idx >= 0 || idx == Hit::kHitCCCFilterIdx) && lyr != prev_lyr) {
557557
++lyr_cnt;
558558
prev_lyr = lyr;
559559
}
@@ -568,7 +568,7 @@ namespace mkfit {
568568
std::vector<int> foundLayers() const {
569569
std::vector<int> layers;
570570
for (int ihit = 0; ihit <= lastHitIdx_; ++ihit) {
571-
if (hitsOnTrk_[ihit].index >= 0 || hitsOnTrk_[ihit].index == -9) {
571+
if (hitsOnTrk_[ihit].index >= 0 || hitsOnTrk_[ihit].index == Hit::kHitCCCFilterIdx) {
572572
layers.push_back(hitsOnTrk_[ihit].layer);
573573
}
574574
}

RecoTracker/MkFitCore/standalone/index-desc.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ Hit indices attached to HitOnTrack array for each track are described below.
1717

1818
Idx >= 0 : Track contains a reconstructed hit. Idx indicates position within container where hit resides. Before building in mkFit, idx (with layer number) points to the position within Event::layerHits_ [vector of vector of hits, first index: layer, second index: hit idx]. Just prior to building, hit idxs are translated into their position within layerHits_ to EventOfHits::m_layers_of_hits [vector of LayerOfHits, first index is layer, LayerOfHits class for containing array of Hits]. Building uses layers_of_hits, then for validation, the hits are translated back to layerHits_.
1919

20-
Idx == -1 : Track has not found a hit on this layer (true miss).
20+
Idx == -1 = kHitMissIdx : Track has not found a hit on this layer (true miss).
2121

22-
Idx == -2 : Track has reached maximum number of holes/misses (-1).
22+
Idx == -2 = kHitStopIdx : Track has reached maximum number of holes/misses (-1).
2323

24-
Idx == -3 : Track not in sensitive region of detector, does not count towards efficiency.
24+
Idx == -3 = kHitEdgeIdx : Track not in sensitive region of detector, does not count towards efficiency.
2525

26-
Idx == -5 : Dummy hit to mark hits with cluster size > maxClusterSize
26+
Idx == -5 = kHitMaxClusterIdx: Dummy hit to mark hits with cluster size > maxClusterSize
2727

28-
Idx == -7 : Dummy hit to mark the location of an inactive module
28+
Idx == -7 = kHitInGapIdx : Dummy hit to mark the location of an inactive module
2929

30-
Idx == -9 : Reference track contained a hit that has since been filtered out via CCC before written to memory file. -9 hits are NOT stored in layerHits_.
30+
Idx == -9 = kHitCCCFilterIdx : Reference track contained a hit that has since been filtered out via CCC before written to memory file. -9 hits are NOT stored in layerHits_.
3131

3232

3333
--------------------

0 commit comments

Comments
 (0)