Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Space point implementation #1900

Closed
Closed
Show file tree
Hide file tree
Changes from 121 commits
Commits
Show all changes
457 commits
Select commit Hold shift + click to select a range
654a27e
array
Jun 27, 2023
402a187
it runs but 0 seeds
Jun 27, 2023
a73c08d
produce output
Jun 27, 2023
32ff6d1
seed.hpp position
Jun 28, 2023
6fe5f32
changes
Jun 28, 2023
1a2d512
compiles
Jun 28, 2023
c7358b6
format and co
Jun 28, 2023
9bf69ed
sycl
Jun 28, 2023
641e3b3
ops
Jun 28, 2023
ad7fc93
test
Jun 28, 2023
beb3084
format
Jun 28, 2023
9e6b0d5
class for container
Jun 28, 2023
38cd811
no sp data
Jun 28, 2023
d2f1262
ggg
Jun 28, 2023
92ccb85
typo
Jun 28, 2023
7770568
f
Jun 28, 2023
4b9e82e
changes
Jun 28, 2023
c6ee1df
plug
Jun 28, 2023
148ac6f
start with cuda
Jun 28, 2023
ce74229
still cuda
Jun 28, 2023
8a6fc26
firt
Jun 28, 2023
7da7b79
FFF
Jun 28, 2023
59bce24
g
Jun 28, 2023
eb7e66b
no data
Jun 28, 2023
eb6af3a
g
Jun 28, 2023
0a7ecd9
h
Jun 28, 2023
5ef1ed1
no views
Jun 28, 2023
3e39a36
templated
Jun 28, 2023
86f0f48
cmake
Jun 28, 2023
ae35629
h
Jun 28, 2023
5bc6771
changes
Jun 28, 2023
e49b814
ok
Jun 28, 2023
f89e53f
ops
Jun 28, 2023
eaa0ce8
h
Jun 29, 2023
08f14e0
ok?
Jun 29, 2023
163c2fc
format and co
Jun 29, 2023
425e08f
cleaning
Jun 29, 2023
8bd9c5c
no internal seed anymore
Jun 29, 2023
7bff462
another cleaning
Jun 29, 2023
18bed60
no more internal space points
Jun 29, 2023
a57b255
docs 1
Jun 29, 2023
871c649
docs 2
Jun 29, 2023
70a90ba
docs 3
Jun 29, 2023
0163bbb
unwanted change
Jun 29, 2023
aa6b581
no any cast
Jul 2, 2023
49d5264
format
Jul 2, 2023
795edc7
Merge branch 'OrthogonalImplementation' into SpacePointImplementation
Jul 2, 2023
b456f08
return refs
Jul 3, 2023
25636b8
format
Jul 3, 2023
93b8c97
std::atan2f
Jul 3, 2023
1ba94b6
only get the container once
Jul 3, 2023
e161939
different include
Jul 3, 2023
05785ee
no std
Jul 3, 2023
f19f49a
Merge remote-tracking branch 'origin/main' into releases
paulgessinger Jul 4, 2023
2194802
Bump to version v27.1.0
github-actions[bot] Jul 4, 2023
3754f37
Merge remote-tracking branch 'upstream/main'
Jul 6, 2023
5fb4f38
cmake
Jul 7, 2023
21c3837
Merge remote-tracking branch 'upstream/main' into main
Jul 9, 2023
af4fb43
no refs for simple types
Jul 18, 2023
8235d12
Merge remote-tracking branch 'upstream/main' into SpacePointImplement…
Jul 18, 2023
629b32d
cleaning
Jul 18, 2023
7267eb7
Merge remote-tracking branch 'upstream/main' into SpacePointImplement…
Jul 24, 2023
0c165fb
Merge remote-tracking branch 'origin/SpacePointImplementation' into S…
Jul 24, 2023
6a4ce50
Merge remote-tracking branch 'origin/main' into releases
paulgessinger Jul 24, 2023
296c597
Bump to version v27.2.0
github-actions[bot] Jul 24, 2023
c2dedcd
Merge remote-tracking branch 'upstream/main' into SpacePointImplement…
Jul 25, 2023
7bfddf1
Merge remote-tracking branch 'origin/main' into releases
paulgessinger Jul 28, 2023
0d8aa41
Bump to version v28.0.0
github-actions[bot] Jul 28, 2023
758b064
Merge remote-tracking branch 'origin/main' into releases
paulgessinger Aug 7, 2023
08e51b5
Bump to version v28.1.0
github-actions[bot] Aug 7, 2023
1b7f1c0
Merge remote-tracking branch 'origin/main' into releases
paulgessinger Aug 17, 2023
c612e7c
Bump to version v28.2.0
github-actions[bot] Aug 17, 2023
7fa0861
sync
Aug 25, 2023
e6ca34f
Grid takes the ownership
Aug 28, 2023
729167a
changes
Aug 28, 2023
c38900b
minor changes
Aug 29, 2023
8c9075c
Mutable in ad-hoc container
Aug 29, 2023
eb0ff6d
sync
Aug 29, 2023
78f86ab
changes
Aug 30, 2023
b08dfc2
sync
Sep 1, 2023
e3c2fb8
take back ownership
Sep 4, 2023
867ec9c
sync
Oct 26, 2023
36d0c92
sync
Oct 31, 2023
9552ebc
First implementation
Nov 21, 2023
ae0724c
changes
Nov 22, 2023
f9d16c0
no future
Nov 23, 2023
501f16c
minor
Nov 23, 2023
6aa0a62
format
Nov 23, 2023
4326ed6
first round of tests
Nov 24, 2023
558efd5
sub iteration
Dec 12, 2023
cb8de3f
format
Dec 12, 2023
b9cf4cc
changes
Dec 12, 2023
70c7feb
format
Dec 12, 2023
a77b90b
format
Dec 12, 2023
02bf47b
format
Dec 12, 2023
b53dedd
test 1 for cuda
Dec 12, 2023
b8793b1
local, not global
Dec 12, 2023
bc77b3e
agains cuda
Dec 12, 2023
0f0b59d
and again format
Dec 12, 2023
bf60dfd
more tests for global iterator
Dec 12, 2023
e074e16
more tests and some bug fixing
Dec 12, 2023
1c55a27
oopsie
Dec 12, 2023
9179279
even more tests
Dec 13, 2023
a35da6d
remove line
Dec 13, 2023
773d11c
format
Dec 13, 2023
f7fdcb5
first round of comments
Dec 13, 2023
d5016b8
format
Dec 13, 2023
ec66bfa
test for checking iterations
Dec 13, 2023
9ea63ab
clang tidy
Dec 13, 2023
4772218
remove property
Dec 15, 2023
bc0aa70
First implementation
Nov 21, 2023
167756d
changes
Nov 22, 2023
b12d268
no future
Nov 23, 2023
cc20c8d
minor
Nov 23, 2023
5285668
format
Nov 23, 2023
7c9d4e4
first round of tests
Nov 24, 2023
5d7e2ab
sub iteration
Dec 12, 2023
e0d0fe7
format
Dec 12, 2023
309a0ef
changes
Dec 12, 2023
ab158e1
format
Dec 12, 2023
52b90cd
format
Dec 12, 2023
118db39
format
Dec 12, 2023
592183b
test 1 for cuda
Dec 12, 2023
c2ad48b
local, not global
Dec 12, 2023
57f8876
agains cuda
Dec 12, 2023
b1abea1
and again format
Dec 12, 2023
3e9599c
more tests for global iterator
Dec 12, 2023
0c70d03
more tests and some bug fixing
Dec 12, 2023
f759e1e
oopsie
Dec 12, 2023
63917d9
even more tests
Dec 13, 2023
3d31631
remove line
Dec 13, 2023
1bba1e9
format
Dec 13, 2023
bfe8e61
first round of comments
Dec 13, 2023
86af08d
format
Dec 13, 2023
d627255
test for checking iterations
Dec 13, 2023
bd7bd05
clang tidy
Dec 13, 2023
ec2fe30
move and rename
Dec 15, 2023
bcf7ec1
first working version
Dec 15, 2023
edc349b
changes
Dec 15, 2023
1da0f92
sync
Dec 15, 2023
e39777f
tests
Dec 16, 2023
73a5600
changes
Dec 16, 2023
cdce928
changes
Dec 16, 2023
c39a265
sync
Dec 16, 2023
65d249a
formta
Dec 16, 2023
ee1e504
Merge branch 'main' into removeSkipProperty
paulgessinger Dec 17, 2023
1c5cc86
cuda
Dec 18, 2023
4f64437
new methods and tests
Dec 18, 2023
601339e
Add comments
Dec 18, 2023
afa5acf
format
Dec 18, 2023
a325bc2
spelling
Dec 18, 2023
8b7374f
add protections
Dec 18, 2023
59eb33f
Core
Dec 18, 2023
c0f3253
first input check
Dec 18, 2023
ee18f0f
use asserts
Dec 18, 2023
072d184
typo
Dec 18, 2023
5df2442
bug
Dec 18, 2023
30565d7
to be reverted change
Dec 18, 2023
41a10bd
Update builds.yml
CarloVarni Dec 18, 2023
f0728e0
Protection against empty zbin neighbours in example seeding alg
CarloVarni Dec 18, 2023
04c9ba2
Update SeedingAlgorithm.cpp
CarloVarni Dec 18, 2023
1adf1a8
test
Dec 19, 2023
a3a772b
set default num phi neighbours to 1
Dec 19, 2023
dfe672f
update comment
Dec 19, 2023
3800426
format, license and spelling
Dec 19, 2023
63669c1
test with empty inputs
Dec 19, 2023
c5078f3
Merge remote-tracking branch 'upstream/main' into GenericBinFinder
Dec 19, 2023
623b3de
clang tidy
Dec 19, 2023
66f8342
test constructor
Dec 19, 2023
1b16b19
Merge remote-tracking branch 'upstream/main' into GenericBinFinder
Dec 21, 2023
31de7db
Merge remote-tracking branch 'origin/AddCommentsGridIterator' into Ge…
Dec 21, 2023
a079084
add other changes
Dec 21, 2023
62a0420
Move objects instead of copying
Dec 21, 2023
044bab2
reserve
Dec 21, 2023
bbea8dd
Merge remote-tracking branch 'origin/removeSkipProperty' into general…
Dec 21, 2023
a27f540
breaking changes
Dec 21, 2023
ad40814
First implementation
Dec 21, 2023
a1f6bae
Implementation and tests
Dec 21, 2023
006af4e
separate Filling
Dec 22, 2023
eafbb94
another test
Dec 22, 2023
2bd528d
sync
Dec 22, 2023
0b544ab
sync
Jan 8, 2024
b9e94c6
sync
Jan 9, 2024
3d474f7
copyright and typos
Jan 9, 2024
5e39602
test for boundary types
Jan 9, 2024
9e408e0
sync
Jan 10, 2024
baf80fa
sync
Jan 10, 2024
86b25ea
fix test and format
Jan 10, 2024
212e4ce
fix test and format
Jan 10, 2024
78feaee
copyright
Jan 10, 2024
a5c6e84
format
Jan 10, 2024
dfb08bd
from shared to unique and always request reference
Jan 11, 2024
8433591
minor changes
Jan 11, 2024
96ae871
format round
Jan 11, 2024
ee23896
first change for SYCL
Jan 11, 2024
93721f6
other SYCL changes
Jan 11, 2024
c302d3e
no idea
Jan 11, 2024
f273e4a
include tuple
Jan 11, 2024
c85782d
no general namespace
Jan 11, 2024
905d418
minor
Jan 11, 2024
2bc3bf5
DIM from grid
Jan 11, 2024
8dbb825
format
Jan 11, 2024
2659e7e
cuda first round
Jan 11, 2024
bf2e6af
another cuda round
Jan 11, 2024
7a7bf8e
third cuda round
Jan 11, 2024
754dd24
again cuda
Jan 11, 2024
351bb4c
oopsie
Jan 11, 2024
4d3c127
changes
Jan 11, 2024
074051b
and last format
Jan 11, 2024
053a033
Merge remote-tracking branch 'origin/main' into generalBinnedSPgroup
Jan 15, 2024
ec89adb
ops
Jan 15, 2024
c397e07
sync
Jan 15, 2024
45909e4
sync
Jan 16, 2024
0f5dfcf
ops
Jan 16, 2024
936d893
wrong include
Jan 17, 2024
2e3bdce
sync
Jan 17, 2024
df67e54
working sync
Jan 17, 2024
1273a54
with 2854
Jan 17, 2024
5783034
address comments
Jan 17, 2024
90620c8
format
Jan 17, 2024
38c01ad
cuda test
Jan 17, 2024
96215ad
ops
Jan 17, 2024
01e57d8
changes
Jan 18, 2024
bad00ac
update
Jan 18, 2024
acfa098
sync
Jul 2, 2024
6faf432
sync and compiles
Jul 3, 2024
15528d0
changes
Jul 3, 2024
ab24e62
changes
Jul 3, 2024
60979d9
no copies
Jul 3, 2024
61dd3b3
sync
Jul 14, 2024
4538c33
no plug in
Jul 14, 2024
26bd5f2
no plug in
Jul 14, 2024
b3d9ed1
changes
Jul 14, 2024
7117190
remove files
Jul 14, 2024
121486c
change seed EDM
Jul 14, 2024
92e47eb
changes
Jul 22, 2024
7e4f9eb
sync
Jul 22, 2024
bec4eac
sync
Jul 23, 2024
e7b66f2
no read option
Jul 23, 2024
10fd65f
copyright
Jul 23, 2024
f4aca13
size_t test
Jul 23, 2024
dfa557e
format
Jul 23, 2024
a6b1a7d
Merge remote-tracking branch 'upstream/main' into SpacePointImplement…
Jul 23, 2024
446aa4e
documentation
Jul 23, 2024
460d085
changes
Jul 23, 2024
e9f2da2
format
Jul 23, 2024
79903cf
changes
Jul 23, 2024
5c80a7d
change
Jul 23, 2024
03265c6
format
Jul 23, 2024
3583c9e
doc
Jul 23, 2024
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
35 changes: 35 additions & 0 deletions Core/include/Acts/EventData/Seed.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// 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 <array>
#include <limits>

namespace Acts {

template <typename external_spacePoint_t>
class Seed {
public:
Seed(const external_spacePoint_t& b, const external_spacePoint_t& m,
const external_spacePoint_t& u, float vertex,
float seedQuality = -std::numeric_limits<float>::infinity());

const std::array<const external_spacePoint_t*, 3>& sp() const;
float z() const;
float seedQuality() const;

private:
std::array<const external_spacePoint_t*, 3> m_spacepoints;
float m_zvertex{0.};
float m_seedQuality{-std::numeric_limits<float>::infinity()};
};

} // namespace Acts

#include "Acts/EventData/Seed.ipp"
36 changes: 36 additions & 0 deletions Core/include/Acts/EventData/Seed.ipp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// 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/.

namespace Acts {

template <typename external_spacePoint_t>
Seed<external_spacePoint_t>::Seed(const external_spacePoint_t& b,
const external_spacePoint_t& m,
const external_spacePoint_t& u, float vertex,
float seedQuality)
: m_spacepoints({&b, &m, &u}),
m_zvertex(vertex),
m_seedQuality(seedQuality) {}

template <typename external_spacePoint_t>
inline const std::array<const external_spacePoint_t*, 3>&
Seed<external_spacePoint_t>::sp() const {
return m_spacepoints;
}

template <typename external_spacePoint_t>
inline float Seed<external_spacePoint_t>::z() const {
return m_zvertex;
}

template <typename external_spacePoint_t>
inline float Seed<external_spacePoint_t>::seedQuality() const {
return m_seedQuality;
}

} // namespace Acts
209 changes: 209 additions & 0 deletions Core/include/Acts/EventData/SpacePointContainer.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
// 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 "Acts/Definitions/Algebra.hpp"
#include "Acts/Definitions/Units.hpp"
#include "Acts/EventData/SpacePointData.hpp"
#include "Acts/EventData/SpacePointProxy.hpp"
#include "Acts/EventData/SpacePointProxyIterator.hpp"
#include "Acts/EventData/Utils.hpp"
#include "Acts/Utilities/HashedString.hpp"

#include <any>
#include <vector>

#include <math.h>

namespace Acts {
struct SpacePointContainerConfig {
bool useDetailedDoubleMeasurementInfo = false;
bool isInInternalUnits = false;

SpacePointContainerConfig toInternalUnits() const {
if (isInInternalUnits) {
throw std::runtime_error(
"Repeated conversion to internal units for "
"SpacePointContainerConfig");
}
using namespace Acts::UnitLiterals;
SpacePointContainerConfig config = *this;
config.isInInternalUnits = true;
return config;
};
};

struct SpacePointContainerOptions {
// location of beam in x,y plane.
// used as offset for Space Points
Acts::Vector2 beamPos{0 * Acts::UnitConstants::mm,
0 * Acts::UnitConstants::mm};
bool isInInternalUnits = false;

SpacePointContainerOptions toInternalUnits() const {
if (isInInternalUnits) {
throw std::runtime_error(
"Repeated conversion to internal units for "
"SpacePointContainerOptions");
}
using namespace Acts::UnitLiterals;
SpacePointContainerOptions options = *this;
options.isInInternalUnits = true;
options.beamPos[0] /= 1_mm;
options.beamPos[1] /= 1_mm;
return options;
}
};

template <typename container_t, template <typename> class holder_t>
class SpacePointContainer {
public:
friend class Acts::SpacePointProxy<
Acts::SpacePointContainer<container_t, holder_t>, false>;
friend class Acts::SpacePointProxy<
Acts::SpacePointContainer<container_t, holder_t>, true>;
friend class Acts::SpacePointProxyIterator<
Acts::SpacePointContainer<container_t, holder_t>, false>;
friend class Acts::SpacePointProxyIterator<
Acts::SpacePointContainer<container_t, holder_t>, true>;

public:
static constexpr bool read_only = true;

using SpacePointProxyType =
Acts::SpacePointProxy<Acts::SpacePointContainer<container_t, holder_t>,
false>;
using ConstSpacePointProxyType =
Acts::SpacePointProxy<Acts::SpacePointContainer<container_t, holder_t>,
true>;

using iterator = Acts::SpacePointProxyIterator<
Acts::SpacePointContainer<container_t, holder_t>, false>;
using const_iterator = Acts::SpacePointProxyIterator<
Acts::SpacePointContainer<container_t, holder_t>, true>;

using ValueType = typename std::conditional<
read_only,
typename std::conditional<
std::is_const<typename container_t::ValueType>::value,
typename container_t::ValueType,
const typename container_t::ValueType>::type,
typename container_t::ValueType>::type;
using ProxyType =
typename std::conditional<read_only, ConstSpacePointProxyType,
SpacePointProxyType>::type;
using value_type = ProxyType;

public:
// Constructors
// It makes sense to support both options of
// taking or not the ownership

// Do not take ownership
// Activate only if holder_t is RefHolder
template <template <typename> class H = holder_t,
typename = std::enable_if_t<Acts::detail::is_same_template<
H, Acts::detail::RefHolder>::value>>
SpacePointContainer(const Acts::SpacePointContainerConfig& config,
const Acts::SpacePointContainerOptions& options,
container_t& container);

// Take the ownership
// Activate only if holder_t is ValueHolder
template <template <typename> class H = holder_t,
typename = std::enable_if_t<Acts::detail::is_same_template<
H, Acts::detail::ValueHolder>::value>>
SpacePointContainer(const Acts::SpacePointContainerConfig& config,
const Acts::SpacePointContainerOptions& options,
container_t&& container);

// If we take ownership, forbid copy operations
// Need to define copy operations only if holder_t is RefHolder !!!
template <template <typename> class H = holder_t,
typename = std::enable_if_t<Acts::detail::is_same_template<
H, Acts::detail::RefHolder>::value>>
SpacePointContainer(SpacePointContainer& other);

template <template <typename> class H = holder_t,
typename = std::enable_if_t<Acts::detail::is_same_template<
H, Acts::detail::RefHolder>::value,
bool>>
SpacePointContainer& operator=(SpacePointContainer& other);

// move operations
SpacePointContainer(SpacePointContainer&& other) noexcept;
SpacePointContainer& operator=(SpacePointContainer&& other) noexcept;

// Destructor
~SpacePointContainer() = default;

std::size_t size() const;

template <bool RO = read_only, typename = std::enable_if_t<!RO>>
iterator begin();

template <bool RO = read_only, typename = std::enable_if_t<!RO>>
iterator end();

const_iterator begin() const;
const_iterator end() const;

template <bool RO = read_only, typename = std::enable_if_t<!RO>>
ValueType& sp(const std::size_t& n);

ValueType& sp(const std::size_t& n) const;

private:
void initialize();

template <bool RO = read_only, typename = std::enable_if_t<!RO>>
container_t& container();

const container_t& container() const;

template <bool RO = read_only, typename = std::enable_if_t<!RO>>
ProxyType& proxy(const std::size_t& n);

const ProxyType& proxy(const std::size_t& n) const;

const std::vector<ProxyType>& proxies() const;

template <bool RO = read_only, typename = std::enable_if_t<!RO>>
std::vector<ProxyType>& proxies();

private:
const float& x(const std::size_t& n) const;
const float& y(const std::size_t& n) const;
const float& z(const std::size_t& n) const;
const float& phi(const std::size_t& n) const;
const float& radius(const std::size_t& n) const;
const float& varianceR(const std::size_t& n) const;
const float& varianceZ(const std::size_t& n) const;

const float& quality(const std::size_t& n) const;
const float& deltaR(const std::size_t& n) const;

void setQuality(const std::size_t& n, const float& value) const;
void setDeltaR(const std::size_t& n, const float& value) const;

// component methods for additional quantities
template <typename T>
const T& component(HashedString key, const std::size_t& n) const;

private:
Acts::SpacePointContainerConfig m_config;
Acts::SpacePointContainerOptions m_options;
mutable Acts::SpacePointData m_data;
holder_t<container_t> m_container;
std::vector<ProxyType> m_proxies;
};

} // namespace Acts

#include "Acts/EventData/SpacePointContainer.ipp"
Loading