15 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import (BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg, BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg)
16 from JpsiUpsilonTools.JpsiUpsilonToolsConfig
import PrimaryVertexRefittingToolCfg
17 acc = ComponentAccumulator()
18 isSimulation = flags.Input.isMC
19 V0Tools = acc.popToolsAndMerge(BPHY_V0ToolCfg(flags, BPHYDerivationName))
20 vkalvrt = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName))
21 acc.addPublicTool(vkalvrt)
22 acc.addPublicTool(V0Tools)
23 trackselect = acc.popToolsAndMerge(BPHY_InDetDetailedTrackSelectorToolCfg(flags, BPHYDerivationName))
24 acc.addPublicTool(trackselect)
25 vpest = acc.popToolsAndMerge(BPHY_VertexPointEstimatorCfg(flags, BPHYDerivationName))
26 acc.addPublicTool(vpest)
27 BPHY16JpsiFinder = CompFactory.Analysis.JpsiFinder(
28 name =
"BPHY16JpsiFinder",
31 TrackAndTrack =
False,
33 invMassUpper = 12000.0,
36 oppChargesOnly =
True,
37 atLeastOneComb =
True,
38 useCombinedMeasurement =
False,
39 muonCollectionKey =
"Muons",
40 TrackParticleCollection =
"InDetTrackParticles",
41 V0VertexFitterTool =
None,
43 TrkVertexFitterTool = vkalvrt,
44 TrackSelectorTool = trackselect,
45 VertexPointEstimator = vpest,
47 acc.addPublicTool(BPHY16JpsiFinder)
48 BPHY16_Reco_mumu = CompFactory.DerivationFramework.Reco_Vertex(
49 name =
"BPHY16_Reco_mumu",
50 VertexSearchTool = BPHY16JpsiFinder,
51 OutputVtxContainerName =
"BPHY16OniaCandidates",
52 PVContainerName =
"PrimaryVertices",
53 RefPVContainerName =
"BPHY16RefittedPrimaryVertices1",
56 PVRefitter = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags)),
60 BPHY16_Select_Upsi = CompFactory.DerivationFramework.Select_onia2mumu(
61 name =
"BPHY16_Select_Upsi",
62 HypothesisName =
"Upsilon",
63 InputVtxContainerName =
"BPHY16OniaCandidates",
65 VtxMassHypo = 9460.30,
71 BPHY16Plus2Tracks = CompFactory.Analysis.JpsiPlus2Tracks(name =
"BPHY16Plus2Tracks",
72 kaonkaonHypothesis =
False,
73 pionpionHypothesis =
False,
74 kaonpionHypothesis =
False,
75 ManualMassHypo = [ 105.658, 105.658, 105.658, 105.658 ],
80 oppChargesOnly =
False,
82 JpsiContainerKey =
"BPHY16OniaCandidates",
83 TrackParticleCollection =
"InDetTrackParticles",
84 MuonsUsedInJpsi =
"Muons",
85 ExcludeJpsiMuonsOnly =
True,
86 RequireNMuonTracks = 1,
87 TrkVertexFitterTool = vkalvrt,
88 TrackSelectorTool = trackselect,
89 UseMassConstraint =
False)
91 BPHY16FourTrackSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(name =
"BPHY16FourTrackSelectAndWrite",
92 VertexSearchTool = BPHY16Plus2Tracks,
93 OutputVtxContainerName =
"BPHY16FourTrack",
94 PVContainerName =
"PrimaryVertices",
95 RefPVContainerName =
"BPHY16RefittedPrimaryVertices2",
98 PVRefitter = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags)),
99 MaxPVrefit = 10000, DoVertexType = 7)
101 BPHY16_Select_FourTrack = CompFactory.DerivationFramework.Select_onia2mumu(
102 name =
"BPHY16_Select_FourTracks",
103 HypothesisName =
"FourTracks",
104 InputVtxContainerName =
"BPHY16FourTrack",
106 TrkMasses = [105.658, 105.658, 105.658, 105.658],
107 VtxMassHypo = 18100.0,
110 Chi2Max = BPHY16Plus2Tracks.Chi2Cut)
111 BPHY16_Revertex = CompFactory.DerivationFramework.ReVertex(
112 name =
"BPHY16_ReVertex",
113 InputVtxContainerName =
"BPHY16FourTrack",
115 TrackIndices = [ 2, 3 ],
116 PVRefitter = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags)),
117 TrkVertexFitterTool = vkalvrt,
118 OutputVtxContainerName =
"BPHY16TwoTrack")
119 BPHY16_Select_TwoTrack = CompFactory.DerivationFramework.Select_onia2mumu(
120 name =
"BPHY16_Select_TwoTracks",
121 HypothesisName =
"TwoTracks",
122 InputVtxContainerName =
"BPHY16TwoTrack",
124 TrkMasses = [105.658, 105.658],
125 VtxMassHypo = 18100.0,
130 from DerivationFrameworkTools.DerivationFrameworkToolsConfig
import (
131 xAODStringSkimmingToolCfg)
132 BPHY16_SelectEvent = acc.getPrimaryAndMerge(xAODStringSkimmingToolCfg(
133 flags, name =
"BPHY16_SelectEvent",
134 expression =
"count(BPHY16FourTrack.passed_FourTracks) > 0"))
136 augTools = [BPHY16_Reco_mumu, BPHY16_Select_Upsi, BPHY16FourTrackSelectAndWrite, BPHY16_Select_FourTrack, BPHY16_Revertex, BPHY16_Select_TwoTrack]
137 skimTools = [BPHY16_SelectEvent]
138 for t
in augTools +skimTools : acc.addPublicTool(t)
139 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
"BPHY16Kernel",
140 AugmentationTools = augTools,
142 SkimmingTools = skimTools,
149 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
150 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
151 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
152 BPHY16SlimmingHelper =
SlimmingHelper(
"BPHY16SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
153 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import getDefaultAllVariables
154 AllVariables = getDefaultAllVariables()
158 BPHY16SlimmingHelper.IncludeMuonTriggerContent =
True
159 BPHY16SlimmingHelper.IncludeBPhysTriggerContent =
True
162 AllVariables += [
"PrimaryVertices"]
163 StaticContent += [
"xAOD::VertexContainer#BPHY16RefittedPrimaryVertices1"]
164 StaticContent += [
"xAOD::VertexAuxContainer#BPHY16RefittedPrimaryVertices1Aux."]
165 StaticContent += [
"xAOD::VertexContainer#BPHY16RefittedPrimaryVertices2"]
166 StaticContent += [
"xAOD::VertexAuxContainer#BPHY16RefittedPrimaryVertices2Aux."]
169 AllVariables += [
"InDetTrackParticles"]
174 AllVariables += [
"CombinedMuonTrackParticles"]
175 AllVariables += [
"ExtrapolatedMuonTrackParticles"]
178 AllVariables += [
"Muons"]
181 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY16_Reco_mumu.OutputVtxContainerName]
183 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY16_Reco_mumu.OutputVtxContainerName]
185 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY16FourTrackSelectAndWrite.OutputVtxContainerName]
187 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY16FourTrackSelectAndWrite.OutputVtxContainerName]
189 StaticContent += [
"xAOD::VertexContainer#%s" % BPHY16_Revertex.OutputVtxContainerName]
191 StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY16_Revertex.OutputVtxContainerName]
196 AllVariables += [
"TruthEvents",
"TruthParticles",
"TruthVertices",
"MuonTruthParticles"]
197 BPHY16SlimmingHelper.AllVariables = AllVariables
198 BPHY16SlimmingHelper.StaticContent = StaticContent
199 BPHY16ItemList = BPHY16SlimmingHelper.GetItemList()
200 acc.merge(OutputStreamCfg(flags,
"DAOD_BPHY16", ItemList=BPHY16ItemList, AcceptAlgs=[
"BPHY16Kernel"]))
201 acc.merge(SetupMetaDataForStreamCfg(flags,
"DAOD_BPHY16", AcceptAlgs=[
"BPHY16Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
202 acc.printConfig(withDetails=
True, summariseProps=
True, onlyComponents = [], printDefaults=
True)