ATLAS Offline Software
InDetRecStatisticsConfig.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 # Configuration of InDetRecStatistics package
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory import CompFactory
5 import AthenaCommon.SystemOfUnits as Units
6 from AthenaConfiguration.Enums import BeamType
7 
8 def InDetRecStatisticsAlgCfg(flags, name='InDetRecStatistics', **kwargs):
10 
11  if "TruthToTrackTool" not in kwargs and flags.Tracking.doTruth:
12  from TrkConfig.TrkTruthCreatorToolsConfig import TruthToTrackToolCfg
13  TruthToTrackTool = acc.popToolsAndMerge(TruthToTrackToolCfg(flags))
14  acc.addPublicTool(TruthToTrackTool)
15  kwargs.setdefault("TruthToTrackTool", TruthToTrackTool)
16 
17  if "SummaryTool" not in kwargs:
18  from TrkConfig.TrkTrackSummaryToolConfig import InDetTrackSummaryToolCfg
19  SummaryTool = acc.popToolsAndMerge(InDetTrackSummaryToolCfg(flags))
20  acc.addPublicTool(SummaryTool)
21  kwargs.setdefault("SummaryTool", SummaryTool)
22 
23  if "ResidualPullCalculator" not in kwargs:
24  from TrkConfig.TrkResidualPullCalculatorConfig import (
25  ResidualPullCalculatorCfg)
26  kwargs.setdefault("ResidualPullCalculator", acc.addPublicTool(
27  acc.popToolsAndMerge(ResidualPullCalculatorCfg(flags))))
28 
29  kwargs.setdefault("PrintSecondary", True)
30  kwargs.setdefault("UseTrackSummary", True)
31  kwargs.setdefault("DoTruth", flags.Tracking.doTruth)
32  kwargs.setdefault("fakeTrackCut", 0.8)
33  kwargs.setdefault("fakeTrackCut2", 0.5)
34 
35  if flags.Beam.Type in [BeamType.Cosmics, BeamType.SingleBeam]:
36  kwargs.setdefault("minPt", 0.*Units.GeV)
37  kwargs.setdefault("maxEta", 9999.)
38  kwargs.setdefault("maxRStartPrimary", 9999999.)
39  kwargs.setdefault("maxRStartSecondary", 9999999.)
40  kwargs.setdefault("maxZStartPrimary", 9999999.)
41  kwargs.setdefault("maxZStartSecondary", 9999999.)
42  kwargs.setdefault("minREndPrimary", 0.)
43  kwargs.setdefault("minREndSecondary", 0.)
44  kwargs.setdefault("minZEndPrimary", 0.)
45  kwargs.setdefault("minZEndSecondary", 0.)
46 
47  else:
48  kwargs.setdefault("minPt", 1.*Units.GeV)
49  kwargs.setdefault("maxEta", 2.7)
50  kwargs.setdefault("maxRStartPrimary", 25.)
51  kwargs.setdefault("maxRStartSecondary", 560.)
52  kwargs.setdefault("maxZStartPrimary", 320.)
53  kwargs.setdefault("maxZStartSecondary", 1500.)
54  kwargs.setdefault("minREndPrimary", 400.)
55  kwargs.setdefault("minREndSecondary", 1000.)
56  kwargs.setdefault("minZEndPrimary", 2300.)
57  kwargs.setdefault("minZEndSecondary", 2700.)
58 
59  acc.addEventAlgo(CompFactory.InDet.InDetRecStatisticsAlg(name, **kwargs))
60  return acc
61 
62 def ITkRecStatisticsAlgCfg(flags, name='ITkRecStatistics', **kwargs):
63  acc = ComponentAccumulator()
64 
65  if "TruthToTrackTool" not in kwargs and flags.Tracking.doTruth:
66  from TrkConfig.TrkTruthCreatorToolsConfig import TruthToTrackToolCfg
67  TruthToTrackTool = acc.popToolsAndMerge(TruthToTrackToolCfg(flags))
68  acc.addPublicTool(TruthToTrackTool)
69  kwargs.setdefault("TruthToTrackTool", TruthToTrackTool)
70 
71  if "SummaryTool" not in kwargs:
72  from TrkConfig.TrkTrackSummaryToolConfig import ITkTrackSummaryToolCfg
73  SummaryTool = acc.popToolsAndMerge(ITkTrackSummaryToolCfg(flags))
74  acc.addPublicTool(SummaryTool)
75  kwargs.setdefault("SummaryTool", SummaryTool)
76 
77  if "ResidualPullCalculator" not in kwargs:
78  from TrkConfig.TrkResidualPullCalculatorConfig import (
79  ResidualPullCalculatorCfg)
80  kwargs.setdefault("ResidualPullCalculator", acc.addPublicTool(
81  acc.popToolsAndMerge(ResidualPullCalculatorCfg(flags))))
82 
83  kwargs.setdefault("PrintSecondary", True)
84  kwargs.setdefault("UseTrackSummary", True)
85  kwargs.setdefault("DoTruth", flags.Tracking.doTruth)
86  kwargs.setdefault("fakeTrackCut", 0.8)
87  kwargs.setdefault("fakeTrackCut2", 0.5)
88 
89  kwargs.setdefault("minPt", 1.*Units.GeV)
90  kwargs.setdefault("maxEta", 4.0)
91  kwargs.setdefault("maxRStartPrimary", 25.)
92  kwargs.setdefault("maxRStartSecondary", 560.)
93  kwargs.setdefault("maxZStartPrimary", 320.)
94  kwargs.setdefault("maxZStartSecondary", 1500.)
95  kwargs.setdefault("minREndPrimary", 400.)
96  kwargs.setdefault("minREndSecondary", 1000.)
97  kwargs.setdefault("minZEndPrimary", 2300.)
98  kwargs.setdefault("minZEndSecondary", 2700.)
99 
100  acc.addEventAlgo(CompFactory.InDet.InDetRecStatisticsAlg(name, **kwargs))
101  return acc
SystemOfUnits
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.InDetRecStatisticsConfig.InDetRecStatisticsAlgCfg
def InDetRecStatisticsAlgCfg(flags, name='InDetRecStatistics', **kwargs)
Definition: InDetRecStatisticsConfig.py:8
python.InDetRecStatisticsConfig.ITkRecStatisticsAlgCfg
def ITkRecStatisticsAlgCfg(flags, name='ITkRecStatistics', **kwargs)
Definition: InDetRecStatisticsConfig.py:62
python.TrkTrackSummaryToolConfig.InDetTrackSummaryToolCfg
def InDetTrackSummaryToolCfg(flags, name='InDetTrackSummaryTool', **kwargs)
Definition: TrkTrackSummaryToolConfig.py:22
python.TrkTruthCreatorToolsConfig.TruthToTrackToolCfg
def TruthToTrackToolCfg(flags, name="TruthToTrack", **kwargs)
Definition: TrkTruthCreatorToolsConfig.py:25
python.TrkTrackSummaryToolConfig.ITkTrackSummaryToolCfg
def ITkTrackSummaryToolCfg(flags, name='ITkTrackSummaryTool', **kwargs)
Definition: TrkTrackSummaryToolConfig.py:94
python.TrkResidualPullCalculatorConfig.ResidualPullCalculatorCfg
def ResidualPullCalculatorCfg(flags, name='ResidualPullCalculator', **kwargs)
Definition: TrkResidualPullCalculatorConfig.py:6