Skip to content

Commit

Permalink
refactor: Refactor FPE masks in Examples (#2581)
Browse files Browse the repository at this point in the history
We are currently mixing where we set masks and some of them are not accurate anymore. Here I try to reduce the masks to a minimum and set them in the code when appropriate.

blocked by:
- #2580
  • Loading branch information
andiwand authored Oct 28, 2023
1 parent fa3e67e commit 166c57a
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 72 deletions.
8 changes: 0 additions & 8 deletions CI/physmon/fpe_masks.yml

This file was deleted.

3 changes: 0 additions & 3 deletions CI/physmon/workflows/physmon_ckf_tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ def run_ckf_tracking(truthSmearedSeeded, truthEstimatedSeeded, label):
events=500,
numThreads=-1,
logLevel=acts.logging.INFO,
fpeMasks=acts.examples.Sequencer.FpeMask.fromFile(
Path(__file__).parent.parent / "fpe_masks.yml"
),
)

tp = Path(temp)
Expand Down
3 changes: 0 additions & 3 deletions CI/physmon/workflows/physmon_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
events=1000,
numThreads=1,
logLevel=acts.logging.INFO,
fpeMasks=acts.examples.Sequencer.FpeMask.fromFile(
Path(__file__).parent.parent / "fpe_masks.yml"
),
)

for d in setup.decorators:
Expand Down
48 changes: 0 additions & 48 deletions CI/physmon/workflows/physmon_track_finding_ttbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
addFatras,
addDigitization,
)

from acts.examples.reconstruction import (
addSeeding,
TruthSeedRanges,
Expand All @@ -34,57 +33,10 @@


with tempfile.TemporaryDirectory() as temp:
fpeMasks = acts.examples.Sequencer.FpeMask.fromFile(
Path(__file__).parent.parent / "fpe_masks.yml"
) + [
acts.examples.Sequencer.FpeMask(
"Examples/Algorithms/Fatras/src/FatrasSimulation.cpp",
(172, 173),
acts.FpeType.FLTINV,
1,
),
acts.examples.Sequencer.FpeMask(
"Examples/Algorithms/Fatras/src/FatrasSimulation.cpp",
(235, 236),
acts.FpeType.FLTINV,
1,
),
acts.examples.Sequencer.FpeMask(
"Examples/Algorithms/Fatras/src/FatrasSimulation.cpp",
(235, 236),
acts.FpeType.FLTOVF,
1,
),
acts.examples.Sequencer.FpeMask(
"Examples/Io/Root/src/RootTrajectorySummaryWriter.cpp",
(371, 372),
acts.FpeType.FLTINV,
1,
),
acts.examples.Sequencer.FpeMask(
"Core/src/Utilities/AnnealingUtility.cpp",
(38, 39),
acts.FpeType.FLTUND,
1,
),
acts.examples.Sequencer.FpeMask(
"Fatras/include/ActsFatras/Kernel/detail/SimulationActor.hpp",
(110, 111),
acts.FpeType.FLTINV,
1,
),
acts.examples.Sequencer.FpeMask(
"Fatras/include/ActsFatras/Kernel/Simulation.hpp",
(96, 97),
acts.FpeType.FLTOVF,
1,
),
]
s = acts.examples.Sequencer(
events=3,
numThreads=-1,
logLevel=acts.logging.INFO,
fpeMasks=fpeMasks,
)

tp = Path(temp)
Expand Down
3 changes: 0 additions & 3 deletions CI/physmon/workflows/physmon_truth_tracking_gsf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
events=10000,
numThreads=-1,
logLevel=acts.logging.INFO,
fpeMasks=acts.examples.Sequencer.FpeMask.fromFile(
Path(__file__).parent.parent / "fpe_masks.yml"
),
)

tp = Path(temp)
Expand Down
3 changes: 0 additions & 3 deletions CI/physmon/workflows/physmon_truth_tracking_kalman.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
events=10000,
numThreads=-1,
logLevel=acts.logging.INFO,
fpeMasks=acts.examples.Sequencer.FpeMask.fromFile(
Path(__file__).parent.parent / "fpe_masks.yml"
),
)

tp = Path(temp)
Expand Down
3 changes: 0 additions & 3 deletions CI/physmon/workflows/physmon_vertexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ def run_vertexing(fitter, mu, events):
events=events,
numThreads=-1,
logLevel=acts.logging.INFO,
fpeMasks=acts.examples.Sequencer.FpeMask.fromFile(
Path(__file__).parent.parent / "fpe_masks.yml"
),
)

tp = Path(temp)
Expand Down
2 changes: 1 addition & 1 deletion Core/include/Acts/TrackFitting/detail/GsfUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void computePosteriorWeights(
.data(),
state.predictedCovariance(), state.projector(), state.calibratedSize());

const auto factor = std::sqrt(1. / detR) * std::exp(-0.5 * chi2);
const auto factor = std::sqrt(1. / detR) * safeExp(-0.5 * chi2);

// If something is not finite here, just leave the weight as it is
if (std::isfinite(factor)) {
Expand Down
2 changes: 2 additions & 0 deletions Core/include/Acts/Vertexing/AdaptiveMultiVertexFinder.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,10 @@ auto Acts::AdaptiveMultiVertexFinder<vfitter_t, sfinder_t>::find(
break;
}
}
// MARK: fpeMaskBegin(FLTUND, 1, #2590)
bool keepVertex = isGoodVertex &&
keepNewVertex(vtxCandidate, allVerticesPtr, fitterState);
// MARK: fpeMaskEnd(FLTUND)
ACTS_DEBUG("New vertex will be saved: " << keepVertex);

// Delete vertex from allVertices list again if it's not kept
Expand Down

0 comments on commit 166c57a

Please sign in to comment.