ATLAS Offline Software
Loading...
Searching...
No Matches
PixelClusteringTestConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3if __name__ == "__main__":
4 from argparse import ArgumentParser
5 argumentParser = ArgumentParser()
6 argumentParser.add_argument(
7 "--xclbinPath",
8 required = True,
9 )
10
11 argumentParser.add_argument(
12 "--testVectorPath",
13 required = True,
14 )
15
16 argumentParser.add_argument(
17 "--outputClusterPath",
18 default = "pixel_clustering_output.txt",
19 )
20
21 argumentParser.add_argument(
22 "--outputEdmPath",
23 default = "pixel_clustering_edm_output.txt",
24 )
25
26 argumentParser.add_argument(
27 "--bufferSize",
28 type = int,
29 default = 8192,
30 )
31
32 argumentParser.add_argument(
33 "--events",
34 type = int,
35 default = 2,
36 )
37
38 argumentParser.add_argument(
39 "--verbose",
40 action = "store_true",
41 )
42
43 arguments = argumentParser.parse_args()
44
45 from AthenaConfiguration.AllConfigFlags import initConfigFlags
46 flags = initConfigFlags()
47
48 if arguments.verbose:
49 from AthenaCommon.Constants import DEBUG
50 flags.Exec.OutputLevel = DEBUG
51
52 flags.lock()
53
54 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
55 acc = MainServicesCfg(flags)
56
57 from AthenaConfiguration.ComponentFactory import CompFactory
58 acc.addService(CompFactory.ChronoStatSvc(
59 PrintUserTime = True,
60 PrintSystemTime = True,
61 PrintEllapsedTime = True,
62 ))
63
64 acc.addService(CompFactory.AthXRT.DeviceMgmtSvc(XclbinPathsList = [arguments.xclbinPath]))
65
66 from EFTrackingFPGAUtility.EFTrackingDataStreamLoaderAlgorithmConfig import EFTrackingDataStreamLoaderAlgorithmCfg
67 acc.merge(EFTrackingDataStreamLoaderAlgorithmCfg(
68 flags,
69 name = "dataStreamLoader",
70 bufferSize = arguments.bufferSize,
71 GHITZTxtInputPaths = [
72 arguments.inputTestVectorPath,
73 ],
74 GHITZTxtInputKeys = [
75 "pixel_clustering_input",
76 ],
77 ))
78
79 from EFTrackingFPGAPipeline.EFTrackingXrtAlgorithmConfig import EFTrackingXrtAlgorithmCfg
80 acc.merge(EFTrackingXrtAlgorithmCfg(
81 flags,
82 bufferSize = arguments.bufferSize,
83 inputInterfaces = [
84 ["configurableLengthWideLoader:{configurableLengthWideLoader_1}", "pixel_clustering_input", 0],
85 ],
86 outputInterfaces = [
87 ["dynamicLengthWideUnloader:{dynamicLengthWideUnloader_1}", "pixel_clustering_output", 1],
88 ["dynamicLengthWideUnloader:{dynamicLengthWideUnloader_2}", "pixel_clustering_edm_output", 1],
89 ],
90 vSizeInterfaces = [
91 ["configurableLengthWideLoader:{configurableLengthWideLoader_1}", "pixel_clustering_input", 2],
92 ],
93 ))
94
95 from EFTrackingFPGAUtility.EFTrackingDataStreamUnloaderAlgorithmConfig import EFTrackingDataStreamUnloaderAlgorithmCfg
96 acc.merge(EFTrackingDataStreamUnloaderAlgorithmCfg(
97 flags,
98 name = "dataStreamUnloader",
99 GHITZTxtOutputPaths = [
100 arguments.outputPath,
101 arguments.outputEdmPath,
102 ],
103 GHITZTxtOutputKeys = [
104 "pixel_clustering_output",
105 "pixel_clustering_edm_output",
106 ],
107 ))
108
109 acc.run(arguments.events)
110