3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
8 prefix = kwargs[
"prefix"]
9 kwargs.setdefault(
"doVeryLoose",
False)
10 kwargs.setdefault(
"doLoose",
False)
11 kwargs.setdefault(
"doMedium",
False)
12 kwargs.setdefault(
"doTight",
False)
19 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import AsgSelectionToolWrapperCfg
20 from TauAnalysisTools.TauAnalysisToolsConfig
import TauSelectionToolCfg
22 TauAugmentationTools = []
24 if kwargs[
"doVeryLoose"]:
26 name =
'TauSelectorVeryLoose',
27 ConfigPath =
'TauAnalysisAlgorithms/tau_selection_veryloose_noeleid.conf'))
28 acc.addPublicTool(TauSelectorVeryLoose)
31 name =
"TauVeryLooseWrapper",
32 AsgSelectionTool = TauSelectorVeryLoose,
33 StoreGateEntryName =
"DFTauVeryLoose",
34 ContainerName =
"TauJets"))
35 TauAugmentationTools.append(TauVeryLooseWrapper)
39 name =
'TauSelectorLoose',
40 ConfigPath =
'TauAnalysisAlgorithms/tau_selection_loose_noeleid.conf'))
41 acc.addPublicTool(TauSelectorLoose)
44 name =
"TauLooseWrapper",
45 AsgSelectionTool = TauSelectorLoose,
46 StoreGateEntryName =
"DFTauLoose",
47 ContainerName =
"TauJets"))
48 TauAugmentationTools.append(TauLooseWrapper)
50 if kwargs[
"doMedium"]:
52 name =
'TauSelectorMedium',
53 ConfigPath =
'TauAnalysisAlgorithms/tau_selection_medium_noeleid.conf'))
54 acc.addPublicTool(TauSelectorMedium)
57 name =
"TauMediumWrapper",
58 AsgSelectionTool = TauSelectorMedium,
59 StoreGateEntryName =
"DFTauMedium",
60 ContainerName =
"TauJets"))
61 TauAugmentationTools.append(TauMediumWrapper)
65 name =
'TauSelectorTight',
66 ConfigPath =
'TauAnalysisAlgorithms/tau_selection_tight_noeleid.conf'))
67 acc.addPublicTool(TauSelectorTight)
70 name =
"TauTightWrapper",
71 AsgSelectionTool = TauSelectorTight,
72 StoreGateEntryName =
"DFTauTight",
73 ContainerName =
"TauJets"))
74 TauAugmentationTools.append(TauTightWrapper)
76 if TauAugmentationTools:
77 CommonAugmentation = CompFactory.DerivationFramework.CommonAugmentation
78 acc.addEventAlgo(CommonAugmentation(f
"{prefix}_TauAugmentationKernel", AugmentationTools = TauAugmentationTools))
85 """Configure the low-pt di-tau building"""
89 from JetRecConfig.JetRecConfig
import JetRecCfg
90 from JetRecConfig.StandardLargeRJets
import AntiKt10LCTopo
91 acc.merge(
JetRecCfg(flags,AntiKt10LCTopo))
93 from DiTauRec.DiTauBuilderConfig
import DiTauBuilderLowPtCfg
100 """Decorate tau ID scores and working points"""
102 kwargs.setdefault(
"evetoFix",
True)
103 kwargs.setdefault(
"GNNTauID",
True)
104 kwargs.setdefault(
"TauContainerName",
"TauJets")
105 kwargs.setdefault(
"prefix", kwargs[
'TauContainerName'])
109 import tauRec.TauToolHolder
as tauTools
112 if kwargs[
'evetoFix']:
113 tools.append( acc.popToolsAndMerge(tauTools.TauWPDecoratorEleRNNFixCfg(flags)) )
115 if kwargs[
'GNNTauID']:
117 tools.append( acc.popToolsAndMerge(tauTools.TauVertexedClusterDecoratorCfg(flags)) )
119 tools.append( acc.popToolsAndMerge(tauTools.TauGNNEvaluatorCfg(flags,0)) )
120 tools.append( acc.popToolsAndMerge(tauTools.TauGNNEvaluatorCfg(flags,1)) )
121 tools.append( acc.popToolsAndMerge(tauTools.TauWPDecoratorGNNCfg(flags,0)) )
122 tools.append( acc.popToolsAndMerge(tauTools.TauWPDecoratorGNNCfg(flags,1)) )
126 acc.addPublicTool(tool)
128 TauIDDecoratorWrapper = CompFactory.DerivationFramework.TauIDDecoratorWrapper
129 TauIDDecoratorKernel = CompFactory.DerivationFramework.CommonAugmentation
131 prefix = kwargs[
'prefix']
132 tauIDDecoratorWrapper = TauIDDecoratorWrapper(name = f
"{prefix}_TauIDDecoratorWrapper",
133 TauContainerName = kwargs[
'TauContainerName'],
136 acc.addPublicTool(tauIDDecoratorWrapper)
137 acc.addEventAlgo(TauIDDecoratorKernel(name = f
"{prefix}_TauIDDecorKernel",
138 AugmentationTools = [tauIDDecoratorWrapper]))
145 """Configure the MuonRM AOD tau building"""
150 import tauRec.TauToolHolder
as tauTools
152 tools_mod.append( acc.popToolsAndMerge(tauTools.TauAODMuonRemovalCfg(flags)) )
154 tools_after.append( acc.popToolsAndMerge(tauTools.TauVertexedClusterDecoratorCfg(flags)) )
155 tools_after.append( acc.popToolsAndMerge(tauTools.TauTrackRNNClassifierCfg(flags)) )
156 tools_after.append( acc.popToolsAndMerge(tauTools.EnergyCalibrationLCCfg(flags)) )
157 tools_after.append( acc.popToolsAndMerge(tauTools.TauCommonCalcVarsCfg(flags)) )
158 tools_after.append( acc.popToolsAndMerge(tauTools.TauSubstructureCfg(flags)) )
159 tools_after.append( acc.popToolsAndMerge(tauTools.Pi0ClusterCreatorCfg(flags)) )
160 tools_after.append( acc.popToolsAndMerge(tauTools.Pi0ClusterScalerCfg(flags)) )
161 tools_after.append( acc.popToolsAndMerge(tauTools.Pi0ScoreCalculatorCfg(flags)) )
162 tools_after.append( acc.popToolsAndMerge(tauTools.Pi0SelectorCfg(flags)) )
163 tools_after.append( acc.popToolsAndMerge(tauTools.TauVertexVariablesCfg(flags)) )
164 import PanTauAlgs.JobOptions_Main_PanTau_New
as pantau
165 tools_after.append( acc.popToolsAndMerge(pantau.PanTauCfg(flags)) )
166 tools_after.append( acc.popToolsAndMerge(tauTools.TauCombinedTESCfg(flags)) )
167 tools_after.append( acc.popToolsAndMerge(tauTools.MvaTESVariableDecoratorCfg(flags)) )
168 tools_after[-1].EventShapeKey =
''
169 tools_after.append( acc.popToolsAndMerge(tauTools.MvaTESEvaluatorCfg(flags)) )
170 tools_after.append( acc.popToolsAndMerge(tauTools.TauIDVarCalculatorCfg(flags)) )
171 tools_after.append( acc.popToolsAndMerge(tauTools.TauJetRNNEvaluatorCfg(flags)) )
172 tools_after.append( acc.popToolsAndMerge(tauTools.TauWPDecoratorJetRNNCfg(flags)) )
173 tools_after.append( acc.popToolsAndMerge(tauTools.TauEleRNNEvaluatorCfg(flags)) )
174 tools_after.append( acc.popToolsAndMerge(tauTools.TauWPDecoratorEleRNNCfg(flags)) )
175 tools_after.append( acc.popToolsAndMerge(tauTools.TauDecayModeNNClassifierCfg(flags)) )
176 TauAODRunnerAlg=CompFactory.getComp(
"TauAODRunnerAlg")
177 for tool
in tools_mod:
179 for tool
in tools_after:
182 name =
"MuonRemovalTauAODReRecoAlg",
183 Key_tauOutputContainer =
"TauJets_MuonRM",
184 Key_pi0OutputContainer =
"TauFinalPi0s_MuonRM",
185 Key_neutralPFOOutputContainer =
"TauNeutralParticleFlowObjects_MuonRM",
186 Key_chargedPFOOutputContainer =
"TauChargedParticleFlowObjects_MuonRM",
187 Key_hadronicPFOOutputContainer =
"TauHadronicParticleFlowObjects_MuonRM",
188 Key_tauTrackOutputContainer =
"TauTracks_MuonRM",
189 Key_vertexOutputContainer =
"TauSecondaryVertices_MuonRM",
190 modificationTools = tools_mod,
191 officialTools = tools_after
193 acc.addEventAlgo(myTauAODRunnerAlg)
198 """configure tau thinning"""
201 TauThinningTool = CompFactory.DerivationFramework.TauThinningTool
202 acc.addPublicTool(TauThinningTool(name, **kwargs), primary=
True)