Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
351 commits
Select commit Hold shift + click to select a range
0a44a1c
update
benjaminhuth Jun 7, 2023
e61493c
clang-format
benjaminhuth Jun 7, 2023
fadd5c4
revert changes from other PR
benjaminhuth Jun 7, 2023
52dae38
update comment
benjaminhuth Jun 7, 2023
d104f9c
fix include
benjaminhuth Jun 8, 2023
968e8b4
Merge branch 'main' into feature/hit-merger
benjaminhuth Jun 8, 2023
47e9c93
link to boost
benjaminhuth Jun 8, 2023
59e3bec
Merge branch 'feature/hit-merger' into experimental/combine-exatrkx-ckf
benjaminhuth Jun 8, 2023
9ae41f1
add proto track writer sub
benjaminhuth Jun 9, 2023
5cb23c2
implement proto track writer
benjaminhuth Jun 9, 2023
6ac66cc
fix
benjaminhuth Jun 9, 2023
bfd59ef
some refactorings in exatrkx
benjaminhuth Jun 9, 2023
8f7aa1f
refactor loggers
benjaminhuth Jun 9, 2023
4039935
fixes
benjaminhuth Jun 9, 2023
bbe2cdb
refactor
benjaminhuth Jun 9, 2023
60c9449
clang-format
benjaminhuth Jun 9, 2023
3811de3
fix python
benjaminhuth Jun 9, 2023
12d8fdb
Merge branch 'refactor/exatrkx-logger-etc' into experimental/combine-…
benjaminhuth Jun 9, 2023
395fcf9
remove leftovers
benjaminhuth Jun 9, 2023
7cdaa05
remove another leftover
benjaminhuth Jun 9, 2023
d41e46b
leftovers
benjaminhuth Jun 9, 2023
f287e43
remove leftovers
benjaminhuth Jun 9, 2023
15a2256
fixes
benjaminhuth Jun 12, 2023
4f08ae5
fixes
benjaminhuth Jun 12, 2023
1031d66
some status
benjaminhuth Jun 12, 2023
e721b13
adjust log level
benjaminhuth Jun 12, 2023
64c4ee3
log level, refactors
benjaminhuth Jun 13, 2023
1a9f861
Merge branch 'refactor/exatrkx-logger-etc' into feature/exatrkx-clust…
benjaminhuth Jun 13, 2023
cda02a8
hopefully last refactor
benjaminhuth Jun 13, 2023
4c2270e
fix weird device bug?
benjaminhuth Jun 13, 2023
1f3cdfd
some state
benjaminhuth Jun 13, 2023
7492019
revert last again
benjaminhuth Jun 13, 2023
c281afe
update
benjaminhuth Jun 13, 2023
3637694
Merge branch 'feature/exatrkx-cluster-info' into experimental/combine…
benjaminhuth Jun 13, 2023
0e55671
update
benjaminhuth Jun 13, 2023
086de45
update
benjaminhuth Jun 13, 2023
186db39
update
benjaminhuth Jun 13, 2023
7054466
Merge branch 'feature/exatrkx-cluster-info' into experimental/combine…
benjaminhuth Jun 13, 2023
14e3a4b
update
benjaminhuth Jun 15, 2023
d96b0fc
Merge branch 'main' into refactor/consistent-measurement-id
benjaminhuth Jun 15, 2023
b28fccb
start to change reader and writer for clusters and started with unit …
benjaminhuth Jun 15, 2023
90a4812
add round trip test
benjaminhuth Jun 16, 2023
1a766e8
fix
benjaminhuth Jun 16, 2023
d2614a2
add log failing thresholds
benjaminhuth Jun 20, 2023
524fd14
Merge branch 'main' into refactor/exatrkx-logger-etc
benjaminhuth Jun 20, 2023
4543e76
make clang tidy happy
benjaminhuth Jun 20, 2023
749c7e3
Merge branch 'main' into refactor/exatrkx-logger-etc
benjaminhuth Jun 21, 2023
cb3f37b
add undirectedness to plugin
benjaminhuth Jun 21, 2023
7f2493c
fixes
benjaminhuth Jun 21, 2023
98432b4
adjust log level
benjaminhuth Jun 21, 2023
3ea465d
fix python binding
benjaminhuth Jun 21, 2023
fba426f
unit test works!
benjaminhuth Jun 22, 2023
c3a3e0e
adjust hyperparams so we get at least some tracks
benjaminhuth Jun 22, 2023
33bd7eb
Merge branch 'refactor/exatrkx-logger-etc' into feature/exatrkx-kdtree
benjaminhuth Jun 22, 2023
1f2bcae
make it work also in demonstrator
benjaminhuth Jun 22, 2023
28594f0
clang format
benjaminhuth Jun 22, 2023
477b142
Merge branch 'main' into feature/exatrkx-kdtree
benjaminhuth Jun 22, 2023
96909e7
improve zip
benjaminhuth Jun 22, 2023
bc3da41
improve zip
benjaminhuth Jun 22, 2023
edd9829
fix
benjaminhuth Jun 22, 2023
783f4a6
Merge branch 'feature/zip2' into feature/exatrkx-kdtree
benjaminhuth Jun 22, 2023
a83c2b8
improve track building
benjaminhuth Jun 22, 2023
4b61d0c
add some std::move
benjaminhuth Jun 22, 2023
26de693
fix std::move
benjaminhuth Jun 23, 2023
bd5547a
fix prototracks to seeds
benjaminhuth Jun 26, 2023
51ce331
Merge branch 'feature/exatrkx-kdtree' into experimental/combine-exatr…
benjaminhuth Jun 26, 2023
a7b7129
Merge branch 'main' into experimental/combine-exatrkx-ckf
benjaminhuth Jul 19, 2023
89cc2e1
make patched python constructors accept pathlib Paths
benjaminhuth Jul 27, 2023
69b1fda
add reader and unit test
benjaminhuth Jul 28, 2023
23f4f3f
Apply suggestions from code review
benjaminhuth Jul 28, 2023
fd42767
add comment
benjaminhuth Jul 28, 2023
d60200d
Merge branch 'main' into feature/root-hit-reader
andiwand Jul 28, 2023
af2a798
small fixes and changes
benjaminhuth Jul 28, 2023
1d3df6e
Merge branch 'main' into refactor/consistent-measurement-id
benjaminhuth Jul 28, 2023
2902cd3
Merge branch 'feature/root-hit-reader' into refactor/consistent-measu…
benjaminhuth Jul 28, 2023
f83fed9
update and harmonize with root simhit reader PR
benjaminhuth Jul 28, 2023
b8785d4
Merge branch 'main' into feature/root-hit-reader
kodiakhq[bot] Jul 31, 2023
c412a6c
Merge branch 'feature/root-hit-reader' into experimental/combine-exat…
benjaminhuth Jul 31, 2023
b96d543
update
benjaminhuth Jul 31, 2023
4e5afd7
fix
benjaminhuth Jul 31, 2023
4987ec4
Merge branch 'main' into experimental/combine-exatrkx-ckf
benjaminhuth Jul 31, 2023
979ec7d
really allow paths as str
benjaminhuth Jul 31, 2023
a0041aa
efficiency printer, clang format
benjaminhuth Jul 31, 2023
af17b32
fix
benjaminhuth Jul 31, 2023
2841338
fixes
benjaminhuth Jul 31, 2023
8627114
update
benjaminhuth Jul 31, 2023
ab34123
fix
benjaminhuth Jul 31, 2023
31467f8
update
benjaminhuth Jul 31, 2023
82f8507
boost histogram and other stuff
benjaminhuth Jul 31, 2023
81d52fd
update
benjaminhuth Jul 31, 2023
2686787
fix
benjaminhuth Jul 31, 2023
5f9aa4c
Merge branch 'main' into refactor/consistent-measurement-id
benjaminhuth Aug 1, 2023
e6ea7b8
Merge branch 'refactor/consistent-measurement-id' into experimental/c…
benjaminhuth Aug 1, 2023
65b7d27
spelling
benjaminhuth Aug 1, 2023
87c852b
update
benjaminhuth Aug 1, 2023
acf772b
Merge branch 'refactor/consistent-measurement-id' into experimental/c…
benjaminhuth Aug 1, 2023
3386e7a
fix
benjaminhuth Aug 1, 2023
bf20a94
Merge branch 'refactor/consistent-measurement-id' into experimental/c…
benjaminhuth Aug 1, 2023
bc7826c
add measurment particle map algorithm
benjaminhuth Aug 1, 2023
a7f575c
fix spelling and initialize properly
benjaminhuth Aug 1, 2023
150e603
fixes
benjaminhuth Aug 1, 2023
11cd0bd
update eff printer
benjaminhuth Aug 1, 2023
7738cc8
update eff printer
benjaminhuth Aug 1, 2023
ab2beb3
speed up reading and refactor
benjaminhuth Aug 1, 2023
cc4d5f8
Merge branch 'refactor/consistent-measurement-id' into experimental/c…
benjaminhuth Aug 1, 2023
3211baf
allow inversion of cluster size
benjaminhuth Aug 1, 2023
310037a
some more logging
benjaminhuth Aug 1, 2023
fd88229
fix
benjaminhuth Aug 1, 2023
72293ac
fix radius calculation
benjaminhuth Aug 1, 2023
45ba322
format
benjaminhuth Aug 1, 2023
3818b11
first try of truth based metrics
benjaminhuth Aug 2, 2023
60a8598
fix
benjaminhuth Aug 2, 2023
c4aa49d
some more printing and logging
benjaminhuth Aug 3, 2023
605f2ed
add pipeline class in plugin
benjaminhuth Aug 3, 2023
2670946
small improvement
benjaminhuth Aug 3, 2023
2243999
big update
benjaminhuth Aug 4, 2023
d94210f
update
benjaminhuth Aug 4, 2023
f24736b
try to fix duplicate edge removal
benjaminhuth Aug 4, 2023
13444b3
improve functions and add test
benjaminhuth Aug 4, 2023
db97737
fix
benjaminhuth Aug 4, 2023
688cba2
add option to shuffle direction
benjaminhuth Aug 4, 2023
04e07ee
fix
benjaminhuth Aug 4, 2023
83f4b1d
add script
benjaminhuth Aug 6, 2023
08b336f
add truth graph
benjaminhuth Aug 6, 2023
5f9aefe
change and improve proto track eff pur algorithm
benjaminhuth Aug 6, 2023
47835a9
fixes
benjaminhuth Aug 6, 2023
ee86856
clang format & count histogram
benjaminhuth Aug 6, 2023
5f4acc9
improve tests and refactor code
benjaminhuth Aug 12, 2023
0d0914c
fix unused variable
benjaminhuth Aug 13, 2023
54b7374
pull in changes
benjaminhuth Aug 13, 2023
f6f5b95
revert renaming to make diff more readable
benjaminhuth Aug 13, 2023
5e5e1c9
remove wrong comment
benjaminhuth Aug 13, 2023
1fee768
rename back from at::Tensor to torch::Tensor to reduce diff, clang-fo…
benjaminhuth Aug 13, 2023
feb4d9d
really do it
benjaminhuth Aug 13, 2023
6bf6d18
fix onnx
benjaminhuth Aug 13, 2023
447b08e
revert fix
benjaminhuth Aug 14, 2023
727eb32
fix [skip ci]
benjaminhuth Aug 15, 2023
fcea0bf
clang-format
benjaminhuth Aug 15, 2023
8bbfd9e
fix onnx
benjaminhuth Aug 16, 2023
2a0aac9
apply fix
benjaminhuth Aug 16, 2023
248f5f4
[skip ci]
benjaminhuth Aug 16, 2023
4aa5c1f
Merge branch 'fix/edgue-building-remove-duplicates' into experimental…
benjaminhuth Aug 16, 2023
e15d74f
use logger of writer instead of local one
benjaminhuth Aug 17, 2023
ef71bc5
update
benjaminhuth Aug 17, 2023
87c487d
Merge branch 'main' into experimental/combine-exatrkx-ckf
benjaminhuth Aug 17, 2023
7397501
Merge branch 'refactor/logger-avg-simhits' into experimental/combine-…
benjaminhuth Aug 17, 2023
45af4d1
make binning more flexible
benjaminhuth Aug 17, 2023
c278e9c
Merge branch 'feature/custom-binning-ckf-perf-writer' into experiment…
benjaminhuth Aug 17, 2023
86f4ca9
add more plot tools
benjaminhuth Aug 17, 2023
eee7d48
remove csv files
benjaminhuth Aug 17, 2023
0b91d85
Update Examples/Framework/include/ActsExamples/Utilities/Helpers.hpp
benjaminhuth Aug 17, 2023
fe0f6e1
spelling
benjaminhuth Aug 17, 2023
9605a1c
delete torchscript files
benjaminhuth Aug 17, 2023
cf5a417
Merge branch 'feature/custom-binning-ckf-perf-writer' into experiment…
benjaminhuth Aug 17, 2023
1663244
sub for shift checkerk
benjaminhuth Aug 21, 2023
4815855
make shift test
benjaminhuth Aug 21, 2023
a5b4eb6
enhance truthtrackfinder
benjaminhuth Aug 22, 2023
ed222cd
improve truth metrics by using real particle info
benjaminhuth Aug 22, 2023
554d280
clang-format
benjaminhuth Aug 22, 2023
3e34c93
simple fix
benjaminhuth Aug 22, 2023
f5bf0b1
update
benjaminhuth Aug 22, 2023
1a66db3
add hit selector
benjaminhuth Aug 22, 2023
41ae933
introduce CantorEdge class
benjaminhuth Aug 22, 2023
46cd4ad
clang-format
benjaminhuth Aug 22, 2023
54e220a
Merge branch 'main' into feature/custom-binning-ckf-perf-writer
benjaminhuth Aug 22, 2023
1108ddb
Add particles matched map to CKFPerformanceWriter
benjaminhuth Aug 28, 2023
30cae19
fix
benjaminhuth Aug 28, 2023
85600bb
remove leftovers
benjaminhuth Aug 28, 2023
67672d1
Merge branch 'feature/custom-binning-ckf-perf-writer' into experiment…
benjaminhuth Aug 28, 2023
937a161
enhance particle selector
benjaminhuth Aug 28, 2023
4d91861
fix missing python
benjaminhuth Aug 28, 2023
23e9c2f
fix missing python binding
benjaminhuth Aug 28, 2023
ce0e623
another fix part selection
benjaminhuth Aug 28, 2023
ebe56dc
another fix
benjaminhuth Aug 28, 2023
ff3dbb1
hopefully final fix
benjaminhuth Aug 28, 2023
97a51eb
important fixgit status!
benjaminhuth Aug 29, 2023
2bf5f50
refactor edge classifier
benjaminhuth Aug 30, 2023
43a8e1d
fix CKF perf writer csv output
benjaminhuth Aug 30, 2023
c1d1156
improve prototrack writer
benjaminhuth Aug 30, 2023
8bdf4c8
clang-format
benjaminhuth Aug 30, 2023
4f6c996
improve particle selector to support geometry selection for measurements
benjaminhuth Aug 30, 2023
3ea13f8
improve measurement selector algorithm
benjaminhuth Aug 30, 2023
d42e989
fix particle selector
benjaminhuth Aug 31, 2023
c2ade60
fix ckf performance writer
benjaminhuth Aug 31, 2023
0c7fe4e
improve prototracks-to-seeds algorithm
benjaminhuth Sep 1, 2023
dbff648
improve python error messages
benjaminhuth Sep 1, 2023
9c33cd2
improve / fix prototracks to seeds
benjaminhuth Sep 1, 2023
28e3b4a
clang format
benjaminhuth Sep 1, 2023
41d43ad
try more advanced prototracks-to-seeds
benjaminhuth Sep 5, 2023
bacf785
fix
benjaminhuth Sep 6, 2023
46dbfce
fix event range
benjaminhuth Sep 6, 2023
1ddfa8f
improve prototracks to seeds
benjaminhuth Sep 6, 2023
b8d89e8
fix inconsistent length in track finding from prototrack algorithm
benjaminhuth Sep 6, 2023
6982cdc
change debug level in track parameters estimation
benjaminhuth Sep 6, 2023
459ab33
refactor python bindings, add geometry ID value constructor
benjaminhuth Sep 7, 2023
a187cd2
add some more diagnostics to digitization
benjaminhuth Sep 7, 2023
8354b68
fix counting issue and revert warning because unnecessary
benjaminhuth Sep 7, 2023
8ea8ef9
Improve PrototracksToSeeds algorithm
benjaminhuth Sep 7, 2023
7df0723
changes to exatrkx
benjaminhuth Sep 7, 2023
2aafe58
Merge branch 'main' into experimental/combine-exatrkx-ckf
benjaminhuth Sep 7, 2023
4c2b717
* Merge stash
benjaminhuth Sep 8, 2023
5b61821
clang-format
benjaminhuth Sep 8, 2023
c30dfb9
fix multi GPU support
benjaminhuth Sep 8, 2023
5b573e9
add code again
benjaminhuth Sep 13, 2023
05a9f7a
Merge branch 'fix/digitization-missing-code-why-dont-know-at-all' int…
benjaminhuth Sep 13, 2023
86ab058
make FRNN threadsave
benjaminhuth Sep 20, 2023
5391d00
add graph storage
benjaminhuth Sep 20, 2023
7d2b909
clang-format
benjaminhuth Sep 20, 2023
8d3401b
fix graph storage hook
benjaminhuth Sep 20, 2023
26e0e1f
add option to boost track building to only keep the two best-weighted…
benjaminhuth Sep 20, 2023
06ea194
fix: missing patched constructor
benjaminhuth Sep 20, 2023
306a5f6
add option to use directed graph in track building
benjaminhuth Sep 20, 2023
467620c
maybe fix radius extraction?
benjaminhuth Sep 20, 2023
7c28a8c
update directed graph pruning to respect in and out edges
benjaminhuth Sep 21, 2023
4db4aef
remove advanced seeding again, speed up default prototrack seeding
benjaminhuth Sep 21, 2023
d067733
fix
benjaminhuth Sep 21, 2023
013f0d2
extend hooks to take weights and add weights to graph storage
benjaminhuth Sep 21, 2023
75ae4e1
fix bad any_cast
benjaminhuth Sep 21, 2023
1cb3f6e
fix multi-GPU code for CPU platform
benjaminhuth Sep 25, 2023
840cebc
update track building with optional graph cleaning
benjaminhuth Sep 27, 2023
53c3fab
revoke directed graph in boost again since it makes trouble
benjaminhuth Oct 4, 2023
fd68ed7
write aggregate seeding metrics to root file
benjaminhuth Oct 4, 2023
76b2a6a
make seeding more configurable
benjaminhuth Oct 4, 2023
92b93b4
add additional statistics print to finding algorithms
benjaminhuth Oct 6, 2023
ef11bbe
Add tag attribute to TrackFindingFromPrototrackAlgorithm
benjaminhuth Oct 6, 2023
e32ce2d
clang-format
benjaminhuth Oct 6, 2023
1674c6e
implement double matching
benjaminhuth Oct 13, 2023
2454157
add python binding
benjaminhuth Oct 13, 2023
8f354af
Merge branch 'main' into experimental/combine-exatrkx-ckf
benjaminhuth Oct 16, 2023
1de727f
refactor
benjaminhuth Oct 17, 2023
c24dcb4
add timing measurement
benjaminhuth Oct 17, 2023
add24de
remove parallel GPU access and use simple mutex
benjaminhuth Oct 17, 2023
abd3e8c
clang format
benjaminhuth Oct 17, 2023
21c7612
update
benjaminhuth Oct 17, 2023
19c1606
refactor prototracks to pars and seeds
benjaminhuth Oct 17, 2023
ae017a8
clang-format
benjaminhuth Oct 17, 2023
e3edffd
fix
benjaminhuth Oct 17, 2023
ee0b023
restore some changes in boost track building
benjaminhuth Oct 18, 2023
f471741
Merge branch 'main' into experimental/combine-exatrkx-ckf
benjaminhuth Oct 19, 2023
6ba144f
fix version control marker
benjaminhuth Oct 21, 2023
83c9a23
Merge branch 'main' into experimental/combine-exatrkx-ckf
benjaminhuth Oct 21, 2023
e31975f
fix merge
benjaminhuth Oct 21, 2023
eac6bd2
fix
benjaminhuth Oct 22, 2023
21669da
remove feature from particle selector
benjaminhuth Oct 23, 2023
8e27683
updates, fixes
benjaminhuth Oct 23, 2023
33fc2e3
fix
benjaminhuth Oct 23, 2023
40db3b7
Merge branch 'main' into experimental/combine-exatrkx-ckf
benjaminhuth Oct 24, 2023
913b5e1
fix
benjaminhuth Nov 4, 2023
a499216
refactor
benjaminhuth Nov 4, 2023
8a61d48
update
benjaminhuth Nov 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,9 @@ build*
!.gitlab-ci.yml
!.clang-tidy
!.oclint

Examples/Scripts/Python/csv
Examples/Scripts/Python/onnx_models
Examples/Scripts/Python/torchscript_models/
*.old
*.old2
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ option(ACTS_BUILD_PLUGIN_GEANT4 "Build Geant4 plugin" OFF)
option(ACTS_BUILD_PLUGIN_EXATRKX "Build the Exa.TrkX plugin" OFF)
option(ACTS_EXATRKX_ENABLE_ONNX "Build the Onnx backend for the exatrkx plugin" OFF)
option(ACTS_EXATRKX_ENABLE_TORCH "Build the torchscript backend for the exatrkx plugin" ON)
option(ACTS_EXATRKX_ENABLE_STUB "Only build a stub backend for the exatrkx plugin" OFF)
option(ACTS_USE_SYSTEM_ACTSDD4HEP "Use the ActsDD4hep glue library provided by the system instead of building it" OFF)
option(ACTS_BUILD_PLUGIN_IDENTIFICATION "Build Identification plugin" OFF)
option(ACTS_BUILD_PLUGIN_JSON "Build json plugin" OFF)
option(ACTS_USE_SYSTEM_NLOHMANN_JSON "Use nlohmann::json provided by the system instead of the bundled version" ${ACTS_USE_SYSTEM_LIBS})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ class CombinatorialKalmanFilter {
m_updaterLogger{m_logger->cloneWithSuffix("Updater")},
m_smootherLogger{m_logger->cloneWithSuffix("Smoother")} {}

private:
public:
using KalmanNavigator = typename propagator_t::Navigator;

/// The propagator for the transport and material update
Expand Down
53 changes: 53 additions & 0 deletions Core/include/Acts/Utilities/ContainerPrinter.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// This file is part of the Acts project.
//
// Copyright (C) 2023 CERN for the benefit of the Acts project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#pragma once

#include <limits>
#include <ostream>

namespace Acts {

template <typename iterator_t>
struct ContainerPrinter {
iterator_t begin;
iterator_t end;

template <typename container_t>
ContainerPrinter(const container_t &c, std::size_t max) {
begin = c.cbegin();
const auto n = std::min(c.size(), max);
end = begin;
std::advance(end, n);
assert(std::distance(begin, end) == static_cast<std::ptrdiff_t>(n));
}

template <typename container_t>
ContainerPrinter(const container_t &c) : ContainerPrinter(c, c.size()) {}

ContainerPrinter(iterator_t a, iterator_t b) : begin(a), end(b) {}
};

template <typename iterator_t>
std::ostream &operator<<(std::ostream &os,
const ContainerPrinter<iterator_t> &p) {
for (auto it = p.begin; it != p.end; ++it) {
os << *it << " ";
}
return os;
}

template <class container_t>
ContainerPrinter(const container_t &, std::size_t)
-> ContainerPrinter<typename std::decay_t<container_t>::const_iterator>;

template <class container_t>
ContainerPrinter(const container_t &)
-> ContainerPrinter<typename std::decay_t<container_t>::const_iterator>;

} // namespace Acts
1 change: 1 addition & 0 deletions Core/include/Acts/Utilities/KDTree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include <algorithm>
#include <array>
#include <cassert>
#include <cmath>
#include <functional>
#include <memory>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
#include "ActsExamples/Framework/ProcessCode.hpp"
#include "ActsExamples/Framework/RandomNumbers.hpp"
#include "ActsFatras/Digitization/Channelizer.hpp"
#include "ActsFatras/Digitization/PlanarSurfaceDrift.hpp"
#include "ActsFatras/Digitization/PlanarSurfaceMask.hpp"
#include "ActsFatras/Digitization/Segmentizer.hpp"
#include "ActsFatras/Digitization/UncorrelatedHitSmearer.hpp"

#include <cstddef>
Expand Down Expand Up @@ -69,20 +68,6 @@ class DigitizationAlgorithm final : public IAlgorithm {
const DigitizationConfig& config() const { return m_cfg; }

private:
/// Helper method for the geometric channelizing part
///
/// @param geoCfg is the geometric digitization configuration
/// @param hit the Simultated hit
/// @param surface the Surface on which this is supposed to happen
/// @param gctx the Geometry context
/// @param rng the Random number engine for the drift smearing
///
/// @return the list of channels
std::vector<ActsFatras::Channelizer::ChannelSegment> channelizing(
const GeometricConfig& geoCfg, const SimHit& hit,
const Acts::Surface& surface, const Acts::GeometryContext& gctx,
RandomEngine& rng) const;

/// Helper method for creating digitized parameters from clusters
///
/// @todo ADD random smearing
Expand All @@ -93,7 +78,7 @@ class DigitizationAlgorithm final : public IAlgorithm {
/// @return the list of digitized parameters
DigitizedParameters localParameters(
const GeometricConfig& geoCfg,
const std::vector<ActsFatras::Channelizer::ChannelSegment>& channels,
const std::vector<ActsFatras::Segmentizer::ChannelSegment>& channels,
RandomEngine& rng) const;

/// Nested smearer struct that holds geometric digitizer and smearing
Expand All @@ -113,9 +98,7 @@ class DigitizationAlgorithm final : public IAlgorithm {
DigitizationConfig m_cfg;
/// Digitizers within geometry hierarchy
Acts::GeometryHierarchyMap<Digitizer> m_digitizers;
/// Geometric digtizers
ActsFatras::PlanarSurfaceDrift m_surfaceDrift;
ActsFatras::PlanarSurfaceMask m_surfaceMask;
/// Geometric digtizer
ActsFatras::Channelizer m_channelizer;

ReadDataHandle<SimHitContainer> m_simContainerReadHandle{this,
Expand Down
36 changes: 10 additions & 26 deletions Examples/Algorithms/Digitization/src/DigitizationAlgorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,16 +205,20 @@ ActsExamples::ProcessCode ActsExamples::DigitizationAlgorithm::execute(
ACTS_VERBOSE("Configured to geometric digitize "
<< digitizer.geometric.indices.size()
<< " parameters.");
auto channels = channelizing(digitizer.geometric, simHit,
*surfacePtr, ctx.geoContext, rng);
if (channels.empty()) {
const auto& cfg = digitizer.geometric;
Acts::Vector3 driftDir = cfg.drift(simHit.position(), rng);
auto channelsRes = m_channelizer.channelize(
simHit, *surfacePtr, ctx.geoContext, driftDir,
cfg.segmentation, cfg.thickness);
if (!channelsRes.ok() || channelsRes->empty()) {
ACTS_DEBUG(
"Geometric channelization did not work, skipping this hit.")
continue;
}
ACTS_VERBOSE("Activated " << channels.size()
ACTS_VERBOSE("Activated " << channelsRes->size()
<< " channels for this hit.");
dParameters = localParameters(digitizer.geometric, channels, rng);
dParameters =
localParameters(digitizer.geometric, *channelsRes, rng);
}

// Smearing part - (optionally) rest
Expand Down Expand Up @@ -292,30 +296,10 @@ ActsExamples::ProcessCode ActsExamples::DigitizationAlgorithm::execute(
return ProcessCode::SUCCESS;
}

std::vector<ActsFatras::Channelizer::ChannelSegment>
ActsExamples::DigitizationAlgorithm::channelizing(
const GeometricConfig& geoCfg, const SimHit& hit,
const Acts::Surface& surface, const Acts::GeometryContext& gctx,
RandomEngine& rng) const {
Acts::Vector3 driftDir = geoCfg.drift(hit.position(), rng);

auto driftedSegment =
m_surfaceDrift.toReadout(gctx, surface, geoCfg.thickness, hit.position(),
hit.direction(), driftDir);
auto maskedSegmentRes = m_surfaceMask.apply(surface, driftedSegment);
if (maskedSegmentRes.ok()) {
auto maskedSegment = maskedSegmentRes.value();
// Now Channelize
return m_channelizer.segments(gctx, surface, geoCfg.segmentation,
maskedSegment);
}
return {};
}

ActsExamples::DigitizedParameters
ActsExamples::DigitizationAlgorithm::localParameters(
const GeometricConfig& geoCfg,
const std::vector<ActsFatras::Channelizer::ChannelSegment>& channels,
const std::vector<ActsFatras::Segmentizer::ChannelSegment>& channels,
RandomEngine& rng) const {
DigitizedParameters dParameters;

Expand Down
1 change: 1 addition & 0 deletions Examples/Algorithms/Geant4/src/SensitiveSteppingAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <G4Track.hh>
#include <G4UnitsTable.hh>
#include <G4VPhysicalVolume.hh>
#include <boost/describe.hpp>

class G4PrimaryParticle;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ class TrackFindingAlgorithm final : public IAlgorithm {
mutable std::atomic<size_t> m_nTotalSeeds{0};
mutable std::atomic<size_t> m_nFailedSeeds{0};

mutable std::mutex m_mutex;
mutable std::vector<unsigned> m_nTracksPerSeeds;
mutable std::vector<unsigned> m_nSelTracksPerSeeds;

mutable tbb::combinable<Acts::VectorMultiTrajectory::Statistics>
m_memoryStatistics{[]() {
auto mtj = std::make_shared<Acts::VectorMultiTrajectory>();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
// This file is part of the Acts project.
//
// Copyright (C) 2022 CERN for the benefit of the Acts project
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#pragma once

#include "Acts/TrackFinding/CombinatorialKalmanFilter.hpp"
#include "Acts/TrackFitting/KalmanFitter.hpp"

namespace Acts {

template <typename propagator_t, typename traj_t>
struct CombinedKfAndCkf {
propagator_t m_propagator;
std::unique_ptr<const Logger> m_logger;
KalmanFitter<propagator_t, traj_t> m_kalmanFitter;

CombinedKfAndCkf(propagator_t pPropagator,
std::unique_ptr<const Logger> _logger =
getDefaultLogger("KfCkfComb", Logging::INFO))
: m_propagator(std::move(pPropagator)),
m_logger(std::move(_logger)),
m_kalmanFitter(pPropagator, m_logger->cloneWithSuffix(":KF")) {}

const Logger& logger() const { return *m_logger; }

template <typename sli_kf_t, typename sli_ckf_t, typename start_parameters_t,
typename track_container_t>
auto runKalmanFitter(
sli_kf_t it, sli_kf_t end, const start_parameters_t& sParameters,
const CombinatorialKalmanFilterOptions<sli_ckf_t, traj_t>& ckfOptions,
track_container_t& trackContainer) const {
KalmanFitterExtensions<traj_t> extensions;
extensions.calibrator = ckfOptions.extensions.calibrator;
extensions.updater = ckfOptions.extensions.updater;
extensions.smoother = ckfOptions.extensions.smoother;
// extensions.outlierFinder = ckfOptions.extensions.outlierFinder;

KalmanFitterOptions<traj_t> kfOptions(
ckfOptions.geoContext, ckfOptions.magFieldContext,
ckfOptions.calibrationContext, extensions,
ckfOptions.propagatorPlainOptions, ckfOptions.referenceSurface,
ckfOptions.multipleScattering, ckfOptions.energyLoss, false);

return m_kalmanFitter.fit(it, end, sParameters, kfOptions, trackContainer);
}

template <typename sli_kf_t, typename sli_ckf_t, typename start_parameters_t,
typename track_container_t, template <typename> class holder_t>
auto findTracks(
sli_kf_t it, sli_kf_t end, const start_parameters_t& kfStartParameters,
const CombinatorialKalmanFilterOptions<sli_ckf_t, traj_t>& ckfOptions,
TrackContainer<track_container_t, traj_t, holder_t>& trackContainer) const
-> Result<CombinatorialKalmanFilterResult<traj_t>> {
// The KF run
auto kfResult =
runKalmanFitter(it, end, kfStartParameters, ckfOptions, trackContainer);

if (!kfResult.ok()) {
return kfResult.error();
}

ACTS_INFO("Done KF fitting");

// The CKF run
using SourceLinkAccessor = SourceLinkAccessorDelegate<sli_ckf_t>;

using ThisCkf = CombinatorialKalmanFilter<propagator_t, traj_t>;
using Aborter = typename ThisCkf::template Aborter<SourceLinkAccessor,
BoundTrackParameters>;
using Actor = typename ThisCkf::template Actor<SourceLinkAccessor,
BoundTrackParameters>;
using Actors = ActionList<Actor>;
using Aborters = AbortList<Aborter>;

PropagatorOptions<Actors, Aborters> propOptions(ckfOptions.geoContext,
ckfOptions.magFieldContext);

propOptions.setPlainOptions(ckfOptions.propagatorPlainOptions);

auto& combKalmanActor = propOptions.actionList.template get<Actor>();
combKalmanActor.targetSurface = ckfOptions.referenceSurface;
combKalmanActor.multipleScattering = ckfOptions.multipleScattering;
combKalmanActor.energyLoss = ckfOptions.energyLoss;
combKalmanActor.smoothing = ckfOptions.smoothing;
combKalmanActor.m_sourcelinkAccessor = ckfOptions.sourcelinkAccessor;
combKalmanActor.m_extensions = ckfOptions.extensions;

// Prepare the start parameters
const auto state = *kfResult->trackStates().end();

BoundTrackParameters ckfStartParameters(
state.referenceSurface().getSharedPtr(), state.filtered(),
state.filteredCovariance());

// Prepare the result
using CkfResultType =
typename propagator_t::template action_list_t_result_t<
CurvilinearTrackParameters, Actors>;
CkfResultType inputResult;

auto& ckfResult =
inputResult.template get<CombinatorialKalmanFilterResult<traj_t>>();
ckfResult.fittedStates = &kfResult->container().trackStateContainer();
ckfResult.lastMeasurementIndices.push_back(kfResult->tipIndex());
ckfResult.lastTrackIndices.push_back(kfResult->tipIndex());

const CombinatorialKalmanFilterTipState tipState{
kfResult->nMeasurements() + kfResult->nHoles(),
kfResult->nTrackStates(), kfResult->nMeasurements(), 0ul,
kfResult->nHoles()};

ckfResult.activeTips.push_back({kfResult->tipIndex(), tipState});

// Run the CombinatorialKalmanFilter.
auto result = m_propagator.template propagate(
ckfStartParameters, propOptions, std::move(inputResult));

if (!result.ok()) {
ACTS_ERROR("Propapation failed: " << result.error() << " "
<< result.error().message()
<< " with the initial parameters:\n"
<< ckfStartParameters.parameters());
return result.error();
}

ACTS_INFO("Done CKF fitting");

return result->template get<CombinatorialKalmanFilterResult<traj_t>>();
}
}; // namespace Acts

} // namespace Acts
Loading