Skip to content

Commit

Permalink
fix: Track selector printouts to be in line with actual cuts (#3815)
Browse files Browse the repository at this point in the history
Minor fix to the printouts in the track selector to show the right limits applied to the counters. 
 





<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **New Features**
	- Enhanced output clarity with new printing functions for cut values in track selection.
	- Added validation checks for `etaMax` parameter and improved error handling for bin indexing.

- **Bug Fixes**
	- Updated logic for evaluating track validity to ensure accurate results.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
pbutti authored Nov 12, 2024
1 parent 6ad165b commit 5fc391b
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions Core/include/Acts/TrackFinding/TrackSelector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,24 +304,32 @@ inline TrackSelector::Config& TrackSelector::Config::pt(double min,

inline std::ostream& operator<<(std::ostream& os,
const TrackSelector::Config& cuts) {
auto print = [&](const char* name, const auto& min, const auto& max) {
// for printing cuts set up with `within`
auto printMinMax = [&](const char* name, const auto& min, const auto& max) {
os << " - " << min << " <= " << name << " < " << max << "\n";
};
// for printing cuts set up with `checkMin`
auto printMin = [&](const char* name, const auto& min) {
os << " - " << min << " <= " << name << "\n";
};
// for printing cuts set up with `checkMax`
auto printMax = [&](const char* name, const auto& max) {
os << " - " << name << " <= " << max << "\n";
};

print("loc0", cuts.loc0Min, cuts.loc0Max);
print("loc1", cuts.loc1Min, cuts.loc1Max);
print("time", cuts.timeMin, cuts.timeMax);
print("phi", cuts.phiMin, cuts.phiMax);
print("eta", cuts.etaMin, cuts.etaMax);
print("absEta", cuts.absEtaMin, cuts.absEtaMax);
print("pt", cuts.ptMin, cuts.ptMax);
print("nHoles", 0, cuts.maxHoles);
print("nOutliers", 0, cuts.maxOutliers);
print("nHoles + nOutliers", 0, cuts.maxHolesAndOutliers);
print("nSharedHits", 0, cuts.maxSharedHits);
print("chi2", 0.0, cuts.maxChi2);
os << " - " << cuts.minMeasurements << " <= nMeasurements\n";

printMinMax("loc0", cuts.loc0Min, cuts.loc0Max);
printMinMax("loc1", cuts.loc1Min, cuts.loc1Max);
printMinMax("time", cuts.timeMin, cuts.timeMax);
printMinMax("phi", cuts.phiMin, cuts.phiMax);
printMinMax("eta", cuts.etaMin, cuts.etaMax);
printMinMax("absEta", cuts.absEtaMin, cuts.absEtaMax);
printMinMax("pt", cuts.ptMin, cuts.ptMax);
printMax("nHoles", cuts.maxHoles);
printMax("nOutliers", cuts.maxOutliers);
printMax("nHoles + nOutliers", cuts.maxHolesAndOutliers);
printMax("nSharedHits", cuts.maxSharedHits);
printMax("chi2", cuts.maxChi2);
printMin("nMeasurements", cuts.minMeasurements);
return os;
}

Expand Down

0 comments on commit 5fc391b

Please sign in to comment.