ATLAS Offline Software
Functions | Variables
BPHY18 Namespace Reference

Functions

def BPHY18Cfg (flags)
 

Variables

string BPHYDerivationName = "BPHY18"
 
string streamName = "StreamDAOD_BPHY18"
 

Function Documentation

◆ BPHY18Cfg()

def BPHY18.BPHY18Cfg (   flags)

Definition at line 14 of file BPHY18.py.

14 def BPHY18Cfg(flags):
15  from DerivationFrameworkBPhys.commonBPHYMethodsCfg import (BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg, BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg)
16  from JpsiUpsilonTools.JpsiUpsilonToolsConfig import PrimaryVertexRefittingToolCfg
17  from DerivationFrameworkEGamma.EGammaCommonConfig import EGammaCommonCfg
18  from AthenaServices.PartPropSvcConfig import PartPropSvcCfg
19 
20  acc = ComponentAccumulator()
21  PartPropSvcName = acc.getPrimaryAndMerge(PartPropSvcCfg(flags)).name
22  acc.merge(EGammaCommonCfg(flags))
23  isSimulation = flags.Input.isMC
24  V0Tools = acc.popToolsAndMerge(BPHY_V0ToolCfg(flags, BPHYDerivationName))
25  vkalvrt = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName)) # VKalVrt vertex fitter
26  acc.addPublicTool(vkalvrt)
27  acc.addPublicTool(V0Tools)
28  trackselect = acc.popToolsAndMerge(BPHY_InDetDetailedTrackSelectorToolCfg(flags, BPHYDerivationName))
29  acc.addPublicTool(trackselect)
30  vpest = acc.popToolsAndMerge(BPHY_VertexPointEstimatorCfg(flags, BPHYDerivationName))
31  acc.addPublicTool(vpest)
32 
33  #BPHY18TriggerSkim = CompFactory.DerivationFramework.TriggerSkimmingTool(name = "BPHY18TriggerSkim",
34 # TriggerListOR = triggerList,
35 # TriggerListORHLTOnly = triggerList_unseeded )
36 
37  ElectronLHSelectorLHvloose_nod0 = CompFactory.AsgElectronLikelihoodTool("ElectronLHSelectorLHvloosenod0",
38  primaryVertexContainer = "PrimaryVertices",
39  ConfigFile="ElectronPhotonSelectorTools/offline/mc20_20230321/ElectronLikelihoodVeryLooseOfflineConfig2017_Smooth_NoD0_NoPix.conf")
40 
41  # decorate electrons with the output of LH
42 
43  ElectronPassLHvloosenod0 = CompFactory.DerivationFramework.EGElectronLikelihoodToolWrapper(name = "ElectronPassLHvloosenod0",
44  EGammaElectronLikelihoodTool = ElectronLHSelectorLHvloose_nod0,
45  EGammaFudgeMCTool = "",
46  CutType = "",
47  StoreGateEntryName = "DFCommonElectronsLHVeryLoosenod0",
48  ContainerName = "Electrons",
49  StoreTResult=False)
50 
51  BPHY18DiElectronFinder = CompFactory.Analysis.JpsiFinder_ee(
52  name = "BPHY18DiElectronFinder",
53  elAndEl = True,
54  elAndTrack = False,
55  TrackAndTrack = False,
56  assumeDiElectrons = True,
57  elThresholdPt = 4000.0,
58  invMassUpper = 7000.0,
59  invMassLower = 1.0,
60  Chi2Cut = 30.,
61  oppChargesOnly = False,
62  allChargeCombinations = True,
63  useElectronTrackMeasurement = True,
64  electronCollectionKey = "Electrons",
65  TrackParticleCollection = "GSFTrackParticles",
66  useEgammaCuts = True,
67  V0VertexFitterTool = None,
68  useV0Fitter = False,
69  TrkVertexFitterTool = vkalvrt,
70  TrackSelectorTool = trackselect,
71  VertexPointEstimator = vpest,
72  ElectronSelection = "d0_or_nod0",
73  PartPropSvc = PartPropSvcName
74  )
75  extraTools = [BPHY18DiElectronFinder]
76  BPHY18DiElectronSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
77  name = "BPHY18DiElectronSelectAndWrite",
78  VertexSearchTool = BPHY18DiElectronFinder,
79  OutputVtxContainerName = "BPHY18DiElectronCandidates",
80  PVContainerName = "PrimaryVertices",
81  V0Tools = V0Tools,
82  PVRefitter = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags)),
83  RefPVContainerName = "SHOULDNOTBEUSED",
84  DoVertexType = 7
85  )
86 
87  BPHY18_Select_DiElectrons = CompFactory.DerivationFramework.Select_onia2mumu(
88  name = "BPHY18_Select_DiElectrons",
89  HypothesisName = "Jpsi",
90  InputVtxContainerName = "BPHY18DiElectronCandidates",
91  V0Tools = V0Tools,
92  VtxMassHypo = 3096.916,
93  MassMin = 1.0,
94  MassMax = 7000.0,
95  Chi2Max = 30,
96  DoVertexType = 7
97  )
98 
99  BPHY18BeeKst = CompFactory.Analysis.JpsiPlus2Tracks(
100  name = "BPHY18BeeKstFinder",
101  kaonkaonHypothesis = False,
102  pionpionHypothesis = False,
103  kaonpionHypothesis = True,
104  oppChargesOnly = False,
105  SameChargesOnly = False,
106  trkThresholdPt = 500.0,
107  trkMaxEta = 3.0,
108  BThresholdPt = 1000.,
109  BMassLower = 3000.0,
110  BMassUpper = 6500.0,
111  JpsiContainerKey = "BPHY18DiElectronCandidates",
112  TrackParticleCollection = "InDetTrackParticles",
113  ExcludeCrossJpsiTracks = False,
114  TrkVertexFitterTool = vkalvrt,
115  TrackSelectorTool = trackselect,
116  UseMassConstraint = False,
117  DiTrackMassUpper = 1110.,
118  DiTrackMassLower = 690.,
119  Chi2Cut = 15.0,
120  DiTrackPt = 500.,
121  TrkQuadrupletMassLower = 1000.0,
122  TrkQuadrupletMassUpper = 10000.0,
123  FinalDiTrackPt = 500.,
124  UseGSFTrackIndices = [0,1]
125  )
126  BPHY18BeeKstSelectAndWrite = CompFactory.DerivationFramework.Reco_Vertex(
127  name = "BPHY18BeeKstSelectAndWrite",
128  VertexSearchTool = BPHY18BeeKst,
129  OutputVtxContainerName = "BeeKstCandidates",
130  PVContainerName = "PrimaryVertices",
131  RefPVContainerName = "BPHY18RefittedPrimaryVertices",
132  RefitPV = True,
133  V0Tools = V0Tools,
134  PVRefitter = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags)),
135  MaxPVrefit = 10000,
136  DoVertexType = 7
137  )
138 
139  BPHY18_Select_BeeKst = CompFactory.DerivationFramework.Select_onia2mumu(
140  name = "BPHY18_Select_BeeKst",
141  HypothesisName = "Bd",
142  InputVtxContainerName = "BeeKstCandidates",
143  V0Tools = V0Tools,
144  TrkMasses = [0.511, 0.511, 493.677, 139.570],
145  VtxMassHypo = 5279.6,
146  MassMin = 1.0,
147  MassMax = 10000.0,
148  Chi2Max = 30.0
149  )
150 
151  BPHY18_Select_BeeKstbar = CompFactory.DerivationFramework.Select_onia2mumu(
152  name = "BPHY18_Select_Bd2JpsiKstbar",
153  HypothesisName = "Bdbar",
154  InputVtxContainerName = "BeeKstCandidates",
155  V0Tools = V0Tools,
156  TrkMasses = [0.511, 0.511, 139.570, 493.677],
157  VtxMassHypo = 5279.6,
158  MassMin = 1.0,
159  MassMax = 10000.0,
160  Chi2Max = 30.0
161  )
162 
163 
164  BPHY18_diMeson_revertex = CompFactory.DerivationFramework.ReVertex(
165  name = "BPHY18_diMeson_revertex",
166  InputVtxContainerName = "BeeKstCandidates",
167  V0Tools = V0Tools,
168  PVRefitter = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags)),
169  TrackIndices = [ 2, 3 ],
170  TrkVertexFitterTool = vkalvrt,
171  OutputVtxContainerName = "BPHY18DiMeson"
172  )
173 
174  BPHY18_Select_Kpi = CompFactory.DerivationFramework.Select_onia2mumu(
175  name = "BPHY18_Select_Kpi",
176  HypothesisName = "Kpi",
177  InputVtxContainerName = "BPHY18DiMeson",
178  V0Tools = V0Tools,
179  TrkMasses = [ 493.677, 139.570 ],
180  VtxMassHypo = 891.66,
181  MassMin = 1.0,
182  MassMax = 100000.0,
183  Chi2Max = 100.0
184  )
185 
186  BPHY18_Select_piK = CompFactory.DerivationFramework.Select_onia2mumu(
187  name = "BPHY18_Select_piK",
188  HypothesisName = "piK",
189  InputVtxContainerName = "BPHY18DiMeson",
190  V0Tools = V0Tools,
191  TrkMasses = [ 139.570, 493.677 ],
192  VtxMassHypo = 891.66,
193  MassMin = 1.0,
194  MassMax = 100000.0,
195  Chi2Max = 100.0
196  )
197 
198  BPHY18_SelectBeeKstEvent = CompFactory.DerivationFramework.xAODStringSkimmingTool(
199  name = "BPHY18_SelectBeeKstEvent",
200  expression = "(count(BeeKstCandidates.passed_Bd > 0) + count(BeeKstCandidates.passed_Bdbar > 0)) > 0")
201 
202  BPHY18SkimmingAND = CompFactory.DerivationFramework.FilterCombinationAND(
203  "BPHY18SkimmingAND",
204  #FilterList = [BPHY18_SelectBeeKstEvent, BPHY18TriggerSkim]) # TODO: Need to update the trigger names
205  FilterList = [BPHY18_SelectBeeKstEvent])
206  extraTools += [BPHY18_SelectBeeKstEvent, BPHY18SkimmingAND]
207  BPHY18_thinningTool_Tracks = CompFactory.DerivationFramework.Thin_vtxTrk(
208  name = "BPHY18_thinningTool_Tracks",
209  TrackParticleContainerName = "InDetTrackParticles",
210  StreamName = streamName,
211  VertexContainerNames = ["BeeKstCandidates"],
212  PassFlags = ["passed_Bd", "passed_Bdbar"] )
213 
214  BPHY18_thinningTool_GSFTracks = CompFactory.DerivationFramework.Thin_vtxTrk(
215  name = "BPHY18_thinningTool_GSFTracks",
216  TrackParticleContainerName = "GSFTrackParticles",
217  StreamName = streamName,
218  VertexContainerNames = ["BeeKstCandidates"],
219  PassFlags = ["passed_Bd", "passed_Bdbar"] )
220 
221  BPHY18_thinningTool_PV = CompFactory.DerivationFramework.BPhysPVThinningTool(
222  name = "BPHY18_thinningTool_PV",
223  StreamName = streamName,
224  CandidateCollections = ["BeeKstCandidates"],
225  KeepPVTracks = True
226  )
227 
228  BPHY18MuonTPThinningTool = CompFactory.DerivationFramework.MuonTrackParticleThinning(
229  name = "BPHY18MuonTPThinningTool",
230  StreamName = streamName,
231  MuonKey = "Muons",
232  InDetTrackParticlesKey = "InDetTrackParticles")
233 
234  BPHY18EgammaTPThinningTool = CompFactory.DerivationFramework.EgammaTrackParticleThinning(
235  name = "BPHY18EgammaTPThinningTool",
236  StreamName = streamName,
237  SGKey = "Electrons",
238  InDetTrackParticlesKey = "InDetTrackParticles")
239 
240  BPHY18TruthThinTool = CompFactory.DerivationFramework.GenericTruthThinning(name = "BPHY18TruthThinTool",
241  ParticleSelectionString = "abs(TruthParticles.pdgId) == 11 || abs(TruthParticles.pdgId) == 13 || abs(TruthParticles.pdgId) == 10311 || abs(TruthParticles.pdgId) == 521 || abs(TruthParticles.pdgId) == 523 || abs(TruthParticles.pdgId) == 511 || abs(TruthParticles.pdgId) == 513",
242  PreserveDescendants = True,
243  StreamName = streamName,
244  PreserveAncestors = True)
245 
246  BPHY18TruthThinNoChainTool = CompFactory.DerivationFramework.GenericTruthThinning(name = "BPHY18TruthThinNoChainTool",
247  ParticleSelectionString = "abs(TruthParticles.pdgId) == 5 || abs(TruthParticles.pdgId) == 12 || abs(TruthParticles.pdgId) == 14",
248  PreserveDescendants = False,
249  StreamName = streamName,
250  PreserveAncestors = False)
251 
252  thinningCollection = [ BPHY18_thinningTool_Tracks, BPHY18_thinningTool_GSFTracks,
253  BPHY18_thinningTool_PV, #BPHY18_thinningTool_PV_GSF,
254  BPHY18EgammaTPThinningTool, BPHY18MuonTPThinningTool
255  ]
256 
257 
258  augTools = [ElectronPassLHvloosenod0,
259  BPHY18DiElectronSelectAndWrite, BPHY18_Select_DiElectrons,
260  BPHY18BeeKstSelectAndWrite, BPHY18_Select_BeeKst, BPHY18_Select_BeeKstbar,
261  BPHY18_diMeson_revertex, BPHY18_Select_Kpi, BPHY18_Select_piK]
262  skimTools = [BPHY18SkimmingAND]
263 
264  if isSimulation:
265  thinningCollection += [BPHY18TruthThinTool,BPHY18TruthThinNoChainTool]
266 
267  for t in augTools + skimTools + thinningCollection + extraTools: acc.addPublicTool(t)
268  acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel("BPHY18Kernel",
269  AugmentationTools = augTools,
270  #Only skim if not MC
271  SkimmingTools = skimTools,
272  ThinningTools = thinningCollection))
273 
274  from IsolationAlgs.DerivationTrackIsoConfig import DerivationTrackIsoCfg
275  acc.merge(DerivationTrackIsoCfg(flags, object_types=("Electrons", "Muons")))
276 
277 
278  #====================================================================
279  # Slimming
280  #====================================================================
281 
282  from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
283  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
284  from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
285  BPHY18SlimmingHelper = SlimmingHelper("BPHY18SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
286  from DerivationFrameworkBPhys.commonBPHYMethodsCfg import getDefaultAllVariables
287  AllVariables = getDefaultAllVariables()
288  StaticContent = []
289  ExtraVariables = []
290  BPHY18SlimmingHelper.SmartCollections = ["Electrons", "Muons", "InDetTrackParticles" ]
291 
292  # Needed for trigger objects
293  BPHY18SlimmingHelper.IncludeMuonTriggerContent = False
294  BPHY18SlimmingHelper.IncludeBPhysTriggerContent = False
295  BPHY18SlimmingHelper.IncludeEGammaTriggerContent = True
296 
297  AllVariables += ["PrimaryVertices"]
298  StaticContent += ["xAOD::VertexContainer#BPHY18RefittedPrimaryVertices"]
299  StaticContent += ["xAOD::VertexAuxContainer#BPHY18RefittedPrimaryVerticesAux."]
300 
301  ExtraVariables += ["Muons.etaLayer1Hits.etaLayer2Hits.etaLayer3Hits.etaLayer4Hits.phiLayer1Hits.phiLayer2Hits.phiLayer3Hits.phiLayer4Hits",
302  "Muons.numberOfTriggerEtaLayers.numberOfPhiLayers",
303  "InDetTrackParticles.numberOfTRTHits.numberOfTRTHighThresholdHits.vx.vy.vz.pixeldEdx",
304  "PrimaryVertices.chiSquared.covariance",
305  "Electrons.deltaEta1.DFCommonElectronsLHVeryLoosenod0.ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt1000.ptvarcone20_Nonprompt_All_MaxWeightTTVA_pt1000.ptvarcone30_Nonprompt_All_MaxWeightTTVA_pt500.ptvarcone40_Nonprompt_All_MaxWeightTTVALooseCone_pt1000.ptvarcone20_Nonprompt_All_MaxWeightTTVALooseCone_pt1000",
306  "egammaClusters.calE.calEta.calPhi.e_sampl.eta_sampl.etaCalo.phiCalo.ETACALOFRAME.PHICALOFRAME",
307  "HLT_xAOD__ElectronContainer_egamma_ElectronsAuxDyn.charge"]
308 
309 
310  StaticContent += ["xAOD::VertexContainer#%s" % BPHY18DiElectronSelectAndWrite.OutputVtxContainerName]
311  StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY18DiElectronSelectAndWrite.OutputVtxContainerName]
312 
313  StaticContent += ["xAOD::VertexContainer#%s" % BPHY18BeeKstSelectAndWrite.OutputVtxContainerName]
314  StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY18BeeKstSelectAndWrite.OutputVtxContainerName]
315 
316  StaticContent += ["xAOD::VertexContainer#%s" % BPHY18_diMeson_revertex.OutputVtxContainerName]
317  StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY18_diMeson_revertex.OutputVtxContainerName]
318 
319  AllVariables += [ "GSFTrackParticles"]
320 
321 
322  # Truth information for MC only
323  if isSimulation:
324  AllVariables += ["TruthEvents","TruthParticles","TruthVertices", "ElectronTruthParticles"]
325 
326  AllVariables = list(set(AllVariables)) # remove duplicates
327 
328  BPHY18SlimmingHelper.AllVariables = AllVariables
329  BPHY18SlimmingHelper.ExtraVariables = ExtraVariables
330 
331  BPHY18SlimmingHelper.StaticContent = StaticContent
332 
333  from DerivationFrameworkEGamma.ElectronsCPDetailedContent import ElectronsCPDetailedContent, GSFTracksCPDetailedContent
334  BPHY18SlimmingHelper.ExtraVariables += ElectronsCPDetailedContent
335  BPHY18SlimmingHelper.ExtraVariables += GSFTracksCPDetailedContent
336 
337  BPHY18ItemList = BPHY18SlimmingHelper.GetItemList()
338  acc.merge(OutputStreamCfg(flags, "DAOD_BPHY18", ItemList=BPHY18ItemList, AcceptAlgs=["BPHY18Kernel"]))
339  acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_BPHY18", AcceptAlgs=["BPHY18Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
340  acc.printConfig(withDetails=True, summariseProps=True, onlyComponents = [], printDefaults=True, printComponentsOnly=False)
341  return acc

Variable Documentation

◆ BPHYDerivationName

string BPHY18.BPHYDerivationName = "BPHY18"

Definition at line 11 of file BPHY18.py.

◆ streamName

string BPHY18.streamName = "StreamDAOD_BPHY18"

Definition at line 12 of file BPHY18.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
python.EGammaCommonConfig.EGammaCommonCfg
def EGammaCommonCfg(ConfigFlags)
Definition: EGammaCommonConfig.py:15
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
commonBPHYMethodsCfg.BPHY_V0ToolCfg
def BPHY_V0ToolCfg(flags, BPHYDerivationName)
Definition: commonBPHYMethodsCfg.py:11
BPHY18.BPHY18Cfg
def BPHY18Cfg(flags)
Definition: BPHY18.py:14
python.InDetConversionFinderToolsConfig.BPHY_VertexPointEstimatorCfg
def BPHY_VertexPointEstimatorCfg(flags, name="BPHY_VertexPointEstimator", **kwargs)
Definition: InDetConversionFinderToolsConfig.py:69
commonBPHYMethodsCfg.getDefaultAllVariables
def getDefaultAllVariables()
Definition: commonBPHYMethodsCfg.py:32
DerivationTrackIsoConfig.DerivationTrackIsoCfg
def DerivationTrackIsoCfg(flags, **jwarg)
Definition: DerivationTrackIsoConfig.py:11
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