ATLAS Offline Software
Loading...
Searching...
No Matches
BPHY18 Namespace Reference

Functions

 BPHY18Cfg (flags)

Variables

str BPHYDerivationName = "BPHY18"
str streamName = "StreamDAOD_BPHY18"

Function Documentation

◆ BPHY18Cfg()

BPHY18.BPHY18Cfg ( flags)

Definition at line 14 of file BPHY18.py.

14def BPHY18Cfg(flags):
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
19
20 acc = ComponentAccumulator()
21 PartPropSvcName = acc.getPrimaryAndMerge(PartPropSvcCfg(flags))
22 acc.merge(EGammaCommonCfg(flags))
23 isSimulation = flags.Input.isMC
24 V0Tools = acc.popToolsAndMerge(BPHY_V0ToolCfg(flags, BPHYDerivationName))
25 vkalvrt = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName)) # VKalVrt vertex fitter
26 acc.addPublicTool(vkalvrt)
27 acc.addPublicTool(V0Tools)
28 trackselect = acc.popToolsAndMerge(BPHY_InDetDetailedTrackSelectorToolCfg(flags, BPHYDerivationName))
29 acc.addPublicTool(trackselect)
30 vpest = acc.popToolsAndMerge(BPHY_VertexPointEstimatorCfg(flags, BPHYDerivationName))
31 acc.addPublicTool(vpest)
32 PVrefit = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags))
33 acc.addPublicTool(PVrefit)
34 skimmingTools = []
35
36 if flags.Trigger.EDMVersion >= 0:
37 BPHY18TriggerSkim = CompFactory.DerivationFramework.TriggerSkimmingTool(
38 name = "BPHY18TriggerSkim",
39 TriggerListOR = [
40 "HLT_e5_lhvloose_e3_lhvloose_bBeeM6000_L1BKeePrimary",
41 "HLT_2e5_bBeeM6000_L1BKeePrimary",
42 "HLT_e5_lhvloose_bBeeM6000_L1BKeePrimary",
43 "HLT_e5_lhvloose_e3_lhvloose_bBeeM6000_L1BKeePrescaled",
44 "HLT_2e5_bBeeM6000_L1BKeePrescaled",
45 "HLT_e5_lhvloose_bBeeM6000_L1BKeePrescaled"
46 ]
47 )
48 skimmingTools += [BPHY18TriggerSkim]
49
50 ElectronLHSelectorLHvloose_nod0 = CompFactory.AsgElectronLikelihoodTool("ElectronLHSelectorLHvloosenod0",
51 primaryVertexContainer = "PrimaryVertices",
52 ConfigFile="ElectronPhotonSelectorTools/offline/mc20_20230321/ElectronLikelihoodVeryLooseOfflineConfig2017_Smooth_NoD0_NoPix.conf")
53
54 # decorate electrons with the output of LH
55 from DerivationFrameworkEGamma.EGammaToolsConfig import EGElectronLikelihoodToolWrapperCfg
56 ElectronPassLHvloosenod0 = acc.addPublicTool(acc.popToolsAndMerge(EGElectronLikelihoodToolWrapperCfg(flags, name = "ElectronPassLHvloosenod0",
57 EGammaElectronLikelihoodTool = ElectronLHSelectorLHvloose_nod0,
58 EGammaFudgeMCTool = "",
59 CutType = "",
60 StoreGateEntryName = "DFCommonElectronsLHVeryLoosenod0",
61 ContainerName = "Electrons",
62 StoreTResult=False)))
63
64 BPHY18DiElectronFinder = CompFactory.Analysis.JpsiFinder_ee(
65 name = "BPHY18DiElectronFinder",
66 elAndEl = True,
67 elAndTrack = False,
68 TrackAndTrack = False,
69 assumeDiElectrons = True,
70 elThresholdPt = 4000.0,
71 invMassUpper = 7000.0,
72 invMassLower = 1.0,
73 Chi2Cut = 30.,
74 oppChargesOnly = False,
75 allChargeCombinations = True,
76 useElectronTrackMeasurement = True,
77 electronCollectionKey = "Electrons",
78 TrackParticleCollection = "GSFTrackParticles",
79 useEgammaCuts = True,
80 TrkVertexFitterTool = vkalvrt,
81 TrackSelectorTool = trackselect,
82 VertexPointEstimator = vpest,
83 ElectronSelection = "d0_or_nod0",
84 PartPropSvc = PartPropSvcName
85 )
86 extraTools = [BPHY18DiElectronFinder]
87 BPHY18DiElectronSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
88 name = "BPHY18DiElectronSelectAndWrite",
89 VertexSearchTool = BPHY18DiElectronFinder,
90 OutputVtxContainerName = "BPHY18DiElectronCandidates",
91 PVContainerName = "PrimaryVertices",
92 V0Tools = V0Tools,
93 PVRefitter = PVrefit,
94 RefPVContainerName = "SHOULDNOTBEUSED",
95 DoVertexType = 7
96 )
97
98 BPHY18_Select_DiElectrons = CompFactory.DerivationFramework.Select_onia2mumu(
99 name = "BPHY18_Select_DiElectrons",
100 HypothesisName = "Jpsi",
101 InputVtxContainerName = "BPHY18DiElectronCandidates",
102 V0Tools = V0Tools,
103 VtxMassHypo = 3096.916,
104 MassMin = 1.0,
105 MassMax = 7000.0,
106 Chi2Max = 30,
107 DoVertexType = 7
108 )
109
110 BPHY18BeeKst = CompFactory.Analysis.JpsiPlus2Tracks(
111 name = "BPHY18BeeKstFinder",
112 kaonkaonHypothesis = False,
113 pionpionHypothesis = False,
114 kaonpionHypothesis = True,
115 oppChargesOnly = False,
116 SameChargesOnly = False,
117 trkThresholdPt = 500.0,
118 trkMaxEta = 3.0,
119 BThresholdPt = 1000.,
120 BMassLower = 3000.0,
121 BMassUpper = 6500.0,
122 JpsiContainerKey = "BPHY18DiElectronCandidates",
123 TrackParticleCollection = "InDetTrackParticles",
124 ExcludeCrossJpsiTracks = False,
125 TrkVertexFitterTool = vkalvrt,
126 TrackSelectorTool = trackselect,
127 UseMassConstraint = False,
128 DiTrackMassUpper = 1110.,
129 DiTrackMassLower = 690.,
130 Chi2Cut = 15.0,
131 DiTrackPt = 500.,
132 TrkQuadrupletMassLower = 1000.0,
133 TrkQuadrupletMassUpper = 10000.0,
134 FinalDiTrackPt = 500.,
135 UseGSFTrackIndices = [0,1]
136 )
137 BPHY18BeeKstSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
138 name = "BPHY18BeeKstSelectAndWrite",
139 VertexSearchTool = BPHY18BeeKst,
140 OutputVtxContainerName = "BeeKstCandidates",
141 PVContainerName = "PrimaryVertices",
142 RefPVContainerName = "BPHY18RefittedPrimaryVertices",
143 RefitPV = True,
144 V0Tools = V0Tools,
145 PVRefitter = PVrefit,
146 MaxPVrefit = 10000,
147 DoVertexType = 7
148 )
149
150 BPHY18_Select_BeeKst = CompFactory.DerivationFramework.Select_onia2mumu(
151 name = "BPHY18_Select_BeeKst",
152 HypothesisName = "Bd",
153 InputVtxContainerName = "BeeKstCandidates",
154 V0Tools = V0Tools,
155 TrkMasses = [0.511, 0.511, 493.677, 139.570],
156 VtxMassHypo = 5279.6,
157 MassMin = 1.0,
158 MassMax = 10000.0,
159 Chi2Max = 30.0
160 )
161
162 BPHY18_Select_BeeKstbar = CompFactory.DerivationFramework.Select_onia2mumu(
163 name = "BPHY18_Select_Bd2JpsiKstbar",
164 HypothesisName = "Bdbar",
165 InputVtxContainerName = "BeeKstCandidates",
166 V0Tools = V0Tools,
167 TrkMasses = [0.511, 0.511, 139.570, 493.677],
168 VtxMassHypo = 5279.6,
169 MassMin = 1.0,
170 MassMax = 10000.0,
171 Chi2Max = 30.0
172 )
173
174
175 BPHY18_diMeson_revertex = CompFactory.DerivationFramework.ReVertex(
176 name = "BPHY18_diMeson_revertex",
177 InputVtxContainerName = "BeeKstCandidates",
178 V0Tools = V0Tools,
179 PVRefitter = PVrefit,
180 TrackIndices = [ 2, 3 ],
181 TrkVertexFitterTool = vkalvrt,
182 OutputVtxContainerName = "BPHY18DiMeson"
183 )
184
185 BPHY18_Select_Kpi = CompFactory.DerivationFramework.Select_onia2mumu(
186 name = "BPHY18_Select_Kpi",
187 HypothesisName = "Kpi",
188 InputVtxContainerName = "BPHY18DiMeson",
189 V0Tools = V0Tools,
190 TrkMasses = [ 493.677, 139.570 ],
191 VtxMassHypo = 891.66,
192 MassMin = 1.0,
193 MassMax = 100000.0,
194 Chi2Max = 100.0
195 )
196
197 BPHY18_Select_piK = CompFactory.DerivationFramework.Select_onia2mumu(
198 name = "BPHY18_Select_piK",
199 HypothesisName = "piK",
200 InputVtxContainerName = "BPHY18DiMeson",
201 V0Tools = V0Tools,
202 TrkMasses = [ 139.570, 493.677 ],
203 VtxMassHypo = 891.66,
204 MassMin = 1.0,
205 MassMax = 100000.0,
206 Chi2Max = 100.0
207 )
208
209 from DerivationFrameworkTools.DerivationFrameworkToolsConfig import (
210 xAODStringSkimmingToolCfg)
211 BPHY18_SelectBeeKstEvent = acc.getPrimaryAndMerge(xAODStringSkimmingToolCfg(
212 flags, name = "BPHY18_SelectBeeKstEvent",
213 expression = "(count(BeeKstCandidates.passed_Bd > 0) + count(BeeKstCandidates.passed_Bdbar > 0)) > 0"))
214 skimmingTools += [BPHY18_SelectBeeKstEvent]
215
216 BPHY18SkimmingAND = CompFactory.DerivationFramework.FilterCombinationAND(
217 "BPHY18SkimmingAND", FilterList = skimmingTools)
218
219 BPHY18_thinningTool_Tracks = CompFactory.DerivationFramework.Thin_vtxTrk(
220 name = "BPHY18_thinningTool_Tracks",
221 TrackParticleContainerName = "InDetTrackParticles",
222 StreamName = streamName,
223 VertexContainerNames = ["BeeKstCandidates"],
224 PassFlags = ["passed_Bd", "passed_Bdbar"] )
225
226 BPHY18_thinningTool_GSFTracks = CompFactory.DerivationFramework.Thin_vtxTrk(
227 name = "BPHY18_thinningTool_GSFTracks",
228 TrackParticleContainerName = "GSFTrackParticles",
229 StreamName = streamName,
230 VertexContainerNames = ["BeeKstCandidates"],
231 PassFlags = ["passed_Bd", "passed_Bdbar"] )
232
233 BPHY18_thinningTool_PV = CompFactory.DerivationFramework.BPhysPVThinningTool(
234 name = "BPHY18_thinningTool_PV",
235 StreamName = streamName,
236 CandidateCollections = ["BeeKstCandidates"],
237 KeepPVTracks = True
238 )
239
240 BPHY18MuonTPThinningTool = CompFactory.DerivationFramework.MuonTrackParticleThinning(
241 name = "BPHY18MuonTPThinningTool",
242 StreamName = streamName,
243 MuonKey = "Muons",
244 InDetTrackParticlesKey = "InDetTrackParticles")
245
246 BPHY18EgammaTPThinningTool = CompFactory.DerivationFramework.EgammaTrackParticleThinning(
247 name = "BPHY18EgammaTPThinningTool",
248 StreamName = streamName,
249 SGKey = "Electrons",
250 InDetTrackParticlesKey = "InDetTrackParticles")
251
252 BPHY18TruthThinTool = CompFactory.DerivationFramework.GenericTruthThinning(name = "BPHY18TruthThinTool",
253 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",
254 PreserveDescendants = True,
255 StreamName = streamName,
256 PreserveAncestors = True)
257
258 BPHY18TruthThinNoChainTool = CompFactory.DerivationFramework.GenericTruthThinning(name = "BPHY18TruthThinNoChainTool",
259 ParticleSelectionString = "abs(TruthParticles.pdgId) == 5 || abs(TruthParticles.pdgId) == 12 || abs(TruthParticles.pdgId) == 14",
260 PreserveDescendants = False,
261 StreamName = streamName,
262 PreserveAncestors = False)
263
264 thinningCollection = [ BPHY18_thinningTool_Tracks, BPHY18_thinningTool_GSFTracks,
265 BPHY18_thinningTool_PV, #BPHY18_thinningTool_PV_GSF,
266 BPHY18EgammaTPThinningTool, BPHY18MuonTPThinningTool
267 ]
268
269
270 augTools = [ElectronPassLHvloosenod0,
271 BPHY18DiElectronSelectAndWrite, BPHY18_Select_DiElectrons,
272 BPHY18BeeKstSelectAndWrite, BPHY18_Select_BeeKst, BPHY18_Select_BeeKstbar,
273 BPHY18_diMeson_revertex, BPHY18_Select_Kpi, BPHY18_Select_piK]
274 skimTools = [BPHY18SkimmingAND]
275
276 if isSimulation:
277 thinningCollection += [BPHY18TruthThinTool,BPHY18TruthThinNoChainTool]
278
279 for t in (augTools + skimTools + skimmingTools + thinningCollection +
280 extraTools):
281 acc.addPublicTool(t)
282
283 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel("BPHY18Kernel",
284 AugmentationTools = augTools,
285 #Only skim if not MC
286 SkimmingTools = skimTools,
287 ThinningTools = thinningCollection))
288
289 from IsolationAlgs.DerivationTrackIsoConfig import DerivationTrackIsoCfg
290 acc.merge(DerivationTrackIsoCfg(flags, object_types=("Electrons", "Muons")))
291
292
293 #====================================================================
294 # Slimming
295 #====================================================================
296
297 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
298 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
299 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
300 BPHY18SlimmingHelper = SlimmingHelper("BPHY18SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
301 from DerivationFrameworkBPhys.commonBPHYMethodsCfg import getDefaultAllVariables
302 AllVariables = getDefaultAllVariables()
303 StaticContent = []
304 ExtraVariables = []
305 BPHY18SlimmingHelper.SmartCollections = ["Electrons", "Muons", "InDetTrackParticles" ]
306
307 # Needed for trigger objects
308 BPHY18SlimmingHelper.IncludeMuonTriggerContent = False
309 BPHY18SlimmingHelper.IncludeBPhysTriggerContent = False
310 BPHY18SlimmingHelper.IncludeEGammaTriggerContent = True
311
312 AllVariables += ["PrimaryVertices"]
313 StaticContent += ["xAOD::VertexContainer#BPHY18RefittedPrimaryVertices"]
314 StaticContent += ["xAOD::VertexAuxContainer#BPHY18RefittedPrimaryVerticesAux."]
315
316 ExtraVariables += ["Muons.etaLayer1Hits.etaLayer2Hits.etaLayer3Hits.etaLayer4Hits.phiLayer1Hits.phiLayer2Hits.phiLayer3Hits.phiLayer4Hits",
317 "Muons.numberOfTriggerEtaLayers.numberOfPhiLayers",
318 "InDetTrackParticles.numberOfTRTHits.numberOfTRTHighThresholdHits.vx.vy.vz.pixeldEdx",
319 "PrimaryVertices.chiSquared.covariance",
320 "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",
321 "egammaClusters.calE.calEta.calPhi.e_sampl.eta_sampl.etaCalo.phiCalo.ETACALOFRAME.PHICALOFRAME",
322 "HLT_xAOD__ElectronContainer_egamma_ElectronsAuxDyn.charge"]
323
324
325 StaticContent += ["xAOD::VertexContainer#%s" % BPHY18DiElectronSelectAndWrite.OutputVtxContainerName]
326 StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY18DiElectronSelectAndWrite.OutputVtxContainerName]
327
328 StaticContent += ["xAOD::VertexContainer#%s" % BPHY18BeeKstSelectAndWrite.OutputVtxContainerName]
329 StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY18BeeKstSelectAndWrite.OutputVtxContainerName]
330
331 StaticContent += ["xAOD::VertexContainer#%s" % BPHY18_diMeson_revertex.OutputVtxContainerName]
332 StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY18_diMeson_revertex.OutputVtxContainerName]
333
334 AllVariables += [ "GSFTrackParticles"]
335
336
337 # Truth information for MC only
338 if isSimulation:
339 AllVariables += ["TruthEvents","TruthParticles","TruthVertices", "ElectronTruthParticles"]
340
341 AllVariables = list(set(AllVariables)) # remove duplicates
342
343 BPHY18SlimmingHelper.AllVariables = AllVariables
344 BPHY18SlimmingHelper.ExtraVariables = ExtraVariables
345
346 BPHY18SlimmingHelper.StaticContent = StaticContent
347
348 from DerivationFrameworkEGamma.ElectronsCPDetailedContent import ElectronsCPDetailedContent, GSFTracksCPDetailedContent
349 BPHY18SlimmingHelper.ExtraVariables += ElectronsCPDetailedContent
350 BPHY18SlimmingHelper.ExtraVariables += GSFTracksCPDetailedContent
351
352 BPHY18ItemList = BPHY18SlimmingHelper.GetItemList()
353 acc.merge(OutputStreamCfg(flags, "DAOD_BPHY18", ItemList=BPHY18ItemList, AcceptAlgs=["BPHY18Kernel"]))
354 acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_BPHY18", AcceptAlgs=["BPHY18Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
355 acc.printConfig(withDetails=True, summariseProps=True, onlyComponents = [], printDefaults=True)
356 return acc
STL class.

Variable Documentation

◆ BPHYDerivationName

str BPHY18.BPHYDerivationName = "BPHY18"

Definition at line 11 of file BPHY18.py.

◆ streamName

str BPHY18.streamName = "StreamDAOD_BPHY18"

Definition at line 12 of file BPHY18.py.