4 from AthenaConfiguration.ComponentFactory
import CompFactory
5 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
10 from LArGeoAlgsNV.LArGMConfig
import LArGMCfg
12 from TileGeoModel.TileGMConfig
import TileGMCfg
15 cfg.addEventAlgo(CompFactory.CaloCellPosition2Ntuple())
16 cfg.addService(CompFactory.THistSvc(Output = [
"file1 DATAFILE='"+outputFile+
"' OPT='RECREATE'"]))
20 if __name__==
"__main__":
22 parser= argparse.ArgumentParser()
23 parser.add_argument(
"--loglevel", default=
None, help=
"logging level (ALL, VERBOSE, DEBUG,INFO, WARNING, ERROR, or FATAL")
24 parser.add_argument(
"-r",
"--runnumber",default=0x7fffffff, type=int, help=
"run number to query the DB")
25 parser.add_argument(
"-l",
"--lbnumber",default=1, type=int, help=
"LB number to query the DB")
26 parser.add_argument(
"-d",
"--database",default=
None, help=
"Database name or sqlite file name")
27 parser.add_argument(
"-o",
"--output",default=
"LArCellPos.root", help=
"output file name")
28 parser.add_argument(
"-f",
"--folder",default=
None, help=
"database folder to read")
29 parser.add_argument(
"-t",
"--tag",default=
None, help=
"folder-level tag to read")
30 parser.add_argument(
"-m",
"--mc", action=
'store_true', help=
"data or MC?")
33 (args,leftover)=parser.parse_known_args(sys.argv[1:])
36 print(
"ERROR, unhandled argument(s):",leftover)
39 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
41 flags.Input.isMC = args.mc
42 flags.IOVDb.DatabaseInstance=
"OFLP200" if args.mc
else "CONDBR2"
43 from Campaigns.Utils
import Campaign
44 flags.Input.MCCampaign=Campaign.Unknown
45 flags.LAr.doAlign=
True
47 flags.Input.TypedCollections=()
49 flags.LAr.doHVCorr=
False
50 flags.Input.RunNumbers=[args.runnumber]
51 flags.IOVDb.GlobalTag=
"OFLCOND-MC23-SDR-RUN3-05" if args.mc
else "CONDBR2-BLKPA-2024-03"
52 from AthenaConfiguration.TestDefaults
import defaultGeometryTags
53 flags.GeoModel.AtlasVersion=defaultGeometryTags.RUN3
57 from AthenaCommon
import Constants
58 if hasattr(Constants,args.loglevel):
59 flags.Exec.OutputLevel=getattr(Constants,args.loglevel)
61 raise ValueError(
"Unknown log-level, allowed values are ALL, VERBOSE, DEBUG,INFO, WARNING, ERROR, FATAL")
65 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
68 from McEventSelector.McEventSelectorConfig
import McEventSelectorCfg
70 FirstLB=args.lbnumber,
74 TimeStampInterval = 1))
75 cfg.addEventAlgo(CompFactory.xAODMaker.EventInfoCnvAlg(AODKey =
'McEventInfo'),sequenceName=
"AthAlgSeq")
81 dbstr=
"sqlite://;schema="+args.database+
";dbname=" + flags.IOVDb.DatabaseInstance
83 if args.tag
or args.database:
84 from IOVDbSvc.IOVDbSvcConfig
import addOverride
85 cfg.merge(
addOverride(flags,
"/LAR/LArCellPositionShift",args.tag,dbstr))