2 from AthenaConfiguration.AccumulatorCache
import AccumulatorCache
3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
9 if not flags.Input.isMC:
12 from ActsAlignmentAlgs.AlignmentAlgsConfig
import ActsGeometryContextAlgCfg
16 if flags.Detector.EnableMDT: containerNames+=[
"MDT_SDO" if useSDO
else "xMdtSimHits"]
17 if flags.Detector.EnableRPC: containerNames+=[
"RPC_SDO" if useSDO
else "xRpcSimHits"]
18 if flags.Detector.EnableTGC: containerNames+=[
"TGC_SDO" if useSDO
else "xTgcSimHits"]
19 if flags.Detector.EnableMM: containerNames+=[
"MM_SDO" if useSDO
else "xMmSimHits"]
20 if flags.Detector.EnablesTGC: containerNames+=[
"sTGC_SDO" if useSDO
else "xStgcSimHits"]
22 from MuonConfig.MuonCalibrationConfig
import MdtCalibDbAlgCfg, NswErrorCalibDbAlgCfg
23 if flags.Detector.EnableMDT:
25 if flags.Detector.EnableMM
or flags.Detector.EnablesTGC:
27 kwargs.setdefault(
"SimHitKeys", containerNames)
29 the_alg = CompFactory.MuonR4.TruthSegmentMaker(name, **kwargs)
30 result.addEventAlgo(the_alg, primary =
True)
35 from ActsAlignmentAlgs.AlignmentAlgsConfig
import ActsGeometryContextAlgCfg
37 the_alg = CompFactory.MuonR4.PrepDataToSimHitAssocAlg(name, **kwargs)
38 result.addEventAlgo(the_alg, primary =
True)
43 if not flags.Input.isMC:
45 from MuonConfig.MuonDataPrepConfig
import PrimaryMeasContNamesCfg
48 if "xMdt" in cont_name:
50 elif "xRpc" in cont_name:
52 elif "xTgc" in cont_name:
54 elif "MM" in cont_name:
59 name=f
"{cont_name}PrepDataToSimHitAssoc",
61 Measurements=cont_name,
62 AssocPull = 1.
if cont_name==
"xAODsTgcPads" else 3. ))
67 if flags.Detector.GeometryMDT:
68 container =
"xMdtSimHits" if not useSDO
else "MDT_SDO"
69 the_alg = CompFactory.MuonR4.SimHitToTruthPartAssocAlg(
"MuonMdtSimHitToTruthMappingAlg",
70 SimHitContainer = container,
71 HitIdDecoration =
"truthMdtHits")
72 result.addEventAlgo(the_alg)
73 if flags.Detector.GeometryRPC:
74 container =
"xRpcSimHits" if not useSDO
else "RPC_SDO"
75 the_alg = CompFactory.MuonR4.SimHitToTruthPartAssocAlg(
"MuonRpcSimHitToTruthMappingAlg",
76 SimHitContainer = container,
77 HitIdDecoration =
"truthRpcHits")
78 result.addEventAlgo(the_alg)
79 if flags.Detector.GeometryTGC:
80 container =
"xTgcSimHits" if not useSDO
else "TGC_SDO"
81 the_alg = CompFactory.MuonR4.SimHitToTruthPartAssocAlg(
"MuonTgcSimHitToTruthMappingAlg",
82 SimHitContainer = container,
83 HitIdDecoration =
"truthTgcHits")
84 result.addEventAlgo(the_alg)
85 if flags.Detector.GeometryMM:
86 container =
"xMmSimHits" if not useSDO
else "MM_SDO"
87 the_alg = CompFactory.MuonR4.SimHitToTruthPartAssocAlg(
"MuonMmSimHitToTruthMappingAlg",
88 SimHitContainer = container,
89 HitIdDecoration =
"truthMMHits")
90 result.addEventAlgo(the_alg)
91 if flags.Detector.GeometrysTGC:
92 container =
"xStgcSimHits" if not useSDO
else "sTGC_SDO"
93 the_alg = CompFactory.MuonR4.SimHitToTruthPartAssocAlg(
"MuonsTGCSimHitToTruthMappingAlg",
94 SimHitContainer = container,
95 HitIdDecoration =
"truthStgcHits")
96 result.addEventAlgo(the_alg)
102 from MuonTrackFindingAlgs.TrackFindingConfig
import TrackSummaryToolCfg
104 fillHoles=
False, fillOutliers=
False,
105 recomputeSegment =
False)))
106 the_alg = CompFactory.MuonR4.TruthHitSummaryAlg(name, **kwargs)
107 result.addEventAlgo(the_alg, primary =
True)
113 kwargs.setdefault(
"SegmentKey",
"")
114 from MuonConfig.MuonDataPrepConfig
import PrimaryMeasContNamesCfg
116 the_alg = CompFactory.MuonR4.RecoSegToTruthAssocAlg(**kwargs)
117 result.addEventAlgo(the_alg, primary =
True)
123 if flags.Detector.GeometryMDT: hitDecors+=[
"truthMdtHits"]
124 if flags.Detector.GeometryRPC: hitDecors+=[
"truthRpcHits"]
125 if flags.Detector.GeometryTGC: hitDecors+=[
"truthTgcHits"]
126 if flags.Detector.GeometryMM: hitDecors+=[
"truthMMHits"]
127 if flags.Detector.GeometrysTGC: hitDecors+=[
"truthStgcHits"]
128 kwargs.setdefault(
"SimHitIds", hitDecors)
129 the_alg = CompFactory.MuonR4.TruthSegToTruthPartAssocAlg(name, **kwargs)
130 result.addEventAlgo(the_alg, primary =
True)
136 if flags.Detector.GeometryMDT: hitDecors+=[
"truthMdtHits"]
137 if flags.Detector.GeometryRPC: hitDecors+=[
"truthRpcHits"]
138 if flags.Detector.GeometryTGC: hitDecors+=[
"truthTgcHits"]
139 if flags.Detector.GeometryMM: hitDecors+=[
"truthMMHits"]
140 if flags.Detector.GeometrysTGC: hitDecors+=[
"truthStgcHits"]
141 kwargs.setdefault(
"SimHitIds", hitDecors)
142 the_alg = CompFactory.MuonR4.TrackToTruthPartAssocAlg(**kwargs)
143 result.addEventAlgo(the_alg, primary =
True)
150 if not flags.Input.isMC:
152 if useSDO
and recoAssoc:
155 from MuonConfig.MuonTruthAlgsConfig
import TruthMuonMakerAlgCfg