ATLAS Offline Software
Loading...
Searching...
No Matches
dumpMdtCalib.py
Go to the documentation of this file.
1# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2from AthenaConfiguration.ComponentFactory import CompFactory
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4
5def MdtCalibJsonDumpAlgCfg(flags, name= "MdtCalibJsonDumpAlg", **kwargs):
6 result = ComponentAccumulator()
7 from MuonConfig.MuonCalibrationConfig import MdtCalibDbAlgCfg
8 result.merge(MdtCalibDbAlgCfg(flags))
9 kwargs.setdefault("JsonPerIOV",False and not flags.Input.isMC)
10 the_alg = CompFactory.Muon.MdtCalibJsonDumpAlg(name=name, **kwargs)
11 result.addEventAlgo(the_alg, primary = True)
12 return result
13
14if __name__ == "__main__":
15 from AthenaConfiguration.AllConfigFlags import initConfigFlags
16 from MuonGeoModelTestR4.testGeoModel import SetupArgParser
17 parser = SetupArgParser()
18 parser.add_argument("--outRtJSON" , default="RtConstants.json")
19 parser.add_argument("--outT0JSON" , default="T0Constants.json")
20 parser.set_defaults(outRootFile="MdtCalib.root")
21
22 args = parser.parse_args()
23 from MuonGeoModelTestR4.testGeoModel import setupGeoR4TestCfg
24 from MuonConfig.MuonConfigUtils import executeTest, setupHistSvcCfg
25 flags = initConfigFlags()
26 flags.Muon.Calib.fitAnalyticRt = True
27
28 flags, cfg = setupGeoR4TestCfg(args, flags)
29 cfg.merge(MdtCalibJsonDumpAlgCfg(flags,RtJSON = args.outRtJSON, TubeT0JSON = args.outT0JSON))
30 cfg.merge(setupHistSvcCfg(flags, outFile = "{rootFile}.root".format(rootFile = args.outRtJSON[: args.outRtJSON.rfind(".")]), outStream="MDTRTCALIBDUMP"))
31 cfg.merge(setupHistSvcCfg(flags, outFile = "{rootFile}.root".format(rootFile = args.outT0JSON[: args.outT0JSON.rfind(".")]), outStream="MDTT0CALIBDUMP"))
32
33 from MuonCondAlgR4.ConditionsConfig import MdtAnalyticRtCalibAlgCfg
34 cfg.merge(MdtAnalyticRtCalibAlgCfg(flags))
35 executeTest(cfg)
MdtCalibJsonDumpAlgCfg(flags, name="MdtCalibJsonDumpAlg", **kwargs)