Skip to content

Commit

Permalink
ci: Use TrackFitterPerformance writer for CKF (#3735)
Browse files Browse the repository at this point in the history
Adding `TrackFitterPerformanceWriter` to the track finding jobs in addition to `CKFPerformanceWriter`.

blocked by 
- #3742
  • Loading branch information
andiwand authored Oct 19, 2024
1 parent ac41c04 commit af1bcc6
Show file tree
Hide file tree
Showing 18 changed files with 110 additions and 55 deletions.
12 changes: 10 additions & 2 deletions CI/physmon/phys_perf_mon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,19 @@ function trackfinding() {
run_histcmp \
$outdir/data/$path/performance_ckf.root \
$refdir/$path/performance_ckf.root \
"CKF | ${name}" \
"CKF finding performance | ${name}" \
$path/performance_ckf.html \
$path/performance_ckf_plots \
--config $default_config

run_histcmp \
$outdir/data/$path/performance_fitting_ckf.root \
$refdir/$path/performance_fitting_ckf.root \
"CKF fitting performance | ${name}" \
$path/performance_fitting_ckf.html \
$path/performance_fitting_ckf_plots \
--config $default_config

run Examples/Scripts/generic_plotter.py \
$outdir/data/$path/tracksummary_ckf.root \
tracksummary \
Expand All @@ -252,7 +260,7 @@ function trackfinding() {
run_histcmp \
$outdir/data/$path/performance_ckf_ambi.root \
$refdir/$path/performance_ckf_ambi.root \
"Ambisolver | ${name}" \
"Ambisolver finding performance | ${name}" \
$path/performance_ckf_ambi.html \
$path/performance_ckf_ambi
fi
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 3 additions & 2 deletions CI/physmon/workflows/physmon_trackfinding_1muon.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def run_ckf_tracking(label, seeding):
maxSeedsPerSpM=1,
sigmaScattering=5,
radLengthPerSeed=0.1,
minPt=500 * u.MeV,
minPt=0.5 * u.GeV,
impactMax=3 * u.mm,
),
SeedFinderOptionsArg(bFieldInZ=2 * u.T),
Expand Down Expand Up @@ -163,8 +163,9 @@ def run_ckf_tracking(label, seeding):
if seeding != SeedingAlgorithm.TruthSmeared
else []
) + [
"performance_ckf.root",
"tracksummary_ckf.root",
"performance_fitting_ckf.root",
"performance_ckf.root",
]:
perf_file = tp / file
assert perf_file.exists(), f"Performance file not found {perf_file}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
maxSeedsPerSpM=1,
sigmaScattering=5,
radLengthPerSeed=0.1,
minPt=500 * u.MeV,
minPt=0.5 * u.GeV,
impactMax=3 * u.mm,
),
SeedFinderOptionsArg(bFieldInZ=2 * u.T, beamPos=(0.0, 0.0)),
Expand Down Expand Up @@ -195,6 +195,10 @@

s.run()

shutil.move(
tp / "performance_fitting_ambi.root",
tp / "performance_fitting_ckf_ambi.root",
)
shutil.move(
tp / "performance_ambi.root",
tp / "performance_ckf_ambi.root",
Expand All @@ -208,7 +212,9 @@
for file in [
"performance_seeding.root",
"tracksummary_ckf.root",
"performance_fitting_ckf.root",
"performance_ckf.root",
"performance_fitting_ckf_ambi.root",
"performance_ckf_ambi.root",
"performance_vertexing_ivf_notime.root",
"performance_vertexing_amvf_gauss_notime.root",
Expand Down
10 changes: 8 additions & 2 deletions CI/physmon/workflows/physmon_trackfinding_ttbar_pu200.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
maxSeedsPerSpM=1,
sigmaScattering=5,
radLengthPerSeed=0.1,
minPt=500 * u.MeV,
minPt=0.5 * u.GeV,
impactMax=3 * u.mm,
),
SeedFinderOptionsArg(bFieldInZ=2 * u.T, beamPos=(0.0, 0.0)),
Expand All @@ -118,7 +118,7 @@
setup.trackingGeometry,
setup.field,
TrackSelectorConfig(
pt=(500 * u.MeV, None),
pt=(0.5 * u.GeV, None),
loc0=(-4.0 * u.mm, 4.0 * u.mm),
nMeasurementsMin=6,
maxHoles=2,
Expand Down Expand Up @@ -179,6 +179,10 @@

s.run()

shutil.move(
tp / "performance_fitting_ambi.root",
tp / "performance_fitting_ckf_ambi.root",
)
shutil.move(
tp / "performance_ambi.root",
tp / "performance_ckf_ambi.root",
Expand All @@ -192,7 +196,9 @@
for file in [
"performance_seeding.root",
"tracksummary_ckf.root",
"performance_fitting_ckf.root",
"performance_ckf.root",
"performance_fitting_ckf_ambi.root",
"performance_ckf_ambi.root",
"performance_vertexing_amvf_gauss_notime.root",
"performance_vertexing_amvf_grid_time.root",
Expand Down
16 changes: 11 additions & 5 deletions Examples/Framework/src/Validation/ResPlotTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,21 +158,27 @@ void ActsExamples::ResPlotTool::fill(
auto trackParameter = fittedParamters.parameters();

// get the perigee surface
auto pSurface = &fittedParamters.referenceSurface();
const auto& pSurface = fittedParamters.referenceSurface();

// get the truth position and momentum
ParametersVector truthParameter = ParametersVector::Zero();

// get the truth perigee parameter
auto lpResult = pSurface->globalToLocal(gctx, truthParticle.position(),
truthParticle.direction());
if (lpResult.ok()) {
auto intersection =
pSurface
.intersect(gctx, truthParticle.position(), truthParticle.direction())
.closest();
if (intersection.isValid()) {
auto lpResult = pSurface.globalToLocal(gctx, intersection.position(),
truthParticle.direction());
assert(lpResult.ok());

truthParameter[Acts::BoundIndices::eBoundLoc0] =
lpResult.value()[Acts::BoundIndices::eBoundLoc0];
truthParameter[Acts::BoundIndices::eBoundLoc1] =
lpResult.value()[Acts::BoundIndices::eBoundLoc1];
} else {
ACTS_ERROR("Global to local transformation did not succeed.");
ACTS_ERROR("Cannot get the truth perigee parameter");
}
truthParameter[Acts::BoundIndices::eBoundPhi] =
phi(truthParticle.direction());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct AlgorithmContext;
///
/// Only considers the track finding itself, i.e. grouping of hits into tracks,
/// and computes relevant per-track and per-particles statistics.
class TrackFinderPerformanceWriter final : public WriterT<TrackContainer> {
class TrackFinderPerformanceWriter final : public WriterT<ConstTrackContainer> {
public:
struct Config {
/// Input reconstructed track collection.
Expand Down Expand Up @@ -59,7 +59,7 @@ class TrackFinderPerformanceWriter final : public WriterT<TrackContainer> {

private:
ProcessCode writeT(const AlgorithmContext& ctx,
const TrackContainer& tracks) override;
const ConstTrackContainer& tracks) override;

struct Impl;

Expand Down
4 changes: 2 additions & 2 deletions Examples/Io/Root/src/TrackFinderPerformanceWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ struct ActsExamples::TrackFinderPerformanceWriter::Impl {

const Acts::Logger& logger() const { return _logger; }

void write(std::uint64_t eventId, const TrackContainer& tracks,
void write(std::uint64_t eventId, const ConstTrackContainer& tracks,
const SimParticleContainer& particles,
const HitParticlesMap& hitParticlesMap,
const TrackParticleMatching& trackParticleMatching) {
Expand Down Expand Up @@ -276,7 +276,7 @@ ActsExamples::TrackFinderPerformanceWriter::~TrackFinderPerformanceWriter() =

ActsExamples::ProcessCode ActsExamples::TrackFinderPerformanceWriter::writeT(
const ActsExamples::AlgorithmContext& ctx,
const ActsExamples::TrackContainer& tracks) {
const ActsExamples::ConstTrackContainer& tracks) {
const auto& particles = m_impl->inputParticles(ctx);
const auto& hitParticlesMap = m_impl->inputMeasurementParticlesMap(ctx);
const auto& trackParticleMatching = m_impl->inputTrackParticleMatching(ctx);
Expand Down
Loading

0 comments on commit af1bcc6

Please sign in to comment.