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

Functions

 BPHY14Cfg (flags)

Variables

str BPHYDerivationName = "BPHY14"
str streamName = "StreamDAOD_BPHY14"

Function Documentation

◆ BPHY14Cfg()

BPHY14.BPHY14Cfg ( flags)

Definition at line 15 of file BPHY14.py.

15def BPHY14Cfg(flags):
16 from DerivationFrameworkBPhys.commonBPHYMethodsCfg import (
17 BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg,
18 BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg,
19 AugOriginalCountsCfg)
20 from JpsiUpsilonTools.JpsiUpsilonToolsConfig import PrimaryVertexRefittingToolCfg
21 acc = ComponentAccumulator()
22 isSimulation = flags.Input.isMC
23 doLRT = flags.Tracking.doLargeD0
24 if not doLRT : print("BPHY14: LRT tracks disabled")
25 mainMuonInput = "StdWithLRTMuons" if doLRT else "Muons"
26 mainIDInput = "InDetWithLRTTrackParticles" if doLRT else "InDetTrackParticles"
27 if doLRT:
28 from DerivationFrameworkLLP.LLPToolsConfig import LRTMuonMergerAlg
29 from AthenaConfiguration.Enums import LHCPeriod
30 acc.merge(LRTMuonMergerAlg( flags,
31 PromptMuonLocation = "Muons",
32 LRTMuonLocation = "MuonsLRT",
33 OutputMuonLocation = mainMuonInput,
34 CreateViewCollection = True,
35 UseRun3WP = flags.GeoModel.Run == LHCPeriod.Run3))
36 from DerivationFrameworkInDet.InDetToolsConfig import InDetLRTMergeCfg
37 acc.merge(InDetLRTMergeCfg(flags))
38
39 toRelink = ["InDetTrackParticles", "InDetLargeD0TrackParticles"] if doLRT else []
40 MuonReLink = [ "Muons", "MuonsLRT" ] if doLRT else []
41
42 V0Tools = acc.popToolsAndMerge(BPHY_V0ToolCfg(flags, BPHYDerivationName))
43 vkalvrt = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, BPHYDerivationName)) # VKalVrt vertex fitter
44 acc.addPublicTool(vkalvrt)
45 acc.addPublicTool(V0Tools)
46 trackselect = acc.popToolsAndMerge(BPHY_InDetDetailedTrackSelectorToolCfg(flags, BPHYDerivationName))
47 acc.addPublicTool(trackselect)
48 vpest = acc.popToolsAndMerge(BPHY_VertexPointEstimatorCfg(flags, BPHYDerivationName))
49 acc.addPublicTool(vpest)
50 BPHY14JpsiFinder = CompFactory.Analysis.JpsiFinder(
51 name = "BPHY14JpsiFinder",
52 muAndMu = True,
53 muAndTrack = False,
54 TrackAndTrack = False,
55 assumeDiMuons = True, # If true, will assume dimu hypothesis and use PDG value for mu mass
56 invMassUpper = 15000.0,
57 invMassLower = 2000.,
58 Chi2Cut = 200.,
59 muonThresholdPt = 2500.,
60 oppChargesOnly = True,
61 atLeastOneComb = False,
62 combOnly = True,
63 useCombinedMeasurement = False, # Only takes effect if combOnly=True
64 muonCollectionKey = "Muons",
65 TrackParticleCollection = mainIDInput,
66 useV0Fitter = False, # if False a TrkVertexFitterTool will be used
67 TrkVertexFitterTool = vkalvrt,
68 V0VertexFitterTool = None,
69 TrackSelectorTool = trackselect,
70 VertexPointEstimator = vpest,
71 useMCPCuts = False
72 )
73 acc.addPublicTool(BPHY14JpsiFinder )
74
75 BPHY14_Reco_mumu = CompFactory.DerivationFramework.Reco_Vertex(
76 name = "BPHY14_Reco_mumu",
77 VertexSearchTool = BPHY14JpsiFinder,
78 OutputVtxContainerName = "BPHY14OniaCandidates",
79 PVContainerName = "PrimaryVertices",
80 V0Tools = V0Tools,
81 PVRefitter = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags)),
82 RelinkTracks = toRelink,
83 RelinkMuons = MuonReLink,
84 RefPVContainerName = "BPHY14RefittedPrimaryVertices",
85 RefitPV = True,
86 MaxPVrefit = 100000,
87 DoVertexType = 7)
88
89 BPHY14_AugOriginalCounts = acc.popToolsAndMerge(AugOriginalCountsCfg(flags, name = "BPHY14_AugOriginalCounts"))
90
91 BPHY14_Select_Jpsi2mumu = CompFactory.DerivationFramework.Select_onia2mumu(
92 name = "BPHY14_Select_Jpsi2mumu",
93 HypothesisName = "Jpsi",
94 InputVtxContainerName = "BPHY14OniaCandidates",
95 V0Tools = V0Tools,
96 VtxMassHypo = 3096.916,
97 MassMin = 2000.0,
98 MassMax = 4000.0,
99 Chi2Max = 200,
100 DoVertexType = 7)
101
102 BPHY14_Select_Psi2mumu = CompFactory.DerivationFramework.Select_onia2mumu(
103 name = "BPHY14_Select_Psi2mumu",
104 HypothesisName = "Psi",
105 V0Tools = V0Tools,
106 InputVtxContainerName = "BPHY14OniaCandidates",
107 VtxMassHypo = 3686.09,
108 MassMin = 3300.0,
109 MassMax = 7500.0,
110 Chi2Max = 200,
111 DoVertexType = 7)
112
113 BPHY14_Select_Upsi2mumu = CompFactory.DerivationFramework.Select_onia2mumu(
114 name = "BPHY14_Select_Upsi2mumu",
115 HypothesisName = "Upsi",
116 InputVtxContainerName = "BPHY14OniaCandidates",
117 V0Tools = V0Tools,
118 VtxMassHypo = 9460.30,
119 MassMin = 7000.0,
120 MassMax = 15000.0,
121 Chi2Max = 200,
122 DoVertexType = 7)
123
124 acc.merge(EGammaCommonCfg(flags))
125 photonRequirements = 'Photons.Tight'
126 expression = "(count(BPHY14OniaCandidates.passed_Jpsi) > 0 || count(BPHY14OniaCandidates.passed_Psi) > 0 || count(BPHY14OniaCandidates.passed_Upsi) > 0) && count("+photonRequirements+") >0"
127 from DerivationFrameworkTools.DerivationFrameworkToolsConfig import xAODStringSkimmingToolCfg
128 BPHY14_SelectEvent = acc.getPrimaryAndMerge(xAODStringSkimmingToolCfg(flags, name = "BPHY14_SelectEvent",
129 expression = expression))
130
131 BPHY14ThinningTools = []
132 BPHY14Thin_vtxTrk = CompFactory.DerivationFramework.Thin_vtxTrk(
133 name = "BPHY14Thin_vtxTrk",
134 StreamName = streamName,
135 TrackParticleContainerName = mainIDInput,
136 VertexContainerNames = ["BPHY14OniaCandidates"],
137 PassFlags = ["passed_Jpsi", "passed_Psi", "passed_Upsi"] )
138
139 BPHY14MuonTPThinningTool = CompFactory.DerivationFramework.MuonTrackParticleThinning(name = "BPHY14MuonTPThinningTool",
140 StreamName = streamName,
141 MuonKey = "Muons",
142 InDetTrackParticlesKey = mainIDInput)
143 BPHY14ThinningTools.append(BPHY14MuonTPThinningTool)
144
145 BPHY14PhotonTPThinningTool = CompFactory.DerivationFramework.EgammaTrackParticleThinning(name = "BPHY14PhotonTPThinningTool",
146 StreamName = streamName,
147 SGKey = "Photons",
148 GSFTrackParticlesKey = "GSFTrackParticles",
149 GSFConversionVerticesKey="GSFConversionVertices",
150 InDetTrackParticlesKey = mainIDInput,
151 SelectionString = photonRequirements,
152 BestMatchOnly = False,
153 ConeSize = 0.6,
154 #ApplyAnd = False Has been removed?
155 )
156 BPHY14ThinningTools.append(BPHY14PhotonTPThinningTool)
157 BPHY14TruthThinTool = CompFactory.DerivationFramework.GenericTruthThinning(name = "BPHY14TruthThinTool",
158 StreamName = streamName,
159 ParticleSelectionString = "TruthParticles.pdgId == 22 || TruthParticles.pdgId == 443 || TruthParticles.pdgId == 100443 || TruthParticles.pdgId == 553 || TruthParticles.pdgId == 100553 || TruthParticles.pdgId == 200553",
160 PreserveDescendants = True,
161 PreserveAncestors = True)
162 if isSimulation:
163 BPHY14ThinningTools.append(BPHY14TruthThinTool)
164
165 BPHY14ThinningTools += [BPHY14PhotonTPThinningTool, BPHY14MuonTPThinningTool, BPHY14Thin_vtxTrk]
166 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
167 BPHY14SlimTools = [ BPHY14_SelectEvent ]
168 BPHY14AugTools = [BPHY14_Reco_mumu, BPHY14_AugOriginalCounts, BPHY14_Select_Jpsi2mumu, BPHY14_Select_Jpsi2mumu,
169 BPHY14_Select_Psi2mumu, BPHY14_Select_Upsi2mumu]
170 for t in BPHY14ThinningTools + BPHY14SlimTools + BPHY14AugTools: acc.addPublicTool(t)
171 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel("BPHY14Kernel",
172 AugmentationTools= BPHY14AugTools, SkimmingTools = BPHY14SlimTools, ThinningTools = BPHY14ThinningTools ))
173 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
174 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
175 BPHY14SlimmingHelper = SlimmingHelper("BPHY14SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
176 BPHY14SlimmingHelper.SmartCollections = []
177
178 # Needed for trigger objects
179 BPHY14SlimmingHelper.IncludeMuonTriggerContent = True
180 BPHY14SlimmingHelper.IncludeBPhysTriggerContent = True
181 BPHY14SlimmingHelper.IncludeEGammaTriggerContent = True
182
183
184 BPHY14_SmartCollections = ["PrimaryVertices"]
185 BPHY14_StaticContent = ["xAOD::VertexContainer#BPHY14RefittedPrimaryVertices"]
186 BPHY14_StaticContent += ["xAOD::VertexAuxContainer#BPHY14RefittedPrimaryVerticesAux."]
187
188
190 BPHY14_ExtraVariables = []
191 #BPHY14_SmartCollections += [mainIDInput]
192 #BPHY14_ExtraVariables = ["%s.vx.vy.vz" % mainIDInput]
193
194
195
198 from DerivationFrameworkBPhys.commonBPHYMethodsCfg import getDefaultAllVariables
199 BPHY14_AllVariables = getDefaultAllVariables()
200 BPHY14_AllVariables += ["CombinedMuonTrackParticles"]
201 BPHY14_AllVariables += ["ExtrapolatedMuonTrackParticles"]
202
203
204 BPHY14_AllVariables += ["Muons"]
205
206 BPHY14_ExtraVariables += ["%s.etcone30.etcone40" % "Muons"
207 +".momentumBalanceSignificance"
208 +".scatteringCurvatureSignificance"
209 +".scatteringNeighbourSignificance"
210 +".msInnerMatchDOF.msInnerMatchChi2"
211 +".msOuterMatchDOF.msOuterMatchChi2"
212 +".EnergyLoss.ParamEnergyLoss.MeasEnergyLoss"
213 +".ET_Core" ]
214 #BPHY14_AllVariables += ["Muons"]
215
216
217 BPHY14_StaticContent += ["xAOD::VertexContainer#%s" % BPHY14_Reco_mumu.OutputVtxContainerName]
218 BPHY14_StaticContent += ["xAOD::VertexAuxContainer#%sAux" % BPHY14_Reco_mumu.OutputVtxContainerName]
219
220 BPHY14_StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % BPHY14_Reco_mumu.OutputVtxContainerName]
221
222 # Truth information for MC only
223 if isSimulation:
224 BPHY14_StaticContent += ["xAOD::TruthParticleContainer#TruthMuons","xAOD::TruthParticleAuxContainer#TruthMuonsAux."]
225 BPHY14_StaticContent += ["xAOD::TruthParticleContainer#TruthPhotons","xAOD::TruthParticleAuxContainer#TruthPhotonsAux."]
226 BPHY14_AllVariables += ["TruthEvents","TruthParticles","TruthVertices","MuonTruthParticles"]
227
228 BPHY14_AllVariables += ["Photons"] #,"Muons","InDetTrackParticles","PrimaryVertices"]
229
230 BPHY14_SmartCollections += ["InDetTrackParticles"]
231 BPHY14_ExtraVariables += ["%s.vx.vy.vz" % "InDetTrackParticles"]
232
233 BPHY14_AllVariables = list(set(BPHY14_AllVariables)) # remove duplicates
234
235 BPHY14SlimmingHelper.AllVariables = BPHY14_AllVariables
236 BPHY14SlimmingHelper.StaticContent = BPHY14_StaticContent
237 BPHY14SlimmingHelper.SmartCollections = BPHY14_SmartCollections
238 BPHY14SlimmingHelper.ExtraVariables = BPHY14_ExtraVariables
239 BPHY14ItemList = BPHY14SlimmingHelper.GetItemList()
240 acc.merge(OutputStreamCfg(flags, "DAOD_BPHY14", ItemList=BPHY14ItemList, AcceptAlgs=["BPHY14Kernel"]))
241 acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_BPHY14", AcceptAlgs=["BPHY14Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
242 acc.printConfig(withDetails=True, summariseProps=True, onlyComponents = [], printDefaults=True)
243 return acc
void print(char *figname, TCanvas *c1)
STL class.

Variable Documentation

◆ BPHYDerivationName

str BPHY14.BPHYDerivationName = "BPHY14"

Definition at line 12 of file BPHY14.py.

◆ streamName

str BPHY14.streamName = "StreamDAOD_BPHY14"

Definition at line 13 of file BPHY14.py.