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