10 """Configure the common augmentation"""
11 acc = ComponentAccumulator()
14 from DerivationFrameworkInDet.InDetToolsConfig
import TrackParticleThinningPHYSCfg, MuonTrackParticleThinningCfg, DiTauTrackParticleThinningCfg
15 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import GenericObjectThinningCfg
16 from DerivationFrameworkCalo.DerivationFrameworkCaloConfig
import CaloClusterThinningCfg
17 from DerivationFrameworkTau.TauCommonConfig
import TauThinningCfg
21 if "TrackParticleThinningToolName" in kwargs:
22 acc.merge(TrackParticleThinningPHYSCfg(
24 name = kwargs[
'TrackParticleThinningToolName'],
25 StreamName = StreamName,
26 Z0SGEntryName =
"DFCommonInDetTrackZ0AtPV",
27 InDetTrackParticlesKey =
"InDetTrackParticles"))
30 if "MuonTPThinningToolName" in kwargs:
31 acc.merge(MuonTrackParticleThinningCfg(
33 name = kwargs[
'MuonTPThinningToolName'],
34 StreamName = StreamName,
36 InDetTrackParticlesKey =
"InDetTrackParticles"))
39 if "TauJetThinningToolName" in kwargs:
40 if "PHYSLITE" in StreamName:
41 tau_thinning_expression = f
"TauJets.pt >= {flags.Tau.MinPtLITE} && (TauJets.nTracks == 1 || TauJets.nTracks == 3) && abs(TauJets.charge) == 1"
43 tau_thinning_expression = f
"TauJets.pt >= {flags.Tau.MinPtDAOD} && TauJets.nTracks <= {flags.Tau.MaxTracksDAOD}"
45 acc.merge(TauThinningCfg(flags,
46 name = kwargs[
'TauJetThinningToolName'],
47 StreamName = StreamName,
49 TauTracks =
"TauTracks",
50 TrackParticles =
"InDetTrackParticles",
51 TauNeutralPFOs =
"TauNeutralParticleFlowObjects",
52 TauSecondaryVertices =
"TauSecondaryVertices",
53 SelectionString = tau_thinning_expression))
55 if "TauJets_MuonRMThinningToolName" in kwargs:
56 tau_murm_thinning_expression = tau_thinning_expression.replace(
'TauJets',
'TauJets_MuonRM')
57 acc.merge(TauThinningCfg(flags,
58 name = kwargs[
'TauJets_MuonRMThinningToolName'],
59 StreamName = StreamName,
60 Taus =
"TauJets_MuonRM",
61 TauTracks =
"TauTracks_MuonRM",
62 TrackParticles =
"InDetTrackParticles",
63 TauNeutralPFOs =
"TauNeutralParticleFlowObjects_MuonRM",
64 TauSecondaryVertices =
"TauSecondaryVertices_MuonRM",
65 SelectionString = tau_murm_thinning_expression))
67 if "TauJets_EleRMThinningToolName" in kwargs:
68 tau_erm_thinning_expression = tau_thinning_expression.replace(
'TauJets',
'TauJets_EleRM')
69 acc.merge(TauThinningCfg(flags,
70 name = kwargs[
'TauJets_EleRMThinningToolName'],
71 StreamName = StreamName,
72 Taus =
"TauJets_EleRM",
73 TauTracks =
"TauTracks_EleRM",
74 TrackParticles =
"InDetTrackParticles",
75 TauNeutralPFOs =
"TauNeutralParticleFlowObjects_EleRM",
76 TauSecondaryVertices =
"TauSecondaryVertices_EleRM",
77 SelectionString = tau_erm_thinning_expression))
80 if "DiTauThinningToolName" in kwargs:
81 acc.merge(GenericObjectThinningCfg(
83 name = kwargs[
'DiTauThinningToolName'],
84 StreamName = StreamName,
85 ContainerName =
"DiTauJets",
86 SelectionString =
"DiTauJets.nSubjets > 1 && abs(DiTauJets.charge) < 3"))
89 if "DiTauTPThinningToolName" in kwargs:
90 acc.merge(DiTauTrackParticleThinningCfg(
92 name = kwargs[
'DiTauTPThinningToolName'],
93 StreamName = StreamName,
94 DiTauKey =
"DiTauJets",
95 InDetTrackParticlesKey =
"InDetTrackParticles",
96 SelectionString =
"DiTauJets.nSubjets > 1 && abs(DiTauJets.charge) < 3"))
99 if "DiTauLowPtThinningToolName" in kwargs:
100 acc.merge(GenericObjectThinningCfg(
102 name = kwargs[
'DiTauLowPtThinningToolName'],
103 StreamName = StreamName,
104 ContainerName =
"DiTauJetsLowPt",
105 SelectionString =
"DiTauJetsLowPt.nSubjets > 1 && (DiTauJetsLowPt.charge == 0 || abs(DiTauJetsLowPt.charge) == 2)"))
108 if "DiTauLowPtTPThinningToolName" in kwargs:
109 acc.merge(DiTauTrackParticleThinningCfg(
111 name = kwargs[
'DiTauLowPtTPThinningToolName'],
112 StreamName = StreamName,
113 DiTauKey =
"DiTauJetsLowPt",
114 InDetTrackParticlesKey =
"InDetTrackParticles",
115 SelectionString =
"DiTauJetsLowPt.nSubjets > 1 && (DiTauJetsLowPt.charge == 0 || abs(DiTauJetsLowPt.charge) == 2)"))
118 if "ElectronCaloClusterThinningToolName" in kwargs:
119 acc.merge(CaloClusterThinningCfg(
121 name = kwargs[
'ElectronCaloClusterThinningToolName'],
122 StreamName = StreamName,
123 SGKey =
"AnalysisElectrons",
124 CaloClCollectionSGKey =
"egammaClusters",
128 if "PhotonCaloClusterThinningToolName" in kwargs:
129 acc.merge(CaloClusterThinningCfg(
131 name = kwargs[
'PhotonCaloClusterThinningToolName'],
132 StreamName = StreamName,
133 SGKey =
"AnalysisPhotons",
134 CaloClCollectionSGKey =
"egammaClusters",
138 if "ElectronGSFTPThinningToolName" in kwargs:
139 ElectronGSFTPThinningTool = CompFactory.DerivationFramework.EgammaTrackParticleThinning(
140 name = kwargs[
'ElectronGSFTPThinningToolName'],
141 StreamName = StreamName,
142 SGKey =
"AnalysisElectrons",
143 GSFTrackParticlesKey =
"GSFTrackParticles",
144 InDetTrackParticlesKey =
"",
145 BestMatchOnly =
True)
146 acc.addPublicTool(ElectronGSFTPThinningTool)
149 if "PhotonGSFTPThinningToolName" in kwargs:
150 PhotonGSFTPThinningTool = CompFactory.DerivationFramework.EgammaTrackParticleThinning(
151 name = kwargs[
'PhotonGSFTPThinningToolName'],
152 StreamName = StreamName,
153 SGKey =
"AnalysisPhotons",
154 GSFTrackParticlesKey =
"GSFTrackParticles",
155 GSFConversionVerticesKey =
"GSFConversionVertices",
156 InDetTrackParticlesKey =
"",
157 BestMatchOnly =
True,
158 BestVtxMatchOnly =
True)
159 acc.addPublicTool(PhotonGSFTPThinningTool)