ATLAS Offline Software
Loading...
Searching...
No Matches
SolveConfig.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3# File: InDetAlignConfig/python/SolveConfig.py
4# Author: David Brunner (david.brunner@cern.ch), Thomas Strebler (thomas.strebler@cern.ch)
5
6from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
7from AthenaConfiguration.ComponentFactory import CompFactory
8
9
10def AlignAlgCfg(flags, name="AlignAlgSolve", **kwargs):
11 cfg = ComponentAccumulator()
12
13 if "GeometryManagerTool" not in kwargs:
14 from InDetAlignConfig.IDAlignToolsConfig import InDetGeometryManagerToolCfg
15 kwargs.setdefault("GeometryManagerTool", cfg.addPublicTool(cfg.popToolsAndMerge(
16 InDetGeometryManagerToolCfg(flags))))
17
18 if "AlignTool" not in kwargs:
19 from InDetAlignConfig.IDAlignToolsConfig import GlobalChi2AlignToolCfg
20 kwargs.setdefault("AlignTool", cfg.popToolsAndMerge(GlobalChi2AlignToolCfg(flags)))
21
22 if "AlignDBTool" not in kwargs:
23 from InDetAlignConfig.IDAlignToolsConfig import InDetTrkAlignDBToolCfg
24 kwargs.setdefault("AlignDBTool", cfg.popToolsAndMerge(InDetTrkAlignDBToolCfg(flags)))
25
26 if "AlignTrackCreator" not in kwargs:
27 from InDetAlignConfig.IDAlignToolsConfig import AlignTrackCreatorCfg
28 kwargs.setdefault("AlignTrackCreator", cfg.popToolsAndMerge(
29 AlignTrackCreatorCfg(flags)))
30
31 kwargs.setdefault("AlignTrackPreProcessor", None)
32 kwargs.setdefault("WriteNtuple", False)
33 kwargs.setdefault("SolveOnly", True)
34
35 cfg.addEventAlgo(CompFactory.Trk.AlignAlg(name, **kwargs))
36 return cfg
37
38def WriteConstCfg(flags, name = "WriteConst", **kwargs):
39 cfg = ComponentAccumulator()
40
41 objectList = [
42 "CondAttrListCollection#/Indet/AlignL1/ID",
43 "CondAttrListCollection#/Indet/AlignL2/PIX",
44 "CondAttrListCollection#/Indet/AlignL2/SCT",
45 "AlignableTransformContainer#/Indet/AlignL3",
46 "CondAttrListCollection#/TRT/AlignL1/TRT",
47 "AlignableTransformContainer#/TRT/AlignL2",
48 # Disable TRT L3 until ATLIDTRKCP-745 is solved
49 #"TRTCond::StrawDxContainer#/TRT/Calib/DX",
50 "CondAttrListCollection#/Indet/IBLDist"
51 ]
52
53 tagList = [
54 "InDetAlignL1-T0-Alignment",
55 "InDetAlignL2PIX-T0-Alignment",
56 "InDetAlignL2SCT-T0-Alignment",
57 "InDetAlignL3-T0-Alignment",
58 "InDetAlignL1TRT-T0-Alignment",
59 "InDetAlignL2TRT-T0-Alignment",
60 # Disable TRT L3 until ATLIDTRKCP-745 is solved
61 #"InDetAlignL3TRT-T0-Alignment",
62 "InDetAlignIBLDIST-T0-Alignment"
63 ]
64
65 from RegistrationServices.OutputConditionsAlgConfig import OutputConditionsAlgCfg
66 cfg.merge(OutputConditionsAlgCfg(
67 flags,
68 outputFile = flags.InDet.Align.outputConditionFile,
69 ObjectList = objectList, IOVTagList = tagList, WriteIOV = True))
70
71 return cfg
72
73def SolveCfg(flags, **kwargs):
74 cfg = AlignAlgCfg(flags)
75 cfg.merge(WriteConstCfg(flags))
76
77 return cfg
SolveCfg(flags, **kwargs)
AlignAlgCfg(flags, name="AlignAlgSolve", **kwargs)
WriteConstCfg(flags, name="WriteConst", **kwargs)