ATLAS Offline Software
Loading...
Searching...
No Matches
BPHY3.py
Go to the documentation of this file.
1# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2#====================================================================
3# BPHY3.py
4#====================================================================
5
6from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
7from AthenaConfiguration.ComponentFactory import CompFactory
8from AthenaConfiguration.Enums import MetadataCategory
9
10BPHYDerivationName = "BPHY3"
11streamName = "StreamDAOD_BPHY3"
12
13def BPHY3Cfg(flags):
14 from DerivationFrameworkBPhys.commonBPHYMethodsCfg import (BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg, BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg)
15 from JpsiUpsilonTools.JpsiUpsilonToolsConfig import PrimaryVertexRefittingToolCfg
16 acc = ComponentAccumulator()
17 V0Tools = acc.popToolsAndMerge(BPHY_V0ToolCfg(flags, BPHYDerivationName))
18 vkalvrt = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName)) # VKalVrt vertex fitter
19 acc.addPublicTool(vkalvrt)
20 acc.addPublicTool(V0Tools)
21 trackselect = acc.popToolsAndMerge(BPHY_InDetDetailedTrackSelectorToolCfg(flags, BPHYDerivationName))
22 acc.addPublicTool(trackselect)
23 vpest = acc.popToolsAndMerge(BPHY_VertexPointEstimatorCfg(flags, BPHYDerivationName))
24 acc.addPublicTool(vpest)
25 BPHY3JpsiFinder = CompFactory.Analysis.JpsiFinder(
26 name = "BPHY3JpsiFinder",
27 muAndMu = False,
28 muAndTrack = False,
29 TrackAndTrack = True,
30 assumeDiMuons = False, # If true, will assume dimu hypothesis and use PDG value for mu mass
31 invMassUpper = 10000.0,
32 invMassLower = 0.0,
33 Chi2Cut = 100.,
34 oppChargesOnly = True,
35 atLeastOneComb = False,
36 useCombinedMeasurement = False, # Only takes effect if combOnly=True
37 muonCollectionKey = "Muons",
38 TrackParticleCollection = "InDetTrackParticles",
39 V0VertexFitterTool = None, # V0 vertex fitter
40 useV0Fitter = False, # if False a TrkVertexFitterTool will be used
41 TrkVertexFitterTool = vkalvrt, # VKalVrt vertex fitter
42 TrackSelectorTool = trackselect,
43 VertexPointEstimator = vpest,
44 useMCPCuts = False,
45 track1Mass = 139.57, # Not very important, only used to calculate inv. mass cut, leave it loose here
46 track2Mass = 139.57)
47
48 BPHY3_Reco_diTrk = CompFactory.DerivationFramework.Reco_Vertex(
49 name = "BPHY3_Reco_diTrk",
50 VertexSearchTool = BPHY3JpsiFinder,
51 OutputVtxContainerName = "BPHY3VertexCandidates",
52 V0Tools = V0Tools,
53 PVRefitter = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags)),
54 PVContainerName = "PrimaryVertices",
55 RefPVContainerName = "BPHY3RefittedPrimaryVertices")
56 BPHY3_Select_PiPi = CompFactory.DerivationFramework.Select_onia2mumu(
57 name = "BPHY3_Select_PiPi",
58 HypothesisName = "PiPi",
59 InputVtxContainerName = "BPHY3VertexCandidates",
60 V0Tools = V0Tools,
61 TrkMasses = [139.57,139.57],
62 VtxMassHypo = 497.614,
63 MassMin = 300.0,
64 MassMax = 700.0,
65 Chi2Max = 20)
66 BPHY3_Select_PiK = CompFactory.DerivationFramework.Select_onia2mumu(
67 name = "BPHY3_Select_PiK",
68 HypothesisName = "PiK",
69 InputVtxContainerName = "BPHY3VertexCandidates",
70 V0Tools = V0Tools,
71 TrkMasses = [139.57,493.677],
72 VtxMassHypo = 892.,
73 MassMin = 0.0,
74 MassMax = 3500.0,
75 Chi2Max = 10)
76 BPHY3_Select_KPi = CompFactory.DerivationFramework.Select_onia2mumu(
77 name = "BPHY3_Select_KPi",
78 HypothesisName = "KPi",
79 InputVtxContainerName = "BPHY3VertexCandidates",
80 V0Tools = V0Tools,
81 TrkMasses = [493.677,139.57],
82 VtxMassHypo = 892.,
83 MassMin = 0.0,
84 MassMax = 3500.0,
85 Chi2Max = 10)
86 BPHY3_Select_KK = CompFactory.DerivationFramework.Select_onia2mumu(
87 name = "BPHY3_Select_KK",
88 HypothesisName = "KK",
89 InputVtxContainerName = "BPHY3VertexCandidates",
90 V0Tools = V0Tools,
91 TrkMasses = [493.677,493.677],
92 VtxMassHypo = 1019.461,
93 MassMin = 0.0,
94 MassMax = 1100.0,
95 Chi2Max = 20)
96 BPHY3_Select_PP = CompFactory.DerivationFramework.Select_onia2mumu(
97 name = "BPHY3_Select_PP",
98 HypothesisName = "PP",
99 InputVtxContainerName = "BPHY3VertexCandidates",
100 V0Tools = V0Tools,
101 TrkMasses = [938.272,938.272],
102 VtxMassHypo = 3096.916,
103 MassMin = 2800.0,
104 MassMax = 3600.0,
105 Chi2Max = 1)
106
107 expression = "count(BPHY3VertexCandidates.passed_PiPi) > 0 || count(BPHY3VertexCandidates.passed_KPi) > 0 || count(BPHY3VertexCandidates.passed_PiK) > 0 || count(BPHY3VertexCandidates.passed_KK) > 0 || count(BPHY3VertexCandidates.passed_PP) > 0"
108 BPHY3_SelectEvent = CompFactory.DerivationFramework.xAODStringSkimmingTool(name = "BPHY3_SelectEvent", expression = expression)
109 BPHY3Thin_vtxTrk = CompFactory.DerivationFramework.Thin_vtxTrk(
110 name = "BPHY3Thin_vtxTrk",
111 TrackParticleContainerName = "InDetTrackParticles",
112 VertexContainerNames = ["BPHY3VertexCandidates"],
113 StreamName = streamName,
114 PassFlags = ["passed_PiPi","passed_KPi","passed_PiK","passed_KK","passed_PP"])
115 augCollections=[BPHY3_Reco_diTrk,BPHY3_Select_PiPi,BPHY3_Select_KPi,BPHY3_Select_PiK,BPHY3_Select_KK,BPHY3_Select_PP]
116 skimCollections = [BPHY3_SelectEvent]
117 BPHY3ThinningTools = [BPHY3Thin_vtxTrk]
118 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel(
119 "BPHY3Kernel",
120 AugmentationTools = augCollections,
121 SkimmingTools = skimCollections,
122 ThinningTools = BPHY3ThinningTools))
123
124 for t in augCollections +BPHY3ThinningTools +skimCollections : acc.addPublicTool(t)
125 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
126 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
127 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
128 BPHY3SlimmingHelper = SlimmingHelper("BPHY3SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
129 from DerivationFrameworkBPhys.commonBPHYMethodsCfg import getDefaultAllVariables
130 AllVariables = getDefaultAllVariables()
131 StaticContent = []
132
133
134 AllVariables += ["PrimaryVertices"]
135
136
137 AllVariables += ["InDetTrackParticles"]
138
139
140 StaticContent += ["xAOD::VertexContainer#%s" % BPHY3_Reco_diTrk.OutputVtxContainerName]
141
142 StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY3_Reco_diTrk.OutputVtxContainerName]
143 BPHY3SlimmingHelper.AllVariables = AllVariables
144 BPHY3SlimmingHelper.StaticContent = StaticContent
145 BPHY3ItemList = BPHY3SlimmingHelper.GetItemList()
146 acc.merge(OutputStreamCfg(flags, "DAOD_BPHY3", ItemList=BPHY3ItemList, AcceptAlgs=["BPHY3Kernel"]))
147 acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_BPHY3", AcceptAlgs=["BPHY3Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
148 acc.printConfig(withDetails=True, summariseProps=True, onlyComponents = [], printDefaults=True)
149 return acc
BPHY3Cfg(flags)
Definition BPHY3.py:13