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: Adding a few changes to test seeding algorithm #4075

Merged
Merged
Show file tree
Hide file tree
Changes from 4 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
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class SeedingAlgorithm final : public IAlgorithm {
WriteDataHandle<SimSeedContainer> m_outputSeeds{this, "OutputSeeds"};

static inline bool itkFastTrackingCuts(float bottomRadius, float cotTheta) {
static float rMin = 50.;
static float rMin = 45.;
static float cotThetaMax = 1.5;

if (bottomRadius < rMin &&
Expand All @@ -125,7 +125,7 @@ class SeedingAlgorithm final : public IAlgorithm {
// At small r we remove points beyond |z| > 200.
float r = sp.radius();
float zabs = std::abs(sp.z());
if (zabs > 200. && r < 50.) {
if (zabs > 200. && r < 45.) {
return false;
}

Expand Down
2 changes: 2 additions & 0 deletions Examples/Io/Root/src/RootAthenaDumpReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,8 @@ RootAthenaDumpReader::readSpacepoints(
ACTS_DEBUG("Created " << spacePoints.size() << " overall space points");
ACTS_DEBUG("Created " << pixelSpacePoints.size() << " "
<< " pixel space points");
ACTS_DEBUG("Created " << stripSpacePoints.size() << " "
<< " strip space points");

return {spacePoints, pixelSpacePoints, stripSpacePoints};
}
Expand Down
1 change: 1 addition & 0 deletions Examples/Python/python/acts/examples/itk.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ def itkSeedingAlgConfig(
zBinNeighborsTop=zBinNeighborsTop,
zBinNeighborsBottom=zBinNeighborsBottom,
numPhiNeighbors=numPhiNeighbors,
useExtraCuts=highOccupancyConfig,
)

return (
Expand Down
3 changes: 2 additions & 1 deletion Examples/Python/python/acts/examples/reconstruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ def addStandardSeeding(
seedFilterConfigArg: SeedFilterConfigArg,
spacePointGridConfigArg: SpacePointGridConfigArg,
logLevel: acts.logging.Level = None,
outputSeeds: str = "seeds",
):
"""adds standard seeding
For parameters description see addSeeding
Expand Down Expand Up @@ -767,7 +768,7 @@ def addStandardSeeding(
seedingAlg = acts.examples.SeedingAlgorithm(
level=logLevel,
inputSpacePoints=[spacePoints],
outputSeeds="seeds",
outputSeeds=outputSeeds,
**acts.examples.defaultKWArgs(
allowSeparateRMax=seedingAlgorithmConfigArg.allowSeparateRMax,
zBinNeighborsTop=seedingAlgorithmConfigArg.zBinNeighborsTop,
Expand Down
6 changes: 3 additions & 3 deletions Examples/Python/src/Input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ void addInput(Context& ctx) {
ActsExamples::RootAthenaDumpReader, mex, "RootAthenaDumpReader", treename,
inputfile, outputMeasurements, outputPixelSpacePoints,
outputStripSpacePoints, outputSpacePoints, outputClusters,
outputMeasurementParticlesMap, outputParticles, onlyPassedParticles,
skipOverlapSPsPhi, skipOverlapSPsEta, geometryIdMap, trackingGeometry,
absBoundaryTolerance);
outputMeasurementParticlesMap, outputParticles, onlySpacepoints,
onlyPassedParticles, skipOverlapSPsPhi, skipOverlapSPsEta, geometryIdMap,
trackingGeometry, absBoundaryTolerance);

#ifdef WITH_GEOMODEL_PLUGIN
ACTS_PYTHON_DECLARE_READER(ActsExamples::RootAthenaDumpGeoIdCollector, mex,
Expand Down
59 changes: 59 additions & 0 deletions Examples/Scripts/Python/reader_and_seeding.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import sys
from pathlib import Path

import acts.examples
import acts

from acts.examples import (
CsvSpacePointReader,
TrackParamsEstimationAlgorithm,
SeedingPerformanceWriter,
)
from acts.examples.reconstruction import (
addStandardSeeding,
)

from acts.examples.itk import itkSeedingAlgConfig, InputSpacePointsType


s = acts.examples.Sequencer(events=1, numThreads=1, outputDir="output")

# loggingLevel = acts.logging.INFO
loggingLevel = acts.logging.DEBUG

s.addReader(
acts.examples.RootAthenaDumpReader(
level=loggingLevel,
treename="GNN4ITk",
inputfile="Dump_GNN4Itk.root",
onlySpacepoints=True,
outputPixelSpacePoints="pixel_spacepoints",
outputStripSpacePoints="strip_spacepoints",
outputSpacePoints="spacepoints",
)
)


# run pixel seeding
seeding_pixel = addStandardSeeding(
s,
"pixel_spacepoints",
*acts.examples.itk.itkSeedingAlgConfig(
InputSpacePointsType.PixelSpacePoints, highOccupancyConfig=True
),
logLevel=loggingLevel,
outputSeeds="pixel_seeds"
)


# run strip seeding
seeding_strip = addStandardSeeding(
s,
"strip_spacepoints",
*acts.examples.itk.itkSeedingAlgConfig(InputSpacePointsType.StripSpacePoints),
logLevel=acts.logging.DEBUG,
outputSeeds="strip_seeds"
)


s.run()
Loading