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

Functions

 BPHY18Cfg (flags)

Variables

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

Function Documentation

◆ BPHY18Cfg()

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