46def TauTruthToolsCfg(flags):
47 """Configure tau truth making and matching"""
49 acc = ComponentAccumulator()
51 # Ensure that we are running on MC
52 if not flags.Input.isMC:
53 # FIXME If this happens it indicates an issue with the configuration in the caller, so better to throw an exception?!
57 TauTruthAugmentationTools1 = []
58 TauTruthAugmentationTools1.append(
59 acc.addPublicTool(acc.popToolsAndMerge(TruthCollectionMakerTauCfg(flags))))
60 CommonAugmentation = CompFactory.DerivationFramework.CommonAugmentation
61 acc.addEventAlgo(CommonAugmentation("TauTruthCommonKernel1",
62 AugmentationTools = TauTruthAugmentationTools1,
63 ExtraOutputs = {( 'xAOD::TruthParticleContainer' , 'StoreGateSvc+TruthTaus' )} ))
65 # tau truth matching, if reconstructed taus are present in the input
66 # this should be dropped from derivations and deferred to analysis level (the only use case in derivations is PHYSLITE)
67 TauTruthAugmentationTools2 = []
68 for cont in ["TauJets","TauJets_EleRM"]:
69 if "xAOD::TauJetContainer#"+cont in flags.Input.TypedCollections:
70 TauTruthAugmentationTools2.append(
71 acc.addPublicTool(acc.popToolsAndMerge(TauTruthMatchingWrapperCfg(flags, cont))))
73 acc.addEventAlgo(CommonAugmentation( "TauTruthCommonKernel2",
74 AugmentationTools = TauTruthAugmentationTools2,
75 ExtraInputs = {( 'xAOD::TruthParticleContainer' , 'StoreGateSvc+TruthTaus' )} ))