From c4ba83638396f17e82ab7ca1e504c610172299f6 Mon Sep 17 00:00:00 2001 From: Carlo Varni <75478407+CarloVarni@users.noreply.github.com> Date: Tue, 11 Jul 2023 16:09:35 +0200 Subject: [PATCH 1/2] feat: clear method for Track Container (#2290) I figured this may come in handy --- Core/include/Acts/EventData/TrackContainer.hpp | 7 +++++++ .../Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Core/include/Acts/EventData/TrackContainer.hpp b/Core/include/Acts/EventData/TrackContainer.hpp index 18f5a724f0e..54a74bd0243 100644 --- a/Core/include/Acts/EventData/TrackContainer.hpp +++ b/Core/include/Acts/EventData/TrackContainer.hpp @@ -236,6 +236,13 @@ class TrackContainer { container().ensureDynamicColumns_impl(other.container()); } + /// Clear the content of the track container + template > + void clear() { + m_container->clear(); + m_traj->clear(); + } + protected: template > diff --git a/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp b/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp index 5dcf13e041e..020ffaa1bef 100644 --- a/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp +++ b/Examples/Algorithms/TrackFinding/src/TrackFindingAlgorithm.cpp @@ -134,8 +134,9 @@ ActsExamples::ProcessCode ActsExamples::TrackFindingAlgorithm::execute( unsigned int nSeed = 0; for (std::size_t iseed = 0; iseed < initialParameters.size(); ++iseed) { - trackContainerTemp->clear(); - trackStateContainerTemp->clear(); + // Clear trackContainerTemp and trackStateContainerTemp + tracksTemp.clear(); + auto result = (*m_cfg.findTracks)(initialParameters.at(iseed), options, tracksTemp); m_nTotalSeeds++; From 617d03f9ddcd8a26af65427515efe3cf21bd0e53 Mon Sep 17 00:00:00 2001 From: Andreas Stefl Date: Tue, 11 Jul 2023 17:34:00 +0200 Subject: [PATCH 2/2] chore: Accumulated small changes (#2293) I pulled this out of https://github.com/acts-project/acts/pull/2086 since it is not relevant there but I would still like to merge them. These changes are random improvements across the code base which should not have any effects on CPU or physics performance. --- CI/physmon/workflows/physmon_ckf_tracking.py | 6 +++--- CI/physmon/workflows/physmon_vertexing.py | 11 +++-------- Core/src/Material/Interactions.cpp | 6 +++--- Core/src/TrackFitting/GainMatrixSmoother.cpp | 2 -- .../include/ActsExamples/EventData/SimHit.hpp | 2 +- .../include/ActsExamples/EventData/SimParticle.hpp | 3 +-- Examples/Scripts/Python/digitization.py | 2 +- Examples/Scripts/Python/full_chain_odd.py | 2 +- 8 files changed, 13 insertions(+), 21 deletions(-) diff --git a/CI/physmon/workflows/physmon_ckf_tracking.py b/CI/physmon/workflows/physmon_ckf_tracking.py index 1ac953d2cc5..50cfb3f0573 100755 --- a/CI/physmon/workflows/physmon_ckf_tracking.py +++ b/CI/physmon/workflows/physmon_ckf_tracking.py @@ -90,12 +90,12 @@ def run_ckf_tracking(truthSmearedSeeded, truthEstimatedSeeded, label): s, setup.trackingGeometry, setup.field, - TruthSeedRanges(pt=(500.0 * u.MeV, None), nHits=(9, None)), + TruthSeedRanges(pt=(500 * u.MeV, None), nHits=(9, None)), ParticleSmearingSigmas( pRel=0.01 ), # only used by SeedingAlgorithm.TruthSmeared SeedFinderConfigArg( - r=(None, 200 * u.mm), # rMin=default, 33mm + r=(33 * u.mm, 200 * u.mm), deltaR=(1 * u.mm, 60 * u.mm), collisionRegion=(-250 * u.mm, 250 * u.mm), z=(-2000 * u.mm, 2000 * u.mm), @@ -105,7 +105,7 @@ def run_ckf_tracking(truthSmearedSeeded, truthEstimatedSeeded, label): minPt=500 * u.MeV, impactMax=3 * u.mm, ), - SeedFinderOptionsArg(bFieldInZ=1.99724 * u.T, beamPos=(0.0, 0.0)), + SeedFinderOptionsArg(bFieldInZ=2 * u.T), TruthEstimatedSeedingAlgorithmConfigArg(deltaR=(10.0 * u.mm, None)), seedingAlgorithm=SeedingAlgorithm.TruthSmeared if truthSmearedSeeded diff --git a/CI/physmon/workflows/physmon_vertexing.py b/CI/physmon/workflows/physmon_vertexing.py index 12dfc14511b..c0a7805e0cb 100755 --- a/CI/physmon/workflows/physmon_vertexing.py +++ b/CI/physmon/workflows/physmon_vertexing.py @@ -17,12 +17,9 @@ from acts.examples.reconstruction import ( addSeeding, - TruthSeedRanges, - ParticleSmearingSigmas, SeedFinderConfigArg, SeedFinderOptionsArg, SeedingAlgorithm, - TruthEstimatedSeedingAlgorithmConfigArg, addCKFTracks, addAmbiguityResolution, AmbiguityResolutionConfig, @@ -92,7 +89,7 @@ def run_vertexing(fitter, mu, events): setup.trackingGeometry, setup.field, SeedFinderConfigArg( - r=(None, 200 * u.mm), # rMin=default, 33mm + r=(33 * u.mm, 200 * u.mm), deltaR=(1 * u.mm, 60 * u.mm), collisionRegion=(-250 * u.mm, 250 * u.mm), z=(-2000 * u.mm, 2000 * u.mm), @@ -102,10 +99,9 @@ def run_vertexing(fitter, mu, events): minPt=500 * u.MeV, impactMax=3 * u.mm, ), - SeedFinderOptionsArg(bFieldInZ=1.99724 * u.T), + SeedFinderOptionsArg(bFieldInZ=2 * u.T), seedingAlgorithm=SeedingAlgorithm.Default, geoSelectionConfigFile=setup.geoSel, - rnd=rnd, # only used by SeedingAlgorithm.TruthSmeared ) addCKFTracks( @@ -113,9 +109,8 @@ def run_vertexing(fitter, mu, events): setup.trackingGeometry, setup.field, TrackSelectorConfig( - pt=(500 * u.MeV, None), loc0=(-4.0 * u.mm, 4.0 * u.mm), - absEta=(None, 3.0), + pt=(500 * u.MeV, None), nMeasurementsMin=6, ), ) diff --git a/Core/src/Material/Interactions.cpp b/Core/src/Material/Interactions.cpp index 64fdb51fd9b..133008c5f8f 100644 --- a/Core/src/Material/Interactions.cpp +++ b/Core/src/Material/Interactions.cpp @@ -201,10 +201,10 @@ float Acts::computeEnergyLossLandau(const MaterialSlab& slab, int /* unused */, const auto rq = Acts::RelativisticQuantities(m, qOverP, q); const auto eps = computeEpsilon(Ne, thickness, rq); const auto dhalf = computeDeltaHalf(I, Ne, rq); - const auto t = computeMassTerm(Me, rq); - // uses RPP2018 eq. 33.11 + const auto u = computeMassTerm(Me, rq); + // uses RPP2018 eq. 33.12 const auto running = - std::log(t / I) + std::log(eps / I) + 0.2f - rq.beta2 - 2 * dhalf; + std::log(u / I) + std::log(eps / I) + 0.2f - rq.beta2 - 2 * dhalf; return eps * running; } diff --git a/Core/src/TrackFitting/GainMatrixSmoother.cpp b/Core/src/TrackFitting/GainMatrixSmoother.cpp index a6c98bd47dc..659393973f3 100644 --- a/Core/src/TrackFitting/GainMatrixSmoother.cpp +++ b/Core/src/TrackFitting/GainMatrixSmoother.cpp @@ -26,8 +26,6 @@ Result GainMatrixSmoother::calculate( const Logger& logger) const { ACTS_VERBOSE("Prev. predicted covariance\n" << predictedCovariance(prev_ts) << "\n, inverse: \n" - << predictedCovariance(prev_ts).inverse() - << "\n, regularized inverse: \n" << predictedCovariance(prev_ts).inverse()); // Gain smoothing matrix diff --git a/Examples/Framework/include/ActsExamples/EventData/SimHit.hpp b/Examples/Framework/include/ActsExamples/EventData/SimHit.hpp index 5b883b5e54b..94ac2676fbf 100644 --- a/Examples/Framework/include/ActsExamples/EventData/SimHit.hpp +++ b/Examples/Framework/include/ActsExamples/EventData/SimHit.hpp @@ -17,6 +17,6 @@ using SimBarcode = ::ActsFatras::Barcode; using SimHit = ::ActsFatras::Hit; /// Store hits ordered by geometry identifier. -using SimHitContainer = GeometryIdMultiset<::ActsFatras::Hit>; +using SimHitContainer = GeometryIdMultiset; } // end of namespace ActsExamples diff --git a/Examples/Framework/include/ActsExamples/EventData/SimParticle.hpp b/Examples/Framework/include/ActsExamples/EventData/SimParticle.hpp index 5311666e0fe..9f16c1576a2 100644 --- a/Examples/Framework/include/ActsExamples/EventData/SimParticle.hpp +++ b/Examples/Framework/include/ActsExamples/EventData/SimParticle.hpp @@ -50,8 +50,7 @@ struct SecondaryVertexIdGetter { using SimParticle = ::ActsFatras::Particle; /// Store particles ordered by particle identifier. using SimParticleContainer = - ::boost::container::flat_set<::ActsFatras::Particle, - detail::CompareParticleId>; + ::boost::container::flat_set; /// Iterate over groups of particles belonging to the same primary vertex. inline GroupBy