14 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import (BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg, BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg)
15 from JpsiUpsilonTools.JpsiUpsilonToolsConfig
import PrimaryVertexRefittingToolCfg
17 isSimulation = flags.Input.isMC
20 dimuon_mass_min = 100.
21 dimuon_mass_max = 150e3
23 V0Tools = acc.popToolsAndMerge(
BPHY_V0ToolCfg(flags, BPHYDerivationName))
25 acc.addPublicTool(vkalvrt)
26 acc.addPublicTool(V0Tools)
28 acc.addPublicTool(trackselect)
30 acc.addPublicTool(vpest)
31 from TrkConfig.AtlasExtrapolatorConfig
import InDetExtrapolatorCfg
33 acc.addPublicTool(extrap)
34 BPHY6_Extrap_Tool = CompFactory.DerivationFramework.MuonExtrapolationTool(name =
"BPHY6_ExtrapolationTool", Extrapolator = extrap)
35 BPHY6JpsiFinder = CompFactory.Analysis.JpsiFinder(
36 name =
"BPHY6JpsiFinder",
39 TrackAndTrack =
False,
41 invMassUpper = dimuon_mass_max,
42 invMassLower = dimuon_mass_min,
43 Chi2Cut = dimuon_chi2_max,
44 oppChargesOnly =
True,
45 atLeastOneComb =
True,
46 useCombinedMeasurement =
False,
47 muonCollectionKey =
"Muons",
48 TrackParticleCollection =
"InDetTrackParticles",
49 V0VertexFitterTool =
None,
51 TrkVertexFitterTool = vkalvrt,
52 TrackSelectorTool = trackselect,
53 VertexPointEstimator = vpest,
56 BPHY6_Reco_mumu = CompFactory.DerivationFramework.Reco_Vertex(
57 name =
"BPHY6_Reco_mumu",
58 VertexSearchTool = BPHY6JpsiFinder,
59 OutputVtxContainerName =
"BPHY6OniaCandidates",
62 PVContainerName =
"PrimaryVertices",
63 RefPVContainerName =
"BPHY6RefittedPrimaryVertices")
65 BPHY6_Select_Jpsi2mumu = CompFactory.DerivationFramework.Select_onia2mumu(
66 name =
"BPHY6_Select_Jpsi2mumu",
67 HypothesisName =
"Jpsi",
68 InputVtxContainerName =
"BPHY6OniaCandidates",
70 VtxMassHypo = 3096.916,
75 BPHY6_Select_Psi2mumu = CompFactory.DerivationFramework.Select_onia2mumu(
76 name =
"BPHY6_Select_Psi2mumu",
77 HypothesisName =
"Psi",
78 InputVtxContainerName =
"BPHY6OniaCandidates",
80 VtxMassHypo = 3686.09,
85 BPHY6_Select_Upsi2mumu = CompFactory.DerivationFramework.Select_onia2mumu(
86 name =
"BPHY6_Select_Upsi2mumu",
87 HypothesisName =
"Upsi",
88 InputVtxContainerName =
"BPHY6OniaCandidates",
90 VtxMassHypo = 9460.30,
95 BPHY6_Select_Bmumu2mumu = CompFactory.DerivationFramework.Select_onia2mumu(
96 name =
"BPHY6_Select_Bmumu2mumu",
97 HypothesisName =
"Bmumu",
98 InputVtxContainerName =
"BPHY6OniaCandidates",
100 VtxMassHypo = 5366.77,
105 BPHY6_Select_Zmumu2mumu = CompFactory.DerivationFramework.Select_onia2mumu(
106 name =
"BPHY6_Select_Zmumu2mumu",
107 HypothesisName =
"Zmumu",
108 InputVtxContainerName =
"BPHY6OniaCandidates",
110 VtxMassHypo = 91187.6,
115 BPHY6_Select_Onia2mumu = CompFactory.DerivationFramework.Select_onia2mumu(
116 name =
"BPHY6_Select_Onia2mumu",
117 HypothesisName =
"Onia",
118 InputVtxContainerName =
"BPHY6OniaCandidates",
120 VtxMassHypo = 3096.916,
121 MassMin = dimuon_mass_min,
122 MassMax = dimuon_mass_max,
125 trigger_list = [
r'HLT_\d?mu\d+']
127 BPHY6TrigSkimmingTool = CompFactory.DerivationFramework.TriggerSkimmingTool( name =
"BPHY6TrigSkimmingTool",
128 TriggerListOR = trigger_list )
129 expression =
"count(BPHY6OniaCandidates.passed_Onia) > 0 "
130 BPHY6_SelectEvent = CompFactory.DerivationFramework.xAODStringSkimmingTool(name =
"BPHY6_SelectEvent",
131 expression = expression)
132 BPHY6Thin_vtxTrk = CompFactory.DerivationFramework.Thin_vtxTrk(
133 name =
"BPHY6Thin_vtxTrk",
134 TrackParticleContainerName =
"InDetTrackParticles",
135 StreamName = streamName,
136 VertexContainerNames = [
"BPHY6OniaCandidates"],
137 PassFlags = [
"passed_Onia"], )
138 BPHY6MuonTPThinningTool = CompFactory.DerivationFramework.MuonTrackParticleThinning(name =
"BPHY6MuonTPThinningTool",
140 StreamName = streamName,
141 InDetTrackParticlesKey =
"InDetTrackParticles")
144 BPHY6ThinningTools = [BPHY6Thin_vtxTrk, BPHY6MuonTPThinningTool]
146 BPHY6TruthThinTool = CompFactory.DerivationFramework.GenericTruthThinning(name =
"BPHY6TruthThinTool",
147 ParticleSelectionString =
"TruthParticles.pdgId == 443 || TruthParticles.pdgId == 100443 || TruthParticles.pdgId == 553 || TruthParticles.pdgId == 100553 || TruthParticles.pdgId == 200553 || TruthParticles.pdgId == 23 || TruthParticles.pdgId == 531 || TruthParticles.pdgId == 511 || TruthParticles.pdgId == 521 || TruthParticles.pdgId == 541",
148 PreserveDescendants =
True,
149 StreamName = streamName,
150 PreserveAncestors =
True)
151 BPHY6ThinningTools.append(BPHY6TruthThinTool)
153 SkimmingORTool = CompFactory.DerivationFramework.FilterCombinationOR(
"BPHY6SkimmingOR",
154 FilterList = [BPHY6_SelectEvent,BPHY6TrigSkimmingTool])
156 augTools = [BPHY6_Reco_mumu, BPHY6_Select_Jpsi2mumu, BPHY6_Select_Psi2mumu, BPHY6_Select_Upsi2mumu,BPHY6_Select_Bmumu2mumu,
157 BPHY6_Select_Zmumu2mumu,BPHY6_Select_Onia2mumu, BPHY6_Extrap_Tool]
158 for t
in augTools + BPHY6ThinningTools + [SkimmingORTool] + [BPHY6_SelectEvent,BPHY6TrigSkimmingTool]: acc.addPublicTool(t)
159 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
"BPHY6Kernel",
160 AugmentationTools = augTools,
161 SkimmingTools = [SkimmingORTool],
162 ThinningTools = BPHY6ThinningTools ))
164 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
165 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
166 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
167 BPHY6SlimmingHelper =
SlimmingHelper(
"BPHY6SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
170 BPHY6SlimmingHelper.IncludeMuonTriggerContent =
True
171 BPHY6SlimmingHelper.IncludeBPhysTriggerContent =
True
172 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import getDefaultAllVariables
175 AllVariables += [
"LVL1MuonRoIs"]
178 AllVariables += [
"PrimaryVertices"]
179 StaticContent += [
"xAOD::VertexContainer#BPHY6RefittedPrimaryVertices"]
180 StaticContent += [
"xAOD::VertexAuxContainer#BPHY6RefittedPrimaryVerticesAux."]
183 AllVariables += [
"InDetTrackParticles"]
185 AllVariables += [
"HLT_xAOD__TrackParticleContainer_InDetTrigTrackingxAODCnv_Muon_EFID"]
186 AllVariables += [
"HLT_xAOD__TrackParticleContainer_InDetTrigTrackingxAODCnv_Muon_IDTrig"]
187 AllVariables += [
"HLT_xAOD__TrackParticleContainer_InDetTrigTrackingxAODCnv_Muon_FTF"]
188 AllVariables += [
"HLT_xAOD__TrackParticleContainer_InDetTrigTrackingxAODCnv_Bphysics_FTF"]
189 AllVariables += [
"HLT_xAOD__TrackParticleContainer_InDetTrigTrackingxAODCnv_Bphysics_IDTrig"]
196 AllVariables += [
"CombinedMuonTrackParticles"]
197 AllVariables += [
"ExtrapolatedMuonTrackParticles"]
198 AllVariables += [
"MuonSpectrometerTrackParticles"]
201 AllVariables += [
"Muons"]
202 AllVariables += [
"HLT_xAOD__L2StandAloneMuonContainer_MuonL2SAInfo"]
203 AllVariables += [
"HLT_xAOD__L2CombinedMuonContainer_MuonL2CBInfo"]
204 AllVariables += [
"HLT_xAOD__MuonContainer_MuonEFInfo"]
207 AllVariables += [
"HLT_xAOD__TrigBphysContainer_L2BMuMuXFex" ]
208 AllVariables += [
"HLT_xAOD__TrigBphysContainer_EFBMuMuXFex" ]
209 AllVariables += [
"HLT_xAOD__TrigBphysContainer_L2BMuMuFex" ]
210 AllVariables += [
"HLT_xAOD__TrigBphysContainer_EFBMuMuFex" ]
211 AllVariables += [
"HLT_xAOD__TrigBphysContainer_L2TrackMass" ]
212 AllVariables += [
"HLT_xAOD__TrigBphysContainer_EFTrackMass" ]
213 AllVariables += [
"HLT_xAOD__TrigBphysContainer_L2MultiMuFex"]
214 AllVariables += [
"HLT_xAOD__TrigBphysContainer_EFMultiMuFex"]
218 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY6_Reco_mumu.OutputVtxContainerName]
219 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY6_Reco_mumu.OutputVtxContainerName]
222 AllVariables += [
"TruthEvents",
"TruthParticles",
"TruthVertices",
"MuonTruthParticles"]
223 BPHY6SlimmingHelper.AllVariables = AllVariables
224 BPHY6SlimmingHelper.StaticContent = StaticContent
225 BPHY6ItemList = BPHY6SlimmingHelper.GetItemList()
226 acc.merge(
OutputStreamCfg(flags,
"DAOD_BPHY6", ItemList=BPHY6ItemList, AcceptAlgs=[
"BPHY6Kernel"]))
227 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_BPHY6", AcceptAlgs=[
"BPHY6Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
228 acc.printConfig(withDetails=
True, summariseProps=
True, onlyComponents = [], printDefaults=
True, printComponentsOnly=
False)