15 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import (BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg, BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg)
16 from JpsiUpsilonTools.JpsiUpsilonToolsConfig
import PrimaryVertexRefittingToolCfg
18 isSimulation = flags.Input.isMC
19 V0Tools = acc.popToolsAndMerge(
BPHY_V0ToolCfg(flags, BPHYDerivationName))
21 acc.addPublicTool(vkalvrt)
22 acc.addPublicTool(V0Tools)
24 acc.addPublicTool(trackselect)
26 acc.addPublicTool(vpest)
28 BPHY21_AugOriginalCounts = CompFactory.DerivationFramework.AugOriginalCounts(
29 name =
"BPHY21_AugOriginalCounts",
30 VertexContainer =
"PrimaryVertices",
31 TrackContainer =
"InDetTrackParticles")
36 BPHY21_triggerList = [
42 "HLT_mu18_nomucomb_mu8noL1",
44 "HLT_mu20_nomucomb_mu8noL1",
46 "HLT_mu22_nomucomb_mu8noL1",
49 "HLT_mu10_mu6_bJpsimumu",
50 "HLT_mu22_mu8noL1_calotag_0eta010_L1MU1"
53 BPHY21_JpsiFinder = CompFactory.Analysis.JpsiFinder(
54 name =
"BPHY21_JpsiFinder",
57 TrackAndTrack =
False,
59 muonThresholdPt = 2700,
60 invMassUpper = 3400.0,
61 invMassLower = 2800.0,
63 oppChargesOnly =
True,
65 atLeastOneComb =
False,
66 useCombinedMeasurement =
False,
67 muonCollectionKey =
"Muons",
68 TrackParticleCollection =
"InDetTrackParticles",
69 V0VertexFitterTool =
None,
71 TrkVertexFitterTool = vkalvrt,
72 TrackSelectorTool = trackselect,
73 VertexPointEstimator = vpest,
75 acc.addPublicTool(BPHY21_JpsiFinder)
76 BPHY21_JpsiSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
77 name =
"BPHY21_JpsiSelectAndWrite",
78 VertexSearchTool = BPHY21_JpsiFinder,
79 OutputVtxContainerName =
"BPHY21_JpsiCandidates",
82 PVContainerName =
"PrimaryVertices",
83 RefPVContainerName =
"SHOULDNOTBEUSED",
85 BPHY21_Select_Jpsi2mumu = CompFactory.DerivationFramework.Select_onia2mumu(
86 name =
"BPHY21_Select_Jpsi2mumu",
87 HypothesisName =
"Jpsi",
88 InputVtxContainerName =
"BPHY21_JpsiCandidates",
90 VtxMassHypo = 3096.900,
98 BPHY21_TriggerSkim = CompFactory.DerivationFramework.TriggerSkimmingTool(name =
"BPHY21_TriggerSkim",
99 TriggerListOR = BPHY21_triggerList)
100 BPHY21_SelectJpsiEvent = CompFactory.DerivationFramework.xAODStringSkimmingTool(
101 name =
"BPHY21_SelectJpsiEvent",
102 expression =
"count(BPHY21_JpsiCandidates.passed_Jpsi) > 0")
104 BPHY21_SkimmingOR = CompFactory.DerivationFramework.FilterCombinationOR(
"BPHY21_SkimmingOR",
105 FilterList = [ BPHY21_TriggerSkim, BPHY21_SelectJpsiEvent] )
106 acc.addPublicTool(BPHY21_SelectJpsiEvent)
107 acc.addPublicTool(BPHY21_TriggerSkim)
108 acc.addPublicTool(BPHY21_SkimmingOR)
110 augTools = [BPHY21_JpsiSelectAndWrite, BPHY21_Select_Jpsi2mumu, BPHY21_AugOriginalCounts]
111 for t
in augTools : acc.addPublicTool(t)
112 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
"BPHY21Kernel",
113 AugmentationTools = augTools,
115 SkimmingTools = [BPHY21_SkimmingOR]
if not isSimulation
else [],
120 from DerivationFrameworkCore.SlimmingHelper
import SlimmingHelper
121 from OutputStreamAthenaPool.OutputStreamConfig
import OutputStreamCfg
122 from xAODMetaDataCnv.InfileMetaDataConfig
import SetupMetaDataForStreamCfg
123 BPHY21_SlimmingHelper =
SlimmingHelper(
"BPHY21_SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
124 from DerivationFrameworkBPhys.commonBPHYMethodsCfg
import getDefaultAllVariables
126 BPHY21_StaticContent = []
129 BPHY21_SlimmingHelper.IncludeMuonTriggerContent =
True
130 BPHY21_SlimmingHelper.IncludeBPhysTriggerContent =
True
133 BPHY21_AllVariables += [
"PrimaryVertices"]
134 BPHY21_StaticContent += [
"xAOD::VertexContainer#BPHY21_RefittedPrimaryVertices"]
135 BPHY21_StaticContent += [
"xAOD::VertexAuxContainer#BPHY21_RefittedPrimaryVerticesAux."]
138 BPHY21_AllVariables += [
"InDetTrackParticles"]
143 BPHY21_AllVariables += [
"CombinedMuonTrackParticles"]
144 BPHY21_AllVariables += [
"ExtrapolatedMuonTrackParticles"]
147 BPHY21_AllVariables += [
"Muons"]
151 BPHY21_StaticContent += [
"xAOD::VertexContainer#%s" % BPHY21_JpsiSelectAndWrite.OutputVtxContainerName]
153 BPHY21_StaticContent += [
"xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY21_JpsiSelectAndWrite.OutputVtxContainerName]
162 BPHY21_AllVariables += [
"TruthEvents",
"TruthParticles",
"TruthVertices",
"MuonTruthParticles"]
165 BPHY21_AllVariables =
list(
set(BPHY21_AllVariables))
166 BPHY21_SlimmingHelper.AllVariables = BPHY21_AllVariables
167 BPHY21_SlimmingHelper.StaticContent = BPHY21_StaticContent
168 acc.merge(
OutputStreamCfg(flags,
"DAOD_BPHY21", ItemList=BPHY21_SlimmingHelper.GetItemList(), AcceptAlgs=[
"BPHY21Kernel"]))
169 acc.merge(
SetupMetaDataForStreamCfg(flags,
"DAOD_BPHY21", AcceptAlgs=[
"BPHY21Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
170 acc.printConfig(withDetails=
True, summariseProps=
True, onlyComponents = [], printDefaults=
True, printComponentsOnly=
False)