Skip to content

Commit 159912f

Browse files
committed
Test
1 parent e0b814b commit 159912f

File tree

6 files changed

+294
-36
lines changed

6 files changed

+294
-36
lines changed

core/include/traccc/seeding/detail/seeding_config.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,11 @@ struct seedfilter_config {
191191
float deltaInvHelixDiameter = 0.00003f / unit<float>::mm;
192192
// the impact parameters (d0) is multiplied by this factor and subtracted
193193
// from weight
194-
float impactWeightFactor = 1.f;
194+
float impactWeightFactor = 0.5f;
195+
float zOriginWeightFactor = 0.01f;
196+
float zOriginDeltaWeightFactor = 1.f;
195197
// seed weight increased by this value if a compatible seed has been found.
196-
float compatSeedWeight = 200.f;
198+
float compatSeedWeight = 3.f;
197199
// minimum distance between compatible seeds to be considered for weight
198200
// boost
199201
float deltaRMin = 5.f * unit<float>::mm;
@@ -202,7 +204,7 @@ struct seedfilter_config {
202204
unsigned int maxSeedsPerSpM = 20;
203205
// how often do you want to increase the weight of a seed for finding a
204206
// compatible seed?
205-
size_t compatSeedLimit = 2;
207+
size_t compatSeedLimit = 1;
206208
// Tool to apply experiment specific cuts on collected middle space points
207209

208210
size_t max_triplets_per_spM = 5;

device/common/include/traccc/edm/device/device_triplet.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ namespace traccc::device {
1717
/// Triplets of bottom, middle and top spacepoints
1818
struct device_triplet {
1919
// top spacepoint location in internal spacepoint container
20+
sp_location spB;
21+
sp_location spM;
2022
sp_location spT;
2123

2224
using link_type = device::triplet_counter_collection_types::host::size_type;

device/common/include/traccc/seeding/device/impl/find_triplets.ipp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,12 @@ inline void find_triplets(
110110

111111
// Add triplet to jagged vector
112112
triplets.at(posTriplets++) = device_triplet(
113-
{spT_loc, globalIndex, curvature,
114-
-impact_parameter * filter_config.impactWeightFactor,
113+
{spB_loc, spM_loc, spT_loc, globalIndex, curvature,
114+
-impact_parameter * filter_config.impactWeightFactor -
115+
std::abs(lb.Zo()) * filter_config.zOriginWeightFactor -
116+
std::abs(lb.Zo() - lt.Zo()) *
117+
filter_config.zOriginDeltaWeightFactor +
118+
1000.f * std::abs(curvature),
115119
lb.Zo()});
116120
}
117121
}

device/common/include/traccc/seeding/device/impl/select_seeds.ipp

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ inline void select_seeds(
6565
const traccc::details::spacepoint_grid_types::const_view& sp_view,
6666
const triplet_counter_spM_collection_types::const_view& spM_tc_view,
6767
const triplet_counter_collection_types::const_view& tc_view,
68-
const device_triplet_collection_types::const_view& triplet_view,
69-
triplet* data, edm::seed_collection::view seed_view) {
68+
device_triplet_collection_types::view& triplet_view, triplet* data,
69+
const vecmem::data::vector_view<const unsigned int> votes_per_triplet_view,
70+
edm::seed_collection::view seed_view) {
7071

7172
// Check if anything needs to be done.
7273
const triplet_counter_spM_collection_types::const_device triplet_counts_spM(
@@ -83,7 +84,9 @@ inline void select_seeds(
8384
const traccc::details::spacepoint_grid_types::const_device sp_device(
8485
sp_view);
8586

86-
const device_triplet_collection_types::const_device triplets(triplet_view);
87+
device_triplet_collection_types::device triplets(triplet_view);
88+
const vecmem::device_vector<const unsigned int> votes_per_triplet(
89+
votes_per_triplet_view);
8790
edm::seed_collection::device seeds_device(seed_view);
8891

8992
// Current work item = middle spacepoint
@@ -97,9 +100,14 @@ inline void select_seeds(
97100

98101
const unsigned int end_triplets_spM =
99102
spM_counter.posTriplets + spM_counter.m_nTriplets;
103+
100104
// iterate over the triplets in the bin
101105
for (unsigned int i = spM_counter.posTriplets; i < end_triplets_spM; ++i) {
102-
device_triplet aTriplet = triplets[i];
106+
device_triplet& aTriplet = triplets[i];
107+
108+
if (votes_per_triplet.at(i) < 3) {
109+
continue;
110+
}
103111

104112
// spacepoints bottom and top for this triplet
105113
const sp_location spB_loc =
@@ -111,16 +119,6 @@ inline void select_seeds(
111119
const edm::spacepoint_collection::const_device::const_proxy_type spT =
112120
spacepoints.at(sp_device.bin(spT_loc.bin_idx)[spT_loc.sp_idx]);
113121

114-
// update weight of triplet
115-
seed_selecting_helper::seed_weight(filter_config, spM, spB, spT,
116-
aTriplet.weight);
117-
118-
// check if it is a good triplet
119-
if (!seed_selecting_helper::single_seed_cut(filter_config, spM, spB,
120-
spT, aTriplet.weight)) {
121-
continue;
122-
}
123-
124122
// if the number of good triplets is larger than the threshold,
125123
// the triplet with the lowest weight is removed
126124
if (n_triplets_per_spM >= filter_config.max_triplets_per_spM) {
@@ -169,18 +167,12 @@ inline void select_seeds(
169167
break;
170168
}
171169

172-
// check if it is a good triplet
173-
if (seed_selecting_helper::cut_per_middle_sp(filter_config, spacepoints,
174-
sp_device, aTriplet) ||
175-
n_seeds_per_spM == 0) {
170+
n_seeds_per_spM++;
176171

177-
n_seeds_per_spM++;
178-
179-
seeds_device.push_back(
180-
{sp_device.bin(spB_loc.bin_idx)[spB_loc.sp_idx],
181-
sp_device.bin(spM_loc.bin_idx)[spM_loc.sp_idx],
182-
sp_device.bin(spT_loc.bin_idx)[spT_loc.sp_idx]});
183-
}
172+
seeds_device.push_back(
173+
{sp_device.bin(spB_loc.bin_idx)[spB_loc.sp_idx],
174+
sp_device.bin(spM_loc.bin_idx)[spM_loc.sp_idx],
175+
sp_device.bin(spT_loc.bin_idx)[spT_loc.sp_idx]});
184176
}
185177
}
186178

device/common/include/traccc/seeding/device/select_seeds.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ inline void select_seeds(
4141
const triplet_counter_spM_collection_types::const_view& spM_tc_view,
4242
const triplet_counter_collection_types::const_view& tc_view,
4343
const device_triplet_collection_types::const_view& triplet_view,
44-
triplet* data, edm::seed_collection::view seed_view);
44+
triplet* data,
45+
const vecmem::data::vector_view<const unsigned int> votes_per_triplet_view,
46+
edm::seed_collection::view seed_view);
4547

4648
} // namespace traccc::device
4749

0 commit comments

Comments
 (0)