3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
5 from AthenaConfiguration.Enums
import BeamType, LHCPeriod
13 from CaloTools.CaloNoiseCondAlgConfig
import CaloNoiseCondAlgCfg
19 import tauRec.TauToolHolder
as tauTools
22 tools.append( result.popToolsAndMerge(tauTools.JetSeedBuilderCfg(flags)) )
25 if getattr(flags.Tau.ActiveConfig,
'inTauEleRM',
False):
26 tools.append( result.popToolsAndMerge(tauTools.TauEleOverlapChecker(flags)) )
29 if flags.Tau.isStandalone
or flags.Tracking.doVertexFinding:
30 tools.append( result.popToolsAndMerge(tauTools.TauVertexFinderCfg(flags)) )
32 tools.append( result.popToolsAndMerge(tauTools.TauAxisCfg(flags)) )
33 tools.append( result.popToolsAndMerge(tauTools.TauTrackFinderCfg(flags)) )
35 tools.append( result.popToolsAndMerge(tauTools.TauClusterFinderCfg(flags)) )
36 tools.append( result.popToolsAndMerge(tauTools.TauVertexedClusterDecoratorCfg(flags)) )
38 if flags.Beam.Type
is not BeamType.Cosmics:
39 if flags.Tau.doRNNTrackClass:
40 tools.append( result.popToolsAndMerge(tauTools.TauTrackRNNClassifierCfg(flags)) )
41 tools.append( result.popToolsAndMerge(tauTools.EnergyCalibrationLCCfg(flags)) )
43 tools.append( result.popToolsAndMerge(tauTools.CellVariablesCfg(flags)) )
44 tools.append( result.popToolsAndMerge(tauTools.ElectronVetoVarsCfg(flags)) )
45 tools.append( result.popToolsAndMerge(tauTools.TauShotFinderCfg(flags)) )
47 if flags.Tau.doPi0Clus:
48 tools.append( result.popToolsAndMerge(tauTools.Pi0ClusterFinderCfg(flags)) )
51 TauProcessorAlg = CompFactory.getComp(
"TauProcessorAlg")
52 BuildAlg =
TauProcessorAlg(name = flags.Tau.ActiveConfig.prefix+
"TauCoreBuilderAlg",
53 Key_jetInputContainer = flags.Tau.ActiveConfig.SeedJetCollection,
54 Key_tauOutputContainer = flags.Tau.ActiveConfig.TauJets_tmp,
55 Key_tauTrackOutputContainer = flags.Tau.ActiveConfig.TauTracks,
56 Key_tauShotClusOutputContainer = flags.Tau.ActiveConfig.TauShotClusters,
57 Key_tauShotClusLinkContainer = flags.Tau.ActiveConfig.TauShotClustersLinks,
58 Key_tauShotPFOOutputContainer = flags.Tau.ActiveConfig.TauShotPFOs,
59 Key_tauPi0CellOutputContainer = flags.Tau.ActiveConfig.TauCommonPi0Cells,
60 MaxEta = flags.Tau.SeedMaxEta,
61 MinPt = flags.Tau.SeedMinPt,
62 MaxNTracks = flags.Tau.MaxNTracks,
64 CellMakerTool = result.popToolsAndMerge(tauTools.TauCellFinalizerCfg(flags)))
66 if flags.GeoModel.Run
is LHCPeriod.Run4:
67 BuildAlg.PixelDetEleCollKey=
"ITkPixelDetectorElementCollection"
68 BuildAlg.SCTDetEleCollKey=
"ITkStripDetectorElementCollection"
69 BuildAlg.TRTDetEleContKey=
""
71 result.addEventAlgo(BuildAlg)
80 from CaloTools.CaloNoiseCondAlgConfig
import CaloNoiseCondAlgCfg
85 from CaloRec.CaloTopoClusterConfig
import caloTopoCoolFolderCfg
88 from LArBadChannelTool.LArBadChannelConfig
import LArBadChannelCfg
91 from TileConditions.TileBadChannelsConfig
import TileBadChannelsCondAlgCfg
95 import tauRec.TauToolHolder
as tauTools
97 CaloClusterMaker = CompFactory.getComp(
"CaloClusterMaker")
98 CaloTopoForTausMaker = CaloClusterMaker (flags.Tau.ActiveConfig.prefix+
"TauPi0SubtractedClusterMaker")
99 CaloTopoForTausMaker.ClustersOutputName = flags.Tau.ActiveConfig.TauPi0Clusters_tmp
100 CaloTopoForTausMaker.ClusterMakerTools = [result.popToolsAndMerge(tauTools.TauCaloTopoClusterMakerCfg(flags)),
101 result.popToolsAndMerge(tauTools.TauCaloTopoClusterSplitterCfg(flags))]
103 CaloTopoForTausMaker.ClusterCorrectionTools += [result.popToolsAndMerge(tauTools.TauCaloClusterBadChannelCfg(flags))]
104 CaloTopoForTausMaker.ClusterCorrectionTools += [result.popToolsAndMerge(tauTools.TauCaloClusterMomentsMakerCfg(flags))]
106 if flags.Calo.TopoCluster.doCellWeightCalib:
107 CaloTopoForTausMaker.ClusterCorrectionTools += [result.popToolsAndMerge(tauTools.TauCaloClusterCellWeightCalibCfg(flags))]
109 if flags.Calo.TopoCluster.doTopoClusterLocalCalib:
110 CaloTopoForTausMaker.ClusterCorrectionTools += [result.popToolsAndMerge(tauTools.TauCaloClusterLocalCalibCfg(flags)),
111 result.popToolsAndMerge(tauTools.TauCaloOOCCalibCfg(flags)),
112 result.popToolsAndMerge(tauTools.TauCaloOOCPi0CalibCfg(flags)),
113 result.popToolsAndMerge(tauTools.TauCaloDMCalibCfg(flags))]
115 result.addEventAlgo(CaloTopoForTausMaker)
117 relinkAlg = CompFactory.ClusterCellRelinkAlg(name = flags.Tau.ActiveConfig.prefix+
'ClusterCellRelinkAlg',
119 ClustersInput = flags.Tau.ActiveConfig.TauPi0Clusters_tmp,
120 ClustersOutput = flags.Tau.ActiveConfig.TauPi0Clusters,
121 CellLinksOutput = flags.Tau.ActiveConfig.TauPi0ClustersLinks)
122 result.addEventAlgo(relinkAlg)
131 import tauRec.TauToolHolder
as tauTools
135 tools.append( result.popToolsAndMerge(tauTools.Pi0ClusterCreatorCfg(flags)) )
136 tools.append( result.popToolsAndMerge(tauTools.Pi0ClusterScalerCfg(flags)) )
137 tools.append( result.popToolsAndMerge(tauTools.Pi0ScoreCalculatorCfg(flags)) )
138 tools.append( result.popToolsAndMerge(tauTools.Pi0SelectorCfg(flags)) )
140 if flags.Tau.isStandalone
or flags.Tracking.doVertexFinding:
141 tools.append(result.popToolsAndMerge(tauTools.TauVertexVariablesCfg(flags)) )
143 tools.append( result.popToolsAndMerge(tauTools.TauCommonCalcVarsCfg(flags)) )
144 tools.append( result.popToolsAndMerge(tauTools.TauSubstructureCfg(flags)) )
146 if flags.Tau.doPanTau:
147 import PanTauAlgs.JobOptions_Main_PanTau_New
as pantau
148 tools.append( result.popToolsAndMerge(pantau.PanTauCfg(flags)) )
150 tools.append(result.popToolsAndMerge(tauTools.TauCombinedTESCfg(flags)) )
152 if flags.Beam.Type
is not BeamType.Cosmics:
153 tools.append( result.popToolsAndMerge(tauTools.MvaTESVariableDecoratorCfg(flags)) )
154 tools.append( result.popToolsAndMerge(tauTools.MvaTESEvaluatorCfg(flags)) )
156 tools.append( result.popToolsAndMerge(tauTools.TauAODSelectorCfg(flags)) )
158 if flags.Tau.doTauDiscriminant:
159 tools.append( result.popToolsAndMerge(tauTools.TauIDVarCalculatorCfg(flags)) )
160 tools.append( result.popToolsAndMerge(tauTools.TauJetRNNEvaluatorCfg(flags)) )
161 tools.append( result.popToolsAndMerge(tauTools.TauWPDecoratorJetRNNCfg(flags)) )
162 tools.append( result.popToolsAndMerge(tauTools.TauEleRNNEvaluatorCfg(flags)) )
163 tools.append( result.popToolsAndMerge(tauTools.TauWPDecoratorEleRNNCfg(flags)) )
164 tools.append( result.popToolsAndMerge(tauTools.TauDecayModeNNClassifierCfg(flags)) )
166 TauRunnerAlg = CompFactory.getComp(
"TauRunnerAlg")
167 RunnerAlg =
TauRunnerAlg(name = flags.Tau.ActiveConfig.prefix+
"TauRecRunnerAlg",
168 Key_tauInputContainer = flags.Tau.ActiveConfig.TauJets_tmp,
169 Key_Pi0ClusterInputContainer = flags.Tau.ActiveConfig.TauPi0Clusters,
170 Key_tauOutputContainer = flags.Tau.ActiveConfig.TauJets,
171 Key_neutralPFOOutputContainer = flags.Tau.ActiveConfig.TauNeutralPFOs,
172 Key_hadronicPFOOutputContainer = flags.Tau.ActiveConfig.TauHadronicPFOs,
173 Key_chargedPFOOutputContainer = flags.Tau.ActiveConfig.TauChargedPFOs,
174 Key_vertexOutputContainer = flags.Tau.ActiveConfig.TauSecondaryVertices,
175 Key_pi0Container = flags.Tau.ActiveConfig.TauFinalPi0s,
178 result.addEventAlgo(RunnerAlg)
184 from OutputStreamAthenaPool.OutputStreamConfig
import addToESD,addToAOD
189 TauAODList += [
"xAOD::TauJetContainer#{}" .
format(flags.Tau.ActiveConfig.TauJets) ]
190 TauAODList += [
"xAOD::TauTrackContainer#{}" .
format(flags.Tau.ActiveConfig.TauTracks) ]
191 TauAODList += [
"xAOD::TauTrackAuxContainer#{}Aux." .
format(flags.Tau.ActiveConfig.TauTracks) ]
192 TauAODList += [
"xAOD::VertexContainer#{}" .
format(flags.Tau.ActiveConfig.TauSecondaryVertices) ]
193 TauAODList += [
"xAOD::VertexAuxContainer#{}Aux.-vxTrackAtVertex".
format(flags.Tau.ActiveConfig.TauSecondaryVertices) ]
194 TauAODList += [
"xAOD::CaloClusterContainer#{}" .
format(flags.Tau.ActiveConfig.TauPi0Clusters) ]
195 TauAODList += [
"xAOD::CaloClusterAuxContainer#{}Aux." .
format(flags.Tau.ActiveConfig.TauPi0Clusters) ]
196 TauAODList += [
"CaloClusterCellLinkContainer#{}_links".
format(flags.Tau.ActiveConfig.TauPi0Clusters) ]
197 TauAODList += [
"xAOD::CaloClusterContainer#{}" .
format(flags.Tau.ActiveConfig.TauShotClusters)]
198 TauAODList += [
"xAOD::CaloClusterAuxContainer#{}Aux." .
format(flags.Tau.ActiveConfig.TauShotClusters)]
199 TauAODList += [
"CaloClusterCellLinkContainer#{}_links".
format(flags.Tau.ActiveConfig.TauShotClusters) ]
200 TauAODList += [
"xAOD::ParticleContainer#{}" .
format(flags.Tau.ActiveConfig.TauFinalPi0s) ]
201 TauAODList += [
"xAOD::ParticleAuxContainer#{}Aux." .
format(flags.Tau.ActiveConfig.TauFinalPi0s) ]
202 TauAODList += [
"xAOD::PFOContainer#{}" .
format(flags.Tau.ActiveConfig.TauShotPFOs) ]
203 TauAODList += [
"xAOD::PFOAuxContainer#{}Aux." .
format(flags.Tau.ActiveConfig.TauShotPFOs) ]
204 TauAODList += [
"xAOD::PFOContainer#{}" .
format(flags.Tau.ActiveConfig.TauNeutralPFOs) ]
205 TauAODList += [
"xAOD::PFOAuxContainer#{}Aux." .
format(flags.Tau.ActiveConfig.TauNeutralPFOs) ]
206 TauAODList += [
"xAOD::PFOContainer#{}" .
format(flags.Tau.ActiveConfig.TauHadronicPFOs) ]
207 TauAODList += [
"xAOD::PFOAuxContainer#{}Aux." .
format(flags.Tau.ActiveConfig.TauHadronicPFOs) ]
210 TauESDList =
list(TauAODList)
214 TauAODList += [
"xAOD::TauJetAuxContainer#{}Aux.-VertexedClusters.-mu.-nVtxPU.-ABS_ETA_LEAD_TRACK.-TAU_ABSDELTAPHI.-TAU_ABSDELTAETA.-absipSigLeadTrk.-passThinning.-chargedGlobalFELinks.-neutralGlobalFELinks"
215 .
format(flags.Tau.ActiveConfig.TauJets) ]
219 TauESDList += [
"xAOD::TauJetAuxContainer#{}Aux.-VertexedClusters.-chargedGlobalFELinks.-neutralGlobalFELinks".
format(flags.Tau.ActiveConfig.TauJets) ]
220 TauESDList += [
"xAOD::PFOContainer#{}" .
format(flags.Tau.ActiveConfig.TauChargedPFOs) ]
221 TauESDList += [
"xAOD::PFOAuxContainer#{}Aux." .
format(flags.Tau.ActiveConfig.TauChargedPFOs) ]
223 result.merge(
addToESD(flags,TauESDList))
224 result.merge(
addToAOD(flags,TauAODList))
230 from OutputStreamAthenaPool.OutputStreamConfig
import addToESD,addToAOD
233 DiTauOutputList = [
"xAOD::DiTauJetContainer#DiTauJets" ]
234 DiTauOutputList += [
"xAOD::DiTauJetAuxContainer#DiTauJetsAux." ]
236 result.merge(
addToESD(flags,DiTauOutputList))
237 result.merge(
addToAOD(flags,DiTauOutputList))
245 tauThinAlg = CompFactory.TauThinningAlg(name = flags.Tau.ActiveConfig.prefix+
"TauThinningAlg",
246 Taus = flags.Tau.ActiveConfig.TauJets,
247 TauTracks = flags.Tau.ActiveConfig.TauTracks,
248 TauNeutralPFOs = flags.Tau.ActiveConfig.TauNeutralPFOs,
249 TauPi0Clusters = flags.Tau.ActiveConfig.TauPi0Clusters,
250 TauPi0CellLinks = flags.Tau.ActiveConfig.TauPi0ClustersLinks,
251 TauFinalPi0s = flags.Tau.ActiveConfig.TauFinalPi0s,
252 TauShotPFOs = flags.Tau.ActiveConfig.TauShotPFOs,
253 TauShotClusters = flags.Tau.ActiveConfig.TauShotClusters,
254 TauShotCellLinks = flags.Tau.ActiveConfig.TauShotClustersLinks,
255 TauHadronicPFOs = flags.Tau.ActiveConfig.TauHadronicPFOs,
256 TauSecondaryVertices = flags.Tau.ActiveConfig.TauSecondaryVertices)
257 result.addEventAlgo(tauThinAlg)
266 flags_TauRec = flags.cloneAndReplace(
"Tau.ActiveConfig",
"Tau.TauRec")
274 if (flags.Output.doWriteESD
or flags.Output.doWriteAOD):
277 if (flags.Output.doWriteAOD
and flags.Tau.ThinTaus):
281 if flags.Tau.doTauEleRMRec:
283 flags_TauEleRM = flags.cloneAndReplace(
"Tau.ActiveConfig",
"Tau.TauEleRM")
288 from JetRecConfig.JetRecConfig
import JetRecCfg
289 from JetRecConfig.StandardSmallRJets
import AntiKt4LCTopo
290 AntiKt4LCTopo_EleRM = AntiKt4LCTopo.clone(suffix=
"_EleRM")
291 AntiKt4LCTopo_EleRM.inputdef.name = flags_TauEleRM.Tau.ActiveConfig.LCTopoOrigin_EleRM
292 AntiKt4LCTopo_EleRM.inputdef.inputname = flags_TauEleRM.Tau.ActiveConfig.CaloCalTopoClusters_EleRM
293 AntiKt4LCTopo_EleRM.inputdef.containername = flags_TauEleRM.Tau.ActiveConfig.LCOriginTopoClusters_EleRM
294 AntiKt4LCTopo_EleRM.standardRecoMode =
True
295 AntiKt4LCTopo_EleRM.context =
"EleRM"
297 result.merge(
JetRecCfg(flags_TauEleRM, AntiKt4LCTopo_EleRM))
305 if (flags.Output.doWriteESD
or flags.Output.doWriteAOD):
308 if (flags.Output.doWriteAOD
and flags.Tau.ThinTaus):
312 if flags.Tau.doDiTauRec:
313 from DiTauRec.DiTauBuilderConfig
import DiTauBuilderCfg
316 if (flags.Output.doWriteESD
or flags.Output.doWriteAOD):
326 from ElectronPhotonSelectorTools.AsgElectronLikelihoodToolsConfig
import AsgElectronLikelihoodToolCfg
327 from ElectronPhotonSelectorTools.LikelihoodEnums
import LikeEnum
328 from ElectronPhotonSelectorTools.ElectronLikelihoodToolMapping
import electronLHmenu
329 ElectronLHSelectorEleRM = result.popToolsAndMerge(
332 name = flags.Tau.ActiveConfig.prefix+
"ElectronLHSelector",
333 quality = getattr(LikeEnum, flags.Tau.ActiveConfig.EleRM_ElectronWorkingPoint),
334 menu = electronLHmenu.offlineMC21,
338 tauElecSubtractAlg = CompFactory.TauElecSubtractAlg(
339 name = flags.Tau.ActiveConfig.prefix+
"TauElecSubtractAlg",
340 Key_ElectronsInput =
'Electrons',
341 Key_ClustersInput =
'CaloCalTopoClusters',
342 Key_ClustersOutput = flags.Tau.ActiveConfig.CaloCalTopoClusters_EleRM,
343 Key_IDTracksInput =
'InDetTrackParticles',
344 Key_IDTracksOutput = flags.Tau.ActiveConfig.TrackCollection,
345 Key_RemovedClustersOutput = flags.Tau.ActiveConfig.RemovedElectronClusters,
346 Key_RemovedTracksOutput = flags.Tau.ActiveConfig.RemovedElectronTracks,
347 ElectronLHTool = ElectronLHSelectorEleRM,
350 result.addEventAlgo(tauElecSubtractAlg)
357 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
365 flags.Input.Files = [
"/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/RecExRecoTest/mc21_13p6TeV/ESDFiles/mc21_13p6TeV.421450.PhPy8EG_A14_ttbar_hdamp258p75_SingleLep_fct.recon.ESD.e8445_e8447_s3822_r13565/ESD.28877240._000046.pool.root.1"]
366 flags.IOVDb.GlobalTag =
"OFLCOND-MC21-SDR-RUN3-10"
368 flags.Output.ESDFileName =
"ESD.pool.root"
369 flags.Output.AODFileName =
"AOD.pool.root"
370 flags.Exec.MaxEvents = 10
372 flags.Scheduler.ShowDataDeps =
True
373 flags.Scheduler.ShowDataFlow =
True
374 flags.Scheduler.ShowControlFlow =
True
383 flags.Concurrency.NumThreads = 1
384 flags.Concurrency.NumConcurrentEvents = 1
388 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
391 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
395 loadFromSG = [(
'xAOD::EventInfo',
'StoreGateSvc+EventInfo'),
396 (
'AthenaAttributeList' ,
'StoreGateSvc+Input' ),
397 (
'CaloCellContainer' ,
'StoreGateSvc+AllCalo' )]
398 cfg.addEventAlgo(CompFactory.SGInputLoader(Load=loadFromSG), sequenceName=
"AthAlgSeq")
402 from SGComps.AddressRemappingConfig
import AddressRemappingCfg
403 rename_maps = [
'%s#%s->%s' % (
"xAOD::TauJetContainer",
"TauJets",
"old_TauJets"),
404 '%s#%s->%s' % (
"xAOD::TauJetAuxContainer",
"TauJetsAux.",
"old_TauJetsAux.")]
409 if __name__==
"__main__":