6 if __name__==
'__main__':
12 parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
14 parser.add_argument(
'-r',
'--run', dest=
'run', default=
'00408918', help=
'Run number string as in input filename', type=str)
15 parser.add_argument(
'-g',
'--gain', dest=
'gain', default=
"MEDIUM", help=
'Gain string', type=str)
16 parser.add_argument(
'-i',
'--infile', dest=
'infile', default=
"", help=
'Input POOL file to dump', type=str)
17 parser.add_argument(
'-e',
'--outrdir', dest=
'outrdir', default=
"/eos/atlas/atlascerngroupdisk/det-larg/Temp/Weekly/ntuples", help=
'Output root file directory', type=str)
18 parser.add_argument(
'-o',
'--outrwavefile', dest=
'outrwavefile', default=
"", help=
'Output CaliWave root file name', type=str)
19 parser.add_argument(
'-p',
'--outrofcfile', dest=
'outrofcfile', default=
"", help=
'Output OFC root file name', type=str)
20 parser.add_argument(
'-c',
'--isSC', dest=
'supercells', default=
False, action=
'store_true', help=
'is SC data ?')
21 parser.add_argument(
'-b',
'--badchansqlite', dest=
'badsql', default=
"SnapshotBadChannel.db", help=
'Input sqlite file for bad channels', type=str)
23 args = parser.parse_args()
24 if help
in args
and args.help
is not None and args.help:
28 for _, value
in args._get_kwargs():
35 from LArCalibProcessing.LArCalib_Delay_OFCCaliConfig
import LArDelay_OFCCali_PoolDumpCfg
38 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
41 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
43 from LArCalibProcessing.LArCalibConfigFlags
import addLArCalibFlags
49 flags.LArCalib.Input.Files = [ args.infile ]
50 flags.LArCalib.Input.RunNumbers = [
int(args.run),]
51 flags.Input.RunNumbers = [
int(args.run)]
52 gainNumMap={
"HIGH":0,
"MEDIUM":1,
"LOW":2}
53 flags.LArCalib.Gain=gainNumMap[args.gain.upper()]
56 flags.LArCalib.isSC = args.supercells
60 flags.LArCalib.BadChannelTag =
"-RUN2-UPD3-00"
61 flags.LArCalib.BadChannelDB = args.badsql
67 if not args.outrwavefile:
68 inbase=os.path.basename(args.infile)
69 idx=inbase.find(
'.pool.root')
71 OutputCaliWaveRootFileName = inbase[0:idx]+
'.root'
73 OutputCaliWaveRootFileName =
'LArCaliWave.root'
75 OutputCaliWaveRootFileName = args.outrwavefile
77 if not args.outrofcfile:
78 inbase=os.path.basename(args.infile)
79 idx=inbase.find(
'.pool.root')
81 OutputOFCCaliRootFileName = inbase[0:idx]+
'.root'
83 OutputOFCCaliRootFileName =
'LArOFCCali.root'
85 OutputOFCCaliRootFileName = args.outrofcfile
87 flags.LArCalib.Output.ROOTFile = args.outrdir +
"/" + OutputCaliWaveRootFileName
88 flags.LArCalib.Output.ROOTFile2 = args.outrdir +
"/" + OutputOFCCaliRootFileName
91 flags.IOVDb.GlobalTag =
"LARCALIB-RUN2-00"
93 from AthenaConfiguration.TestDefaults
import defaultGeometryTags
94 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
98 flags.Exec.OutputLevel = INFO
104 cfg.getService(
"IOVDbSvc").DBInstance=
""
105 cfg.getService(
"IOVDbSvc").forceRunNumber=
int(args.run)
108 from AthenaConfiguration.ComponentFactory
import CompFactory
109 mcCnvSvc = CompFactory.McCnvSvc()
110 cfg.addService(mcCnvSvc)
111 cfg.addService(CompFactory.EvtPersistencySvc(
"EventPersistencySvc",CnvServices=[mcCnvSvc.getFullJobOptName(),]))
112 eventSelector=CompFactory.McEventSelector(
"EventSelector",
113 RunNumber = flags.LArCalib.Input.RunNumbers[0],
116 InitialTimeStamp = 0,
117 TimeStampInterval = 1
120 cfg.addService(eventSelector)