Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 5 additions & 4 deletions Core/include/Acts/Seeding2/GbtsTrackingFilter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

#pragma once

#include "Acts/Definitions/Units.hpp"
#include "Acts/Seeding2/GbtsDataStorage.hpp"
#include "Acts/Seeding2/GbtsGeometry.hpp"

Expand Down Expand Up @@ -70,9 +71,9 @@ class GbtsTrackingFilter final {
float radLen = 0.025;

/// Measurement uncertainty in x direction.
float sigmaX = 0.08;
float sigmaX = 0.08 * Acts::UnitConstants::mm;
/// Measurement uncertainty in y direction.
float sigmaY = 0.25;
float sigmaY = 0.25 * Acts::UnitConstants::mm;

/// Measurement weight in x direction.
float weightX = 0.5;
Expand All @@ -88,9 +89,9 @@ class GbtsTrackingFilter final {
float addHit = 14.0;

/// Maximum track curvature.
float maxCurvature = 1e-3f;
float maxCurvature = 1e-3f / Acts::UnitConstants::mm;
/// Maximum longitudinal impact parameter.
float maxZ0 = 170.0;
float maxZ0 = 170.0 * Acts::UnitConstants::mm;
};

/// State for the tracking filter, containing edge states and a global
Expand Down
85 changes: 65 additions & 20 deletions Core/include/Acts/Seeding2/GraphBasedTrackSeeder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,16 @@ class GraphBasedTrackSeeder {
bool matchBeforeCreate = false;
/// Use legacy tuning parameters.
bool useOldTunings = false;
/// description here
bool validateTriplets = true;
/// description here
bool useAdaptiveCuts = true;
/// Tau ratio cut threshold.
float tauRatioCut = 0.007;
/// Tau ratio precut threshold.
float tauRatioPrecut = 0.009f;
/// description here
float tauRatioCorr = 0.006;
/// Eta bin width override (0 uses default from connection file).
// specify non-zero to override eta bin width from connection file (default
// 0.2 in createLinkingScheme.py)
Expand All @@ -66,27 +72,30 @@ class GraphBasedTrackSeeder {
float minPt = 1.0f * UnitConstants::GeV;

// graph building options
/// Transverse momentum coefficient (~0.3*B/2 - assumes nominal field of
/// 2*T).
double ptCoeff = 0.29997 * 1.9972 / 2.0;
/// Use eta binning from geometry structure.
bool useEtaBinning = true;
/// Apply RZ cuts on doublets.
bool doubletFilterRZ = true;
/// Maximum number of Gbts edges/doublets.
std::uint32_t nMaxEdges = 2000000;
/// Minimum delta radius between layers.
float minDeltaRadius = 2.0;
float minDeltaRadius = 2.0 * Acts::UnitConstants::mm;
/// Maximum d0 impact parameter when validating edge connection triplet
float d0Max = 3.0 * UnitConstants::mm;

// Seed extraction options
/// Minimum eta for edge masking.
float edgeMaskMinEta = 1.5;
/// Threshold for hit sharing between seeds.
float hitShareThreshold = 0.49;

/// Max seed eta value considered for splitting.
float maxSeedSplitEta = 0.6;
/// Max allowed curvature for seed self consistency check.
// Units of inverse meters
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Units of inverse meters
/// Units of inverse meters

float maxInvRadDiff = 0.7e-2 / UnitConstants::m;
// GbtsDataStorage options
/// Maximum endcap cluster width.
float maxEndcapClusterWidth = 0.35;
float maxEndcapClusterWidth = 0.35 * Acts::UnitConstants::mm;
};

/// Derived configuration struct that contains calculated parameters based on
Expand All @@ -100,27 +109,56 @@ class GraphBasedTrackSeeder {
float phiSliceWidth = std::numeric_limits<float>::quiet_NaN();
};

/// Seed metadata produced by the GBTS algorithm.
struct SeedProperties {
/// Optional inputs for variables passed in
/// or derived during runtime.
struct Options {
/// Constructor.
/// @param bFieldInZ_ the magnetic field in z
explicit Options(float bFieldInZ_);

/// Magnetic field in z
/// units of GeV/(e*mm).
float bFieldInZ{};

/// Transverse momentum coefficient (~0.3*B/2 - assumes nominal field of
/// 2*T).
double ptCoeff{};
};
/// candidate seed metadata produced by the GBTS algorithm.
struct SeedCandidateProperties {
/// Constructor.
/// @param quality Seed quality score
/// @param clone Clone flag
/// @param sps Space point indices
SeedProperties(float quality, std::int32_t clone,
std::vector<std::uint32_t> sps)
: seedQuality(quality), isClone(clone), spacePoints(std::move(sps)) {}
/// @param sps Vector of pointers to actual space points
/// @param splitFlag used to flag if seed needs to be split in two
SeedCandidateProperties(float quality, std::int32_t clone,
std::vector<const GbtsNode*> sps,
std::uint32_t splitFlag)
: seedQuality(quality),
isClone(clone),
spacePoints(std::move(sps)),
forSeedSplitting(splitFlag) {}

/// Seed quality score.
float seedQuality{};
/// Clone flag.
std::int32_t isClone{};
/// Space point indices.
std::vector<std::uint32_t> spacePoints;
std::vector<const GbtsNode*> spacePoints;
/// Flag for seed splitting.
std::uint32_t forSeedSplitting{};
};

/// Output seed metadata
struct OutputSeedProperties {
/// Constructor.
OutputSeedProperties(float Quality, std::vector<std::uint32_t> sps)
: seedQuality(Quality), spacePoints(std::move(sps)) {}

/// Comparison operator.
/// @param o Other seed properties to compare
/// @return True if this is less than other
auto operator<=>(const SeedProperties& o) const = default;
/// Quality of seed.
float seedQuality{};
/// Index of spacepoints in seed.
std::vector<std::uint32_t> spacePoints;
};

/// Sliding window in phi used to define range used for edge creation
Expand Down Expand Up @@ -154,7 +192,8 @@ class GraphBasedTrackSeeder {
SeedContainer2 createSeeds(const SpacePointContainer2& spacePoints,
const GbtsRoiDescriptor& roi,
std::uint32_t maxLayers,
const GbtsTrackingFilter& filter) const;
const GbtsTrackingFilter& filter,
Options options) const;

private:
DerivedConfig m_cfg;
Expand Down Expand Up @@ -187,7 +226,7 @@ class GraphBasedTrackSeeder {
/// @return Pair of edge count and maximum level
std::pair<std::int32_t, std::int32_t> buildTheGraph(
const GbtsRoiDescriptor& roi, GbtsNodeStorage& nodeStorage,
std::vector<GbtsEdge>& edgeStorage) const;
std::vector<GbtsEdge>& edgeStorage, Options options) const;

/// Run connected component analysis on the graph.
/// @param nEdges Number of edges in the graph
Expand All @@ -206,7 +245,7 @@ class GraphBasedTrackSeeder {
void extractSeedsFromTheGraph(std::uint32_t maxLevel, std::uint32_t nEdges,
std::int32_t nHits,
std::vector<GbtsEdge>& edgeStorage,
std::vector<SeedProperties>& vSeedCandidates,
std::vector<OutputSeedProperties>& vOutputSeeds,
const GbtsTrackingFilter& filter) const;

/// Check to see if z0 of segment is within the expected z range of the
Expand All @@ -218,6 +257,12 @@ class GraphBasedTrackSeeder {
/// @return Whether segment is within beamspot range
bool checkZ0BitMask(std::uint16_t z0BitMask, float z0, float minZ0,
float z0HistoCoeff) const;

float estimateCurvature(const std::array<const GbtsNode*, 3>& nodes) const;

bool validateTriplet(const std::array<const GbtsNode*, 3> candidateTriplet,
float tripletMinPt, float tauRatio, float tauRatioCut,
Options options) const;
};

} // namespace Acts::Experimental
Loading
Loading