15 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import (BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg, BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg)
16 from JpsiUpsilonTools.JpsiUpsilonToolsConfig
import PrimaryVertexRefittingToolCfg
17 from DerivationFrameworkEGamma.EGammaCommonConfig
import EGammaCommonCfg
18 from AthenaServices.PartPropSvcConfig
import PartPropSvcCfg
21 PartPropSvcName = acc.getPrimaryAndMerge(
PartPropSvcCfg(flags)).name
23 isSimulation = flags.Input.isMC
24 V0Tools = acc.popToolsAndMerge(
BPHY_V0ToolCfg(flags, BPHYDerivationName))
26 acc.addPublicTool(vkalvrt)
27 acc.addPublicTool(V0Tools)
29 acc.addPublicTool(trackselect)
31 acc.addPublicTool(vpest)
37 ElectronLHSelectorLHvloose_nod0 = CompFactory.AsgElectronLikelihoodTool(
"ElectronLHSelectorLHvloosenod0",
38 primaryVertexContainer =
"PrimaryVertices",
39 ConfigFile=
"ElectronPhotonSelectorTools/offline/mc20_20230321/ElectronLikelihoodVeryLooseOfflineConfig2017_Smooth_NoD0_NoPix.conf")
43 ElectronPassLHvloosenod0 = CompFactory.DerivationFramework.EGElectronLikelihoodToolWrapper(name =
"ElectronPassLHvloosenod0",
44 EGammaElectronLikelihoodTool = ElectronLHSelectorLHvloose_nod0,
45 EGammaFudgeMCTool =
"",
47 StoreGateEntryName =
"DFCommonElectronsLHVeryLoosenod0",
48 ContainerName =
"Electrons",
51 BPHY18DiElectronFinder = CompFactory.Analysis.JpsiFinder_ee(
52 name =
"BPHY18DiElectronFinder",
55 TrackAndTrack =
False,
56 assumeDiElectrons =
True,
57 elThresholdPt = 4000.0,
58 invMassUpper = 7000.0,
61 oppChargesOnly =
False,
62 allChargeCombinations =
True,
63 useElectronTrackMeasurement =
True,
64 electronCollectionKey =
"Electrons",
65 TrackParticleCollection =
"GSFTrackParticles",
67 V0VertexFitterTool =
None,
69 TrkVertexFitterTool = vkalvrt,
70 TrackSelectorTool = trackselect,
71 VertexPointEstimator = vpest,
72 ElectronSelection =
"d0_or_nod0",
73 PartPropSvc = PartPropSvcName
75 extraTools = [BPHY18DiElectronFinder]
76 BPHY18DiElectronSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
77 name =
"BPHY18DiElectronSelectAndWrite",
78 VertexSearchTool = BPHY18DiElectronFinder,
79 OutputVtxContainerName =
"BPHY18DiElectronCandidates",
80 PVContainerName =
"PrimaryVertices",
83 RefPVContainerName =
"SHOULDNOTBEUSED",
87 BPHY18_Select_DiElectrons = CompFactory.DerivationFramework.Select_onia2mumu(
88 name =
"BPHY18_Select_DiElectrons",
89 HypothesisName =
"Jpsi",
90 InputVtxContainerName =
"BPHY18DiElectronCandidates",
92 VtxMassHypo = 3096.916,
99 BPHY18BeeKst = CompFactory.Analysis.JpsiPlus2Tracks(
100 name =
"BPHY18BeeKstFinder",
101 kaonkaonHypothesis =
False,
102 pionpionHypothesis =
False,
103 kaonpionHypothesis =
True,
104 oppChargesOnly =
False,
105 SameChargesOnly =
False,
106 trkThresholdPt = 500.0,
108 BThresholdPt = 1000.,
111 JpsiContainerKey =
"BPHY18DiElectronCandidates",
112 TrackParticleCollection =
"InDetTrackParticles",
113 ExcludeCrossJpsiTracks =
False,
114 TrkVertexFitterTool = vkalvrt,
115 TrackSelectorTool = trackselect,
116 UseMassConstraint =
False,
117 DiTrackMassUpper = 1110.,
118 DiTrackMassLower = 690.,
121 TrkQuadrupletMassLower = 1000.0,
122 TrkQuadrupletMassUpper = 10000.0,
123 FinalDiTrackPt = 500.,
124 UseGSFTrackIndices = [0,1]
126 BPHY18BeeKstSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
127 name =
"BPHY18BeeKstSelectAndWrite",
128 VertexSearchTool = BPHY18BeeKst,
129 OutputVtxContainerName =
"BeeKstCandidates",
130 PVContainerName =
"PrimaryVertices",
131 RefPVContainerName =
"BPHY18RefittedPrimaryVertices",
139 BPHY18_Select_BeeKst = CompFactory.DerivationFramework.Select_onia2mumu(
140 name =
"BPHY18_Select_BeeKst",
141 HypothesisName =
"Bd",
142 InputVtxContainerName =
"BeeKstCandidates",
144 TrkMasses = [0.511, 0.511, 493.677, 139.570],
145 VtxMassHypo = 5279.6,
151 BPHY18_Select_BeeKstbar = CompFactory.DerivationFramework.Select_onia2mumu(
152 name =
"BPHY18_Select_Bd2JpsiKstbar",
153 HypothesisName =
"Bdbar",
154 InputVtxContainerName =
"BeeKstCandidates",
156 TrkMasses = [0.511, 0.511, 139.570, 493.677],
157 VtxMassHypo = 5279.6,
164 BPHY18_diMeson_revertex = CompFactory.DerivationFramework.ReVertex(
165 name =
"BPHY18_diMeson_revertex",
166 InputVtxContainerName =
"BeeKstCandidates",
169 TrackIndices = [ 2, 3 ],
170 TrkVertexFitterTool = vkalvrt,
171 OutputVtxContainerName =
"BPHY18DiMeson"
174 BPHY18_Select_Kpi = CompFactory.DerivationFramework.Select_onia2mumu(
175 name =
"BPHY18_Select_Kpi",
176 HypothesisName =
"Kpi",
177 InputVtxContainerName =
"BPHY18DiMeson",
179 TrkMasses = [ 493.677, 139.570 ],
180 VtxMassHypo = 891.66,
186 BPHY18_Select_piK = CompFactory.DerivationFramework.Select_onia2mumu(
187 name =
"BPHY18_Select_piK",
188 HypothesisName =
"piK",
189 InputVtxContainerName =
"BPHY18DiMeson",
191 TrkMasses = [ 139.570, 493.677 ],
192 VtxMassHypo = 891.66,
198 BPHY18_SelectBeeKstEvent = CompFactory.DerivationFramework.xAODStringSkimmingTool(
199 name =
"BPHY18_SelectBeeKstEvent",
200 expression =
"(count(BeeKstCandidates.passed_Bd > 0) + count(BeeKstCandidates.passed_Bdbar > 0)) > 0")
202 BPHY18SkimmingAND = CompFactory.DerivationFramework.FilterCombinationAND(
205 FilterList = [BPHY18_SelectBeeKstEvent])
206 extraTools += [BPHY18_SelectBeeKstEvent, BPHY18SkimmingAND]
207 BPHY18_thinningTool_Tracks = CompFactory.DerivationFramework.Thin_vtxTrk(
208 name =
"BPHY18_thinningTool_Tracks",
209 TrackParticleContainerName =
"InDetTrackParticles",
210 StreamName = streamName,
211 VertexContainerNames = [
"BeeKstCandidates"],
212 PassFlags = [
"passed_Bd",
"passed_Bdbar"] )
214 BPHY18_thinningTool_GSFTracks = CompFactory.DerivationFramework.Thin_vtxTrk(
215 name =
"BPHY18_thinningTool_GSFTracks",
216 TrackParticleContainerName =
"GSFTrackParticles",
217 StreamName = streamName,
218 VertexContainerNames = [
"BeeKstCandidates"],
219 PassFlags = [
"passed_Bd",
"passed_Bdbar"] )
221 BPHY18_thinningTool_PV = CompFactory.DerivationFramework.BPhysPVThinningTool(
222 name =
"BPHY18_thinningTool_PV",
223 StreamName = streamName,
224 CandidateCollections = [
"BeeKstCandidates"],
228 BPHY18MuonTPThinningTool = CompFactory.DerivationFramework.MuonTrackParticleThinning(
229 name =
"BPHY18MuonTPThinningTool",
230 StreamName = streamName,
232 InDetTrackParticlesKey =
"InDetTrackParticles")
234 BPHY18EgammaTPThinningTool = CompFactory.DerivationFramework.EgammaTrackParticleThinning(
235 name =
"BPHY18EgammaTPThinningTool",
236 StreamName = streamName,
238 InDetTrackParticlesKey =
"InDetTrackParticles")
240 BPHY18TruthThinTool = CompFactory.DerivationFramework.GenericTruthThinning(name =
"BPHY18TruthThinTool",
241 ParticleSelectionString =
"abs(TruthParticles.pdgId) == 11 || abs(TruthParticles.pdgId) == 13 || abs(TruthParticles.pdgId) == 10311 || abs(TruthParticles.pdgId) == 521 || abs(TruthParticles.pdgId) == 523 || abs(TruthParticles.pdgId) == 511 || abs(TruthParticles.pdgId) == 513",
242 PreserveDescendants =
True,
243 StreamName = streamName,
244 PreserveAncestors =
True)
246 BPHY18TruthThinNoChainTool = CompFactory.DerivationFramework.GenericTruthThinning(name =
"BPHY18TruthThinNoChainTool",
247 ParticleSelectionString =
"abs(TruthParticles.pdgId) == 5 || abs(TruthParticles.pdgId) == 12 || abs(TruthParticles.pdgId) == 14",
248 PreserveDescendants =
False,
249 StreamName = streamName,
250 PreserveAncestors =
False)
252 thinningCollection = [ BPHY18_thinningTool_Tracks, BPHY18_thinningTool_GSFTracks,
253 BPHY18_thinningTool_PV,
254 BPHY18EgammaTPThinningTool, BPHY18MuonTPThinningTool
258 augTools = [ElectronPassLHvloosenod0,
259 BPHY18DiElectronSelectAndWrite, BPHY18_Select_DiElectrons,
260 BPHY18BeeKstSelectAndWrite, BPHY18_Select_BeeKst, BPHY18_Select_BeeKstbar,
261 BPHY18_diMeson_revertex, BPHY18_Select_Kpi, BPHY18_Select_piK]
262 skimTools = [BPHY18SkimmingAND]
265 thinningCollection += [BPHY18TruthThinTool,BPHY18TruthThinNoChainTool]
267 for t
in augTools + skimTools + thinningCollection + extraTools: acc.addPublicTool(t)
268 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
"BPHY18Kernel",
269 AugmentationTools = augTools,
271 SkimmingTools = skimTools,
272 ThinningTools = thinningCollection))
274 from IsolationAlgs.DerivationTrackIsoConfig
import DerivationTrackIsoCfg
282 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
283 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
284 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
285 BPHY18SlimmingHelper =
SlimmingHelper(
"BPHY18SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
286 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import getDefaultAllVariables
290 BPHY18SlimmingHelper.SmartCollections = [
"Electrons",
"Muons",
"InDetTrackParticles" ]
293 BPHY18SlimmingHelper.IncludeMuonTriggerContent =
False
294 BPHY18SlimmingHelper.IncludeBPhysTriggerContent =
False
295 BPHY18SlimmingHelper.IncludeEGammaTriggerContent =
True
297 AllVariables += [
"PrimaryVertices"]
298 StaticContent += [
"xAOD::VertexContainer#BPHY18RefittedPrimaryVertices"]
299 StaticContent += [
"xAOD::VertexAuxContainer#BPHY18RefittedPrimaryVerticesAux."]
301 ExtraVariables += [
"Muons.etaLayer1Hits.etaLayer2Hits.etaLayer3Hits.etaLayer4Hits.phiLayer1Hits.phiLayer2Hits.phiLayer3Hits.phiLayer4Hits",
302 "Muons.numberOfTriggerEtaLayers.numberOfPhiLayers",
303 "InDetTrackParticles.numberOfTRTHits.numberOfTRTHighThresholdHits.vx.vy.vz.pixeldEdx",
304 "PrimaryVertices.chiSquared.covariance",
305 "Electrons.deltaEta1.DFCommonElectronsLHVeryLoosenod0.ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt1000.ptvarcone20_Nonprompt_All_MaxWeightTTVA_pt1000.ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt500.ptvarcone40_Nonprompt_All_MaxWeightTTVALooseCone_pt1000.ptvarcone20_Nonprompt_All_MaxWeightTTVALooseCone_pt1000",
306 "egammaClusters.calE.calEta.calPhi.e_sampl.eta_sampl.etaCalo.phiCalo.ETACALOFRAME.PHICALOFRAME",
307 "HLT_xAOD__ElectronContainer_egamma_ElectronsAuxDyn.charge"]
310 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY18DiElectronSelectAndWrite.OutputVtxContainerName]
311 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY18DiElectronSelectAndWrite.OutputVtxContainerName]
313 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY18BeeKstSelectAndWrite.OutputVtxContainerName]
314 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY18BeeKstSelectAndWrite.OutputVtxContainerName]
316 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY18_diMeson_revertex.OutputVtxContainerName]
317 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY18_diMeson_revertex.OutputVtxContainerName]
319 AllVariables += [
"GSFTrackParticles"]
324 AllVariables += [
"TruthEvents",
"TruthParticles",
"TruthVertices",
"ElectronTruthParticles"]
326 AllVariables =
list(
set(AllVariables))
328 BPHY18SlimmingHelper.AllVariables = AllVariables
329 BPHY18SlimmingHelper.ExtraVariables = ExtraVariables
331 BPHY18SlimmingHelper.StaticContent = StaticContent
333 from DerivationFrameworkEGamma.ElectronsCPDetailedContent
import ElectronsCPDetailedContent, GSFTracksCPDetailedContent
334 BPHY18SlimmingHelper.ExtraVariables += ElectronsCPDetailedContent
335 BPHY18SlimmingHelper.ExtraVariables += GSFTracksCPDetailedContent
337 BPHY18ItemList = BPHY18SlimmingHelper.GetItemList()
338 acc.merge(
OutputStreamCfg(flags,
"DAOD_BPHY18", ItemList=BPHY18ItemList, AcceptAlgs=[
"BPHY18Kernel"]))
339 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_BPHY18", AcceptAlgs=[
"BPHY18Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
340 acc.printConfig(withDetails=
True, summariseProps=
True, onlyComponents = [], printDefaults=
True, printComponentsOnly=
False)