File indexing completed on 2025-01-18 09:12:09
0001
0002 import os
0003 import argparse
0004
0005 import acts
0006
0007 from acts.examples import CsvMuonSimHitReader, CsvDriftCircleReader, MuonHoughSeeder
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 u = acts.UnitConstants
0018 rnd = acts.examples.RandomNumbers(seed=42)
0019
0020
0021 def runHoughFromCsv(inDir):
0022
0023
0024 s = acts.examples.Sequencer(events=8, numThreads=1, logLevel=acts.logging.VERBOSE)
0025
0026
0027 evReader = CsvMuonSimHitReader(
0028 inputStem="MuonSimHit",
0029 inputDir=os.path.dirname(inDir),
0030 outputSimHits="MuonSimHits",
0031 level=acts.logging.VERBOSE,
0032 )
0033 dcReader = CsvDriftCircleReader(
0034 inputStem="MuonDriftCircle",
0035 inputDir=os.path.dirname(inDir),
0036 outputDriftCircles="MuonDriftCircles",
0037 level=acts.logging.VERBOSE,
0038 )
0039
0040 s.addReader(evReader)
0041 s.addReader(dcReader)
0042 seeder = MuonHoughSeeder(
0043 inSimHits=evReader.config.outputSimHits,
0044 inDriftCircles=dcReader.config.outputDriftCircles,
0045 level=acts.logging.VERBOSE,
0046 )
0047 s.addAlgorithm(seeder)
0048 s.run()
0049
0050
0051 if "__main__" == __name__:
0052 p = argparse.ArgumentParser(
0053 description="Example script to run ITk seed finding based on CSV spacepoints",
0054 )
0055 p.add_argument(
0056 "indir",
0057 help="Input directory containing the ITk standalone geometry. Get in touch if you don't have this.",
0058 )
0059
0060 args = p.parse_args()
0061
0062 runHoughFromCsv(args.indir)