ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetConfig
python
TRTSegmentFindingConfig.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2
from
AthenaConfiguration.ComponentAccumulator
import
ComponentAccumulator
3
from
AthenaConfiguration.Enums
import
BeamType
4
5
def
TRTSegmentFindingCfg
(flags, InputCollections = None,
6
ExtraAssociationTracks = None):
7
acc = ComponentAccumulator()
8
9
#
10
# --- get list of already associated hits (always do this, even if no other tracking ran before)
11
#
12
if
InputCollections
is
not
None
:
13
from
InDetConfig.InDetTrackPRD_AssociationConfig
import
(
14
InDetTrackPRD_AssociationCfg)
15
acc.merge(InDetTrackPRD_AssociationCfg(
16
flags,
17
name =
'InDetSegmentTrackPRD_Association'
,
18
AssociationMapName =
'InDetSegmentPRDtoTrackMap'
,
19
TracksName = list(InputCollections) + list(ExtraAssociationTracks
or
[])))
20
21
#
22
# --- TRT track reconstruction
23
#
24
if
flags.Beam.Type
is
BeamType.Cosmics:
25
from
InDetConfig.TRT_TrackSegmentsFinderConfig
import
(
26
TRT_TrackSegmentsFinder_Cosmics_Cfg)
27
acc.merge(TRT_TrackSegmentsFinder_Cosmics_Cfg(flags))
28
else
:
29
from
InDetConfig.TRT_TrackSegmentsFinderConfig
import
(
30
TRT_TrackSegmentsFinderCfg)
31
acc.merge(TRT_TrackSegmentsFinderCfg(flags,
32
InputCollections = InputCollections))
33
34
#
35
# --- load TRT validation alg
36
#
37
if
flags.Tracking.doTruth:
38
from
InDetConfig.InDetSegmentDriftCircleAssValidationConfig
import
(
39
SegmentDriftCircleAssValidationCfg)
40
acc.merge(SegmentDriftCircleAssValidationCfg(flags))
41
42
return
acc
43
44
def
TRTSegmentFinding_Phase_Cfg
(flags):
45
acc = ComponentAccumulator()
46
47
#
48
# --- TRT track reconstruction
49
#
50
if
flags.Beam.Type
is
BeamType.Cosmics:
51
from
InDetConfig.TRT_TrackSegmentsFinderConfig
import
(
52
TRT_TrackSegmentsFinder_Cosmics_Cfg)
53
acc.merge(TRT_TrackSegmentsFinder_Cosmics_Cfg(
54
flags,
55
name=
'InDetTRT_TrackSegmentsFinder_Phase_Cosmics'
,
56
SegmentsLocation =
'TRTSegments_Phase'
))
57
else
:
58
from
InDetConfig.TRT_TrackSegmentsFinderConfig
import
(
59
TRT_TrackSegmentsFinder_Phase_Cfg)
60
acc.merge(TRT_TrackSegmentsFinder_Phase_Cfg(flags))
61
62
#
63
# --- load TRT validation alg
64
#
65
if
flags.Tracking.doTruth:
66
from
InDetConfig.InDetSegmentDriftCircleAssValidationConfig
import
(
67
SegmentDriftCircleAssValidationCfg)
68
acc.merge(SegmentDriftCircleAssValidationCfg(
69
flags,
70
name =
"InDetSegmentDriftCircleAssValidation_Phase"
))
71
72
return
acc
73
74
def
TRTSegmentFinding_TrackSegments_Cfg
(flags):
75
acc = ComponentAccumulator()
76
77
#
78
# --- TRT track reconstruction
79
#
80
if
flags.Beam.Type
is
BeamType.Cosmics:
81
from
InDetConfig.TRT_TrackSegmentsFinderConfig
import
(
82
TRT_TrackSegmentsFinder_Cosmics_Cfg)
83
acc.merge(TRT_TrackSegmentsFinder_Cosmics_Cfg(
84
flags,
85
name=
'InDetTRT_TrackSegmentsFinder_TrackSegments_Cosmics'
,
86
SegmentsLocation =
'TRTSegmentsTRT'
))
87
else
:
88
from
InDetConfig.TRT_TrackSegmentsFinderConfig
import
(
89
TRT_TrackSegmentsFinder_TrackSegments_Cfg)
90
acc.merge(TRT_TrackSegmentsFinder_TrackSegments_Cfg(flags))
91
92
#
93
# --- load TRT validation alg
94
#
95
96
if
flags.Tracking.doTruth:
97
from
InDetConfig.InDetSegmentDriftCircleAssValidationConfig
import
(
98
SegmentDriftCircleAssValidation_TrackSegments_Cfg)
99
acc.merge(SegmentDriftCircleAssValidation_TrackSegments_Cfg(flags))
100
101
return
acc
102
103
104
if
__name__ ==
"__main__"
:
105
from
AthenaConfiguration.AllConfigFlags
import
initConfigFlags
106
flags = initConfigFlags()
107
108
from
AthenaConfiguration.TestDefaults
import
defaultTestFiles
109
flags.Input.Files=defaultTestFiles.RDO_RUN2
110
111
# disable calo for this test
112
flags.Detector.EnableCalo =
False
113
114
numThreads=1
115
flags.Concurrency.NumThreads=numThreads
116
flags.Concurrency.NumConcurrentEvents=numThreads
# Might change this later, but good enough for the moment.
117
118
flags = flags.cloneAndReplace(
"Tracking.ActiveConfig"
,
"Tracking.MainPass"
)
119
120
flags.lock()
121
flags.dump()
122
123
from
AthenaConfiguration.MainServicesConfig
import
MainServicesCfg
124
top_acc = MainServicesCfg(flags)
125
126
from
AthenaPoolCnvSvc.PoolReadConfig
import
PoolReadCfg
127
top_acc.merge(PoolReadCfg(flags))
128
129
from
InDetConfig.TRTPreProcessing
import
TRTPreProcessingCfg
130
top_acc.merge(TRTPreProcessingCfg(flags))
131
top_acc.merge(
TRTSegmentFindingCfg
(flags))
132
133
iovsvc = top_acc.getService(
'IOVDbSvc'
)
134
iovsvc.OutputLevel=5
135
136
top_acc.store(open(
"test_TRTSegmentFinding.pkl"
,
"wb"
))
137
138
import
sys
139
if
"--norun"
not
in
sys.argv:
140
sc = top_acc.run(5)
141
sys.exit(
not
sc.isSuccess())
python.TRTSegmentFindingConfig.TRTSegmentFinding_Phase_Cfg
TRTSegmentFinding_Phase_Cfg(flags)
Definition
TRTSegmentFindingConfig.py:44
python.TRTSegmentFindingConfig.TRTSegmentFinding_TrackSegments_Cfg
TRTSegmentFinding_TrackSegments_Cfg(flags)
Definition
TRTSegmentFindingConfig.py:74
python.TRTSegmentFindingConfig.TRTSegmentFindingCfg
TRTSegmentFindingCfg(flags, InputCollections=None, ExtraAssociationTracks=None)
Definition
TRTSegmentFindingConfig.py:6
Generated on
for ATLAS Offline Software by
1.17.0