ATLAS Offline Software
Loading...
Searching...
No Matches
RunITkPixelCsvWaferIdTool.py
Go to the documentation of this file.
1#!/usr/bin/env python3
2
3# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
4
5"""Configure and initialize ITkPixelCsvWaferIdAlg.
6
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.
11"""
12
13from argparse import ArgumentParser
14
15from AthenaCommon.Constants import INFO
16from AthenaCommon.Constants import DEBUG
17from AthenaCommon.Logging import log
18from AthenaConfiguration.AllConfigFlags import initConfigFlags
19from AthenaConfiguration.MainServicesConfig import MainServicesCfg
20from PixelGeoModelXml.ITkPixelGeoModelConfig import ITkPixelReadoutGeometryCfg
21
22from ITkPixelByteStreamCnv.ITkPixelByteStreamCnvConfig import ITkPixelCsvWaferIdAlgCfg
23
24parser = ArgumentParser("RunITkPixelCsvWaferIdAlg.py")
25parser.add_argument(
26 "--csv-file",
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.",
29)
30parser.add_argument(
31 "--output-file",
32 default="ITkPixelWaferIds.txt",
33 help="Output csv file for one 32-bit waferID identifier per line.",
34)
35
36parser.add_argument(
37 "--verbose",
38 action="store_true",
39 help="Print the full Athena configuration and properties.",
40)
41args = parser.parse_args()
42
43log.setLevel(INFO)
44
45flags = initConfigFlags()
46flags.Input.isMC = True
47flags.Input.Files = [] # No input files needed for this test
48
49#flags.Exec.OutputLevel=DEBUG
50
51from AthenaConfiguration.TestDefaults import defaultGeometryTags
52flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN4
53flags.GeoModel.Align.Dynamic = False
54
55from AthenaConfiguration.TestDefaults import defaultConditionsTags
56flags.IOVDb.GlobalTag = defaultConditionsTags.RUN4_MC
57
58flags.lock()
59
60cfg = MainServicesCfg(flags)
61cfg.merge(ITkPixelReadoutGeometryCfg(flags))
62cfg.merge(ITkPixelCsvWaferIdAlgCfg(flags,
63 CsvFile=args.csv_file,
64 OutputFile=args.output_file))
65
66if args.verbose:
67 cfg.printConfig(withDetails=True, summariseProps=True, printDefaults=True)
68
69# Run the application to initialize and execute
70cfg.run(1)
71
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)