32def TauTruthToolsCfg(flags):
33 """Configure tau truth making and matching"""
35 acc = ComponentAccumulator()
37 # Ensure that we are running on MC
38 if not flags.Input.isMC and not flags.Overlay.DataOverlay:
39 # FIXME If this happens it indicates an issue with the configuration in the caller, so better to throw an exception?!
43 from TauAnalysisTools.TauAnalysisToolsConfig import BuildTruthTausAlgCfg
44 acc.merge(BuildTruthTausAlgCfg(flags))
46 # tau truth matching, if reconstructed taus are present in the input
47 # this should be dropped from derivations and deferred to analysis level (the only use case in derivations is PHYSLITE)
48 TauTruthAugmentationTools2 = []
49 for cont in ["TauJets","TauJets_EleRM"]:
50 if "xAOD::TauJetContainer#"+cont in flags.Input.TypedCollections:
51 TauTruthAugmentationTools2.append(
52 acc.addPublicTool(acc.popToolsAndMerge(TauTruthMatchingWrapperCfg(flags, cont))))
54 CommonAugmentation = CompFactory.DerivationFramework.CommonAugmentation
55 acc.addEventAlgo(CommonAugmentation( "TauTruthCommonKernel2",
56 AugmentationTools = TauTruthAugmentationTools2,
57 ExtraInputs = {( 'xAOD::TruthParticleContainer' , 'StoreGateSvc+TruthTaus' )} ))