6 if __name__==
'__main__':
12 parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsHelpFormatter)
13 parser.add_argument(
'-r',
'--run', dest=
'run', default=
'00408918', help=
'Run number string as in input filename', type=str)
14 parser.add_argument(
'-g',
'--gain', dest=
'gain', default=
"MEDIUM", help=
'Gain string', type=str)
15 parser.add_argument(
'-d',
'--insqlitefile', dest=
'insqlitefile', default=
"", help=
'Input sqlite file with PhysOFC`', type=str)
16 parser.add_argument(
'-e',
'--outrdir', dest=
'outrdir', default=
"/eos/atlas/atlascerngroupdisk/det-larg/Temp/Weekly/ntuples", help=
'Output root file directory', type=str)
17 parser.add_argument(
'-k',
'--outpdir', dest=
'outpdir', default=
"/eos/atlas/atlascerngroupdisk/det-larg/Temp/Weekly/poolFiles", help=
'Output root file directory', type=str)
18 parser.add_argument(
'-l',
'--outprefix', dest=
'outprefix', default=
"LArPhysOFCOnePhase", help=
'Output root file name', type=str)
19 parser.add_argument(
'-n',
'--outsqlite', dest=
'outsql', default=
"mysql_physofconephase.db", help=
'Output sqlite file, in pool output dir.', type=str)
20 parser.add_argument(
'-c',
'--isSC', dest=
'supercells', action=
'store_true', default=
False, help=
'is SC data ?')
21 parser.add_argument(
'-b',
'--badchansqlite', dest=
'badsql', default=
"SnapshotBadChannel.db", help=
'Input sqlite file for bad channels', type=str)
22 parser.add_argument(
'-m',
'--subdet', dest=
'subdet', default=
"EMB", help=
'Subdetector, EMB, EMEC, HEC or FCAL', type=str)
23 parser.add_argument(
'-s',
'--side', dest=
'side', default=
"C", help=
'Detector side empty (means both), C or A', type=str)
24 parser.add_argument(
'-w',
'--ofcwsqlite', dest=
'ofcwsql', default=
"", help=
'Input sqlite file for OFC weights', type=str)
25 parser.add_argument(
'-t',
'--ofcwtag', dest=
'ofcwtag', default=
"", help=
'Tag for OFC weights', type=str)
26 parser.add_argument(
'--poolcat', dest=
'poolcat', default=
"PoolFileCatalog.xml", help=
'Catalog of POOL files', type=str)
27 parser.add_argument(
'-p',
'--ofcphasesqlite', dest=
'ofcphsql', default=
"/afs/cern.ch/user/p/pavol/w0/public/DB_update_22/fillDB/SCOFCPhase.db", help=
'Input sqlite file for OFC phases', type=str)
28 parser.add_argument(
'-u',
'--ofcphasetag', dest=
'ofcphtag', default=
"LARElecCalibOflSCOFCBinPhysShift-08", help=
'Tag for OFC phases', type=str)
29 parser.add_argument(
'--Ncoll',dest=
'Ncoll', default=60, help=
'Number of MinBias collision assumed for OFCs folder', type=int)
30 parser.add_argument(
'--isCalib', dest=
'caliofc', action=
'store_true', default=
False, help=
'is caliOFCs ?')
32 args = parser.parse_args()
33 if help
in args
and args.help
is not None and args.help:
37 for _, value
in args._get_kwargs():
43 from LArCalibProcessing.LArCalib_OFPhasePickerConfig
import LArOFPhasePickerCfg,LArCaliOFPhasePickerCfg
46 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
49 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
51 from LArCalibProcessing.LArCalibConfigFlags
import addLArCalibFlags
57 flags.LArCalib.Input.Files = [ ]
58 flags.LArCalib.Input.RunNumbers = [
int(args.run),]
59 gainNumMap={
"HIGH":0,
"MEDIUM":1,
"LOW":2}
60 flags.LArCalib.Gain=gainNumMap[args.gain.upper()]
62 if args.insqlitefile.startswith(
'/'):
63 flags.LArCalib.Input.Database = args.insqlitefile
65 flags.LArCalib.Input.Database = args.outpdir +
"/" + args.insqlitefile
68 flags.LArCalib.OFC.Ncoll = args.Ncoll
71 flags.LArCalib.isSC = args.supercells
72 flags.LArCalib.Input.SubDet=args.subdet
76 flags.LArCalib.BadChannelDB = args.badsql
79 OutputPoolFileName = args.outprefix+
"_"+args.run
81 OutputPoolFileName +=
"_"+args.subdet
82 OutputPoolFileName +=
".pool.root"
84 idx=OutputPoolFileName.find(
'.pool.root')
86 OutputRootFileName = OutputPoolFileName[0:idx]+
'.root'
88 OutputRootFileName = OutputPoolFileName+
'.root'
90 flags.LArCalib.Output.ROOTFile = args.outrdir +
"/" + OutputRootFileName
91 flags.LArCalib.Output.POOLFile = args.outpdir +
"/" + OutputPoolFileName
92 if args.outsql.startswith(
'/'):
93 flags.IOVDb.DBConnection=
"sqlite://;schema=" + args.outsql +
";dbname=CONDBR2"
95 flags.IOVDb.DBConnection=
"sqlite://;schema="+args.outpdir +
"/" + args.outsql +
";dbname=CONDBR2"
98 flags.IOVDb.GlobalTag =
"LARCALIB-RUN2-00"
100 from AthenaConfiguration.TestDefaults
import defaultGeometryTags
101 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
105 flags.Exec.OutputLevel = INFO
116 if args.ofcwsql
and args.ofcwtag:
117 cfg.merge(
LArOFPhasePickerCfg(flags,InputSCOFCPhaseDb=args.ofcphsql,SCOFCPhaseTag=args.ofcphtag,InputSCOFCWeightDb=args.ofcwsql,SCOFCWeightTag=args.ofcwtag))
119 cfg.merge(
LArOFPhasePickerCfg(flags,InputSCOFCPhaseDb=args.ofcphsql,SCOFCPhaseTag=args.ofcphtag))
123 cfg.getService(
"MessageSvc").defaultLimit = 9999999
124 cfg.getService(
"PoolSvc").WriteCatalog=
"xmlcatalog_file:%s"%args.poolcat
125 cfg.getService(
"PoolSvc").ReadCatalog+=[
"xmlcatalog_file:%s"%args.poolcat]