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

Functions

 BPHY22Cfg (flags)

Variables

str BPHYDerivationName = "BPHY22"
str streamName = "StreamDAOD_BPHY22"

Function Documentation

◆ BPHY22Cfg()

BPHY22.BPHY22Cfg ( flags)

Definition at line 15 of file BPHY22.py.

15def BPHY22Cfg(flags):
16 from AthenaServices.PartPropSvcConfig import PartPropSvcCfg
17 from DerivationFrameworkBPhys.commonBPHYMethodsCfg import (
18 BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg,
19 BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg,
20 AugOriginalCountsCfg)
21 from JpsiUpsilonTools.JpsiUpsilonToolsConfig import PrimaryVertexRefittingToolCfg
22 acc = ComponentAccumulator()
23 acc.getPrimaryAndMerge(PartPropSvcCfg(flags))
24 isSimulation = flags.Input.isMC
25 V0Tools = acc.popToolsAndMerge(BPHY_V0ToolCfg(flags, BPHYDerivationName))
26 vkalvrt = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName)) # VKalVrt vertex fitter
27 acc.addPublicTool(vkalvrt)
28 acc.addPublicTool(V0Tools)
29 trackselect = acc.popToolsAndMerge(BPHY_InDetDetailedTrackSelectorToolCfg(flags, BPHYDerivationName))
30 acc.addPublicTool(trackselect)
31 vpest = acc.popToolsAndMerge(BPHY_VertexPointEstimatorCfg(flags, BPHYDerivationName))
32 acc.addPublicTool(vpest)
33 PVrefit = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags))
34 acc.addPublicTool(PVrefit)
35
36 BPHY22MuPiFinder = CompFactory.Analysis.JpsiFinder(
37 name = "BPHY22MuPiFinder",
38 muAndMu = False,
39 muAndTrack = True, #need doTagAndProbe flag
40 TrackAndTrack = False,
41 assumeDiMuons = False,
42 muonThresholdPt = 2700,
43 trackThresholdPt = 250.0, # MeV
44 invMassUpper = 8200.0,
45 invMassLower = 200.0,
46 Chi2Cut = 10.,
47 oppChargesOnly = False,
48 allChargeCombinations = True,
49 atLeastOneComb = False, # True by default
50 useCombinedMeasurement = False, # Only takes effect if combOnly=True
51 muonCollectionKey = "Muons",
52 TrackParticleCollection = "InDetTrackParticles",
53 TrkVertexFitterTool = vkalvrt, # VKalVrt vertex fitter
54 TrackSelectorTool = trackselect,
55 VertexPointEstimator = vpest,
56 useMCPCuts = False,
57 doTagAndProbe = True, #won't work with all/same charges combs
58 forceTagAndProbe = True) #force T&P to work with any charges combs
59
60 BPHY22MuPiSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
61 name = "BPHY22MuPiSelectAndWrite",
62 VertexSearchTool = BPHY22MuPiFinder,
63 OutputVtxContainerName = "BPHY22MuPiCandidates",
64 V0Tools = V0Tools,
65 PVRefitter = PVrefit,
66 PVContainerName = "PrimaryVertices",
67 RefPVContainerName = "SHOULDNOTBEUSED")
68
69
70 BPHY22DiTrkFinder = CompFactory.Analysis.JpsiFinder(
71 name = "BPHY22DiTrkFinder",
72 muAndMu = False,
73 muAndTrack = False,
74 TrackAndTrack = True,
75 assumeDiMuons = False, # If true, will assume dimu hypothesis and use PDG value for mu mass
76 trackThresholdPt = 900,
77 invMassUpper = 2100.0,
78 invMassLower = 275,
79 Chi2Cut = 20., #chi2
80 oppChargesOnly = True,
81 atLeastOneComb = False,
82 useCombinedMeasurement = False, # Only takes effect if combOnly=True
83 muonCollectionKey = "Muons",
84 TrackParticleCollection = "InDetTrackParticles",
85 TrkVertexFitterTool = vkalvrt, # VKalVrt vertex fitter
86 TrackSelectorTool = trackselect,
87 VertexPointEstimator = vpest,
88 useMCPCuts = False,
89 track1Mass = 139.571, # Not very important, only used to calculate inv. mass cut, leave it loose here
90 track2Mass = 139.571)
91
92 BPHY22DiTrkSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
93 name = "BPHY22DiTrkSelectAndWrite",
94 VertexSearchTool = BPHY22DiTrkFinder,
95 OutputVtxContainerName = "BPHY22DiTrkCandidates",
96 PVContainerName = "PrimaryVertices",
97 V0Tools = V0Tools,
98 PVRefitter = PVrefit,
99 RefPVContainerName = "SHOULDNOTBEUSED",
100 CheckCollections = True,
101 CheckVertexContainers = ['BPHY22MuPiCandidates'])
102
103
104 BMuDstVertexFit = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName, CascadeCnstPrecision = 1e-6))
105
106 BPHY22MuDpst = CompFactory.DerivationFramework.MuPlusDpstCascade(
107 name = "BPHY22MuDpst",
108 HypothesisName = "B",
109 TrkVertexFitterTool = BMuDstVertexFit,
110 DxHypothesis = 421, # MC PID for D0
111 ApplyD0MassConstraint = True,
112 MuPiMassLowerCut = 200.,
113 MuPiMassUpperCut = 8200.,
114 V0Tools = V0Tools,
115 PVRefitter = PVrefit,
116 D0MassLowerCut = 1864.83 - 200.,
117 D0MassUpperCut = 1864.83 + 200.,
118 DstMassLowerCut = 2010.26 - 300.,
119 DstMassUpperCut = 2010.26 + 300.,
120 DstMassUpperCutAft = 2010.26 + 25., #mass cut after cascade fit
121 MassLowerCut = 0.,
122 MassUpperCut = 12500.,
123 Chi2Cut = 5, #chi2/ndf
124 RefitPV = True,
125 RefPVContainerName = "BPHY22RefittedPrimaryVertices",
126 MuPiVertices = "BPHY22MuPiCandidates",
127 CascadeVertexCollections = ["BMuDpstCascadeSV2", "BMuDpstCascadeSV1"],
128 D0Vertices = "BPHY22DiTrkCandidates",
129 DoVertexType = 15 )
130
131 BPHY22Dh3Finder = CompFactory.Analysis.JpsiPlus1Track(
132 name = "BPHY22Dh3Finder",
133 pionHypothesis = True, #false by default
134 kaonHypothesis = False, #true by default
135 trkThresholdPt = 900.0,
136 trkMaxEta = 2.7, # is this value fine?? default would be 102.5
137 BThresholdPt = 2000.0,
138 BMassUpper = 2100.0, # What is this??
139 BMassLower = 500.0,
140 TrkDeltaZ = 20.,
141 TrkTrippletMassUpper = 2200, #2100
142 TrkTrippletMassLower = 500,
143 TrkQuadrupletPt = 2000,
144 JpsiContainerKey = "BPHY22DiTrkCandidates",
145 TrackParticleCollection = "InDetTrackParticles",
146 MuonsUsedInJpsi = "NONE", # ?
147 ExcludeCrossJpsiTracks = False,
148 TrkVertexFitterTool = vkalvrt,
149 TrackSelectorTool = trackselect,
150 UseMassConstraint = False,
151 Chi2Cut = 7) #Cut on chi2/Ndeg_of_freedom 5->7
152
153 BPHY22Dh3SelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
154 name = "BPHY22Dh3SelectAndWrite",
155 VertexSearchTool = BPHY22Dh3Finder,
156 V0Tools = V0Tools,
157 PVRefitter = PVrefit,
158 OutputVtxContainerName = "BPHY22Dh3Candidates",
159 PVContainerName = "PrimaryVertices",
160 RefPVContainerName = "SHOULDNOTBEUSED",
161 MaxPVrefit = 1000)
162
163 BMuDxVertexFit = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName+"BMuDxVertexFit", CascadeCnstPrecision = 1e-6))
164
165 BPHY22MuDs = CompFactory.DerivationFramework.MuPlusDsCascade(
166 name = "BPHY22MuDs",
167 HypothesisName = "B",
168 TrkVertexFitterTool = BMuDxVertexFit,
169 V0Tools = V0Tools,
170 PVRefitter = PVrefit,
171 DxHypothesis = 431,
172 ApplyDxMassConstraint = False,
173 DxMassLowerCut = 1968.28 - 300.,
174 DxMassUpperCut = 1968.28 + 200.,
175 MassLowerCut = 1000,
176 MassUpperCut = 12500,
177 Chi2Cut = 10,
178 RefitPV = True,
179 combOnly = True,
180 TrackSelectorTool = trackselect,
181 useMCPCuts = False,
182 muonThresholdPt = 2700,
183 muonCollectionKey = "Muons",
184 useCombinedMeasurement = False, # Only takes effect if combOnly=True
185 RefPVContainerName = "BPHY22RefittedPrimaryVertices",
186 CascadeVertexCollections = ["BMuDsCascadeSV2", "BMuDsCascadeSV1"],
187 DxVertices = "BPHY22Dh3Candidates")
188
189 BPHY22MuDp = CompFactory.DerivationFramework.MuPlusDsCascade(
190 name = "BPHY22MuDp",
191 HypothesisName = "B",
192 TrkVertexFitterTool = BMuDxVertexFit,
193 V0Tools = V0Tools,
194 PVRefitter = PVrefit,
195 DxHypothesis = 411,
196 ApplyDxMassConstraint = False,
197 DxMassLowerCut = 1869.59 - 180.,
198 DxMassUpperCut = 1869.59 + 250.,
199 MassLowerCut = 1000,
200 MassUpperCut = 12500,
201 Chi2Cut = 10,
202 RefitPV = True,
203 combOnly = True,
204 TrackSelectorTool = trackselect,
205 useMCPCuts = False,
206 muonThresholdPt = 2700,
207 muonCollectionKey = "Muons",
208 useCombinedMeasurement = False, # Only takes effect if combOnly=True
209 RefPVContainerName = "BPHY22RefittedPrimaryVertices",
210 CascadeVertexCollections = ["BMuDpCascadeSV2", "BMuDpCascadeSV1"],
211 DxVertices = "BPHY22Dh3Candidates")
212
213 BPHY22MuLambdaC = CompFactory.DerivationFramework.MuPlusDsCascade(
214 name = "BPHY22MuLambdaC",
215 HypothesisName = "B",
216 TrkVertexFitterTool = BMuDxVertexFit,
217 V0Tools = V0Tools,
218 PVRefitter = PVrefit,
219 DxHypothesis = 4122,
220 ApplyDxMassConstraint = False,
221 DxMassLowerCut = 2286.46 - 200,
222 DxMassUpperCut = 2286.46 + 220,
223 MassLowerCut = 1000,
224 MassUpperCut = 12500,
225 Chi2Cut = 10,
226 RefitPV = True,
227 combOnly = True,
228 TrackSelectorTool = trackselect,
229 useMCPCuts = False,
230 muonThresholdPt = 2700,
231 muonCollectionKey = "Muons",
232 useCombinedMeasurement = False, # Only takes effect if combOnly=True
233 RefPVContainerName = "BPHY22RefittedPrimaryVertices",
234 CascadeVertexCollections = ["BMuLambdaCCascadeSV2", "BMuLambdaCCascadeSV1"],
235 DxVertices = "BPHY22Dh3Candidates")
236
237 CascadeCollections = []
238 CascadeCollections += BPHY22MuDpst.CascadeVertexCollections
239 CascadeCollections += BPHY22MuDp.CascadeVertexCollections
240 CascadeCollections += BPHY22MuDs.CascadeVertexCollections
241 CascadeCollections += BPHY22MuLambdaC.CascadeVertexCollections
242
243 BPHY22_AugOriginalCounts = acc.popToolsAndMerge(
244 AugOriginalCountsCfg(flags, name = "BPHY22_AugOriginalCounts"))
245
246 if not isSimulation: #Only Skim Data
247 BPHY22_SelectBMuDxEvent = CompFactory.DerivationFramework.AnyVertexSkimmingTool("BPHY22_AnyVertexSkimmingTool",
248 VertexContainerNames =CascadeCollections )
249 acc.addPublicTool(BPHY22_SelectBMuDxEvent)
250
251 #====================================================================
252 # Make event selection based on an OR of the input skimming tools
253 #====================================================================
254
255 BPHY22SkimmingOR = CompFactory.DerivationFramework.FilterCombinationOR(
256 "BPHY22SkimmingOR",
257 FilterList = [BPHY22_SelectBMuDxEvent] )
258 acc.addPublicTool(BPHY22SkimmingOR)
259
260 augTools = [BPHY22MuPiSelectAndWrite, #BPHY22_Select_MuPi,
261 BPHY22DiTrkSelectAndWrite, #BPHY22_Select_D0, BPHY22_Select_D0b,
262 BPHY22Dh3SelectAndWrite, #BPHY22_Select_Ds, BPHY22_Select_Dp, BPHY22_Select_Dm, BPHY22_Select_LambdaCp, BPHY22_Select_LambdaCm,
263 BPHY22MuDpst,
264 BPHY22MuDs,
265 BPHY22MuDp,
266 BPHY22MuLambdaC,
267 BPHY22_AugOriginalCounts]
268 for t in augTools : acc.addPublicTool(t)
269 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel("BPHY22Kernel",
270 AugmentationTools = augTools,
271 #Only skim if not MC
272 SkimmingTools = [BPHY22SkimmingOR] if not isSimulation else [],
273 ThinningTools = []))
274
275 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
276 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
277 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
278 BPHY22SlimmingHelper = SlimmingHelper("BPHY22SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
279
280 # Needed for trigger objects
281 BPHY22SlimmingHelper.IncludeMuonTriggerContent = True
282 BPHY22SlimmingHelper.IncludeBPhysTriggerContent = True
283 from DerivationFrameworkBPhys.commonBPHYMethodsCfg import getDefaultAllVariables
284 AllVariables = getDefaultAllVariables()
285 StaticContent = []
286
287 AllVariables += ["PrimaryVertices"]
288 StaticContent += ["xAOD::VertexContainer#BPHY22RefittedPrimaryVertices"]
289 StaticContent += ["xAOD::VertexAuxContainer#BPHY22RefittedPrimaryVerticesAux."]
290
291
292 AllVariables += ["InDetTrackParticles"]
293
294
297 AllVariables += ["CombinedMuonTrackParticles"]
298 AllVariables += ["ExtrapolatedMuonTrackParticles"]
299
300
301 AllVariables += ["Muons"]
302
303
304 StaticContent += ["xAOD::VertexContainer#%s" % BPHY22MuPiSelectAndWrite.OutputVtxContainerName]
305
306 StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY22MuPiSelectAndWrite.OutputVtxContainerName]
307
308
309 for cascades in CascadeCollections:
310 StaticContent += ["xAOD::VertexContainer#%s" % cascades]
311 StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % cascades]
312
313 # Tagging information (in addition to that already requested by usual algorithms)
314 AllVariables += ["MuonSpectrometerTrackParticles" ]
315
316 # Truth information for MC only
317 if isSimulation:
318 AllVariables += ["TruthEvents","TruthParticles","TruthVertices","MuonTruthParticles"]
319
320 AllVariables = list(set(AllVariables)) # remove duplicates
321 BPHY22SlimmingHelper.AllVariables = AllVariables
322 BPHY22SlimmingHelper.StaticContent = StaticContent
323 BPHY22ItemList = BPHY22SlimmingHelper.GetItemList()
324 acc.merge(OutputStreamCfg(flags, "DAOD_BPHY22", ItemList=BPHY22ItemList, AcceptAlgs=["BPHY22Kernel"]))
325 acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_BPHY22", AcceptAlgs=["BPHY22Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
326 acc.printConfig(withDetails=True, summariseProps=True, onlyComponents = [], printDefaults=True)
327 return acc
STL class.

Variable Documentation

◆ BPHYDerivationName

str BPHY22.BPHYDerivationName = "BPHY22"

Definition at line 12 of file BPHY22.py.

◆ streamName

str BPHY22.streamName = "StreamDAOD_BPHY22"

Definition at line 13 of file BPHY22.py.