ATLAS Offline Software
Functions | Variables
BPHY22 Namespace Reference

Functions

def BPHY22Cfg (flags)
 

Variables

string BPHYDerivationName = "BPHY22"
 
string streamName = "StreamDAOD_BPHY22"
 

Function Documentation

◆ BPHY22Cfg()

def BPHY22.BPHY22Cfg (   flags)

Definition at line 15 of file BPHY22.py.

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

Variable Documentation

◆ BPHYDerivationName

string BPHY22.BPHYDerivationName = "BPHY22"

Definition at line 12 of file BPHY22.py.

◆ streamName

string BPHY22.streamName = "StreamDAOD_BPHY22"

Definition at line 13 of file BPHY22.py.

python.HIGG1D1CustomVertexConfig.PrimaryVertexRefittingToolCfg
def PrimaryVertexRefittingToolCfg(flags, **kwargs)
Definition: HIGG1D1CustomVertexConfig.py:7
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.OutputStreamConfig.OutputStreamCfg
def OutputStreamCfg(flags, streamName, ItemList=[], MetadataItemList=[], disableEventTag=False, trigNavThinningSvc=None, takeItemsFromInput=False, extendProvenanceRecord=True, AcceptAlgs=[], HelperTools=[])
Definition: OutputStreamConfig.py:12
commonBPHYMethodsCfg.BPHY_TrkVKalVrtFitterCfg
def BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName, **kwargs)
Definition: commonBPHYMethodsCfg.py:6
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
python.PartPropSvcConfig.PartPropSvcCfg
def PartPropSvcCfg(flags, **kwargs)
Definition: PartPropSvcConfig.py:6
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
BPHY22.BPHY22Cfg
def BPHY22Cfg(flags)
Definition: BPHY22.py:15
commonBPHYMethodsCfg.BPHY_V0ToolCfg
def BPHY_V0ToolCfg(flags, BPHYDerivationName)
Definition: commonBPHYMethodsCfg.py:11
python.InDetConversionFinderToolsConfig.BPHY_VertexPointEstimatorCfg
def BPHY_VertexPointEstimatorCfg(flags, name="BPHY_VertexPointEstimator", **kwargs)
Definition: InDetConversionFinderToolsConfig.py:69
commonBPHYMethodsCfg.getDefaultAllVariables
def getDefaultAllVariables()
Definition: commonBPHYMethodsCfg.py:32
python.InDetTrackSelectorToolConfig.BPHY_InDetDetailedTrackSelectorToolCfg
def BPHY_InDetDetailedTrackSelectorToolCfg(flags, name='BPHY_InDetDetailedTrackSelectorTool', **kwargs)
Definition: InDetTrackSelectorToolConfig.py:213
InfileMetaDataConfig.SetupMetaDataForStreamCfg
def SetupMetaDataForStreamCfg(flags, streamName="", AcceptAlgs=None, createMetadata=None, propagateMetadataFromInput=True, *args, **kwargs)
Definition: InfileMetaDataConfig.py:222
SlimmingHelper
Definition: SlimmingHelper.py:1