diff --git a/Examples/Python/python/acts/examples/itk.py b/Examples/Python/python/acts/examples/itk.py index 591116e92dd..a3b8eb4ccaa 100644 --- a/Examples/Python/python/acts/examples/itk.py +++ b/Examples/Python/python/acts/examples/itk.py @@ -2,6 +2,14 @@ import acts from acts.examples import TGeoDetector from pathlib import Path +import math + +from acts.examples.reconstruction import ( + SeedfinderConfigArg, + SeedFilterConfigArg, + SpacePointGridConfigArg, + SeedingAlgorithmConfigArg, +) u = acts.UnitConstants @@ -249,3 +257,269 @@ def buildITkGeometry( ), ], ) + + +def itkSeedingAlgConfig(inputSpacePointsType): + + # variables that do not change for pixel and strip SPs: + zMax = 3000 * u.mm + zMin = -3000 * u.mm + beamPos = (0 * u.mm, 0 * u.mm) + collisionRegionMin = -200 * u.mm + collisionRegionMax = 200 * u.mm + maxSeedsPerSpM = 4 + cotThetaMax = 27.2899 + sigmaScattering = 2 + radLengthPerSeed = 0.1 + minPt = 900 * u.MeV + bFieldInZ = 2 * u.T + deltaRMin = 20 * u.mm + maxPtScattering = float("inf") * u.GeV + zBinEdges = [ + -3000.0, + -2500.0, + -1400.0, + -925.0, + -450.0, + -250.0, + 250.0, + 450.0, + 925.0, + 1400.0, + 2500.0, + 3000.0, + ] # zBinEdges enables non-equidistant binning in z, in case the binning is not defined the edges are evaluated automatically using equidistant binning + rRangeMiddleSP = [ + [40.0, 90.0], + [40.0, 200.0], + [46.0, 200.0], + [46.0, 200.0], + [46.0, 250.0], + [46.0, 250.0], + [46.0, 250.0], + [46.0, 200.0], + [46.0, 200.0], + [40.0, 200.0], + [40.0, 90.0], + ] # if useVariableMiddleSPRange is set to false, the vector rRangeMiddleSP can be used to define a fixed r range for each z bin: {{rMin, rMax}, ...}. If useVariableMiddleSPRange is set to false and the vector is empty, the cuts won't be applied + useVariableMiddleSPRange = True # if useVariableMiddleSPRange is true, the values in rRangeMiddleSP will be calculated based on r values of the SPs and deltaRMiddleSPRange + binSizeR = 1 * u.mm + forceRadialSorting = True + seedConfirmation = True + centralSeedConfirmationRange = acts.SeedConfirmationRangeConfig( + zMinSeedConf=-250 * u.mm, + zMaxSeedConf=250 * u.mm, + rMaxSeedConf=140 * u.mm, + nTopForLargeR=1, + nTopForSmallR=2, + ) # contains parameters for seed confirmation + forwardSeedConfirmationRange = acts.SeedConfirmationRangeConfig( + zMinSeedConf=-3000 * u.mm, + zMaxSeedConf=3000 * u.mm, + rMaxSeedConf=140 * u.mm, + nTopForLargeR=1, + nTopForSmallR=2, + ) + compatSeedWeight = 100 + curvatureSortingInFilter = True + phiMin = 0 + phiMax = 2 * math.pi + zBinEdges = [ + -3000.0, + -2500.0, + -1400.0, + -925.0, + -450.0, + -250.0, + 250.0, + 450.0, + 925.0, + 1400.0, + 2500.0, + 3000.0, + ] # zBinEdges enables non-equidistant binning in z, in case the binning is not defined the edges are evaluated automatically using equidistant binning + phiBinDeflectionCoverage = 3 + numPhiNeighbors = 1 + + # variables that change for pixel and strip SPs: + if inputSpacePointsType == "PixelSpacePoints": + outputSeeds = "PixelSeeds" + allowSeparateRMax = False + rMaxGridConfig = 320 * u.mm + rMaxSeedFinderConfig = rMaxGridConfig + deltaRMinSP = 6 * u.mm + deltaRMax = 280 * u.mm + deltaRMaxTopSP = 280 * u.mm + deltaRMaxBottomSP = 120 * u.mm + interactionPointCut = True + arithmeticAverageCotTheta = False + deltaZMax = 600 * u.mm + impactMax = 2 * u.mm + zBinsCustomLooping = [ + 1, + 2, + 3, + 4, + 11, + 10, + 9, + 8, + 6, + 5, + 7, + ] # enable custom z looping when searching for SPs, must contain numbers from 1 to the total number of bin in zBinEdges + skipPreviousTopSP = True + zBinNeighborsTop = [ + [0, 0], + [-1, 0], + [-1, 0], + [-1, 0], + [-1, 0], + [-1, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + ] # allows to specify the number of neighbors desired for each bin, [-1,1] means one neighbor on the left and one on the right, if the vector is empty the algorithm returns the 8 surrounding bins + zBinNeighborsBottom = [ + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + [-1, 0], + [-1, 0], + [-1, 0], + [-1, 0], + [-1, 0], + ] + deltaRMiddleMinSPRange = 10 * u.mm + deltaRMiddleMaxSPRange = 10 * u.mm + seedConfirmationFilter = True + impactWeightFactor = 100 + compatSeedLimit = 3 + numSeedIncrement = 10**100 # inf + seedWeightIncrement = 0 + useDetailedDoubleMeasurementInfo = False + maxSeedsPerSpMConf = 5 + maxQualitySeedsPerSpMConf = 5 + useDeltaRorTopRadius = True + else: + outputSeeds = "StripSeeds" + allowSeparateRMax = True + rMaxGridConfig = 1000.0 * u.mm + rMaxSeedFinderConfig = 1200.0 * u.mm + deltaRMinSP = 20 * u.mm + deltaRMax = 600 * u.mm + deltaRMaxTopSP = 300 * u.mm + deltaRMaxBottomSP = deltaRMaxTopSP + interactionPointCut = False + arithmeticAverageCotTheta = True + deltaZMax = 900 * u.mm + impactMax = 20 * u.mm + zBinsCustomLooping = [6, 7, 5, 8, 4, 9, 3, 10, 2, 11, 1] + skipPreviousTopSP = False + zBinNeighborsTop = [ + [0, 0], + [-1, 0], + [-1, 0], + [-1, 0], + [-1, 0], + [-1, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 1], + [0, 0], + ] + zBinNeighborsBottom = [ + [0, 1], + [0, 1], + [0, 1], + [0, 2], + [0, 1], + [0, 0], + [-1, 0], + [-2, 0], + [-1, 0], + [-1, 0], + [-1, 0], + ] + deltaRMiddleMinSPRange = 30 * u.mm + deltaRMiddleMaxSPRange = 150 * u.mm + seedConfirmationFilter = False + impactWeightFactor = 1 + compatSeedLimit = 4 + numSeedIncrement = 1 + seedWeightIncrement = 10100 + useDetailedDoubleMeasurementInfo = True + maxSeedsPerSpMConf = 1000000000 + maxQualitySeedsPerSpMConf = 1000000000 + useDeltaRorTopRadius = False + + # fill namedtuples + seedfinderConfigArg = SeedfinderConfigArg( + maxSeedsPerSpM=maxSeedsPerSpM, + cotThetaMax=cotThetaMax, + sigmaScattering=sigmaScattering, + radLengthPerSeed=radLengthPerSeed, + minPt=minPt, + bFieldInZ=bFieldInZ, + impactMax=impactMax, + interactionPointCut=interactionPointCut, + arithmeticAverageCotTheta=arithmeticAverageCotTheta, + deltaZMax=deltaZMax, + maxPtScattering=maxPtScattering, + zBinEdges=zBinEdges, + skipPreviousTopSP=skipPreviousTopSP, + zBinsCustomLooping=zBinsCustomLooping, + rRangeMiddleSP=rRangeMiddleSP, + useVariableMiddleSPRange=useVariableMiddleSPRange, + binSizeR=binSizeR, + forceRadialSorting=forceRadialSorting, + seedConfirmation=seedConfirmation, + centralSeedConfirmationRange=centralSeedConfirmationRange, + forwardSeedConfirmationRange=forwardSeedConfirmationRange, + deltaR=(deltaRMin, deltaRMax), + deltaRBottomSP=(deltaRMinSP, deltaRMaxBottomSP), + deltaRTopSP=(deltaRMinSP, deltaRMaxTopSP), + deltaRMiddleSPRange=(deltaRMiddleMinSPRange, deltaRMiddleMaxSPRange), + collisionRegion=(collisionRegionMin, collisionRegionMax), + r=(None, rMaxSeedFinderConfig), + z=(zMin, zMax), + beamPos=beamPos, + ) + seedFilterConfigArg = SeedFilterConfigArg( + impactWeightFactor=impactWeightFactor, + compatSeedWeight=compatSeedWeight, + compatSeedLimit=compatSeedLimit, + numSeedIncrement=numSeedIncrement, + seedWeightIncrement=seedWeightIncrement, + seedConfirmation=seedConfirmation, + curvatureSortingInFilter=curvatureSortingInFilter, + maxSeedsPerSpMConf=maxSeedsPerSpMConf, + maxQualitySeedsPerSpMConf=maxQualitySeedsPerSpMConf, + useDeltaRorTopRadius=useDeltaRorTopRadius, + ) + spacePointGridConfigArg = SpacePointGridConfigArg( + rMax=rMaxGridConfig, + zBinEdges=zBinEdges, + phiBinDeflectionCoverage=phiBinDeflectionCoverage, + phi=(phiMin, phiMax), + impactMax=impactMax, + ) + seedingAlgorithmConfigArg = SeedingAlgorithmConfigArg( + allowSeparateRMax=allowSeparateRMax, + zBinNeighborsTop=zBinNeighborsTop, + zBinNeighborsBottom=zBinNeighborsBottom, + numPhiNeighbors=numPhiNeighbors, + ) + + return ( + seedfinderConfigArg, + seedFilterConfigArg, + spacePointGridConfigArg, + seedingAlgorithmConfigArg, + ) diff --git a/Examples/Python/python/acts/examples/reconstruction.py b/Examples/Python/python/acts/examples/reconstruction.py index 1bdbc41b13b..9d8eb479811 100644 --- a/Examples/Python/python/acts/examples/reconstruction.py +++ b/Examples/Python/python/acts/examples/reconstruction.py @@ -37,13 +37,70 @@ "minPt", "bFieldInZ", "impactMax", + "interactionPointCut", + "arithmeticAverageCotTheta", + "deltaZMax", + "maxPtScattering", + "zBinEdges", + "skipPreviousTopSP", + "zBinsCustomLooping", + "rRangeMiddleSP", + "useVariableMiddleSPRange", + "binSizeR", + "forceRadialSorting", + "seedConfirmation", + "centralSeedConfirmationRange", + "forwardSeedConfirmationRange", "deltaR", # (min,max) + "deltaRBottomSP", # (min,max) + "deltaRTopSP", # (min,max) + "deltaRMiddleSPRange", # (min,max) "collisionRegion", # (min,max) "r", # (min,max) "z", # (min,max) "beamPos", # (x,y) ], - defaults=[None] * 7 + [(None, None)] * 5, + defaults=[None] * 21 + [(None, None)] * 8, +) + +SeedFilterConfigArg = namedtuple( + "SeedFilterConfig", + [ + "impactWeightFactor", + "compatSeedWeight", + "compatSeedLimit", + "numSeedIncrement", + "seedWeightIncrement", + "seedConfirmation", + "curvatureSortingInFilter", + "maxSeedsPerSpMConf", + "maxQualitySeedsPerSpMConf", + "useDeltaRorTopRadius", + ], + defaults=[None] * 10, +) + +SpacePointGridConfigArg = namedtuple( + "SeedGridConfig", + [ + "rMax", + "zBinEdges", + "phiBinDeflectionCoverage", + "impactMax", + "phi", # (min,max) + ], + defaults=[None] * 4 + [(None, None)] * 1, +) + +SeedingAlgorithmConfigArg = namedtuple( + "SeedingAlgorithmConfig", + [ + "allowSeparateRMax", + "zBinNeighborsTop", + "zBinNeighborsBottom", + "numPhiNeighbors", + ], + defaults=[None] * 4, ) TrackParamsEstimationConfig = namedtuple( @@ -60,6 +117,9 @@ truthSeedRanges=TruthSeedRanges, particleSmearingSigmas=ParticleSmearingSigmas, seedfinderConfigArg=SeedfinderConfigArg, + seedFilterConfigArg=SeedFilterConfigArg, + spacePointGridConfigArg=SpacePointGridConfigArg, + seedingAlgorithmConfigArg=SeedingAlgorithmConfigArg, trackParamsEstimationConfig=TrackParamsEstimationConfig, logLevel=acts.logging.Level, ) @@ -73,6 +133,9 @@ def addSeeding( particleSmearingSigmas: ParticleSmearingSigmas = ParticleSmearingSigmas(), initialVarInflation: Optional[list] = None, seedfinderConfigArg: SeedfinderConfigArg = SeedfinderConfigArg(), + seedFilterConfigArg: SeedFilterConfigArg = SeedFilterConfigArg(), + spacePointGridConfigArg: SpacePointGridConfigArg = SpacePointGridConfigArg(), + seedingAlgorithmConfigArg: SeedingAlgorithmConfigArg = SeedingAlgorithmConfigArg(), trackParamsEstimationConfig: TrackParamsEstimationConfig = TrackParamsEstimationConfig(), inputParticles: str = "particles_initial", outputDirRoot: Optional[Union[Path, str]] = None, @@ -80,7 +143,6 @@ def addSeeding( rnd: Optional[acts.examples.RandomNumbers] = None, ) -> acts.examples.Sequencer: """This function steers the seeding - Parameters ---------- s: Sequencer @@ -100,9 +162,16 @@ def addSeeding( initialVarInflation : list List of 6 scale factors to inflate the initial covariance matrix Defaults (all 1) specified in Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/ParticleSmearing.hpp - seedfinderConfigArg : SeedfinderConfigArg(maxSeedsPerSpM, cotThetaMax, sigmaScattering, radLengthPerSeed, minPt, bFieldInZ, impactMax, deltaR, collisionRegion, r, z, beamPos) - SeedfinderConfig settings. deltaR, collisionRegion, r, z are ranges specified as a tuple of (min,max). beamPos is specified as (x,y). + seedfinderConfigArg : SeedfinderConfigArg(maxSeedsPerSpM, cotThetaMax, sigmaScattering, radLengthPerSeed, minPt, bFieldInZ, impactMax, interactionPointCut, arithmeticAverageCotTheta, deltaZMax, maxPtScattering, zBinEdges, skipPreviousTopSP, zBinsCustomLooping, rRangeMiddleSP, useVariableMiddleSPRange, binSizeR, forceRadialSorting, seedConfirmation, centralSeedConfirmationRange, forwardSeedConfirmationRange, deltaR, deltaRBottomSP, deltaRTopSP, deltaRMiddleSPRange, collisionRegion, r, z, beamPos) + SeedfinderConfig settings. deltaR, deltaRBottomSP, deltaRTopSP, deltaRMiddleSPRange, collisionRegion, r, z are ranges specified as a tuple of (min,max). beamPos is specified as (x,y). Defaults specified in Core/include/Acts/Seeding/SeedfinderConfig.hpp + seedFilterConfigArg : SeedFilterConfigArg(compatSeedWeight, compatSeedLimit, numSeedIncrement, seedWeightIncrement, seedConfirmation, curvatureSortingInFilter, maxSeedsPerSpMConf, maxQualitySeedsPerSpMConf, useDeltaRorTopRadius) + Defaults specified in Core/include/Acts/Seeding/SeedFinderConfig.hpp + spacePointGridConfigArg : SpacePointGridConfigArg(rMax, zBinEdges, phiBinDeflectionCoverage, phi, impactMax) + SpacePointGridConfigArg settings. phi is specified as a tuple of (min,max). + Defaults specified in Core/include/Acts/Seeding/SpacePointGrid.hpp + seedingAlgorithmConfigArg : SeedingAlgorithmConfigArg(allowSeparateRMax, zBinNeighborsTop, zBinNeighborsBottom, numPhiNeighbors) + Defaults specified in Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/SeedingAlgorithm.hpp trackParamsEstimationConfig : TrackParamsEstimationConfig(deltaR) TrackParamsEstimationAlgorithm configuration. Currently only deltaR=(min,max) range specified here. Defaults specified in Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/TrackParamsEstimationAlgorithm.hpp @@ -217,10 +286,28 @@ def customLogLevel(custom: acts.logging.Level = acts.logging.INFO): rMax=seedfinderConfigArg.r[1], deltaRMin=seedfinderConfigArg.deltaR[0], deltaRMax=seedfinderConfigArg.deltaR[1], - deltaRMinTopSP=seedfinderConfigArg.deltaR[0], - deltaRMinBottomSP=seedfinderConfigArg.deltaR[0], - deltaRMaxTopSP=seedfinderConfigArg.deltaR[1], - deltaRMaxBottomSP=seedfinderConfigArg.deltaR[1], + deltaRMinTopSP=( + seedfinderConfigArg.deltaR[0] + if seedfinderConfigArg.deltaRTopSP[0] is None + else seedfinderConfigArg.deltaRTopSP[0] + ), + deltaRMaxTopSP=( + seedfinderConfigArg.deltaR[1] + if seedfinderConfigArg.deltaRTopSP[1] is None + else seedfinderConfigArg.deltaRTopSP[1] + ), + deltaRMinBottomSP=( + seedfinderConfigArg.deltaR[0] + if seedfinderConfigArg.deltaRBottomSP[0] is None + else seedfinderConfigArg.deltaRBottomSP[0] + ), + deltaRMaxBottomSP=( + seedfinderConfigArg.deltaR[1] + if seedfinderConfigArg.deltaRBottomSP[1] is None + else seedfinderConfigArg.deltaRBottomSP[1] + ), + deltaRMiddleMinSPRange=seedfinderConfigArg.deltaRMiddleSPRange[0], + deltaRMiddleMaxSPRange=seedfinderConfigArg.deltaRMiddleSPRange[1], collisionRegionMin=seedfinderConfigArg.collisionRegion[0], collisionRegionMax=seedfinderConfigArg.collisionRegion[1], zMin=seedfinderConfigArg.z[0], @@ -232,6 +319,20 @@ def customLogLevel(custom: acts.logging.Level = acts.logging.INFO): minPt=seedfinderConfigArg.minPt, bFieldInZ=seedfinderConfigArg.bFieldInZ, impactMax=seedfinderConfigArg.impactMax, + interactionPointCut=seedfinderConfigArg.interactionPointCut, + arithmeticAverageCotTheta=seedfinderConfigArg.arithmeticAverageCotTheta, + deltaZMax=seedfinderConfigArg.deltaZMax, + maxPtScattering=seedfinderConfigArg.maxPtScattering, + zBinEdges=seedfinderConfigArg.zBinEdges, + skipPreviousTopSP=seedfinderConfigArg.skipPreviousTopSP, + zBinsCustomLooping=seedfinderConfigArg.zBinsCustomLooping, + rRangeMiddleSP=seedfinderConfigArg.rRangeMiddleSP, + useVariableMiddleSPRange=seedfinderConfigArg.useVariableMiddleSPRange, + binSizeR=seedfinderConfigArg.binSizeR, + forceRadialSorting=seedfinderConfigArg.forceRadialSorting, + seedConfirmation=seedfinderConfigArg.seedConfirmation, + centralSeedConfirmationRange=seedfinderConfigArg.centralSeedConfirmationRange, + forwardSeedConfirmationRange=seedfinderConfigArg.forwardSeedConfirmationRange, beamPos=( None if seedfinderConfigArg.beamPos is None @@ -245,18 +346,43 @@ def customLogLevel(custom: acts.logging.Level = acts.logging.INFO): ) seedFilterConfig = acts.SeedFilterConfig( - maxSeedsPerSpM=seedFinderConfig.maxSeedsPerSpM, - deltaRMin=seedFinderConfig.deltaRMin, + **acts.examples.defaultKWArgs( + maxSeedsPerSpM=seedFinderConfig.maxSeedsPerSpM, + deltaRMin=seedFinderConfig.deltaRMin, + impactWeightFactor=seedFilterConfigArg.impactWeightFactor, + compatSeedWeight=seedFilterConfigArg.compatSeedWeight, + compatSeedLimit=seedFilterConfigArg.compatSeedLimit, + numSeedIncrement=seedFilterConfigArg.numSeedIncrement, + seedWeightIncrement=seedFilterConfigArg.seedWeightIncrement, + seedConfirmation=seedFilterConfigArg.seedConfirmation, + centralSeedConfirmationRange=seedFinderConfig.centralSeedConfirmationRange, + forwardSeedConfirmationRange=seedFinderConfig.forwardSeedConfirmationRange, + curvatureSortingInFilter=seedFilterConfigArg.curvatureSortingInFilter, + maxSeedsPerSpMConf=seedFilterConfigArg.maxSeedsPerSpMConf, + maxQualitySeedsPerSpMConf=seedFilterConfigArg.maxQualitySeedsPerSpMConf, + useDeltaRorTopRadius=seedFilterConfigArg.useDeltaRorTopRadius, + ) ) gridConfig = acts.SpacePointGridConfig( - bFieldInZ=seedFinderConfig.bFieldInZ, - minPt=seedFinderConfig.minPt, - rMax=seedFinderConfig.rMax, - zMax=seedFinderConfig.zMax, - zMin=seedFinderConfig.zMin, - deltaRMax=seedFinderConfig.deltaRMax, - cotThetaMax=seedFinderConfig.cotThetaMax, + **acts.examples.defaultKWArgs( + bFieldInZ=seedFinderConfig.bFieldInZ, + minPt=seedFinderConfig.minPt, + rMax=( + seedFinderConfig.rMax + if spacePointGridConfigArg.rMax is None + else spacePointGridConfigArg.rMax + ), + zMax=seedFinderConfig.zMax, + zMin=seedFinderConfig.zMin, + deltaRMax=seedFinderConfig.deltaRMax, + cotThetaMax=seedFinderConfig.cotThetaMax, + phiMin=spacePointGridConfigArg.phi[0], + phiMax=spacePointGridConfigArg.phi[1], + impactMax=spacePointGridConfigArg.impactMax, + zBinEdges=spacePointGridConfigArg.zBinEdges, + phiBinDeflectionCoverage=spacePointGridConfigArg.phiBinDeflectionCoverage, + ) ) seedingAlg = acts.examples.SeedingAlgorithm( @@ -264,6 +390,12 @@ def customLogLevel(custom: acts.logging.Level = acts.logging.INFO): inputSpacePoints=[spAlg.config.outputSpacePoints], outputSeeds="seeds", outputProtoTracks="prototracks", + **acts.examples.defaultKWArgs( + allowSeparateRMax=seedingAlgorithmConfigArg.allowSeparateRMax, + zBinNeighborsTop=seedingAlgorithmConfigArg.zBinNeighborsTop, + zBinNeighborsBottom=seedingAlgorithmConfigArg.zBinNeighborsBottom, + numPhiNeighbors=seedingAlgorithmConfigArg.numPhiNeighbors, + ), gridConfig=gridConfig, seedFilterConfig=seedFilterConfig, seedFinderConfig=seedFinderConfig, @@ -280,6 +412,8 @@ def customLogLevel(custom: acts.logging.Level = acts.logging.INFO): rMax=seedfinderConfigArg.r[1], deltaRMin=seedfinderConfigArg.deltaR[0], deltaRMax=seedfinderConfigArg.deltaR[1], + deltaRMiddleMinSPRange=seedfinderConfigArg.deltaRMiddleSPRange[0], + deltaRMiddleMaxSPRange=seedfinderConfigArg.deltaRMiddleSPRange[1], collisionRegionMin=seedfinderConfigArg.collisionRegion[0], collisionRegionMax=seedfinderConfigArg.collisionRegion[1], zMin=seedfinderConfigArg.z[0], @@ -291,6 +425,18 @@ def customLogLevel(custom: acts.logging.Level = acts.logging.INFO): minPt=seedfinderConfigArg.minPt, bFieldInZ=seedfinderConfigArg.bFieldInZ, impactMax=seedfinderConfigArg.impactMax, + interactionPointCut=seedfinderConfigArg.interactionPointCut, + arithmeticAverageCotTheta=seedfinderConfigArg.arithmeticAverageCotTheta, + deltaZMax=seedfinderConfigArg.deltaZMax, + maxPtScattering=seedfinderConfigArg.maxPtScattering, + zBinEdges=seedfinderConfigArg.zBinEdges, + skipPreviousTopSP=seedfinderConfigArg.skipPreviousTopSP, + zBinsCustomLooping=seedfinderConfigArg.zBinsCustomLooping, + rRangeMiddleSP=seedfinderConfigArg.rRangeMiddleSP, + useVariableMiddleSPRange=seedfinderConfigArg.useVariableMiddleSPRange, + binSizeR=seedfinderConfigArg.binSizeR, + forceRadialSorting=seedfinderConfigArg.forceRadialSorting, + seedConfirmation=seedfinderConfigArg.seedConfirmation, beamPos=( None if seedfinderConfigArg.beamPos is None @@ -304,8 +450,20 @@ def customLogLevel(custom: acts.logging.Level = acts.logging.INFO): ) seedFilterConfig = acts.SeedFilterConfig( - maxSeedsPerSpM=seedFinderConfig.maxSeedsPerSpM, - deltaRMin=seedFinderConfig.deltaRMin, + **acts.examples.defaultKWArgs( + maxSeedsPerSpM=seedFinderConfig.maxSeedsPerSpM, + deltaRMin=seedFinderConfig.deltaRMin, + impactWeightFactor=seedFilterConfigArg.impactWeightFactor, + compatSeedWeight=seedFilterConfigArg.compatSeedWeight, + compatSeedLimit=seedFilterConfigArg.compatSeedLimit, + numSeedIncrement=seedFilterConfigArg.numSeedIncrement, + seedWeightIncrement=seedFilterConfigArg.seedWeightIncrement, + seedConfirmation=seedFilterConfigArg.seedConfirmation, + curvatureSortingInFilter=seedFilterConfigArg.curvatureSortingInFilter, + maxSeedsPerSpMConf=seedFilterConfigArg.maxSeedsPerSpMConf, + maxQualitySeedsPerSpMConf=seedFilterConfigArg.maxQualitySeedsPerSpMConf, + useDeltaRorTopRadius=seedFilterConfigArg.useDeltaRorTopRadius, + ) ) seedingAlg = acts.examples.SeedingOrthogonalAlgorithm( diff --git a/Examples/Scripts/Python/full_chain_itk.py b/Examples/Scripts/Python/full_chain_itk.py index 635ccb420c4..0eb004db160 100755 --- a/Examples/Scripts/Python/full_chain_itk.py +++ b/Examples/Scripts/Python/full_chain_itk.py @@ -30,6 +30,8 @@ CKFPerformanceConfig, ) +from acts.examples.itk import itkSeedingAlgConfig + s = acts.examples.Sequencer(events=100, numThreads=-1) s = addParticleGun( s, @@ -72,6 +74,7 @@ TruthSeedRanges(pt=(1.0 * u.GeV, None), eta=(-4.0, 4.0), nHits=(9, None)), # SeedingAlgorithm.TruthEstimated, # SeedingAlgorithm.TruthSmeared, ParticleSmearingSigmas(pRel=0.01), rnd=rnd, + *itkSeedingAlgConfig("PixelSpacePoints"), geoSelectionConfigFile=geo_dir / "itk-hgtd/geoSelection-ITk.json", outputDirRoot=outputDir, ) diff --git a/Examples/Scripts/Python/itk_seeding.py b/Examples/Scripts/Python/itk_seeding.py index 5f0d0b38aa8..d7a3ad4db1b 100755 --- a/Examples/Scripts/Python/itk_seeding.py +++ b/Examples/Scripts/Python/itk_seeding.py @@ -8,251 +8,129 @@ import acts.examples from acts.examples import CsvSpacePointReader +from collections import namedtuple +from acts.examples.reconstruction import ( + SeedfinderConfigArg, + SeedFilterConfigArg, + SpacePointGridConfigArg, + SeedingAlgorithmConfigArg, +) -u = acts.UnitConstants +from acts.examples.itk import itkSeedingAlgConfig +u = acts.UnitConstants -def runITkSeeding(field, inputSPs, outputDir, inputSpacePointsType, s=None): - - # variables that change for pixel and strip SP - if inputSpacePointsType == "PixelSpacePoints": - outputSeeds = "PixelSeeds" - allowSeparateRMax = False - rMaxGridConfig = 320 * u.mm - rMaxSeedFinderConfig = rMaxGridConfig - deltaRMinSP = 6 * u.mm - deltaRMax = 280 * u.mm - deltaRMaxTopSP = 280 * u.mm - deltaRMaxBottomSP = 120 * u.mm - interactionPointCut = True - arithmeticAverageCotTheta = False - deltaZMax = 600 * u.mm - impactMax = 2 * u.mm - zBinsCustomLooping = [ - 1, - 2, - 3, - 4, - 11, - 10, - 9, - 8, - 6, - 5, - 7, - ] # enable custom z looping when searching for SPs, must contain numbers from 1 to the total number of bin in zBinEdges - skipPreviousTopSP = True - zBinNeighborsTop = [ - [0, 0], - [-1, 0], - [-1, 0], - [-1, 0], - [-1, 0], - [-1, 1], - [0, 1], - [0, 1], - [0, 1], - [0, 1], - [0, 0], - ] # allows to specify the number of neighbors desired for each bin, [-1,1] means one neighbor on the left and one on the right, if the vector is empty the algorithm returns the 8 surrounding bins - zBinNeighborsBottom = [ - [0, 1], - [0, 1], - [0, 1], - [0, 1], - [0, 1], - [0, 0], - [-1, 0], - [-1, 0], - [-1, 0], - [-1, 0], - [-1, 0], - ] - deltaRMiddleMinSPRange = 10 * u.mm - deltaRMiddleMaxSPRange = 10 * u.mm - seedConfirmationFilter = (True,) - impactWeightFactor = 100 - compatSeedLimit = 3 - numSeedIncrement = 10**100 # inf - seedWeightIncrement = 0 - useDetailedDoubleMeasurementInfo = False - maxSeedsPerSpMConf = 5 - maxQualitySeedsPerSpMConf = 5 - useDeltaRorTopRadius = True - else: - outputSeeds = "StripSeeds" - allowSeparateRMax = True - rMaxGridConfig = 1000.0 * u.mm - rMaxSeedFinderConfig = 1200.0 * u.mm - deltaRMinSP = 20 * u.mm - deltaRMax = 600 * u.mm - deltaRMaxTopSP = 300 * u.mm - deltaRMaxBottomSP = deltaRMaxTopSP - interactionPointCut = False - arithmeticAverageCotTheta = True - deltaZMax = 900 * u.mm - impactMax = 20 * u.mm - zBinsCustomLooping = [6, 7, 5, 8, 4, 9, 3, 10, 2, 11, 1] - skipPreviousTopSP = False - zBinNeighborsTop = [ - [0, 0], - [-1, 0], - [-1, 0], - [-1, 0], - [-1, 0], - [-1, 1], - [0, 1], - [0, 1], - [0, 1], - [0, 1], - [0, 0], - ] - zBinNeighborsBottom = [ - [0, 1], - [0, 1], - [0, 1], - [0, 2], - [0, 1], - [0, 0], - [-1, 0], - [-2, 0], - [-1, 0], - [-1, 0], - [-1, 0], - ] - deltaRMiddleMinSPRange = 30 * u.mm - deltaRMiddleMaxSPRange = 150 * u.mm - seedConfirmationFilter = False - impactWeightFactor = 1 - compatSeedLimit = 4 - numSeedIncrement = 1 - seedWeightIncrement = 10100 - useDetailedDoubleMeasurementInfo = True - maxSeedsPerSpMConf = 10**100 - maxQualitySeedsPerSpMConf = 10**100 - useDeltaRorTopRadius = False - import math - gridConfig = acts.SpacePointGridConfig( - bFieldInZ=2 * u.T, - minPt=900 * u.MeV, - rMax=rMaxGridConfig, - zMax=3000 * u.mm, - zMin=-3000 * u.mm, - phiMin=0, - phiMax=2 * math.pi, - deltaRMax=deltaRMax, - cotThetaMax=27.2899, - impactMax=impactMax, - zBinEdges=[ - -3000.0, - -2500.0, - -1400.0, - -925.0, - -450.0, - -250.0, - 250.0, - 450.0, - 925.0, - 1400.0, - 2500.0, - 3000.0, - ], # zBinEdges enables non-equidistant binning in z, in case the binning is not defined the edges are evaluated automatically using equidistant binning - phiBinDeflectionCoverage=3, - ) +def addITkSeedingCsv( + s, + inputSPs, + seedfinderConfigArg: SeedfinderConfigArg = SeedfinderConfigArg(), + seedFilterConfigArg: SeedFilterConfigArg = SeedFilterConfigArg(), + spacePointGridConfigArg: SpacePointGridConfigArg = SpacePointGridConfigArg(), + seedingAlgorithmConfigArg: SeedingAlgorithmConfigArg = SeedingAlgorithmConfigArg(), +): seedFinderConfig = acts.SeedfinderConfig( - rMax=rMaxSeedFinderConfig, - deltaRMin=20 * u.mm, - deltaRMax=gridConfig.deltaRMax, - deltaRMinTopSP=deltaRMinSP, - deltaRMinBottomSP=deltaRMinSP, - deltaRMaxTopSP=deltaRMaxTopSP, - deltaRMaxBottomSP=deltaRMaxBottomSP, - collisionRegionMin=-200 * u.mm, - collisionRegionMax=200 * u.mm, - zMin=gridConfig.zMin, - zMax=gridConfig.zMax, - maxSeedsPerSpM=4, - interactionPointCut=interactionPointCut, - cotThetaMax=gridConfig.cotThetaMax, - sigmaScattering=2, - radLengthPerSeed=0.1, - arithmeticAverageCotTheta=arithmeticAverageCotTheta, - deltaZMax=deltaZMax, - minPt=gridConfig.minPt, - bFieldInZ=gridConfig.bFieldInZ, - beamPos=acts.Vector2(0 * u.mm, 0 * u.mm), - impactMax=gridConfig.impactMax, - maxPtScattering=float("inf") * u.GeV, - zBinEdges=gridConfig.zBinEdges, - skipPreviousTopSP=skipPreviousTopSP, - zBinsCustomLooping=zBinsCustomLooping, - rRangeMiddleSP=[ - [40.0, 90.0], - [40.0, 200.0], - [46.0, 200.0], - [46.0, 200.0], - [46.0, 250.0], - [46.0, 250.0], - [46.0, 250.0], - [46.0, 200.0], - [46.0, 200.0], - [40.0, 200.0], - [40.0, 90.0], - ], # if useVariableMiddleSPRange is set to false, the vector rRangeMiddleSP can be used to define a fixed r range for each z bin: {{rMin, rMax}, ...}. If useVariableMiddleSPRange is set to false and the vector is empty, the cuts won't be applied - useVariableMiddleSPRange=True, # if useVariableMiddleSPRange is true, the values in rRangeMiddleSP will be calculated based on r values of the SPs and deltaRMiddleSPRange - deltaRMiddleMinSPRange=deltaRMiddleMinSPRange, - deltaRMiddleMaxSPRange=deltaRMiddleMaxSPRange, - binSizeR=1 * u.mm, - forceRadialSorting=True, - seedConfirmation=True, - centralSeedConfirmationRange=acts.SeedConfirmationRangeConfig( - zMinSeedConf=-250 * u.mm, - zMaxSeedConf=250 * u.mm, - rMaxSeedConf=140 * u.mm, - nTopForLargeR=1, - nTopForSmallR=2, - ), # contains parameters for seed confirmation - forwardSeedConfirmationRange=acts.SeedConfirmationRangeConfig( - zMinSeedConf=-3000 * u.mm, - zMaxSeedConf=3000 * u.mm, - rMaxSeedConf=140 * u.mm, - nTopForLargeR=1, - nTopForSmallR=2, + **acts.examples.defaultKWArgs( + rMin=seedfinderConfigArg.r[0], + rMax=seedfinderConfigArg.r[1], + deltaRMin=seedfinderConfigArg.deltaR[0], + deltaRMax=seedfinderConfigArg.deltaR[1], + deltaRMinTopSP=seedfinderConfigArg.deltaRTopSP[0], + deltaRMinBottomSP=seedfinderConfigArg.deltaRBottomSP[0], + deltaRMaxTopSP=seedfinderConfigArg.deltaRTopSP[1], + deltaRMiddleMinSPRange=seedfinderConfigArg.deltaRMiddleSPRange[0], + deltaRMiddleMaxSPRange=seedfinderConfigArg.deltaRMiddleSPRange[1], + deltaRMaxBottomSP=seedfinderConfigArg.deltaRBottomSP[1], + collisionRegionMin=seedfinderConfigArg.collisionRegion[0], + collisionRegionMax=seedfinderConfigArg.collisionRegion[1], + zMin=seedfinderConfigArg.z[0], + zMax=seedfinderConfigArg.z[1], + maxSeedsPerSpM=seedfinderConfigArg.maxSeedsPerSpM, + cotThetaMax=seedfinderConfigArg.cotThetaMax, + sigmaScattering=seedfinderConfigArg.sigmaScattering, + radLengthPerSeed=seedfinderConfigArg.radLengthPerSeed, + minPt=seedfinderConfigArg.minPt, + bFieldInZ=seedfinderConfigArg.bFieldInZ, + impactMax=seedfinderConfigArg.impactMax, + interactionPointCut=seedfinderConfigArg.interactionPointCut, + arithmeticAverageCotTheta=seedfinderConfigArg.arithmeticAverageCotTheta, + deltaZMax=seedfinderConfigArg.deltaZMax, + maxPtScattering=seedfinderConfigArg.maxPtScattering, + zBinEdges=seedfinderConfigArg.zBinEdges, + skipPreviousTopSP=seedfinderConfigArg.skipPreviousTopSP, + zBinsCustomLooping=seedfinderConfigArg.zBinsCustomLooping, + rRangeMiddleSP=seedfinderConfigArg.rRangeMiddleSP, + useVariableMiddleSPRange=seedfinderConfigArg.useVariableMiddleSPRange, + binSizeR=seedfinderConfigArg.binSizeR, + forceRadialSorting=seedfinderConfigArg.forceRadialSorting, + seedConfirmation=seedfinderConfigArg.seedConfirmation, + centralSeedConfirmationRange=seedfinderConfigArg.centralSeedConfirmationRange, + forwardSeedConfirmationRange=seedfinderConfigArg.forwardSeedConfirmationRange, + beamPos=( + None + if seedfinderConfigArg.beamPos is None + or all([x is None for x in seedfinderConfigArg.beamPos]) + else acts.Vector2( + seedfinderConfigArg.beamPos[0] or 0.0, + seedfinderConfigArg.beamPos[1] or 0.0, + ) + ), ), - useDetailedDoubleMeasurementInfo=useDetailedDoubleMeasurementInfo, ) seedFilterConfig = acts.SeedFilterConfig( - maxSeedsPerSpM=seedFinderConfig.maxSeedsPerSpM, - deltaRMin=seedFinderConfig.deltaRMin, - impactWeightFactor=impactWeightFactor, - compatSeedWeight=100, - compatSeedLimit=compatSeedLimit, - numSeedIncrement=numSeedIncrement, - seedWeightIncrement=seedWeightIncrement, - seedConfirmation=seedConfirmationFilter, - centralSeedConfirmationRange=seedFinderConfig.centralSeedConfirmationRange, - forwardSeedConfirmationRange=seedFinderConfig.forwardSeedConfirmationRange, - curvatureSortingInFilter=True, - maxSeedsPerSpMConf=maxSeedsPerSpMConf, - maxQualitySeedsPerSpMConf=maxQualitySeedsPerSpMConf, - useDeltaRorTopRadius=useDeltaRorTopRadius, + **acts.examples.defaultKWArgs( + maxSeedsPerSpM=seedFinderConfig.maxSeedsPerSpM, + deltaRMin=seedFinderConfig.deltaRMin, + impactWeightFactor=seedFilterConfigArg.impactWeightFactor, + compatSeedWeight=seedFilterConfigArg.compatSeedWeight, + compatSeedLimit=seedFilterConfigArg.compatSeedLimit, + numSeedIncrement=seedFilterConfigArg.numSeedIncrement, + seedWeightIncrement=seedFilterConfigArg.seedWeightIncrement, + seedConfirmation=seedFilterConfigArg.seedConfirmation, + centralSeedConfirmationRange=seedFinderConfig.centralSeedConfirmationRange, + forwardSeedConfirmationRange=seedFinderConfig.forwardSeedConfirmationRange, + curvatureSortingInFilter=seedFilterConfigArg.curvatureSortingInFilter, + maxSeedsPerSpMConf=seedFilterConfigArg.maxSeedsPerSpMConf, + maxQualitySeedsPerSpMConf=seedFilterConfigArg.maxQualitySeedsPerSpMConf, + useDeltaRorTopRadius=seedFilterConfigArg.useDeltaRorTopRadius, + ) + ) + + gridConfig = acts.SpacePointGridConfig( + **acts.examples.defaultKWArgs( + bFieldInZ=seedFinderConfig.bFieldInZ, + minPt=seedFinderConfig.minPt, + rMax=seedFinderConfig.rMax + if spacePointGridConfigArg.rMax == None + else spacePointGridConfigArg.rMax, + zMax=seedFinderConfig.zMax, + zMin=seedFinderConfig.zMin, + deltaRMax=seedFinderConfig.deltaRMax, + cotThetaMax=seedFinderConfig.cotThetaMax, + phiMin=spacePointGridConfigArg.phi[0], + phiMax=spacePointGridConfigArg.phi[1], + impactMax=seedFinderConfig.impactMax, + zBinEdges=spacePointGridConfigArg.zBinEdges, + phiBinDeflectionCoverage=spacePointGridConfigArg.phiBinDeflectionCoverage, + ) ) seedingAlg = acts.examples.SeedingAlgorithm( level=acts.logging.VERBOSE, inputSpacePoints=[inputSPs.config.outputSpacePoints], - outputSeeds=outputSeeds, + outputSeeds="seeds", outputProtoTracks="prototracks", - allowSeparateRMax=allowSeparateRMax, + **acts.examples.defaultKWArgs( + allowSeparateRMax=seedingAlgorithmConfigArg.allowSeparateRMax, + zBinNeighborsTop=seedingAlgorithmConfigArg.zBinNeighborsTop, + zBinNeighborsBottom=seedingAlgorithmConfigArg.zBinNeighborsBottom, + numPhiNeighbors=seedingAlgorithmConfigArg.numPhiNeighbors, + ), gridConfig=gridConfig, - seedFinderConfig=seedFinderConfig, seedFilterConfig=seedFilterConfig, - zBinNeighborsTop=zBinNeighborsTop, - zBinNeighborsBottom=zBinNeighborsBottom, - numPhiNeighbors=1, + seedFinderConfig=seedFinderConfig, ) s = s or acts.examples.Sequencer( @@ -282,13 +160,15 @@ def runITkSeedingFromCsv(): # set magnetic field field = acts.ConstantBField(acts.Vector3(0, 0, 2 * u.T)) + inputSpacePointsType = "PixelSpacePoints" + # Read input space points from input csv files evReader = CsvSpacePointReader( level=acts.logging.INFO, inputStem="spacepoints", inputCollection="pixel", inputDir=os.path.dirname(temp.name), - outputSpacePoints="PixelSpacePoints", + outputSpacePoints=inputSpacePointsType, extendCollection=False, ) @@ -296,13 +176,13 @@ def runITkSeedingFromCsv(): s.addReader(evReader) + print(SeedfinderConfigArg, SeedFilterConfigArg) + # run seeding - runITkSeeding( - field, + addITkSeedingCsv( + s, evReader, - outputDir=os.getcwd(), - inputSpacePointsType="PixelSpacePoints", - s=s, + *itkSeedingAlgConfig(inputSpacePointsType), ).run() # create temporary file with strips SPs and run the seeding @@ -314,20 +194,22 @@ def runITkSeedingFromCsv(): + "/event000000000-spacepoints_strip.csv" ) temp.write( - "measurement_id,sp_type,module_idhash,sp_x,sp_y,sp_z,sp_radius,sp_covr,sp_covz,sp_topHalfStripLength,sp_bottomHalfStripLength,sp_topStripDirection[0],sp_topStripDirection[1],sp_topStripDirection[2],sp_bottomStripDirection[0],sp_bottomStripDirection[1],sp_bottomStripDirection[2],sp_stripCenterDistance[0],sp_stripCenterDistance[1],sp_stripCenterDistance[2],sp_bottomStripCenterPosition[0],sp_bottomStripCenterPosition[1],sp_bottomStripCenterPosition[2]\n 0,1,0,386.77178955078125,-62.579288482666015625,-72.66841888427734375,391.801727294921875,0.100000001490116119384765625,5.11999988555908203125,12.08999919891357421875,12.08999919891357421875,-0.00864744372665882110595703125,-0.02451671846210956573486328125,0.999662101268768310546875,0.00864744372665882110595703125,0.02451671846210956573486328125,0.999662101268768310546875,-6.43960094451904296875,1.04346692562103271484375,23.157070159912109375,386.6771240234375,-62.847682952880859375,-61.724697113037109375\n 1,1,0,543.9947509765625,-87.7279205322265625,-82.09113311767578125,551.02313232421875,0.100000001490116119384765625,5.11999988555908203125,12.08999919891357421875,12.08999919891357421875,-0.0073835677467286586761474609375,-0.024926505982875823974609375,0.999662101268768310546875,0.0073835677467286586761474609375,0.024926505982875823974609375,0.999662101268768310546875,-6.34883975982666015625,1.17108881473541259765625,-2.3926274776458740234375,544.0279541015625,-87.6157989501953125,-86.58742523193359375\n 2,1,0,544.00189208984375,-87.70365142822265625,-83.064239501953125,551.02630615234375,0.100000001490116119384765625,5.11999988555908203125,12.08999919891357421875,12.08999919891357421875,-0.0073835677467286586761474609375,-0.024926505982875823974609375,0.999662101268768310546875,0.011192028410732746124267578125,0.02346457540988922119140625,0.999662101268768310546875,-24.83704376220703125,4.08867168426513671875,-0.0274789035320281982421875,544.0279541015625,-87.6157989501953125,-86.58742523193359375\n 3,1,0,562.2547607421875,-90.650543212890625,-83.99970245361328125,569.5155029296875,0.100000001490116119384765625,5.11999988555908203125,12.08999919891357421875,12.08999919891357421875,-0.011192028410732746124267578125,-0.02346457540988922119140625,0.999662101268768310546875,0.0073835677467286586761474609375,0.024926505982875823974609375,0.999662101268768310546875,11.8808460235595703125,-1.85768926143646240234375,-0.0588833652436733245849609375,562.25762939453125,-90.6445770263671875,-84.2536773681640625\n 4,1,0,562.26605224609375,-90.62686920166015625,-85.00818634033203125,569.52288818359375,0.100000001490116119384765625,5.11999988555908203125,12.08999919891357421875,12.08999919891357421875,-0.011192028410732746124267578125,-0.02346457540988922119140625,0.999662101268768310546875,0.011192028410732746124267578125,0.02346457540988922119140625,0.999662101268768310546875,-6.60735797882080078125,1.05989348888397216796875,2.3062651157379150390625,562.25762939453125,-90.6445770263671875,-84.2536773681640625\n 5,1,0,750.5875244140625,-120.5648040771484375,-98.9385986328125,760.2088623046875,0.100000001490116119384765625,5.11999988555908203125,24.1799983978271484375,24.1799983978271484375,-0.009588238783180713653564453125,-0.02416430227458477020263671875,0.999662101268768310546875,0.009588238783180713653564453125,0.02416430227458477020263671875,0.999662101268768310546875,-6.041371822357177734375,2.1813886165618896484375,0.3670396506786346435546875,750.81573486328125,-119.98968505859375,-122.7309112548828125\n 6,1,0,979.34979248046875,-156.5580291748046875,-114.63397979736328125,991.78448486328125,0.100000001490116119384765625,5.11999988555908203125,24.1799983978271484375,24.1799983978271484375,-0.00824898667633533477783203125,-0.02465364150702953338623046875,0.999662101268768310546875,0.00824898667633533477783203125,0.02465364150702953338623046875,0.999662101268768310546875,-6.2955722808837890625,1.417438507080078125,-1.45441913604736328125,979.4241943359375,-156.335723876953125,-123.64752960205078125" + "measurement_id,sp_type,module_idhash,sp_x,sp_y,sp_z,sp_radius,sp_covr,sp_covz,sp_topHalfStripLength,sp_bottomHalfStripLength,sp_topStripDirection[0],sp_topStripDirection[1],sp_topStripDirection[2],sp_bottomStripDirection[0],sp_bottomStripDirection[1],sp_bottomStripDirection[2],sp_stripCenterDistance[0],sp_stripCenterDistance[1],sp_stripCenterDistance[2],sp_topStripCenterPosition[0],sp_topStripCenterPosition[1],sp_topStripCenterPosition[2]\n 0,1,0,386.77178955078125,-62.579288482666015625,-72.66841888427734375,391.801727294921875,0.100000001490116119384765625,5.11999988555908203125,12.08999919891357421875,12.08999919891357421875,-0.00864744372665882110595703125,-0.02451671846210956573486328125,0.999662101268768310546875,0.00864744372665882110595703125,0.02451671846210956573486328125,0.999662101268768310546875,-6.43960094451904296875,1.04346692562103271484375,23.157070159912109375,386.6771240234375,-62.847682952880859375,-61.724697113037109375\n 1,1,0,543.9947509765625,-87.7279205322265625,-82.09113311767578125,551.02313232421875,0.100000001490116119384765625,5.11999988555908203125,12.08999919891357421875,12.08999919891357421875,-0.0073835677467286586761474609375,-0.024926505982875823974609375,0.999662101268768310546875,0.0073835677467286586761474609375,0.024926505982875823974609375,0.999662101268768310546875,-6.34883975982666015625,1.17108881473541259765625,-2.3926274776458740234375,544.0279541015625,-87.6157989501953125,-86.58742523193359375\n 2,1,0,544.00189208984375,-87.70365142822265625,-83.064239501953125,551.02630615234375,0.100000001490116119384765625,5.11999988555908203125,12.08999919891357421875,12.08999919891357421875,-0.0073835677467286586761474609375,-0.024926505982875823974609375,0.999662101268768310546875,0.011192028410732746124267578125,0.02346457540988922119140625,0.999662101268768310546875,-24.83704376220703125,4.08867168426513671875,-0.0274789035320281982421875,544.0279541015625,-87.6157989501953125,-86.58742523193359375\n 3,1,0,562.2547607421875,-90.650543212890625,-83.99970245361328125,569.5155029296875,0.100000001490116119384765625,5.11999988555908203125,12.08999919891357421875,12.08999919891357421875,-0.011192028410732746124267578125,-0.02346457540988922119140625,0.999662101268768310546875,0.0073835677467286586761474609375,0.024926505982875823974609375,0.999662101268768310546875,11.8808460235595703125,-1.85768926143646240234375,-0.0588833652436733245849609375,562.25762939453125,-90.6445770263671875,-84.2536773681640625\n 4,1,0,562.26605224609375,-90.62686920166015625,-85.00818634033203125,569.52288818359375,0.100000001490116119384765625,5.11999988555908203125,12.08999919891357421875,12.08999919891357421875,-0.011192028410732746124267578125,-0.02346457540988922119140625,0.999662101268768310546875,0.011192028410732746124267578125,0.02346457540988922119140625,0.999662101268768310546875,-6.60735797882080078125,1.05989348888397216796875,2.3062651157379150390625,562.25762939453125,-90.6445770263671875,-84.2536773681640625\n 5,1,0,750.5875244140625,-120.5648040771484375,-98.9385986328125,760.2088623046875,0.100000001490116119384765625,5.11999988555908203125,24.1799983978271484375,24.1799983978271484375,-0.009588238783180713653564453125,-0.02416430227458477020263671875,0.999662101268768310546875,0.009588238783180713653564453125,0.02416430227458477020263671875,0.999662101268768310546875,-6.041371822357177734375,2.1813886165618896484375,0.3670396506786346435546875,750.81573486328125,-119.98968505859375,-122.7309112548828125\n 6,1,0,979.34979248046875,-156.5580291748046875,-114.63397979736328125,991.78448486328125,0.100000001490116119384765625,5.11999988555908203125,24.1799983978271484375,24.1799983978271484375,-0.00824898667633533477783203125,-0.02465364150702953338623046875,0.999662101268768310546875,0.00824898667633533477783203125,0.02465364150702953338623046875,0.999662101268768310546875,-6.2955722808837890625,1.417438507080078125,-1.45441913604736328125,979.4241943359375,-156.335723876953125,-123.64752960205078125" ) temp.read() # set magnetic field field = acts.ConstantBField(acts.Vector3(0, 0, 2 * u.T)) + inputSpacePointsType = "StripSpacePoints" + # Read input space points from input csv files evReader = CsvSpacePointReader( level=acts.logging.INFO, inputStem="spacepoints", inputCollection="strip", inputDir=os.path.dirname(temp.name), - outputSpacePoints="StripSpacePoints", + outputSpacePoints=inputSpacePointsType, extendCollection=False, ) @@ -336,12 +218,10 @@ def runITkSeedingFromCsv(): s.addReader(evReader) # run seeding - runITkSeeding( - field, + addITkSeedingCsv( + s, evReader, - outputDir=os.getcwd(), - inputSpacePointsType="StripSpacePoints", - s=s, + *itkSeedingAlgConfig(inputSpacePointsType), ).run()