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. ))
68 if flags.Detector.GeometryMDT:
69 container =
"xMdtSimHits" if not useSDO
else "MDT_SDO"
70 the_alg = CompFactory.MuonR4.SdoMultiTruthMaker(
"SdoMultiTruthMakerMdt",
71 SimContainer = container,
72 WriteKey =
"MDT_TruthMap")
73 result.addEventAlgo(the_alg)
74 if flags.Detector.GeometryRPC:
75 container =
"xRpcSimHits" if not useSDO
else "RPC_SDO"
76 the_alg = CompFactory.MuonR4.SdoMultiTruthMaker(
"SdoMultiTruthMakerRpc",
77 SimContainer = container,
78 WriteKey =
"RPC_TruthMap")
79 result.addEventAlgo(the_alg)
80 if flags.Detector.GeometryTGC:
81 container =
"xTgcSimHits" if not useSDO
else "TGC_SDO"
82 the_alg = CompFactory.MuonR4.SdoMultiTruthMaker(
"SdoMultiTruthMakerTgc",
83 SimContainer = container,
84 WriteKey =
"TGC_TruthMap")
85 result.addEventAlgo(the_alg)
86 if flags.Detector.GeometryMM:
87 container =
"xMmSimHits" if not useSDO
else "MM_SDO"
88 the_alg = CompFactory.MuonR4.SdoMultiTruthMaker(
"SdoMultiTruthMakerMm",
89 SimContainer = container,
90 WriteKey =
"MM_TruthMap")
91 result.addEventAlgo(the_alg)
92 if flags.Detector.GeometrysTGC:
93 container =
"xStgcSimHits" if not useSDO
else "sTGC_SDO"
94 the_alg = CompFactory.MuonR4.SdoMultiTruthMaker(
"SdoMultiTruthMakerSTGC",
95 SimContainer = container,
96 WriteKey =
"STGC_TruthMap")
97 result.addEventAlgo(the_alg)
104 kwargs.setdefault(
"SegmentKey",
"")
105 the_alg = CompFactory.MuonR4.RecoSegToTruthAssocAlg(**kwargs)
106 result.addEventAlgo(the_alg, primary =
True)
112 if flags.Detector.GeometryMDT: hitDecors+=[
"truthMdtHits"]
113 if flags.Detector.GeometryRPC: hitDecors+=[
"truthRpcHits"]
114 if flags.Detector.GeometryTGC: hitDecors+=[
"truthTgcHits"]
115 if flags.Detector.GeometryMM: hitDecors+=[
"truthMMHits"]
116 if flags.Detector.GeometrysTGC: hitDecors+=[
"truthStgcHits"]
117 kwargs.setdefault(
"SimHitIds", hitDecors)
118 the_alg = CompFactory.MuonR4.TruthSegToTruthPartAssocAlg(name, **kwargs)
119 result.addEventAlgo(the_alg, primary =
True)
125 if flags.Detector.GeometryMDT: hitDecors+=[
"truthMdtHits"]
126 if flags.Detector.GeometryRPC: hitDecors+=[
"truthRpcHits"]
127 if flags.Detector.GeometryTGC: hitDecors+=[
"truthTgcHits"]
128 if flags.Detector.GeometryMM: hitDecors+=[
"truthMMHits"]
129 if flags.Detector.GeometrysTGC: hitDecors+=[
"truthStgcHits"]
130 kwargs.setdefault(
"SimHitIds", hitDecors)
131 the_alg = CompFactory.MuonR4.TrackToTruthPartAssocAlg(**kwargs)
132 result.addEventAlgo(the_alg, primary =
True)
139 if not flags.Input.isMC:
142 from MuonConfig.MuonDataPrepConfig
import PrimaryMeasContNamesCfg
143 PrdLinkInputs = [(
"xAOD::UncalibratedMeasurementContainer" ,
147 from MuonConfig.MuonTruthAlgsConfig
import TruthMuonMakerAlgCfg, MuonTruthHitCountsAlgCfg