Skip to content

Commit

Permalink
feat: ITk seedFilter integration and seed quality confirmation (#1201)
Browse files Browse the repository at this point in the history
This is the draft for the implementation of the ITk seedFilter.

Most of the changes are applied if `seedConfirmation == true` :

- Some confirmation cuts (lines 143 - 152)

- After passing these cuts, another term is added to the weight of the seed (line 156)

- If any of the components of the seed has a weight smaller than the weight of the best seed containing that SP, we skip this seed (lines 160 - 162)

- `numQualitySeeds` is used to count the number of high-quality seeds accepted (line 167)

- If no high-quality seed was found (numQualitySeeds==0) we allow for other seeds with a weight greater than the minimum (lines 187 - 191)
 

In addition, if `useDeltaRTopRadius == true` the deltaR value calculated in seedFinderUtils is used instead of the radius of the top and compatible top SPs (lines 75 - 80 and 87 - 92). I am not sure if deltaR and useDeltaRTopRadius are the best names for these variables.

@noemina @paulgessinger @robertlangenberg
  • Loading branch information
LuisFelipeCoelho committed May 25, 2022
1 parent f1eee2f commit 4ceddf3
Show file tree
Hide file tree
Showing 16 changed files with 375 additions and 76 deletions.
9 changes: 7 additions & 2 deletions Core/include/Acts/Seeding/InternalSeed.hpp
Expand Up @@ -23,14 +23,17 @@ class InternalSeed {
public:
InternalSeed(InternalSpacePoint<SpacePoint>& s0,
InternalSpacePoint<SpacePoint>& s1,
InternalSpacePoint<SpacePoint>& s2, float z);
InternalSpacePoint<SpacePoint>& s2, float z,
bool qualitySeed = false);
InternalSeed& operator=(const InternalSeed& seed);

const std::array<InternalSpacePoint<SpacePoint>*, 3> sp;
float z() const { return m_z; }
bool qualitySeed() const { return m_qualitySeed; }

protected:
float m_z;
bool m_qualitySeed;
};

/// @cond
Expand All @@ -44,15 +47,17 @@ inline InternalSeed<SpacePoint>& InternalSeed<SpacePoint>::operator=(
const InternalSeed<SpacePoint>& seed) {
m_z = seed.m_z;
sp = seed.sp;
m_qualitySeed = seed.m_qualitySeed;
return (*this);
}

template <typename SpacePoint>
inline InternalSeed<SpacePoint>::InternalSeed(
InternalSpacePoint<SpacePoint>& s0, InternalSpacePoint<SpacePoint>& s1,
InternalSpacePoint<SpacePoint>& s2, float z)
InternalSpacePoint<SpacePoint>& s2, float z, bool qualitySeed)
: sp({&s0, &s1, &s2}) {
m_z = z;
m_qualitySeed = qualitySeed;
}

/// @endcond
Expand Down
3 changes: 3 additions & 0 deletions Core/include/Acts/Seeding/InternalSpacePoint.hpp
Expand Up @@ -40,8 +40,10 @@ class InternalSpacePoint {
float phi() const { return atan2f(m_y, m_x); }
const float& varianceR() const { return m_varianceR; }
const float& varianceZ() const { return m_varianceZ; }
const float& deltaR() const { return m_deltaR; }
const float& quality() const { return m_quality; }
const float& cotTheta() const { return m_cotTheta; }
void setDeltaR(float deltaR) { m_deltaR = deltaR; }
void setCotTheta(float cotTheta) { m_cotTheta = cotTheta; }
void setQuality(float quality) {
if (quality >= m_quality) {
Expand All @@ -57,6 +59,7 @@ class InternalSpacePoint {
float m_r; // radius in beam system coordinates
float m_varianceR; //
float m_varianceZ; //
float m_deltaR; //
float m_cotTheta = std::numeric_limits<
double>::quiet_NaN(); // 1/tanTheta estimated from central+this space
// point. Its evaluation requires that the space
Expand Down
33 changes: 33 additions & 0 deletions Core/include/Acts/Seeding/SeedConfirmationRangeConfig.hpp
@@ -0,0 +1,33 @@
// 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 <limits>

namespace Acts {
/// @brief contains parameters for seed confirmation
struct SeedConfirmationRangeConfig {
// z minimum and maximum of middle component of the seed used to define the
// region of the detector for seed confirmation
float zMinSeedConf =
std::numeric_limits<float>::min(); // Acts::UnitConstants::mm
float zMaxSeedConf =
std::numeric_limits<float>::max(); // Acts::UnitConstants::mm
// radius of bottom component of seed that is used to define the number of
// compatible top required
float rMaxSeedConf =
std::numeric_limits<float>::max(); // Acts::UnitConstants::mm
// number of compatible top SPs of seed if bottom radius is larger than
// rMaxSeedConf
size_t nTopForLargeR = 0;
// number of compatible top SPs of seed if bottom radius is smaller than
// rMaxSeedConf
size_t nTopForSmallR = 0;
};
} // namespace Acts
32 changes: 27 additions & 5 deletions Core/include/Acts/Seeding/SeedFilter.hpp
Expand Up @@ -19,7 +19,6 @@
#include <vector>

namespace Acts {

/// Filter seeds at various stages with the currently
/// available information.
template <typename external_spacepoint_t>
Expand All @@ -40,27 +39,50 @@ class SeedFilter {
/// @param invHelixDiameterVec vector containing 1/(2*r) values where r is the helix radius
/// @param impactParametersVec vector containing the impact parameters
/// @param zOrigin on the z axis as defined by bottom and middle space point
/// @param outIt Output iterator for the seeds
/// @param numQualitySeeds number of high quality seeds in seed confirmation
/// @param numSeeds number of seeds that did not pass the quality confirmation but were still accepted, if quality confirmation is not used this is the total number of seeds
/// @param outCont Output container for the seeds
virtual void filterSeeds_2SpFixed(
InternalSpacePoint<external_spacepoint_t>& bottomSP,
InternalSpacePoint<external_spacepoint_t>& middleSP,
std::vector<InternalSpacePoint<external_spacepoint_t>*>& topSpVec,
std::vector<float>& invHelixDiameterVec,
std::vector<float>& impactParametersVec, float zOrigin,
std::back_insert_iterator<std::vector<std::pair<
float, std::unique_ptr<const InternalSeed<external_spacepoint_t>>>>>
outIt) const;
int& numQualitySeeds, int& numSeeds,
std::vector<std::pair<
float, std::unique_ptr<const InternalSeed<external_spacepoint_t>>>>&
outCont) const;

/// Filter seeds once all seeds for one middle space point have been created
/// @param seedsPerSpM vector of pairs containing weight and seed for all
/// @param numQualitySeeds number of high quality seeds in seed confirmation
/// @param outIt Output iterator for the seeds
/// for all seeds with the same middle space point
virtual void filterSeeds_1SpFixed(
std::vector<std::pair<
float, std::unique_ptr<const InternalSeed<external_spacepoint_t>>>>&
seedsPerSpM,
int& numQualitySeeds,
std::back_insert_iterator<std::vector<Seed<external_spacepoint_t>>> outIt)
const;

/// Check if there is a lower quality seed that can be replaced
/// @param bottomSP fixed bottom space point
/// @param middleSP fixed middle space point
/// @param topSp fixed top space point
/// @param zOrigin on the z axis as defined by bottom and middle space point
/// @param isQualitySeed information whether the seed is quality confirmed or not
/// @param weight weight of the seed
/// @param outCont container for the seeds
virtual void checkReplaceSeeds(
InternalSpacePoint<external_spacepoint_t>& bottomSP,
InternalSpacePoint<external_spacepoint_t>& middleSP,
InternalSpacePoint<external_spacepoint_t>& topSp, float zOrigin,
bool isQualitySeed, float weight,
std::vector<std::pair<
float, std::unique_ptr<const InternalSeed<external_spacepoint_t>>>>&
outCont) const;

const SeedFilterConfig getSeedFilterConfig() const { return m_cfg; }
const IExperimentCuts<external_spacepoint_t>* getExperimentCuts() const {
return m_experimentCuts;
Expand Down

0 comments on commit 4ceddf3

Please sign in to comment.