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))
28 if "MuonTPThinningToolName" in kwargs:
29 acc.merge(MuonTrackParticleThinningCfg(
31 name = kwargs[
'MuonTPThinningToolName'],
32 StreamName = StreamName,
34 InDetTrackParticlesKey =
"InDetTrackParticles"))
37 if "TauJetThinningToolName" in kwargs:
38 if "PHYSLITE" in StreamName:
39 tau_thinning_expression = f
"TauJets.pt >= {flags.Tau.MinPtLITE} && (TauJets.nTracks == 1 || TauJets.nTracks == 3) && abs(TauJets.charge) == 1"
41 tau_thinning_expression = f
"TauJets.pt >= {flags.Tau.MinPtDAOD} && TauJets.nTracks <= {flags.Tau.MaxTracksDAOD}"
43 acc.merge(TauThinningCfg(flags,
44 name = kwargs[
'TauJetThinningToolName'],
45 StreamName = StreamName,
47 TauTracks =
"TauTracks",
48 TrackParticles =
"InDetTrackParticles",
49 TauNeutralPFOs =
"TauNeutralParticleFlowObjects",
50 TauSecondaryVertices =
"TauSecondaryVertices",
51 SelectionString = tau_thinning_expression))
53 if "TauJets_MuonRMThinningToolName" in kwargs:
54 tau_murm_thinning_expression = tau_thinning_expression.replace(
'TauJets',
'TauJets_MuonRM')
55 acc.merge(TauThinningCfg(flags,
56 name = kwargs[
'TauJets_MuonRMThinningToolName'],
57 StreamName = StreamName,
58 Taus =
"TauJets_MuonRM",
59 TauTracks =
"TauTracks_MuonRM",
60 TrackParticles =
"InDetTrackParticles",
61 TauNeutralPFOs =
"TauNeutralParticleFlowObjects_MuonRM",
62 TauSecondaryVertices =
"TauSecondaryVertices_MuonRM",
63 SelectionString = tau_murm_thinning_expression))
65 if "TauJets_EleRMThinningToolName" in kwargs:
66 tau_erm_thinning_expression = tau_thinning_expression.replace(
'TauJets',
'TauJets_EleRM')
67 acc.merge(TauThinningCfg(flags,
68 name = kwargs[
'TauJets_EleRMThinningToolName'],
69 StreamName = StreamName,
70 Taus =
"TauJets_EleRM",
71 TauTracks =
"TauTracks_EleRM",
72 TrackParticles =
"InDetTrackParticles",
73 TauNeutralPFOs =
"TauNeutralParticleFlowObjects_EleRM",
74 TauSecondaryVertices =
"TauSecondaryVertices_EleRM",
75 SelectionString = tau_erm_thinning_expression))
78 if "DiTauThinningToolName" in kwargs:
79 acc.merge(GenericObjectThinningCfg(
81 name = kwargs[
'DiTauThinningToolName'],
82 StreamName = StreamName,
83 ContainerName =
"DiTauJets",
84 SelectionString =
"DiTauJets.nSubjets > 1 && abs(DiTauJets.charge) < 3"))
87 if "DiTauTPThinningToolName" in kwargs:
88 acc.merge(DiTauTrackParticleThinningCfg(
90 name = kwargs[
'DiTauTPThinningToolName'],
91 StreamName = StreamName,
92 DiTauKey =
"DiTauJets",
93 InDetTrackParticlesKey =
"InDetTrackParticles",
94 SelectionString =
"DiTauJets.nSubjets > 1 && abs(DiTauJets.charge) < 3"))
97 if "DiTauLowPtThinningToolName" in kwargs:
98 acc.merge(GenericObjectThinningCfg(
100 name = kwargs[
'DiTauLowPtThinningToolName'],
101 StreamName = StreamName,
102 ContainerName =
"DiTauJetsLowPt",
103 SelectionString =
"DiTauJetsLowPt.nSubjets > 1 && (DiTauJetsLowPt.charge == 0 || abs(DiTauJetsLowPt.charge) == 2)"))
106 if "DiTauLowPtTPThinningToolName" in kwargs:
107 acc.merge(DiTauTrackParticleThinningCfg(
109 name = kwargs[
'DiTauLowPtTPThinningToolName'],
110 StreamName = StreamName,
111 DiTauKey =
"DiTauJetsLowPt",
112 InDetTrackParticlesKey =
"InDetTrackParticles",
113 SelectionString =
"DiTauJetsLowPt.nSubjets > 1 && (DiTauJetsLowPt.charge == 0 || abs(DiTauJetsLowPt.charge) == 2)"))
116 if "ElectronCaloClusterThinningToolName" in kwargs:
117 acc.merge(CaloClusterThinningCfg(
119 name = kwargs[
'ElectronCaloClusterThinningToolName'],
120 StreamName = StreamName,
121 SGKey =
"AnalysisElectrons",
122 CaloClCollectionSGKey =
"egammaClusters",
126 if "PhotonCaloClusterThinningToolName" in kwargs:
127 acc.merge(CaloClusterThinningCfg(
129 name = kwargs[
'PhotonCaloClusterThinningToolName'],
130 StreamName = StreamName,
131 SGKey =
"AnalysisPhotons",
132 CaloClCollectionSGKey =
"egammaClusters",
136 if "ElectronGSFTPThinningToolName" in kwargs:
137 ElectronGSFTPThinningTool = CompFactory.DerivationFramework.EgammaTrackParticleThinning(
138 name = kwargs[
'ElectronGSFTPThinningToolName'],
139 StreamName = StreamName,
140 SGKey =
"AnalysisElectrons",
141 GSFTrackParticlesKey =
"GSFTrackParticles",
142 InDetTrackParticlesKey =
"",
143 BestMatchOnly =
True)
144 acc.addPublicTool(ElectronGSFTPThinningTool)
147 if "PhotonGSFTPThinningToolName" in kwargs:
148 PhotonGSFTPThinningTool = CompFactory.DerivationFramework.EgammaTrackParticleThinning(
149 name = kwargs[
'PhotonGSFTPThinningToolName'],
150 StreamName = StreamName,
151 SGKey =
"AnalysisPhotons",
152 GSFTrackParticlesKey =
"GSFTrackParticles",
153 GSFConversionVerticesKey =
"GSFConversionVertices",
154 InDetTrackParticlesKey =
"",
155 BestMatchOnly =
True,
156 BestVtxMatchOnly =
True)
157 acc.addPublicTool(PhotonGSFTPThinningTool)