5 from AthenaConfiguration.ComponentFactory
import CompFactory
6 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
8 if __name__==
'__main__':
13 from AthenaCommon
import Logging
14 log = Logging.logging.getLogger(
'LArSC2Ntuple' )
16 parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
18 parser.add_argument(
'-i',
'--infile', dest=
'inpfile', default=
"OFC_phase.dat", help=
'Input filename', type=str)
19 parser.add_argument(
'-k',
'--outkey', dest=
'outkey', default=
"LArOFCPhase", help=
'phase container key', type=str)
20 parser.add_argument(
'-c',
'--isSC', dest=
'supercells', default=
False, action=
"store_true", help=
'is SC data ?')
21 parser.add_argument(
'-a',
'--hasid', dest=
'hasid', default=
False, action=
"store_true", help=
'has ID in input ?')
22 parser.add_argument(
'-d',
'--default', dest=
'defaultphase', default=0, help=
'if not in input', type=int)
23 parser.add_argument(
'-f',
'--folder', dest=
'folder', default=
"/LAR/ElecCalibOfl/OFCBin/Dummy", help=
' folder name', type=str)
24 parser.add_argument(
'-t',
'--tag', dest=
'tag', default=
"LArOFCPhase-01", help=
'folder tag', type=str)
25 parser.add_argument(
'-o',
'--outsql', dest=
'outsql', default=
"OFCPhase.db", help=
'output sqlite filename', type=str)
26 parser.add_argument(
'-p',
'--outp', dest=
'outpool', default=
"ofc_phase.pool.root", help=
'output pool filename', type=str)
27 parser.add_argument(
'--poolcat', dest=
'poolcat', default=
"PoolFileCatalog.xml", help=
'Catalog of POOL files', type=str)
30 args = parser.parse_args()
31 if help
in args
and args.help
is not None and args.help:
35 for _, value
in args._get_kwargs():
42 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
45 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
47 from LArCalibProcessing.LArCalibConfigFlags
import addLArCalibFlags
51 flags.LArCalib.Input.Files = [ ]
52 flags.LArCalib.Input.RunNumbers = [9999999]
54 flags.LArCalib.IOVStart=0
56 flags.LArCalib.isSC = args.supercells
58 flags.IOVDb.DBConnection=
"sqlite://;schema=" + args.outsql +
";dbname=CONDBR2"
61 flags.IOVDb.GlobalTag =
"CONDBR2-BLKPA-2024-02"
64 from AthenaConfiguration.TestDefaults
import defaultGeometryTags
65 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
69 flags.Exec.OutputLevel = INFO
76 from LArCalibProcessing.LArCalibBaseConfig
import LArCalibBaseCfg
80 LArOFPhaseFill = CompFactory.getComp(
'LArOFPhaseFill')(
"LArOFPhaseFill")
81 LArOFPhaseFill.InputFile = args.inpfile
82 LArOFPhaseFill.keyOFCBin = args.outkey
83 LArOFPhaseFill.isSC = args.supercells
84 LArOFPhaseFill.isID = args.hasid
85 LArOFPhaseFill.DefaultPhase = args.defaultphase
86 LArOFPhaseFill.GroupingType =
"ExtendedSubDetector" if not args.supercells
else "SuperCells"
87 LArOFPhaseFill.OutputLevel = DEBUG
89 cfg.addEventAlgo(LArOFPhaseFill)
91 from RegistrationServices.OutputConditionsAlgConfig
import OutputConditionsAlgCfg
93 outputFile=args.outpool,
94 ObjectList=[
"LArOFCBinComplete#"+args.outkey+
"#"+args.folder,],
95 IOVTagList=[args.tag,],
96 Run1=flags.LArCalib.IOVStart,
97 Run2=flags.LArCalib.IOVEnd
99 cfg.addService(CompFactory.IOVRegistrationSvc(RecreateFolders =
False))
102 from McEventSelector.McEventSelectorConfig
import McEventSelectorCfg
104 RunNumber = flags.LArCalib.Input.RunNumbers[0],
107 InitialTimeStamp = 0,
108 TimeStampInterval = 1))
110 cfg.getService(
"IOVDbSvc").DBInstance=
"CONDBR2"
111 cfg.getService(
"MessageSvc").defaultLimit=9999999
112 cfg.getService(
"PoolSvc").WriteCatalog=
"xmlcatalog_file:%s"%args.poolcat
114 print(
"Start running...")