ATLAS Offline Software
Loading...
Searching...
No Matches
python.STDM16 Namespace Reference

Functions

 DStarSelectionToolCfg (flags, name, **kwargs)
 STDM16Kernel (flags, name='STDM16Kernel', **kwargs)
 STDM16Cfg (flags)

Variables

 logSTDM16 = logging.getLogger('STDM16')
float massD0 = 1864.84
float massPiPlus = 139.570
float massKPlus = 493.677
str CandidatesContainerName = "STDM16_D0Candidates"
str streamName = "StreamDAOD_STDM16"

Function Documentation

◆ DStarSelectionToolCfg()

python.STDM16.DStarSelectionToolCfg ( flags,
name,
** kwargs )

Definition at line 24 of file STDM16.py.

24def DStarSelectionToolCfg(flags, name, **kwargs):
25 acc = ComponentAccumulator()
26 acc.addPublicTool(CompFactory.DerivationFramework.DStarSelectionTool(name = "STDM16_DStarSelectionTool",
27 InputVtxContainerName = CandidatesContainerName,
28 DeltaMassMax = 200.0), primary = True)
29 return acc
30
31

◆ STDM16Cfg()

python.STDM16.STDM16Cfg ( flags)

Definition at line 278 of file STDM16.py.

278def STDM16Cfg(flags):
279
280 acc = STDM16Kernel(flags)
281 from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
282 from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
283 from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
284 from DerivationFrameworkBPhys.commonBPHYMethodsCfg import getDefaultAllVariables
285
286 # PFlow augmentation tool
287
288 AllVariables = getDefaultAllVariables()
289 StaticContent = []
290
291
292
293 AllVariables += ["PrimaryVertices"]
294
295
296 AllVariables += ["InDetTrackParticles"]
297
298
299 #=======================================
300 # Decide what to save
301 #=======================================
302
303 StaticContent += ["xAOD::VertexContainer#%s" % CandidatesContainerName ]
304
305
306 StaticContent += ["xAOD::VertexAuxContainer#%sAux.-vxTrackAtVertex" % CandidatesContainerName]
307
308
309 # # Truth information for MC only
310 if flags.Input.isMC :
311 AllVariables += ["TruthEvents","TruthParticles", "TruthVertices","MuonTruthParticles", "AntiKt4TruthJets","AntiKt4TruthWZJets"]
312
313 STDM16SlimmingHelper = SlimmingHelper("STDM16SlimmingHelper", NamesAndTypes = flags.Input.TypedCollections, flags = flags)
314
315
316 STDM16SlimmingHelper.SmartCollections = ["AntiKt4EMPFlowJets",
317 "EventInfo",
318 "Muons",
319 "PrimaryVertices",
320 "InDetTrackParticles"]
321
322 # This variable is augmented by DStarSelectionTool
323 STDM16SlimmingHelper.ExtraVariables += ["InDetTrackParticles.trackPassDstar",
324 "AntiKt4EMPFlowJets.ConeExclBHadronsFinal.ConeExclCHadronsFinal.GhostBHadronsFinal.GhostCHadronsFinal.GhostBHadronsFinalCount.GhostBHadronsFinalPt.GhostCHadronsFinalCount.GhostCHadronsFinalPt.GhostPartons.isJvtHS.isJvtPU.IsoFixedCone5PtPUsub",
325 "TruthPrimaryVertices.t.x.y.z",
326 "InDetTrackParticles.TTVA_AMVFVertices.TTVA_AMVFWeights.eProbabilityHT.numberOfTRTHits.numberOfTRTOutliers",
327 "EventInfo.GenFiltHT.GenFiltMET.GenFiltHTinclNu.GenFiltPTZ.GenFiltFatJ.HF_Classification.HF_SimpleClassification",
328 "TauJets.dRmax.etOverPtLeadTrk",
329 "TauJets_MuonRM.dRmax.etOverPtLeadTrk",
330 "HLT_xAOD__TrigMissingETContainer_TrigEFMissingET.ex.ey",
331 "HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_mht.ex.ey"]
332
333 # Needed for trigger objects
334
335 STDM16SlimmingHelper.IncludeJetTriggerContent = True
336 STDM16SlimmingHelper.IncludeMuonTriggerContent = True
337 STDM16SlimmingHelper.AllVariables = AllVariables
338 STDM16SlimmingHelper.StaticContent = StaticContent
339 STDM16ItemList = STDM16SlimmingHelper.GetItemList()
340
341 acc.merge(OutputStreamCfg(flags, "DAOD_STDM16", ItemList=STDM16ItemList, AcceptAlgs=["STDM16Kernel"]))
342 acc.merge(SetupMetaDataForStreamCfg(flags, "DAOD_STDM16", AcceptAlgs=["STDM16Kernel"], createMetadata=[MetadataCategory.CutFlowMetaData]))
343 acc.printConfig(withDetails=True, summariseProps=True, onlyComponents = [], printDefaults=True)
344 return acc

◆ STDM16Kernel()

python.STDM16.STDM16Kernel ( flags,
name = 'STDM16Kernel',
** kwargs )
Configure the derivation framework driving algorithm (kernel) for STDM16

Definition at line 32 of file STDM16.py.

32def STDM16Kernel(flags, name='STDM16Kernel', **kwargs):
33 """Configure the derivation framework driving algorithm (kernel) for STDM16"""
34 from DerivationFrameworkBPhys.commonBPHYMethodsCfg import (BPHY_V0ToolCfg, BPHY_InDetDetailedTrackSelectorToolCfg, BPHY_VertexPointEstimatorCfg, BPHY_TrkVKalVrtFitterCfg)
35
36 acc = ComponentAccumulator()
37
38 # #============================================================================
39 # # Adding jets, from DerivationFrameworkPhys/python/PhysCommonConfig.py
40 # #============================================================================
41
42 # MC truth
43 if flags.Input.isMC:
44 from DerivationFrameworkMCTruth.MCTruthCommonConfig import (
45 AddStandardTruthContentsCfg,
46 #AddHFAndDownstreamParticlesCfg,
47 AddMiniTruthCollectionLinksCfg,
48 AddPVCollectionCfg,
49 AddTruthCollectionNavigationDecorationsCfg,
50 TruthClassificationAugmentationsCfg)
51 acc.merge(TruthClassificationAugmentationsCfg(flags))
52 from DerivationFrameworkMCTruth.TruthDerivationToolsConfig import DFCommonTruthCharmToolCfg
53 STDM16CommonTruthCharmTool = acc.getPrimaryAndMerge(DFCommonTruthCharmToolCfg(
54 flags,
55 name = "STDM16CommonTruthCharmTool"))
56 CommonAugmentation = CompFactory.DerivationFramework.CommonAugmentation
57 acc.addEventAlgo(CommonAugmentation("STDM16CommonTruthCharmKernel",AugmentationTools=[STDM16CommonTruthCharmTool]))
58
59 acc.merge(AddStandardTruthContentsCfg(flags))
60 acc.merge(AddTruthCollectionNavigationDecorationsCfg(
61 flags,
62 TruthCollections=["TruthMuons",
63 "TruthBottom",
64 "TruthCharm"
65 ],
66 prefix = 'STDM16_'))
67 # Re-point links on reco objects
68 acc.merge(AddMiniTruthCollectionLinksCfg(flags))
69 acc.merge(AddPVCollectionCfg(flags))
70
71 # InDet, Muon, Egamma common augmentations
72 from DerivationFrameworkInDet.InDetCommonConfig import InDetCommonCfg
73 from DerivationFrameworkMuons.MuonsCommonConfig import MuonsCommonCfg
74 from DerivationFrameworkEGamma.EGammaCommonConfig import EGammaCommonCfg
75
76 # TODO: need to find the new flags equivalent for the missing settings below, then we can
77 # drop these kwargs and do everything via the flags
78 acc.merge(InDetCommonCfg(flags,
79 DoVertexFinding = flags.Tracking.doVertexFinding,
80 AddPseudoTracks = flags.Tracking.doPseudoTracking,
81 DecoLRTTTVA = False,
82 DoR3LargeD0 = flags.Tracking.doLargeD0,
83 StoreSeparateLargeD0Container = flags.Tracking.storeSeparateLargeD0Container,
84 MergeLRT = False))
85 acc.merge(MuonsCommonCfg(flags))
86 acc.merge(EGammaCommonCfg(flags))
87
88
89 from DerivationFrameworkJetEtMiss.JetCommonConfig import JetCommonCfg
90 #from DerivationFrameworkFlavourTag.FtagDerivationConfig import FtagJetCollectionsCfg
91
92 acc.merge(JetCommonCfg(flags))
93
94 # FTagJetColl = ['AntiKt4EMPFlowJets', 'AntiKt10UFOCSSKSoftDropBeta100Zcut10Jets']
95
96 #acc.merge(FtagJetCollectionsCfg(flags,FTagJetColl))
97
98
99 V0Tools = acc.popToolsAndMerge(BPHY_V0ToolCfg(flags, "STDM16"))
100 vkalvrt = acc.popToolsAndMerge(BPHY_TrkVKalVrtFitterCfg(flags, "STDM16")) # VKalVrt vertex fitter
101 trackselect = acc.popToolsAndMerge(BPHY_InDetDetailedTrackSelectorToolCfg(flags, "STDM16"))
102 vpest = acc.popToolsAndMerge(BPHY_VertexPointEstimatorCfg(flags, "STDM16"))
103
104 acc.addPublicTool(vkalvrt)
105 acc.addPublicTool(V0Tools)
106 acc.addPublicTool(trackselect)
107 acc.addPublicTool(vpest)
108
109 #====================================================================
110 # AUGMENTATION TOOLS
111 # Largely based on PhysicsAnalysis/DerivationFramework/DerivationFrameworkBPhys/share/BPHY1.py
112 #====================================================================
113
114 STDM16_AugmentationTools = []
115
116 #====================================================================
117 # Perform di-track vertex fit for D0 -> K- pi+ (and c.c.) candidates
118 #====================================================================
119
120 STDM16_Finder_D0 = CompFactory.Analysis.JpsiFinder(
121 name = "STDM16_Finder_D0",
122 # OutputLevel = INFO,
123 muAndMu = False,
124 muAndTrack = False,
125 TrackAndTrack = True,
126 assumeDiMuons = False,
127 invMassUpper = 3000.0,
128 invMassLower = 0.0,
129 Chi2Cut = 200.,
130 oppChargesOnly = True,
131 atLeastOneComb = False,
132 useCombinedMeasurement = False,
133 track1Mass = massPiPlus, # Not very important, only used to calculate inv. mass cut, leave it loose here
134 track2Mass = massPiPlus, # Not very important, only used to calculate inv. mass cut, leave it loose here
135 trackThresholdPt = 1000.0,
136 muonCollectionKey = "Muons",
137 TrackParticleCollection = "InDetTrackParticles",
138 TrkVertexFitterTool = vkalvrt, # VKalVrt vertex fitter
139 TrackSelectorTool = trackselect,
140 VertexPointEstimator = vpest,
141 useMCPCuts = False)
142
143 acc.addPublicTool(STDM16_Finder_D0)
144
145 from JpsiUpsilonTools.JpsiUpsilonToolsConfig import PrimaryVertexRefittingToolCfg
146 PVrefit = acc.popToolsAndMerge(PrimaryVertexRefittingToolCfg(flags))
147 acc.addPublicTool(PVrefit)
148
149 STDM16_Reco_D0 = CompFactory.DerivationFramework.Reco_Vertex(
150 name = "STDM16_Reco_D0",
151 VertexSearchTool = STDM16_Finder_D0,
152 OutputVtxContainerName = "STDM16_D0Candidates",
153 PVContainerName = "PrimaryVertices",
154 V0Tools = V0Tools,
155 PVRefitter = PVrefit,
156 DoVertexType = 7, #ES not sure how this actually works, it only takes 7(all) and 1 but what does it mean ?????
157 RefPVContainerName = "SHOULDNOTBEUSED",
158 RefitPV = False)
159
160 acc.addPublicTool(STDM16_Reco_D0)
161 STDM16_AugmentationTools += [STDM16_Reco_D0]
162
163 #====================================================================
164 # Perform some selection on the D0 vertex candidates
165 #====================================================================
166
167 # Loose D0 vertex cuts
168 cutMinLxy = -999 # mm
169 cutMinMass = 1600.0 # MeV
170 cutMaxMass = 2100.0 # MeV
171 cutMaxChiSq = 50.0
172
173 # Need two of these, one for each track mass hypothesis
174 STDM16_Select_D0 = CompFactory.DerivationFramework.Select_onia2mumu(
175 name = "STDM16_Select_D0",
176 HypothesisName = "D0",
177 InputVtxContainerName = STDM16_Reco_D0.OutputVtxContainerName,
178 TrkMasses = [massPiPlus,massKPlus],
179 VtxMassHypo = massD0,
180 MassMin = cutMinMass,
181 MassMax = cutMaxMass,
182 Chi2Max = cutMaxChiSq,
183 LxyMin = cutMinLxy)
184
185 acc.addPublicTool(STDM16_Select_D0)
186 STDM16_AugmentationTools += [STDM16_Select_D0]
187
188 STDM16_Select_D0b = CompFactory.DerivationFramework.Select_onia2mumu(
189 name = "STDM16_Select_D0b",
190 HypothesisName = "D0b",
191 InputVtxContainerName = STDM16_Reco_D0.OutputVtxContainerName,
192 TrkMasses = [massKPlus,massPiPlus],
193 VtxMassHypo = massD0,
194 MassMin = cutMinMass,
195 MassMax = cutMaxMass,
196 Chi2Max = cutMaxChiSq,
197 LxyMin = cutMinLxy)
198
199 acc.addPublicTool(STDM16_Select_D0b)
200 STDM16_AugmentationTools += [STDM16_Select_D0b]
201
202 #====================================================================
203 # Look for D*+ -> D0 + pi+ candidates by looking for tracks which
204 # lead to low DeltaM w.r.t. D0 candidates. Good candidates (tracks and vertices)
205 # are augmented with "passed_Dstar" flag
206 #====================================================================
207
208 STDM16_DStarSelectionTool = acc.getPrimaryAndMerge(DStarSelectionToolCfg(flags,
209 name = "STDM16_DStarSelectionTool",
210 InputVtxContainerName = STDM16_Reco_D0.OutputVtxContainerName,
211 DeltaMassMax = 200.0))
212
213 STDM16_AugmentationTools += [STDM16_DStarSelectionTool]
214
215
216 #=======================================
217 # SKIMMING TOOLS
218 #=======================================
219 STDM16_SkimmingTools = []
220
221 #====================================================================
222 # Only retain events with at least one D* candidate
223 #====================================================================
224
225 # Skimming based on number of vertex candidates
226 SelectExpression = "count(STDM16_D0Candidates.passed_Dstar) > 0"
227
228 from DerivationFrameworkTools.DerivationFrameworkToolsConfig import (
229 xAODStringSkimmingToolCfg)
230 STDM16_SelectEvent = acc.getPrimaryAndMerge(xAODStringSkimmingToolCfg(
231 flags, name = "STDM16_SelectEvent", expression = SelectExpression))
232 STDM16_SkimmingTools += [STDM16_SelectEvent]
233
234 #====================================================================
235 # THINNING TOOLS
236 #====================================================================
237 STDM16_ThinningTools = []
238
239 #====================================================================
240 # Only retain vertices passing loose D0 selection in Select_onia2mumu tool
241 #====================================================================
242
243 STDM16_Thin_Vertex = CompFactory.DerivationFramework.Thin_vtxTrk(
244 name = "STDM16_Thin_Vertex",
245 StreamName = streamName,
246 ThinTracks = False,
247 VertexContainerNames = ["STDM16_D0Candidates"],
248 PassFlags = ["passed_Dstar"] )
249 STDM16_ThinningTools += [STDM16_Thin_Vertex]
250 acc.addPublicTool(STDM16_Thin_Vertex)
251
252 #====================================================================
253 # Only retain tracks associated with above D0 vertices and soft pion
254 # candiates found in DStarSelectionTool
255 #====================================================================
256
257 from DerivationFrameworkTools.DerivationFrameworkToolsConfig import GenericObjectThinningCfg
258
259 track_thinning_expression = "(InDetTrackParticles.trackPassDstar == 1)"
260 STDM16_Thin_Tracks = acc.getPrimaryAndMerge(
261 GenericObjectThinningCfg(flags,
262 name = "STDM16_Thin_Tracks",
263 ContainerName = "InDetTrackParticles",
264 StreamName = streamName,
265 SelectionString = track_thinning_expression))
266 STDM16_ThinningTools += [STDM16_Thin_Tracks]
267 acc.addPublicTool(STDM16_Thin_Tracks)
268
269 acc.addPublicTool(STDM16_SelectEvent)
270 acc.addEventAlgo(CompFactory.DerivationFramework.DerivationKernel("STDM16Kernel",
271 SkimmingTools = STDM16_SkimmingTools,
272 ThinningTools = STDM16_ThinningTools,
273 AugmentationTools = STDM16_AugmentationTools))
274
275 return acc
276
277

Variable Documentation

◆ CandidatesContainerName

str python.STDM16.CandidatesContainerName = "STDM16_D0Candidates"

Definition at line 19 of file STDM16.py.

◆ logSTDM16

python.STDM16.logSTDM16 = logging.getLogger('STDM16')

Definition at line 12 of file STDM16.py.

◆ massD0

float python.STDM16.massD0 = 1864.84

Definition at line 15 of file STDM16.py.

◆ massKPlus

float python.STDM16.massKPlus = 493.677

Definition at line 17 of file STDM16.py.

◆ massPiPlus

float python.STDM16.massPiPlus = 139.570

Definition at line 16 of file STDM16.py.

◆ streamName

str python.STDM16.streamName = "StreamDAOD_STDM16"

Definition at line 20 of file STDM16.py.