18 """Configure the derivation framework driving algorithm (kernel) for HIGG1D2"""
22 from DerivationFrameworkPhys.PhysCommonConfig
import PhysCommonAugmentationsCfg
26 from DerivationFrameworkCalo.DerivationFrameworkCaloConfig
import (
27 CaloDecoratorKernelCfg)
31 from DerivationFrameworkInDet.InDetToolsConfig
import TrackParticleThinningCfg, MuonTrackParticleThinningCfg
32 from DerivationFrameworkMCTruth.TruthDerivationToolsConfig
import GenericTruthThinningCfg
36 HIGG1D2_thinning_expression =
"InDetTrackParticles.DFCommonTightPrimary && abs(DFCommonInDetTrackZ0AtPV)*sin(InDetTrackParticles.theta) < 3.0*mm && InDetTrackParticles.pt > 10*GeV"
40 name =
"HIGG1D2TrackParticleThinningTool",
41 StreamName = kwargs[
'StreamName'],
42 SelectionString = HIGG1D2_thinning_expression,
43 InDetTrackParticlesKey =
"InDetTrackParticles"))
46 HIGG1D2MuonTPThinningTool = acc.getPrimaryAndMerge(
49 name =
"HIGG1D2MuonTPThinningTool",
50 StreamName = kwargs[
'StreamName'],
52 InDetTrackParticlesKey =
"InDetTrackParticles"
57 HIGG1D2ElectronTPThinningTool = (
58 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
59 name =
"HIGG1D2ElectronTPThinningTool",
60 StreamName = kwargs[
'StreamName'],
65 acc.addPublicTool(HIGG1D2ElectronTPThinningTool)
68 HIGG1D2PhotonTPThinningTool = (
69 CompFactory.DerivationFramework.EgammaTrackParticleThinning(
70 name =
"HIGG1D2PhotonTPThinningTool",
71 StreamName = kwargs[
'StreamName'],
73 GSFConversionVerticesKey =
"GSFConversionVertices",
77 acc.addPublicTool(HIGG1D2PhotonTPThinningTool)
80 from DerivationFrameworkCalo.DerivationFrameworkCaloConfig
import CaloClusterThinningCfg
82 HIGG1D2CCTCThinningTool = acc.getPrimaryAndMerge(
85 name =
"HIGG1D2CCTCThinningTool",
86 StreamName = kwargs[
'StreamName'],
88 SelectionString =
"Electrons.pt>4*GeV",
89 TopoClCollectionSGKey =
"CaloCalTopoClusters",
94 thinningTools = [HIGG1D2TrackParticleThinningTool,
95 HIGG1D2MuonTPThinningTool,
96 HIGG1D2ElectronTPThinningTool,
97 HIGG1D2PhotonTPThinningTool,
98 HIGG1D2CCTCThinningTool]
101 from DerivationFrameworkEGamma.EGammaToolsConfig
import PhotonVertexSelectionWrapperKernelCfg
105 if flags.Input.isMC :
106 truth_cond_1 =
"((abs(TruthParticles.pdgId) >= 23) && (abs(TruthParticles.pdgId) <= 25))"
107 truth_cond_2 =
"((abs(TruthParticles.pdgId) >= 11) && (abs(TruthParticles.pdgId) <= 16))"
108 truth_cond_3 =
"((abs(TruthParticles.pdgId) == 6))"
109 truth_cond_4 =
"((abs(TruthParticles.pdgId) == 22) && (TruthParticles.pt > 1*GeV))"
110 truth_cond_finalState =
'(TruthParticles.isGenStable)'
111 truth_expression =
'('+truth_cond_1+
' || '+truth_cond_2 +
' || '+truth_cond_3 +
' || '+truth_cond_4+
') || ('+truth_cond_finalState+
')'
115 name =
"HIGG1D2GenericTruthThinningTool",
116 StreamName = kwargs[
'StreamName'],
117 ParticleSelectionString = truth_expression,
118 PreserveDescendants =
False,
119 PreserveGeneratorDescendants =
True,
120 PreserveAncestors =
True))
121 acc.addPublicTool(HIGG1D2GenericTruthThinningTool)
122 thinningTools.append(HIGG1D2GenericTruthThinningTool)
125 from DerivationFrameworkHiggs.SkimmingToolHIGG1Config
import SkimmingToolHIGG1Cfg
126 from DerivationFrameworkHiggs.HIGG1TriggerContent
import expressionTriggers, mergedTriggers
128 SkipTriggerRequirement = flags.Input.isMC
or not flags.Reco.EnableTrigger
132 if not SkipTriggerRequirement:
135 if float(flags.Beam.Energy) == 6500000.0:
138 elif float(flags.Beam.Energy) == 6800000.0:
142 TriggerExp = expressionTriggers[MenuType]
143 TriggerMerged = mergedTriggers[MenuType]
146 from ROOT
import egammaPID
148 MergedElectronIsEM = CompFactory.AsgElectronIsEMSelector(
"MergedElectronIsEM")
149 MergedElectronIsEM.ConfigFile =
"ElectronPhotonSelectorTools/trigger/rel21_20161021/ElectronIsEMMergedTightSelectorCutDefs.conf"
150 MergedElectronIsEM.isEMMask = egammaPID.ElectronTightHLT
151 acc.addPublicTool(MergedElectronIsEM)
155 name =
"HIGG1D2SkimmingTool",
157 ReqireLArError =
True,
158 RequireTrigger =
not SkipTriggerRequirement,
159 IncludeDoublePhotonPreselection =
False,
160 RequirePreselection =
False,
161 RequireKinematic =
False,
162 RequireQuality =
False,
163 RequireIsolation =
False,
164 RequireInvariantMass =
False,
165 Triggers = TriggerExp,
166 MergedElectronTriggers = TriggerMerged,
167 IncludeSingleElectronPreselection =
False,
168 IncludeDoubleElectronPreselection =
False,
169 IncludeSingleMuonPreselection =
False,
170 IncludePhotonDoubleElectronPreselection =
True,
171 IncludeDoubleMuonPreselection =
True,
172 IncludePhotonMergedElectronPreselection =
True,
173 IncludeHighPtPhotonElectronPreselection =
True,
174 MinimumPhotonPt = 9.9*GeV,
175 MinimumElectronPt = 4.4*GeV,
176 MinimumMergedElectronPt = 18*GeV,
177 MinimumMuonPt = 2.9*GeV,
181 MergedElectronCutTool = MergedElectronIsEM))
183 acc.addPublicTool(skimmingTool)
186 from DerivationFrameworkHiggs.MergedElectronConfig
import MergedElectronDetailsDecoratorCfg
188 name =
"HIGG1D2MergedElectronDetailsDecorator"))
189 augmentationTools = [HIGG1D2MergedElectronDetailsDecorator]
193 from IsolationSelection.IsolationSelectionConfig
import IsoCloseByAlgsCfg
194 contNames = [
"Muons",
"Electrons",
"Photons"]
195 acc.merge(
IsoCloseByAlgsCfg(flags, suff =
"_HIGG1D2", isPhysLite =
False, containerNames = contNames, stream_name = kwargs[
'StreamName']))
198 DerivationKernel = CompFactory.DerivationFramework.DerivationKernel
200 SkimmingTools = [skimmingTool],
201 ThinningTools = thinningTools,
202 AugmentationTools = augmentationTools))