5"""Configure and initialize ITkPixelCsvWaferIdAlg.
7This script is a lightweight AthenaConfiguration entry point for the CSV-based
8wafer identifier algorithm. It currently validates that the algorithm can be
9configured and executed, and prints the lookup request that would be passed to
10its waferId() implementation.
13from argparse
import ArgumentParser
17from AthenaCommon.Logging
import log
18from AthenaConfiguration.AllConfigFlags
import initConfigFlags
19from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
20from PixelGeoModelXml.ITkPixelGeoModelConfig
import ITkPixelReadoutGeometryCfg
22from ITkPixelByteStreamCnv.ITkPixelByteStreamCnvConfig
import ITkPixelCsvWaferIdAlgCfg
24parser = ArgumentParser(
"RunITkPixelCsvWaferIdAlg.py")
27 default=
"/eos/atlas/atlascerngroupdisk/det-itk/general/pixels/identifiers/AT2-IP-ES-0016_v1.41_INCOMPLETE-ModuleA_slim.csv",
28 help=
"CSV file to load. The default is resolved through DATAPATH.",
32 default=
"ITkPixelWaferIds.txt",
33 help=
"Output csv file for one 32-bit waferID identifier per line.",
39 help=
"Print the full Athena configuration and properties.",
41args = parser.parse_args()
45flags = initConfigFlags()
46flags.Input.isMC =
True
51from AthenaConfiguration.TestDefaults
import defaultGeometryTags
52flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN4
53flags.GeoModel.Align.Dynamic =
False
55from AthenaConfiguration.TestDefaults
import defaultConditionsTags
56flags.IOVDb.GlobalTag = defaultConditionsTags.RUN4_MC
60cfg = MainServicesCfg(flags)
61cfg.merge(ITkPixelReadoutGeometryCfg(flags))
62cfg.merge(ITkPixelCsvWaferIdAlgCfg(flags,
63 CsvFile=args.csv_file,
64 OutputFile=args.output_file))
67 cfg.printConfig(withDetails=
True, summariseProps=
True, printDefaults=
True)
72print(
"Configured ITkPixelCsvWaferIdAlg")
73print(f
" Input CSV file: {args.csv_file}")
74print(f
" Output file: {args.output_file}")
75print(
" Note: the algorithm execution writes one front end per line to the output file.")
76print(
" 32-bit waferID+feID, 32-bit waferID+feID, FELIX Card Name, Uplink Pin, DMA buffer, SourceID")
void print(char *figname, TCanvas *c1)