ATLAS Offline Software
TrkVertexFittersConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 # Configuration of TrkVertexFitters package
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 
7  flags, name="BaseAdaptiveMultiVertexFitter", **kwargs):
9 
10  if "LinearizedTrackFactory" not in kwargs:
11  from TrkConfig.TrkVertexFitterUtilsConfig import (
12  FullLinearizedTrackFactoryCfg)
13  kwargs.setdefault("LinearizedTrackFactory", acc.popToolsAndMerge(
15 
16  if "ImpactPoint3dEstimator" not in kwargs:
17  from TrkConfig.TrkVertexFitterUtilsConfig import (
18  ImpactPoint3dEstimatorCfg)
19  kwargs.setdefault("ImpactPoint3dEstimator", acc.popToolsAndMerge(
21 
22  acc.setPrivateTools(CompFactory.Trk.AdaptiveMultiVertexFitter(name, **kwargs))
23  return acc
24 
25 def AdaptiveMultiVertexFitterCfg(flags, name="AdaptiveMultiVertexFitter", **kwargs):
26  acc = ComponentAccumulator()
27 
28  if "AnnealingMaker" not in kwargs:
29  from TrkConfig.TrkVertexFitterUtilsConfig import DetAnnealingMakerCfg
30  kwargs.setdefault("AnnealingMaker", acc.popToolsAndMerge(
31  DetAnnealingMakerCfg(flags)))
32 
33  kwargs.setdefault("DoSmoothing", True)
34 
35  acc.setPrivateTools(acc.popToolsAndMerge(
36  BaseAdaptiveMultiVertexFitterCfg(flags, name, **kwargs)))
37  return acc
38 
39 def AdaptiveMultiSecVertexFitterCfg(flags, name="AdaptiveMultiSecVertexFitter", **kwargs):
40  acc = ComponentAccumulator()
41 
42  if "AnnealingMaker" not in kwargs:
43  from TrkConfig.TrkVertexFitterUtilsConfig import SecVtxDetAnnealingMakerCfg
44  kwargs.setdefault("AnnealingMaker", acc.popToolsAndMerge(
46 
47  kwargs.setdefault("DoSmoothing", True)
48 
49  acc.setPrivateTools(acc.popToolsAndMerge(
50  BaseAdaptiveMultiVertexFitterCfg(flags, name, **kwargs)))
51  return acc
52 
53 def SequentialVertexSmootherCfg(flags, name="SequentialVertexSmoother", **kwargs):
54  acc = ComponentAccumulator()
55  acc.setPrivateTools(CompFactory.Trk.SequentialVertexSmoother(name, **kwargs))
56  return acc
57 
58 def BaseAdaptiveVertexFitterCfg(flags, name="BaseAdaptiveVertexFitter", **kwargs):
59  acc = ComponentAccumulator()
60 
61  if "LinearizedTrackFactory" not in kwargs:
62  from TrkConfig.TrkVertexFitterUtilsConfig import (
63  FullLinearizedTrackFactoryCfg)
64  kwargs.setdefault("LinearizedTrackFactory", acc.popToolsAndMerge(
66 
67  if "ImpactPoint3dEstimator" not in kwargs:
68  from TrkConfig.TrkVertexFitterUtilsConfig import (
69  ImpactPoint3dEstimatorCfg)
70  kwargs.setdefault("ImpactPoint3dEstimator", acc.popToolsAndMerge(
72 
73  acc.setPrivateTools(CompFactory.Trk.AdaptiveVertexFitter(name, **kwargs))
74  return acc
75 
76 def AdaptiveVertexFitterCfg(flags, name="AdaptiveVertexFitter", **kwargs):
77  acc = ComponentAccumulator()
78 
79  if "SeedFinder" not in kwargs:
80  from TrkConfig.TrkVertexSeedFinderToolsConfig import ZScanSeedFinderCfg
81  kwargs.setdefault("SeedFinder", acc.popToolsAndMerge(
82  ZScanSeedFinderCfg(flags)))
83 
84  if "AnnealingMaker" not in kwargs:
85  from TrkConfig.TrkVertexFitterUtilsConfig import DetAnnealingMakerCfg
86  kwargs.setdefault("AnnealingMaker", acc.popToolsAndMerge(
87  DetAnnealingMakerCfg(flags)))
88 
89  if "VertexSmoother" not in kwargs:
90  kwargs.setdefault("VertexSmoother", acc.popToolsAndMerge(
92 
93  acc.setPrivateTools(acc.popToolsAndMerge(
94  BaseAdaptiveVertexFitterCfg(flags, name, **kwargs)))
95  return acc
96 
97 def TauAdaptiveVertexFitterCfg(flags, name="TauAdaptiveVertexFitter", **kwargs):
98  acc = ComponentAccumulator()
99 
100  if "SeedFinder" not in kwargs:
101  from TrkConfig.TrkVertexSeedFinderToolsConfig import (
102  CrossDistancesSeedFinderCfg)
103  kwargs.setdefault("SeedFinder", acc.popToolsAndMerge(
105 
106  if "LinearizedTrackFactory" not in kwargs:
107  from TrkConfig.TrkVertexFitterUtilsConfig import (
108  AtlasFullLinearizedTrackFactoryCfg)
109  kwargs.setdefault("LinearizedTrackFactory", acc.popToolsAndMerge(
111 
112  if "ImpactPoint3dEstimator" not in kwargs:
113  from TrkConfig.TrkVertexFitterUtilsConfig import (
114  AtlasImpactPoint3dEstimatorCfg)
115  kwargs.setdefault("ImpactPoint3dEstimator", acc.popToolsAndMerge(
117 
118  if "AnnealingMaker" not in kwargs:
119  from TrkConfig.TrkVertexFitterUtilsConfig import TauDetAnnealingMakerCfg
120  kwargs.setdefault("AnnealingMaker", acc.popToolsAndMerge(
121  TauDetAnnealingMakerCfg(flags)))
122 
123  if "VertexSmoother" not in kwargs:
124  kwargs.setdefault("VertexSmoother", acc.popToolsAndMerge(
126 
127  acc.setPrivateTools(CompFactory.Trk.AdaptiveVertexFitter(name, **kwargs))
128  return acc
129 
130 def AdaptiveVxFitterToolIncSecVtxCfg(flags, name='AdaptiveVxFitterToolIncSecVtx', **kwargs):
131 
132  kwargs.setdefault("MaxIterations", 8000)
133  kwargs.setdefault("MaxDistToLinPoint", 0.2)
134  kwargs.setdefault("InitialError", 0.2)
135 
136  return AdaptiveVertexFitterCfg(flags, name, **kwargs)
137 
139  flags, name="AdaptiveVertexFitterTestAlg", **kwargs):
140  acc = ComponentAccumulator()
141  kwargs.setdefault("Tool", acc.popToolsAndMerge(BaseAdaptiveVertexFitterCfg(flags)))
142  acc.addEventAlgo(CompFactory.Trk.AdaptiveVertexFitterTestAlg(name, **kwargs))
143  return acc
144 
146  flags, name="AdaptiveMultiVertexFitterTestAlg", **kwargs):
147  acc = ComponentAccumulator()
148  kwargs.setdefault("Tool", acc.popToolsAndMerge(
150  acc.addEventAlgo(
151  CompFactory.Trk.AdaptiveMultiVertexFitterTestAlg(name, **kwargs))
152  return acc
153 
154 if __name__ == "__main__":
155 
156  from argparse import ArgumentParser
157  parser = ArgumentParser()
158  parser.add_argument("--test")
159  args = parser.parse_args()
160 
161  from AthenaConfiguration.AllConfigFlags import initConfigFlags
162  flags = initConfigFlags()
163 
164  from AthenaConfiguration.TestDefaults import defaultTestFiles
165  flags.Input.Files = defaultTestFiles.RDO_RUN2
166 
167  flags.lock()
168  flags.dump()
169 
170  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
171  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
172  cfg=MainServicesCfg(flags)
173  cfg.merge(PoolReadCfg(flags))
174 
175  if args.test=="AVF":
176  cfg.merge(AdaptiveVertexFitterTestAlgCfg(flags))
177  elif args.test=="AVMF":
178  cfg.merge(AdaptiveMultiVertexFitterTestAlgCfg(flags))
179 
180  cfg.run(2)
python.TrkVertexFittersConfig.TauAdaptiveVertexFitterCfg
def TauAdaptiveVertexFitterCfg(flags, name="TauAdaptiveVertexFitter", **kwargs)
Definition: TrkVertexFittersConfig.py:97
python.TrkVertexFittersConfig.AdaptiveMultiSecVertexFitterCfg
def AdaptiveMultiSecVertexFitterCfg(flags, name="AdaptiveMultiSecVertexFitter", **kwargs)
Definition: TrkVertexFittersConfig.py:39
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.TrkVertexFitterUtilsConfig.SecVtxDetAnnealingMakerCfg
def SecVtxDetAnnealingMakerCfg(flags, name='SecVtxDetAnnealingMaker', **kwargs)
Definition: TrkVertexFitterUtilsConfig.py:40
python.TrkVertexFittersConfig.AdaptiveVertexFitterCfg
def AdaptiveVertexFitterCfg(flags, name="AdaptiveVertexFitter", **kwargs)
Definition: TrkVertexFittersConfig.py:76
python.TrkVertexFitterUtilsConfig.ImpactPoint3dEstimatorCfg
def ImpactPoint3dEstimatorCfg(flags, name='ImpactPoint3dEstimator', **kwargs)
Definition: TrkVertexFitterUtilsConfig.py:78
python.TrkVertexFittersConfig.AdaptiveMultiVertexFitterCfg
def AdaptiveMultiVertexFitterCfg(flags, name="AdaptiveMultiVertexFitter", **kwargs)
Definition: TrkVertexFittersConfig.py:25
python.TrkVertexFittersConfig.BaseAdaptiveVertexFitterCfg
def BaseAdaptiveVertexFitterCfg(flags, name="BaseAdaptiveVertexFitter", **kwargs)
Definition: TrkVertexFittersConfig.py:58
python.TrkVertexSeedFinderToolsConfig.ZScanSeedFinderCfg
def ZScanSeedFinderCfg(flags, name="ZScanSeedFinder", **kwargs)
Definition: TrkVertexSeedFinderToolsConfig.py:21
python.TrkVertexFittersConfig.AdaptiveVertexFitterTestAlgCfg
def AdaptiveVertexFitterTestAlgCfg(flags, name="AdaptiveVertexFitterTestAlg", **kwargs)
Definition: TrkVertexFittersConfig.py:138
python.TrkVertexFitterUtilsConfig.DetAnnealingMakerCfg
def DetAnnealingMakerCfg(flags, name='DetAnnealingMaker', **kwargs)
Definition: TrkVertexFitterUtilsConfig.py:34
python.TrkVertexFittersConfig.BaseAdaptiveMultiVertexFitterCfg
def BaseAdaptiveMultiVertexFitterCfg(flags, name="BaseAdaptiveMultiVertexFitter", **kwargs)
Definition: TrkVertexFittersConfig.py:6
python.TrkVertexFitterUtilsConfig.AtlasFullLinearizedTrackFactoryCfg
def AtlasFullLinearizedTrackFactoryCfg(flags, name='AtlasFullLinearizedTrkFactory', **kwargs)
Definition: TrkVertexFitterUtilsConfig.py:20
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:256
python.TrkVertexFittersConfig.SequentialVertexSmootherCfg
def SequentialVertexSmootherCfg(flags, name="SequentialVertexSmoother", **kwargs)
Definition: TrkVertexFittersConfig.py:53
python.TrkVertexFittersConfig.AdaptiveVxFitterToolIncSecVtxCfg
def AdaptiveVxFitterToolIncSecVtxCfg(flags, name='AdaptiveVxFitterToolIncSecVtx', **kwargs)
Definition: TrkVertexFittersConfig.py:130
python.TrkVertexFitterUtilsConfig.TauDetAnnealingMakerCfg
def TauDetAnnealingMakerCfg(flags, name='tauRec_TauDetAnnealingMaker', **kwargs)
Definition: TrkVertexFitterUtilsConfig.py:44
python.TrkVertexFitterUtilsConfig.AtlasImpactPoint3dEstimatorCfg
def AtlasImpactPoint3dEstimatorCfg(flags, name='AtlasImpactPoint3dEstimator', **kwargs)
Definition: TrkVertexFitterUtilsConfig.py:92
python.TrkVertexFitterUtilsConfig.FullLinearizedTrackFactoryCfg
def FullLinearizedTrackFactoryCfg(flags, name='FullLinearizedTrkFactory', **kwargs)
Definition: TrkVertexFitterUtilsConfig.py:6
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.TrkVertexSeedFinderToolsConfig.CrossDistancesSeedFinderCfg
def CrossDistancesSeedFinderCfg(flags, name="CrossDistancesSeedFinder", **kwargs)
Definition: TrkVertexSeedFinderToolsConfig.py:33
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
python.TrkVertexFittersConfig.AdaptiveMultiVertexFitterTestAlgCfg
def AdaptiveMultiVertexFitterTestAlgCfg(flags, name="AdaptiveMultiVertexFitterTestAlg", **kwargs)
Definition: TrkVertexFittersConfig.py:145