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"]
17 if flags.Detector.EnableRPC: containerNames+=[
"RPC_SDO"]
18 if flags.Detector.EnableTGC: containerNames+=[
"TGC_SDO"]
19 if flags.Detector.EnableMM: containerNames+=[
"MM_SDO"]
20 if flags.Detector.EnablesTGC: containerNames+=[
"sTGC_SDO"]
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 from MuonConfig.MuonDataPrepConfig
import PrimaryMeasContNamesCfg
69 if flags.Detector.GeometryMDT:
70 the_alg = CompFactory.MuonR4.PrdMultiTruthMaker(
"PrdMultiTruthMakerMdt",
71 PrdContainer = [prd
for prd
in prdContainer
if "xMdt" in prd],
72 WriteKey =
"MDT_TruthMap")
73 result.addEventAlgo(the_alg)
74 if flags.Detector.GeometryRPC:
75 the_alg = CompFactory.MuonR4.PrdMultiTruthMaker(
"PrdMultiTruthMakerRpc",
76 PrdContainer = [prd
for prd
in prdContainer
if "xRpc" in prd],
77 WriteKey =
"RPC_TruthMap")
78 result.addEventAlgo(the_alg)
79 if flags.Detector.GeometryTGC:
80 the_alg = CompFactory.MuonR4.PrdMultiTruthMaker(
"PrdMultiTruthMakerTgc",
81 PrdContainer = [prd
for prd
in prdContainer
if "xTgc" in prd],
82 WriteKey =
"TGC_TruthMap")
83 result.addEventAlgo(the_alg)
84 if flags.Detector.GeometryMM:
85 the_alg = CompFactory.MuonR4.PrdMultiTruthMaker(
"PrdMultiTruthMakerMm",
86 PrdContainer = [prd
for prd
in prdContainer
if "MM" in prd],
87 WriteKey =
"MM_TruthMap")
88 result.addEventAlgo(the_alg)
89 if flags.Detector.GeometrysTGC:
90 the_alg = CompFactory.MuonR4.PrdMultiTruthMaker(
"PrdMultiTruthMakerSTGC",
91 PrdContainer = [prd
for prd
in prdContainer
if "sTgc" in prd],
92 WriteKey =
"STGC_TruthMap")
93 result.addEventAlgo(the_alg)
100 if flags.Detector.GeometryMDT:
101 container =
"xMdtSimHits" if not useSDO
else "MDT_SDO"
102 the_alg = CompFactory.MuonR4.SdoMultiTruthMaker(
"SdoMultiTruthMakerMdt",
103 SimContainer = container,
104 WriteKey =
"MDT_TruthMap")
105 result.addEventAlgo(the_alg)
106 if flags.Detector.GeometryRPC:
107 container =
"xRpcSimHits" if not useSDO
else "RPC_SDO"
108 the_alg = CompFactory.MuonR4.SdoMultiTruthMaker(
"SdoMultiTruthMakerRpc",
109 SimContainer = container,
110 WriteKey =
"RPC_TruthMap")
111 result.addEventAlgo(the_alg)
112 if flags.Detector.GeometryTGC:
113 container =
"xTgcSimHits" if not useSDO
else "TGC_SDO"
114 the_alg = CompFactory.MuonR4.SdoMultiTruthMaker(
"SdoMultiTruthMakerTgc",
115 SimContainer = container,
116 WriteKey =
"TGC_TruthMap")
117 result.addEventAlgo(the_alg)
118 if flags.Detector.GeometryMM:
119 container =
"xMmSimHits" if not useSDO
else "MM_SDO"
120 the_alg = CompFactory.MuonR4.SdoMultiTruthMaker(
"SdoMultiTruthMakerMm",
121 SimContainer = container,
122 WriteKey =
"MM_TruthMap")
123 result.addEventAlgo(the_alg)
124 if flags.Detector.GeometrysTGC:
125 container =
"xStgcSimHits" if not useSDO
else "sTGC_SDO"
126 the_alg = CompFactory.MuonR4.SdoMultiTruthMaker(
"SdoMultiTruthMakerSTGC",
127 SimContainer = container,
128 WriteKey =
"STGC_TruthMap")
129 result.addEventAlgo(the_alg)
136 kwargs.setdefault(
"SegmentKey",
"")
137 the_alg = CompFactory.MuonR4.RecoSegToTruthAssocAlg(**kwargs)
138 result.addEventAlgo(the_alg, primary =
True)
144 if flags.Detector.GeometryMDT: hitDecors+=[
"truthMdtHits"]
145 if flags.Detector.GeometryRPC: hitDecors+=[
"truthRpcHits"]
146 if flags.Detector.GeometryTGC: hitDecors+=[
"truthTgcHits"]
147 if flags.Detector.GeometryMM: hitDecors+=[
"truthMMHits"]
148 if flags.Detector.GeometrysTGC: hitDecors+=[
"truthStgcHits"]
149 kwargs.setdefault(
"SimHitIds", hitDecors)
150 the_alg = CompFactory.MuonR4.TruthSegToTruthPartAssocAlg(name, **kwargs)
151 result.addEventAlgo(the_alg, primary =
True)
157 if flags.Detector.GeometryMDT: hitDecors+=[
"truthMdtHits"]
158 if flags.Detector.GeometryRPC: hitDecors+=[
"truthRpcHits"]
159 if flags.Detector.GeometryTGC: hitDecors+=[
"truthTgcHits"]
160 if flags.Detector.GeometryMM: hitDecors+=[
"truthMMHits"]
161 if flags.Detector.GeometrysTGC: hitDecors+=[
"truthStgcHits"]
162 kwargs.setdefault(
"SimHitIds", hitDecors)
163 the_alg = CompFactory.MuonR4.TrackToTruthPartAssocAlg(**kwargs)
164 result.addEventAlgo(the_alg, primary =
True)
171 if not flags.Input.isMC:
174 from MuonConfig.MuonDataPrepConfig
import PrimaryMeasContNamesCfg
175 PrdLinkInputs = [(
"xAOD::UncalibratedMeasurementContainer" ,
179 from MuonConfig.MuonTruthAlgsConfig
import TruthMuonMakerAlgCfg, MuonTruthHitCountsAlgCfg