This Config Block is meant to help fix older DAOD samples that have the old HepMC barcode instead of uid.
See also https://gitlab.cern.ch/atlas/athena/-/merge_requests/82613
and https://gitlab.cern.ch/atlas/athena/-/merge_requests/82746
Definition at line 8 of file TruthCollectionsFixerConfig.py.
◆ __init__()
| def python.TruthCollectionsFixerConfig.TruthCollectionsFixerBlock.__init__ |
( |
|
self | ) |
|
Definition at line 14 of file TruthCollectionsFixerConfig.py.
15 super(TruthCollectionsFixerBlock, self).
__init__()
17 "truthParticleContainersToFix",
20 info=
"list of input DAOD truthParticle containers to fix",
23 "truthVertexContainersToFix",
26 info=
"list of input DAOD truthVertex containers to fix",
28 self.addOption(
"fixDAODTruthRecord",
True, type=bool,
29 info=
"older derivations have the old HepMC barcodes and need to be fixed, otherwise we get "
30 "a crash on 'missing ::uid'. Schedules an instance of TruthCollectionsFixerBlock. "
31 "Not needed for recent derivations.")
◆ makeAlgs()
| def python.TruthCollectionsFixerConfig.TruthCollectionsFixerBlock.makeAlgs |
( |
|
self, |
|
|
|
config |
|
) |
| |
Definition at line 33 of file TruthCollectionsFixerConfig.py.
33 def makeAlgs(self, config):
36 if not self.fixDAODTruthRecord:
return
38 if config.dataType()
is DataType.Data:
return
41 if self.truthParticleContainersToFix
is not None:
42 partContainers = self.truthParticleContainersToFix
43 elif config.isPhyslite():
45 "TruthBoson",
"TruthBosonsWithDecayParticles",
46 "TruthElectrons",
"TruthMuons",
"TruthPhotons",
"TruthNeutrinos",
48 "TruthTop",
"TruthBottom",
49 "TruthForwardProtons",
50 "TruthBSM",
"TruthBSMWithDecayParticles",
55 "TruthBoson",
"TruthBosonsWithDecayParticles",
56 "TruthElectrons",
"TruthMuons",
"TruthPhotons",
"TruthNeutrinos",
57 "TruthTaus",
"TruthTausWithDecayParticles",
58 "TruthTop",
"TruthBottom",
"TruthCharm",
"TruthHFWithDecayParticles",
59 "TruthForwardProtons",
"TruthPileupParticles",
60 "TruthBSM",
"TruthBSMWithDecayParticles",
65 if self.truthVertexContainersToFix
is not None:
66 vertContainers = self.truthVertexContainersToFix
67 elif config.isPhyslite():
69 "TruthBosonsWithDecayVertices",
70 "TruthBSMWithDecayVertices"
74 "TruthBosonsWithDecayVertices",
75 "TruthHFWithDecayVertices",
76 "TruthTausWithDecayVertices",
77 "TruthBSMWithDecayVertices"
81 if DualUseConfig.isAthena:
83 ars = config.createService(
"AddressRemappingSvc",
"AddressRemappingSvc")
84 pps = config.createService(
"ProxyProviderSvc",
"ProxyProviderSvc")
85 if "AddressRemappingSvc" not in pps.ProviderNames:
86 pps.ProviderNames += [
"AddressRemappingSvc"]
87 for container
in partContainers:
88 ars.TypeKeyRenameMaps += [
89 f
"xAOD::TruthParticleContainer#{container}->InFile{container}",
90 f
"xAOD::AuxContainerBase#{container}Aux.->InFile{container}Aux.",
92 for container
in vertContainers:
93 ars.TypeKeyRenameMaps += [
94 f
"xAOD::TruthVertexContainer#{container}->InFile{container}",
95 f
"xAOD::AuxContainerBase#{container}Aux.->InFile{container}Aux.",
99 for container
in partContainers:
100 alg = config.createAlgorithm(
101 "xAODMaker::TruthParticleFixerAlg",
102 "TruthParticleFixerAlg_" + container,
105 alg.InputContainer = (
106 container
if not DualUseConfig.isAthena
else f
"InFile{container}"
108 alg.OutputContainer = container
111 containers_without_parent_child_links = [
"TruthBosonsWithDecayParticles",
"TruthTausWithDecayParticles",
"BornLeptons",
"TruthPileupParticles",
"TruthForwardProtons"]
112 if DualUseConfig.isAthena
and container
not in containers_without_parent_child_links:
113 alg.LinkPrefixToRemove =
"InFile"
114 alg.ParticleLinks = [
"parentLinks",
"childLinks"]
116 for container
in vertContainers:
117 alg = config.createAlgorithm(
118 "xAODMaker::TruthVertexFixerAlg",
119 "TruthVertexFixerAlg_" + container,
122 alg.InputContainer = (
123 container
if not DualUseConfig.isAthena
else f
"InFile{container}"
125 alg.OutputContainer = container
127 if DualUseConfig.isAthena :
128 alg.LinkPrefixToRemove =
"InFile"
The documentation for this class was generated from the following file: