ATLAS Offline Software
Loading...
Searching...
No Matches
RunITkPixelEncodingMonitoring.py
Go to the documentation of this file.
1#!/usr/bin/env python
2
3# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
4
5"""
6
7Run encoding and monitoring of the RDO to pixel bytestream conversion
8
9"""
10from argparse import ArgumentParser
11
12# Argument parsing
13parser = ArgumentParser("RunITkPixelEncodingMonitoring.py")
14parser.add_argument("-V", "--verboseAccumulators", default=False,
15 action="store_true",
16 help="Print full details of the AlgSequence")
17parser.add_argument("-S", "--verboseStoreGate", default=False,
18 action="store_true",
19 help="Dump the StoreGate(s) each event iteration")
20parser.add_argument("--maxEvents",default=10, type=int,
21 help="The number of events to run. 0 skips execution")
22parser.add_argument("--inputFile",
23 default="/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/PhaseIIUpgrade/RDO/ATLAS-P2-RUN4-03-00-00/mc21_14TeV.601229.PhPy8EG_A14_ttbar_hdamp258p75_SingleLep.recon.RDO.e8481_s4149_r14700/RDO.33629020._000047.pool.root.1",
24 help="The input RDO file to use")
25args = parser.parse_args()
26
27# Some info about the job
28print("----Run encoding and monitoring of the RDO to pixel bytestream conversion----")
29print()
30
31from AthenaConfiguration.AllConfigFlags import initConfigFlags
32flags = initConfigFlags()
33
34# make logging more verbose
35from AthenaCommon.Logging import log
36from AthenaCommon.Constants import DEBUG, INFO
37log.setLevel(INFO)
38
39flags.Input.isMC = True
40import glob
41flags.Input.Files = glob.glob(args.inputFile)
42
43flags.Detector.GeometryCalo = False
44flags.Detector.GeometryMuon = False
45
46# This should run serially for the moment.
47flags.Concurrency.NumThreads = 1
48flags.Concurrency.NumConcurrentEvents = 1
49
50log.debug('Lock config flags now.')
51flags.lock()
52
53make logging more verbose
54from AthenaCommon.Logging import log
55from AthenaCommon.Constants import INFO #DEBUG
56log.setLevel(INFO)
57
58
59if args.verboseAccumulators:
60 cfg.printConfig(withDetails=True)
61if args.verboseStoreGate:
62 cfg.getService("StoreGateSvc").Dump = True
63
64log.debug('Dumping of ConfigFlags now.')
65flags.dump()
66
67from AthenaConfiguration.MainServicesConfig import MainServicesCfg
68cfg=MainServicesCfg(flags)
69
70from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
71cfg.merge(PoolReadCfg(flags))
72
73from ITkPixelCabling.ITkPixelCablingAlgConfig import ITkPixelCablingAlgCfg
74cfg.merge(ITkPixelCablingAlgCfg(flags, name="ITkPixelCablingAlg", UseTestCabling=True))
75
76# Adds the encoding alg
77from ITkPixelByteStreamCnv.ITkPixelByteStreamCnvConfig import ITkPixelEncodingAlgCfg
78cfg.merge( ITkPixelEncodingAlgCfg(flags, doMonitoring = True, doExpertPlots = True) )
79
80# loop over the number of events specified as arguments (default to 10)
81cfg.run(args.maxEvents)
void print(char *figname, TCanvas *c1)