ATLAS Offline Software
Functions | Variables
BPHY28 Namespace Reference

Functions

def BPHY28Kernel (flags)
 
def BPHY28Cfg (flags)
 

Variables

string BPHYDerivationName = "BPHY28"
 
string streamName = "StreamDAOD_BPHY28"
 
string MuMuContainerName = "BPHY28MuMuCandidates"
 
string BsPhiMuMuContainerName = "BPHY28BsKKMuMuCandidates"
 

Function Documentation

◆ BPHY28Cfg()

def BPHY28.BPHY28Cfg (   flags)

Definition at line 204 of file BPHY28.py.

204 def BPHY28Cfg(flags):
205  doLRT = flags.Tracking.doLargeD0
206  isSimulation = flags.Input.isMC
207  acc = BPHY28Kernel(flags)
208  from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
209  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
210  from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
211  BPHY28SlimmingHelper = SlimmingHelper("BPHY28SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
212  from DerivationFrameworkBPhys.commonBPHYMethodsCfg import getDefaultAllVariables
213  AllVariables = getDefaultAllVariables()
214  StaticContent = []
215 
216  # Needed for trigger objects
217  BPHY28SlimmingHelper.IncludeMuonTriggerContent = True
218  BPHY28SlimmingHelper.IncludeBPhysTriggerContent = True
219 
220 
221  AllVariables += ["PrimaryVertices"]
222  StaticContent += ["xAOD::VertexContainer#BPHY28RefittedPrimaryVertices"]
223  StaticContent += ["xAOD::VertexAuxContainer#BPHY28RefittedPrimaryVerticesAux."]
224 
225 
226 
227  AllVariables += ["InDetTrackParticles", "InDetLargeD0TrackParticles"] if doLRT else ["InDetTrackParticles"]
228 
229 
232  AllVariables += ["CombinedMuonTrackParticles"]
233  AllVariables += ["ExtrapolatedMuonTrackParticles"]
234 
235 
236  AllVariables += ["Muons", "MuonsLRT"] if doLRT else ["Muons"]
237 
238 
239 
240  StaticContent += ["xAOD::VertexContainer#%s" % MuMuContainerName]
241 
242  StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % MuMuContainerName]
243 
244  StaticContent += ["xAOD::VertexContainer#%s" % BsPhiMuMuContainerName]
245  StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BsPhiMuMuContainerName]
246 
247 
248  # Tagging information (in addition to that already requested by usual algorithms)
249  AllVariables += [ "MuonSpectrometerTrackParticles" ]
250  SmartVar = ["Photons", "Electrons", "LRTElectrons"] if doLRT else ["Photons", "Electrons"] #[ tagJetCollections ]
251 
252 
253  # Truth information for MC only
254  if isSimulation:
255  AllVariables += ["TruthEvents","TruthParticles","TruthVertices","MuonTruthParticles", "egammaTruthParticles" ]
256 
257 
258  AllVariables = list(set(AllVariables)) # remove duplicates
259 
260  BPHY28SlimmingHelper.AllVariables = AllVariables
261  BPHY28SlimmingHelper.StaticContent = StaticContent
262  BPHY28SlimmingHelper.SmartCollections = SmartVar
263  BPHY28ItemList = BPHY28SlimmingHelper.GetItemList()
264  acc.merge(OutputStreamCfg(flags, "DAOD_BPHY28", ItemList=BPHY28ItemList, AcceptAlgs=["BPHY28Kernel"]))
265  acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_BPHY28", AcceptAlgs=["BPHY28Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
266  acc.printConfig(withDetails=True, summariseProps=True, onlyComponents = [], printDefaults=True, printComponentsOnly=False)
267  return acc

◆ BPHY28Kernel()

def BPHY28.BPHY28Kernel (   flags)

Definition at line 19 of file BPHY28.py.

19 def BPHY28Kernel(flags):
20 
21  # Lists for better code organization
22  augList = [] # List of active augmentation tools
23  skimList = [] # List of active skimming algorithms
24  thinList = [] # List of active thinning algorithms
25  thinTrkVtxList = [] # List of reconstructed candidates to use for the thinning of tracks from vertices
26 
27 
28  from DerivationFrameworkBPhys.commonBPHYMethodsCfg import (BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg, BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg)
29  from JpsiUpsilonTools.JpsiUpsilonToolsConfig import PrimaryVertexRefittingToolCfg
30  acc = ComponentAccumulator()
31  isSimulation = flags.Input.isMC
32  V0Tools = acc.popToolsAndMerge(BPHY_V0ToolCfg(flags, BPHYDerivationName))
33  vkalvrt = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName)) # VKalVrt vertex fitter
34  acc.addPublicTool(vkalvrt)
35  acc.addPublicTool(V0Tools)
36  trackselect = acc.popToolsAndMerge(BPHY_InDetDetailedTrackSelectorToolCfg(flags, BPHYDerivationName))
37  acc.addPublicTool(trackselect)
38  vpest = acc.popToolsAndMerge(BPHY_VertexPointEstimatorCfg(flags, BPHYDerivationName))
39  acc.addPublicTool(vpest)
40  PVrefit = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags))
41  acc.addPublicTool(PVrefit)
42 
43  # LRT
44  doLRT = flags.Tracking.doLargeD0
45  if not doLRT : print("BPHY28: LRT tracks disabled")
46  mainMuonInput = "StdWithLRTMuons" if doLRT else "Muons"
47  mainIDInput = "InDetWithLRTTrackParticles" if doLRT else "InDetTrackParticles"
48  if doLRT:
49  from DerivationFrameworkLLP.LLPToolsConfig import LRTMuonMergerAlg
50  from AthenaConfiguration.Enums import LHCPeriod
51  acc.merge(LRTMuonMergerAlg( flags,
52  PromptMuonLocation = "Muons",
53  LRTMuonLocation = "MuonsLRT",
54  OutputMuonLocation = mainMuonInput,
55  CreateViewCollection = True,
56  UseRun3WP = flags.GeoModel.Run == LHCPeriod.Run3))
57  from DerivationFrameworkInDet.InDetToolsConfig import InDetLRTMergeCfg
58  acc.merge(InDetLRTMergeCfg(flags))
59  toRelink = ["InDetTrackParticles", "InDetLargeD0TrackParticles"] if doLRT else []
60  MuonReLink = [ "Muons", "MuonsLRT" ] if doLRT else []
61 
62 
63  BPHY28_AugOriginalCounts = CompFactory.DerivationFramework.AugOriginalCounts(
64  name = "BPHY28_AugOriginalCounts",
65  VertexContainer = "PrimaryVertices",
66  TrackContainer = "InDetTrackParticles",
67  TrackLRTContainer = "InDetLargeD0TrackParticles" if doLRT else "")
68  augList += [ BPHY28_AugOriginalCounts ]
69 
70  BPHY28MuMuFinder = CompFactory.Analysis.JpsiFinder(
71  name = "BPHY28MuMuFinder",
72  muAndMu = True,
73  muAndTrack = False,
74  TrackAndTrack = False,
75  assumeDiMuons = True,
76  invMassUpper = 100000.0,
77  invMassLower = 0.0,
78  Chi2Cut = 200.,
79  oppChargesOnly = True,
80  combOnly = True,
81  atLeastOneComb = False,
82  useCombinedMeasurement = False, # Only takes effect if combOnly=True
83  muonCollectionKey = mainMuonInput,
84  TrackParticleCollection = mainIDInput,
85  useV0Fitter = False, # if False a TrkVertexFitterTool will be used
86  TrkVertexFitterTool = vkalvrt,
87  V0VertexFitterTool = None,
88  TrackSelectorTool = trackselect,
89  VertexPointEstimator = vpest,
90  useMCPCuts = False )
91 
92  BPHY28MuMuSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(name = "BPHY28MuMuSelectAndWrite",
93  VertexSearchTool = BPHY28MuMuFinder,
94  OutputVtxContainerName = MuMuContainerName,
95  PVContainerName = "PrimaryVertices",
96  V0Tools = V0Tools,
97  PVRefitter = PVrefit,
98  RefPVContainerName = "SHOULDNOTBEUSED",
99  RelinkTracks = toRelink,
100  RelinkMuons = MuonReLink,
101  DoVertexType = 7)
102  augList += [ BPHY28MuMuSelectAndWrite ]
103  thinTrkVtxList += [ MuMuContainerName ]
104 
105 
106  BPHY28_Select_Jpsi2mumu = CompFactory.DerivationFramework.Select_onia2mumu(
107  name = "BPHY28_Select_Jpsi2mumu",
108  HypothesisName = "Jpsi",
109  InputVtxContainerName = MuMuContainerName,
110  V0Tools = V0Tools,
111  VtxMassHypo = 3096.916,
112  MassMin = 2000.0,
113  MassMax = 3600.0,
114  Chi2Max = 200, Do3d = False,
115  DoVertexType = 7)
116  augList += [ BPHY28_Select_Jpsi2mumu ]
117 
118 
119  BPHY28BsKKMuMu = CompFactory.Analysis.JpsiPlus2Tracks(name = "BPHY28BsKKMuMu",
120  kaonkaonHypothesis = True,
121  pionpionHypothesis = False,
122  kaonpionHypothesis = False,
123  trkThresholdPt = 500.0,
124  trkMaxEta = 3.0,
125  BMassUpper = 5900.0,
126  BMassLower = 4900.0,
127  DiTrackMassUpper = 1220,
128  DiTrackMassLower = 820,
129  Chi2Cut = 200.0, # this is chi2/ndf cut
130  TrkQuadrupletMassUpper = 6000.0,
131  TrkQuadrupletMassLower = 4800.0,
132  JpsiContainerKey = MuMuContainerName,
133  TrackParticleCollection = mainIDInput,
134  MuonsUsedInJpsi = mainMuonInput,
135  TrkVertexFitterTool = vkalvrt,
136  TrackSelectorTool = trackselect,
137  UseMassConstraint = False)
138 
139 
140  BPHY28BsKKSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(name = "BPHY28BsKKSelectAndWrite",
141  VertexSearchTool = BPHY28BsKKMuMu,
142  OutputVtxContainerName = BsPhiMuMuContainerName,
143  PVContainerName = "PrimaryVertices",
144  V0Tools = V0Tools,
145  PVRefitter = PVrefit,
146  RefPVContainerName = "BPHY28RefittedPrimaryVertices",
147  RefitPV = True, Do3d = False,
148  RelinkTracks = toRelink,
149  MaxPVrefit = 10000, DoVertexType = 7)
150  augList += [ BPHY28BsKKSelectAndWrite ]
151  thinTrkVtxList += [ BsPhiMuMuContainerName ]
152 
153 
154  BPHY28_Select_Bs2KKMuMu = CompFactory.DerivationFramework.Select_onia2mumu(
155  name = "BPHY28_Select_Bs2KKMuMu",
156  HypothesisName = "Bs",
157  InputVtxContainerName = BsPhiMuMuContainerName,
158  V0Tools = V0Tools,
159  TrkMasses = [105.658, 105.658, 493.677, 493.677],
160  VtxMassHypo = 5366.3,
161  MassMin = 4900.0,
162  MassMax = 5900.0, Do3d = False,
163  Chi2Max = 200)
164  augList += [ BPHY28_Select_Bs2KKMuMu ]
165 
166 
167  if not isSimulation: #Only Skim Data
168  BPHY28_SelectBsKKMuMuEvent = CompFactory.DerivationFramework.xAODStringSkimmingTool(
169  name = "BPHY28_SelectBsKKMuMuEvent",
170  expression = "count(BPHY28BsKKMuMuCandidates.passed_Bs) > 0")
171 
172  skimList += [ BPHY28_SelectBsKKMuMuEvent ]
173 
174 
175 
177  BPHY28_Thin_VtxTracks = CompFactory.DerivationFramework.Thin_vtxTrk( name = "BPHY28_Thin_VtxTracks",
178  StreamName = streamName,
179  TrackParticleContainerName = "InDetTrackParticles",
180  VertexContainerNames = thinTrkVtxList,
181  IgnoreFlags = True )
182  thinList += [ BPHY28_Thin_VtxTracks ]
183 
184  # LRT ID tracks
185  if doLRT:
186  BPHY28_Thin_VtxTracks_LRT = CompFactory.DerivationFramework.Thin_vtxTrk( name = "BPHY28_Thin_VtxTracks_LRT",
187  StreamName = streamName,
188  TrackParticleContainerName = "InDetLargeD0TrackParticles",
189  VertexContainerNames = thinTrkVtxList,
190  IgnoreFlags = True )
191  thinList += [ BPHY28_Thin_VtxTracks_LRT ]
192 
193 
194  for t in augList + skimList + thinList : acc.addPublicTool(t)
195  acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel("BPHY28Kernel",
196  AugmentationTools = augList,
197  #Only skim if not MC
198  SkimmingTools = skimList,
199  ThinningTools = thinList))
200 
201  return acc
202 
203 

Variable Documentation

◆ BPHYDerivationName

string BPHY28.BPHYDerivationName = "BPHY28"

Definition at line 12 of file BPHY28.py.

◆ BsPhiMuMuContainerName

string BPHY28.BsPhiMuMuContainerName = "BPHY28BsKKMuMuCandidates"

Definition at line 16 of file BPHY28.py.

◆ MuMuContainerName

string BPHY28.MuMuContainerName = "BPHY28MuMuCandidates"

Definition at line 15 of file BPHY28.py.

◆ streamName

string BPHY28.streamName = "StreamDAOD_BPHY28"

Definition at line 13 of file BPHY28.py.

python.HIGG1D1CustomVertexConfig.PrimaryVertexRefittingToolCfg
def PrimaryVertexRefittingToolCfg(flags, **kwargs)
Definition: HIGG1D1CustomVertexConfig.py:7
python.LLPToolsConfig.LRTMuonMergerAlg
def LRTMuonMergerAlg(flags, name="LLP1_MuonLRTMergingAlg", **kwargs)
Definition: LLPToolsConfig.py:180
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
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
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
commonBPHYMethodsCfg.BPHY_V0ToolCfg
def BPHY_V0ToolCfg(flags, BPHYDerivationName)
Definition: commonBPHYMethodsCfg.py:11
BPHY28.BPHY28Cfg
def BPHY28Cfg(flags)
Definition: BPHY28.py:204
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.InDetToolsConfig.InDetLRTMergeCfg
def InDetLRTMergeCfg(flags, name="InDetLRTMerge", **kwargs)
Definition: InDetToolsConfig.py:14
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
BPHY28.BPHY28Kernel
def BPHY28Kernel(flags)
Definition: BPHY28.py:19