13 template <
typename external_spacepo
int_t>
17 : m_cfg(config), m_experimentCuts(expCuts) {}
22 template <
typename external_spacepo
int_t>
23 std::vector<std::pair<
24 float, std::unique_ptr<const InternalSeed<external_spacepoint_t>>>>
29 std::vector<float>& invHelixDiameterVec,
30 std::vector<float>& impactParametersVec,
float zOrigin)
const {
31 std::vector<std::pair<
32 float, std::unique_ptr<const InternalSeed<external_spacepoint_t>>>>
35 for (
size_t i = 0; i < topSpVec.size(); i++) {
39 std::vector<float> compatibleSeedR;
41 float invHelixDiameter = invHelixDiameterVec[i];
42 float lowerLimitCurv = invHelixDiameter - m_cfg.deltaInvHelixDiameter;
43 float upperLimitCurv = invHelixDiameter + m_cfg.deltaInvHelixDiameter;
44 float currentTop_r = topSpVec[i]->radius();
45 float impact = impactParametersVec[i];
47 float weight = -(impact * m_cfg.impactWeightFactor);
48 for (
size_t j = 0; j < topSpVec.size(); j++) {
53 float otherTop_r = topSpVec[j]->radius();
54 float deltaR = currentTop_r - otherTop_r;
55 if (
std::abs(deltaR) < m_cfg.deltaRMin) {
61 if (invHelixDiameterVec[j] < lowerLimitCurv) {
64 if (invHelixDiameterVec[j] > upperLimitCurv) {
67 bool newCompSeed =
true;
68 for (
float previousDiameter : compatibleSeedR) {
73 if (
std::abs(previousDiameter - otherTop_r) < m_cfg.deltaRMin) {
79 compatibleSeedR.push_back(otherTop_r);
80 weight += m_cfg.compatSeedWeight;
82 if (compatibleSeedR.size() >= m_cfg.compatSeedLimit) {
86 if (m_experimentCuts !=
nullptr) {
88 weight += m_experimentCuts->seedWeight(bottomSP, middleSP, *topSpVec[i]);
90 if (!m_experimentCuts->singleSeedCut(weight, bottomSP, middleSP,
95 selectedSeeds.push_back(std::make_pair(
97 bottomSP, middleSP, *topSpVec[i], zOrigin)));
103 template <
typename external_spacepo
int_t>
105 std::vector<std::pair<
111 std::sort((seedsPerSpM.begin()), (seedsPerSpM.end()),
113 external_spacepoint_t>>>& i1,
115 external_spacepoint_t>>>& i2) {
116 return i1.first > i2.first;
118 if (m_experimentCuts !=
nullptr) {
119 seedsPerSpM = m_experimentCuts->cutPerMiddleSP(std::move(seedsPerSpM));
121 unsigned int maxSeeds = seedsPerSpM.size();
122 if (maxSeeds > m_cfg.maxSeedsPerSpM) {
123 maxSeeds = m_cfg.maxSeedsPerSpM + 1;
125 auto itBegin = seedsPerSpM.begin();
126 auto it = seedsPerSpM.begin();
130 for (;
it < itBegin + maxSeeds; ++
it) {
132 (*it).second->sp[0]->sp(), (*it).second->sp[1]->sp(),
133 (*it).second->sp[2]->sp(), (*it).second->z()));