ATLAS Offline Software
Loading...
Searching...
No Matches
BPHY4.py
Go to the documentation of this file.
1# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2#====================================================================
3# BPHY4.py
4#====================================================================
5
6from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
7from AthenaConfiguration.ComponentFactory import CompFactory
8from AthenaConfiguration.Enums import MetadataCategory
9
10BPHYDerivationName = "BPHY4"
11streamName = "StreamDAOD_BPHY4"
12
13def BPHY4Cfg(flags):
14 from DerivationFrameworkBPhys.commonBPHYMethodsCfg import (BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg, 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
24 BPHY4FourMuonTool = CompFactory.DerivationFramework.FourMuonTool(
25 name = "BPHY4FourMuonTool",
26 ptCut = 2500.0,
27 etaCut = 2.5,
28 muonCollectionKey = "Muons",
29 TrackParticleCollection = "InDetTrackParticles",
30 V0VertexFitterTool = None, # V0 vertex fitter
31 useV0Fitter = False, # if False a TrkVertexFitterTool will be used
32 TrkVertexFitterTool = vkalvrt, # VKalVrt vertex fitter
33 TrackSelectorTool = trackselect)
34 BPHY4_Reco_4mu = CompFactory.DerivationFramework.Reco_4mu(
35 name = "BPHY4_Reco_4mu",
36 FourMuonTool = BPHY4FourMuonTool,
37 V0Tools = V0Tools,
38 PVRefitter = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags)),
39 PairContainerName = "BPHY4Pairs",
40 QuadrupletContainerName = "BPHY4Quads",
41 PVContainerName = "PrimaryVertices",
42 RefPVContainerName = "BPHY4RefittedPrimaryVertices",
43 RefitPV = True,
44 MaxPVrefit = 100000,
45 DoVertexType = 7)
46
47 BPHY4MuonTPThinningTool = CompFactory.DerivationFramework.MuonTrackParticleThinning(name = "BPHY4MuonTPThinningTool",
48 MuonKey = "Muons",
49 StreamName = streamName,
50 InDetTrackParticlesKey = "InDetTrackParticles")
51 BPHY4ElectronTPThinningTool = CompFactory.DerivationFramework.EgammaTrackParticleThinning(name = "BPHY4ElectronTPThinningTool",
52 SGKey = "Electrons",
53 GSFTrackParticlesKey = "GSFTrackParticles",
54 StreamName = streamName,
55 InDetTrackParticlesKey = "InDetTrackParticles")
56
57 # Skim events accepted by the muon selection
58 BPHY4_SelectEvent = CompFactory.DerivationFramework.xAODStringSkimmingTool(name = 'BPHY4_SelectEvent',
59 expression = '(count(Muons.BPHY4MuonIndex>=0)>0)')
60
61 BPHY4ThinningTools = [BPHY4MuonTPThinningTool, BPHY4ElectronTPThinningTool]
62 BPHY4SlimTools = [BPHY4_SelectEvent]
63 BPHY4AugTools = [BPHY4_Reco_4mu]
64 for t in BPHY4ThinningTools + BPHY4SlimTools + BPHY4AugTools: acc.addPublicTool(t)
65 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel("BPHY4Kernel",
66 AugmentationTools= BPHY4AugTools, SkimmingTools = BPHY4SlimTools, ThinningTools = BPHY4ThinningTools ))
67
68 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
69 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
70 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
71 BPHY4SlimmingHelper = SlimmingHelper("BPHY4SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
72 from DerivationFrameworkBPhys.commonBPHYMethodsCfg import getDefaultAllVariables
73 BPHY4AllVariables = getDefaultAllVariables()
74 BPHY4StaticContent = []
75 BPHY4SmartVariables =[]
76 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
77
78 # Needed for trigger objects
79 BPHY4SlimmingHelper.IncludeMuonTriggerContent = True
80 BPHY4SlimmingHelper.IncludeBPhysTriggerContent = True
81
82
83 BPHY4AllVariables += ["PrimaryVertices"]
84 BPHY4StaticContent += ["xAOD::VertexContainer#BPHY4RefittedPrimaryVertices"]
85 BPHY4StaticContent += ["xAOD::VertexAuxContainer#BPHY4RefittedPrimaryVerticesAux."]
86
87
88 BPHY4AllVariables += ["InDetTrackParticles"]
89 BPHY4SmartVariables += ["InDetTrackParticles"]
90
91
94 BPHY4AllVariables += ["CombinedMuonTrackParticles"]
95 BPHY4AllVariables += ["ExtrapolatedMuonTrackParticles"]
96
97
98 BPHY4SmartVariables += ["Muons"]
99
100
101 BPHY4SmartVariables += ["Electrons"]
102
103
104 BPHY4StaticContent += ["xAOD::VertexContainer#%s" % BPHY4_Reco_4mu.PairContainerName]
105 BPHY4StaticContent += ["xAOD::VertexContainer#%s" % BPHY4_Reco_4mu.QuadrupletContainerName]
106
107
108 BPHY4StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY4_Reco_4mu.PairContainerName]
109 BPHY4StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY4_Reco_4mu.QuadrupletContainerName]
110
111 BPHY4SlimmingHelper.AllVariables = BPHY4AllVariables
112 BPHY4SlimmingHelper.StaticContent = BPHY4StaticContent
113 BPHY4SlimmingHelper.SmartCollections = BPHY4SmartVariables
114 BPHY4ItemList = BPHY4SlimmingHelper.GetItemList()
115 acc.merge(OutputStreamCfg(flags, "DAOD_BPHY4", ItemList=BPHY4ItemList, AcceptAlgs=["BPHY4Kernel"]))
116 acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_BPHY4", AcceptAlgs=["BPHY4Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
117 acc.printConfig(withDetails=True, summariseProps=True, onlyComponents = [], printDefaults=True)
118 return acc
BPHY4Cfg(flags)
Definition BPHY4.py:13