ATLAS Offline Software
EGAM8.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 # ====================================================================
3 # EGAM8.py
4 # This defines DAOD_EGAM8, a skimmed DAOD format for Run 3.
5 # Z->ee reduction for forward e tag-and-probe (one central e, one fwd e)
6 # Z->emu reduction for bkg studies (one mu, one fwd e)
7 # It requires the flag EGAM8 in Derivation_tf.py
8 # ====================================================================
9 
10 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
11 from AthenaConfiguration.ComponentFactory import CompFactory
12 from AthenaConfiguration.Enums import MetadataCategory
13 
14 from AthenaCommon.SystemOfUnits import MeV
15 
16 from DerivationFrameworkEGamma.PhotonsCPDetailedContent import (
17  PhotonsCPDetailedContent,
18 )
19 
20 
22  """Configure the EGAM8 skimming tool"""
23  acc = ComponentAccumulator()
24 
25  expression = " || ".join(
26  [
27  "(count(EGAM8_DiElectronMass >50.0*GeV) >=1)",
28  "(count(EGAM8_MuonElectronMass >50.0*GeV) >=1)",
29  ]
30  )
31  print("EGAM8 skimming expression: ", expression)
32 
33  acc.setPrivateTools(
34  CompFactory.DerivationFramework.xAODStringSkimmingTool(
35  name="EGAM8SkimmingTool", expression=expression
36  )
37  )
38 
39  return acc
40 
41 
43  """Configure the EGAM8 ee invariant mass augmentation tool"""
44  acc = ComponentAccumulator()
45 
46  # ====================================================================
47  # di-electron invariant mass for events passing the Z->ee
48  # selection based on single e trigger, for reco (central) and ID
49  # SF(central+fwd)
50  #
51  # 1 medium e, central, pT>25 GeV
52  # 1 forward e, pT>20 GeV
53  # OS+SS
54  # mee>50 GeV (cut applied in skimming step later)
55  # ====================================================================
56 
57  requirement_tag = " && ".join(
58  ["(Electrons.DFCommonElectronsLHMedium)", "(Electrons.pt > 24.5*GeV)"]
59  )
60  requirement_probe = "ForwardElectrons.pt > 19.5*GeV"
61 
62  acc.setPrivateTools(
63  CompFactory.DerivationFramework.EGInvariantMassTool(
64  name="EGAM8_ZEEMassTool",
65  Object1Requirements=requirement_tag,
66  Object2Requirements=requirement_probe,
67  StoreGateEntryName="EGAM8_DiElectronMass",
68  Mass1Hypothesis=0.511 * MeV,
69  Mass2Hypothesis=0.511 * MeV,
70  Container1Name="Electrons",
71  Container2Name="ForwardElectrons",
72  CheckCharge=False,
73  DoTransverseMass=False,
74  MinDeltaR=0.0,
75  )
76  )
77 
78  return acc
79 
80 
82  """Configure the EGAM8 mue invariant mass augmentation tool"""
83  acc = ComponentAccumulator()
84 
85  # ====================================================================
86  # mue invariant mass for events passing the Z->mue selection based
87  # on single muon trigger, for ID SF(central+fwd) background studies
88  #
89  # 1 medium muon, central, pT>25 GeV
90  # 1 forward e, pT>20 GeV
91  # OS+SS
92  # m(mue)>50 GeV (cut applied in skimming step later)
93  # ====================================================================
94 
95  requirement_muon = " && ".join(
96  [
97  "Muons.pt>24.5*GeV",
98  "abs(Muons.eta)<2.7",
99  "Muons.DFCommonMuonPassPreselection",
100  ]
101  )
102  requirement_electron = "ForwardElectrons.pt > 19.5*GeV"
103 
104  acc.setPrivateTools(
105  CompFactory.DerivationFramework.EGInvariantMassTool(
106  name="EGAM8_ZMuEMassTool",
107  Object1Requirements=requirement_muon,
108  Object2Requirements=requirement_electron,
109  StoreGateEntryName="EGAM8_MuonElectronMass",
110  Mass1Hypothesis=105 * MeV,
111  Mass2Hypothesis=0.511 * MeV,
112  Container1Name="Muons",
113  Container2Name="ForwardElectrons",
114  CheckCharge=False,
115  DoTransverseMass=False,
116  MinDeltaR=0.0,
117  )
118  )
119 
120  return acc
121 
122 
123 # Main algorithm config
124 def EGAM8KernelCfg(flags, name="EGAM8Kernel", **kwargs):
125  """Configure the derivation framework driving algorithm (kernel)
126  for EGAM8"""
127  acc = ComponentAccumulator()
128 
129  # Common augmentations
130  from DerivationFrameworkPhys.PhysCommonConfig import PhysCommonAugmentationsCfg
131 
132  acc.merge(
134  flags, TriggerListsHelper=kwargs["TriggerListsHelper"]
135  )
136  )
137 
138  # EGAM8 augmentations
139  augmentationTools = []
140 
141  # ====================================================================
142  # ee and mue invariant masses
143  # ====================================================================
144  EGAM8ZeeMassTool = acc.popToolsAndMerge(EGAM8ZeeMassToolCfg(flags))
145  acc.addPublicTool(EGAM8ZeeMassTool)
146  augmentationTools.append(EGAM8ZeeMassTool)
147 
148  EGAM8ZmueMassTool = acc.popToolsAndMerge(EGAM8ZmueMassToolCfg(flags))
149  acc.addPublicTool(EGAM8ZmueMassTool)
150  augmentationTools.append(EGAM8ZmueMassTool)
151 
152  # ====================================================================
153  # Common calo decoration tools
154  # ====================================================================
155  from DerivationFrameworkCalo.DerivationFrameworkCaloConfig import (
156  CaloDecoratorKernelCfg)
157  acc.merge(CaloDecoratorKernelCfg(flags))
158 
159  # thinning tools
160  thinningTools = []
161  streamName = kwargs["StreamName"]
162 
163  # Track thinning
164  if flags.Derivation.Egamma.doTrackThinning:
165  from DerivationFrameworkInDet.InDetToolsConfig import (
166  TrackParticleThinningCfg,
167  MuonTrackParticleThinningCfg,
168  TauTrackParticleThinningCfg,
169  )
170 
171  TrackThinningKeepElectronTracks = True
172  TrackThinningKeepPhotonTracks = True
173  TrackThinningKeepAllElectronTracks = False
174  TrackThinningKeepJetTracks = False
175  TrackThinningKeepMuonTracks = True
176  TrackThinningKeepTauTracks = False
177  TrackThinningKeepPVTracks = False
178 
179  # Tracks associated with Electrons
180  if TrackThinningKeepElectronTracks:
181  EGAM8ElectronTPThinningTool = (
182  CompFactory.DerivationFramework.EgammaTrackParticleThinning(
183  name="EGAM8ElectronTPThinningTool",
184  StreamName=streamName,
185  SGKey="Electrons",
186  GSFTrackParticlesKey="GSFTrackParticles",
187  InDetTrackParticlesKey="InDetTrackParticles",
188  SelectionString="Electrons.pt > 0*GeV",
189  BestMatchOnly=True,
190  ConeSize=0.3,
191  )
192  )
193  acc.addPublicTool(EGAM8ElectronTPThinningTool)
194  thinningTools.append(EGAM8ElectronTPThinningTool)
195 
196  # Tracks associated with Electrons (all tracks, large cone, for track
197  # isolation studies of the selected electrons)
198  if TrackThinningKeepAllElectronTracks:
199  EGAM8ElectronTPThinningTool2 = (
200  CompFactory.DerivationFramework.EgammaTrackParticleThinning(
201  name="EGAM8ElectronTPThinningTool2",
202  StreamName=streamName,
203  SGKey="Electrons",
204  GSFTrackParticlesKey="GSFTrackParticles",
205  InDetTrackParticlesKey="InDetTrackParticles",
206  SelectionString="Electrons.pt > 4*GeV",
207  BestMatchOnly=False,
208  ConeSize=0.6,
209  )
210  )
211  acc.addPublicTool(EGAM8ElectronTPThinningTool2)
212  thinningTools.append(EGAM8ElectronTPThinningTool2)
213 
214  # Tracks associated with Photons
215  if TrackThinningKeepPhotonTracks:
216  EGAM8PhotonTPThinningTool = (
217  CompFactory.DerivationFramework.EgammaTrackParticleThinning(
218  name="EGAM8PhotonTPThinningTool",
219  StreamName=streamName,
220  SGKey="Photons",
221  GSFTrackParticlesKey="GSFTrackParticles",
222  InDetTrackParticlesKey="InDetTrackParticles",
223  GSFConversionVerticesKey="GSFConversionVertices",
224  SelectionString="Photons.pt > 0*GeV",
225  BestMatchOnly=True,
226  ConeSize=0.3,
227  )
228  )
229  acc.addPublicTool(EGAM8PhotonTPThinningTool)
230  thinningTools.append(EGAM8PhotonTPThinningTool)
231 
232  # Tracks associated with Jets
233  if TrackThinningKeepJetTracks:
234  EGAM8JetTPThinningTool = (
235  CompFactory.DerivationFramework.JetTrackParticleThinning(
236  name="EGAM8JetTPThinningTool",
237  StreamName=streamName,
238  JetKey="AntiKt4EMPFlowJets",
239  InDetTrackParticlesKey="InDetTrackParticles",
240  )
241  )
242  acc.addPublicTool(EGAM8JetTPThinningTool)
243  thinningTools.append(EGAM8JetTPThinningTool)
244 
245  # Tracks associated with Muons
246  if TrackThinningKeepMuonTracks:
247  EGAM8MuonTPThinningTool = acc.getPrimaryAndMerge(
249  flags,
250  name="EGAM8MuonTPThinningTool",
251  StreamName=streamName,
252  MuonKey="Muons",
253  InDetTrackParticlesKey="InDetTrackParticles",
254  )
255  )
256  thinningTools.append(EGAM8MuonTPThinningTool)
257 
258  # Tracks associated with Taus
259  if TrackThinningKeepTauTracks:
260  EGAM8TauTPThinningTool = acc.getPrimaryAndMerge(
262  flags,
263  name="EGAM8TauTPThinningTool",
264  StreamName=streamName,
265  TauKey="TauJets",
266  ConeSize=0.6,
267  InDetTrackParticlesKey="InDetTrackParticles",
268  DoTauTracksThinning=True,
269  TauTracksKey="TauTracks",
270  )
271  )
272  thinningTools.append(EGAM8TauTPThinningTool)
273 
274  # Tracks from primary vertex
275  thinning_expression = " && ".join(
276  [
277  "(InDetTrackParticles.DFCommonTightPrimary)",
278  "(abs(DFCommonInDetTrackZ0AtPV)*sin(InDetTrackParticles.theta)<3.0*mm)",
279  "(InDetTrackParticles.pt>10*GeV)",
280  ]
281  )
282  if TrackThinningKeepPVTracks:
283  EGAM8TPThinningTool = acc.getPrimaryAndMerge(
285  flags,
286  name="EGAM8TPThinningTool",
287  StreamName=streamName,
288  SelectionString=thinning_expression,
289  InDetTrackParticlesKey="InDetTrackParticles",
290  )
291  )
292  thinningTools.append(EGAM8TPThinningTool)
293 
294  # truth thinning
295  if flags.Input.isMC:
296  # W, Z and Higgs
297  truth_cond_WZH = " && ".join(
298  ["(abs(TruthParticles.pdgId) >= 23)", "(abs(TruthParticles.pdgId) <= 25)"]
299  )
300  # Leptons
301  truth_cond_lep = " && ".join(
302  ["(abs(TruthParticles.pdgId) >= 11)", "(abs(TruthParticles.pdgId) <= 16)"]
303  )
304  # Top quark
305  truth_cond_top = "(abs(TruthParticles.pdgId) == 6)"
306  # Photon
307  truth_cond_gam = " && ".join(
308  ["(abs(TruthParticles.pdgId) == 22)", "(TruthParticles.pt > 1*GeV)"]
309  )
310  # stable particles
311  truth_cond_finalState = " && ".join(
312  ["(TruthParticles.status == 1)", "(TruthParticles.barcode<200000)"]
313  )
314  truth_expression = (
315  "( "
316  + truth_cond_WZH
317  + " ) || "
318  + "( "
319  + truth_cond_lep
320  + " ) || "
321  + "( "
322  + truth_cond_top
323  + " ) || "
324  + "( "
325  + truth_cond_gam
326  + " ) || "
327  + "( "
328  + truth_cond_finalState
329  + " )"
330  )
331  print("EGAM8 truth thinning expression: ", truth_expression)
332 
333  EGAM8TruthThinningTool = CompFactory.DerivationFramework.GenericTruthThinning(
334  name="EGAM8TruthThinningTool",
335  StreamName=streamName,
336  ParticleSelectionString=truth_expression,
337  PreserveDescendants=False,
338  PreserveGeneratorDescendants=True,
339  PreserveAncestors=True,
340  )
341  acc.addPublicTool(EGAM8TruthThinningTool)
342  thinningTools.append(EGAM8TruthThinningTool)
343 
344  # skimming
345  skimmingTool = acc.popToolsAndMerge(EGAM8SkimmingToolCfg(flags))
346  acc.addPublicTool(skimmingTool)
347 
348  # setup the kernel
349  acc.addEventAlgo(
350  CompFactory.DerivationFramework.DerivationKernel(
351  name,
352  SkimmingTools=[skimmingTool],
353  AugmentationTools=augmentationTools,
354  ThinningTools=thinningTools,
355  )
356  )
357 
358  return acc
359 
360 
361 def EGAM8Cfg(flags):
362  acc = ComponentAccumulator()
363 
364  # Get the lists of triggers needed for trigger matching.
365  # This is needed at this scope (for the slimming) and further down
366  # in the config chain for actually configuring the matching, so we create
367  # it here and pass it down
368  # TODO: this should ideally be called higher up to avoid it being run
369  # multiple times in a train
370 
371  from DerivationFrameworkPhys.TriggerListsHelper import TriggerListsHelper
372 
373  EGAM8TriggerListsHelper = TriggerListsHelper(flags)
374 
375  # configure skimming/thinning/augmentation tools
376  acc.merge(
378  flags,
379  name="EGAM8Kernel",
380  StreamName="StreamDAOD_EGAM8",
381  TriggerListsHelper=EGAM8TriggerListsHelper,
382  )
383  )
384 
385  # configure slimming
386  from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
387  from xAODMetaDataCnv.InfileMetaDataConfig import SetupMetaDataForStreamCfg
388  from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
389 
390  EGAM8SlimmingHelper = SlimmingHelper(
391  "EGAM8SlimmingHelper",
392  NamesAndTypes=flags.Input.TypedCollections,
393  flags=flags,
394  )
395 
396  # ------------------------------------------
397  # containers for which we save all variables
398  # -------------------------------------------
399 
400  # baseline
401  EGAM8SlimmingHelper.AllVariables = [
402  "Electrons",
403  "ForwardElectrons",
404  "GSFTrackParticles",
405  "egammaClusters",
406  "ForwardElectronClusters",
407  ]
408 
409  # for trigger studies we also add:
410  # EGAM8SlimmingHelper.AllVariables += [ ]
411 
412  # and on MC we also add:
413  if flags.Input.isMC:
414  EGAM8SlimmingHelper.AllVariables += [
415  "TruthEvents",
416  "TruthParticles",
417  "TruthVertices",
418  "egammaTruthParticles",
419  ]
420 
421  # -------------------------------------------
422  # containers that we slim
423  # -------------------------------------------
424 
425  # first add variables from smart-slimming
426  # adding only also those for which we add all variables since
427  # the XXXCPContent.py files also bring in some extra variables
428  # for other collections
429  EGAM8SlimmingHelper.SmartCollections = [
430  "Electrons",
431  "Photons",
432  "Muons",
433  "TauJets",
434  "PrimaryVertices",
435  "InDetTrackParticles",
436  "AntiKt4EMPFlowJets",
437  "BTagging_AntiKt4EMPFlow",
438  "MET_Baseline_AntiKt4EMPFlow",
439  ]
440  if flags.Input.isMC:
441  EGAM8SlimmingHelper.SmartCollections += [
442  "AntiKt4TruthJets",
443  "AntiKt4TruthDressedWZJets",
444  ]
445 
446  # then add extra variables:
447 
448  # muons
449  EGAM8SlimmingHelper.ExtraVariables += [
450  "Muons.ptcone20.ptcone30.ptcone40.etcone20.etcone30.etcone40"
451  ]
452 
453  # conversion vertices
454  EGAM8SlimmingHelper.ExtraVariables += [
455  "GSFConversionVertices.x.y.z.px.py.pz.pt1.pt2.etaAtCalo.phiAtCalo",
456  "GSFConversionVertices.trackParticleLinks",
457  ]
458 
459  # primary vertices
460  EGAM8SlimmingHelper.ExtraVariables += ["PrimaryVertices.x.y.sumPt2"]
461 
462  # track jets
463  EGAM8SlimmingHelper.ExtraVariables += [
464  "AntiKt4PV0TrackJets.pt.eta.phi.e.m.btaggingLink.constituentLinks"
465  ]
466 
467  # energy density
468  EGAM8SlimmingHelper.ExtraVariables += [
469  "TopoClusterIsoCentralEventShape.Density",
470  "TopoClusterIsoForwardEventShape.Density",
471  "NeutralParticleFlowIsoCentralEventShape.Density",
472  "NeutralParticleFlowIsoForwardEventShape.Density",
473  ]
474 
475  # photons: detailed shower shape variables
476  EGAM8SlimmingHelper.ExtraVariables += PhotonsCPDetailedContent
477 
478  # photons: gain and cluster energy per layer
479  from DerivationFrameworkCalo.DerivationFrameworkCaloConfig import (
480  getGainDecorations,
481  getClusterEnergyPerLayerDecorations,
482  )
483 
484  gainDecorations = getGainDecorations(acc, flags, "EGAM8Kernel")
485  print("EGAM8 gain decorations: ", gainDecorations)
486  EGAM8SlimmingHelper.ExtraVariables.extend(gainDecorations)
487  clusterEnergyDecorations = getClusterEnergyPerLayerDecorations(acc, "EGAM8Kernel")
488  print("EGAM8 cluster energy decorations: ", clusterEnergyDecorations)
489  EGAM8SlimmingHelper.ExtraVariables.extend(clusterEnergyDecorations)
490 
491  # truth
492  if flags.Input.isMC:
493  EGAM8SlimmingHelper.ExtraVariables += [
494  "MuonTruthParticles.e.px.py.pz.status.pdgId.truthOrigin.truthType"
495  ]
496 
497  EGAM8SlimmingHelper.ExtraVariables += [
498  "Photons.truthOrigin.truthType.truthParticleLink"
499  ]
500 
501  # Add event info
502  if flags.Derivation.Egamma.doEventInfoSlimming:
503  EGAM8SlimmingHelper.SmartCollections.append("EventInfo")
504  else:
505  EGAM8SlimmingHelper.AllVariables += ["EventInfo"]
506 
507  # Add egamma trigger objects
508  EGAM8SlimmingHelper.IncludeEGammaTriggerContent = True
509  EGAM8SlimmingHelper.IncludeMuonTriggerContent = True
510 
511  # Trigger matching
512  # Run 2
513  if flags.Trigger.EDMVersion == 2:
514  from DerivationFrameworkPhys.TriggerMatchingCommonConfig import AddRun2TriggerMatchingToSlimmingHelper
515  AddRun2TriggerMatchingToSlimmingHelper(SlimmingHelper = EGAM8SlimmingHelper,
516  OutputContainerPrefix = "TrigMatch_",
517  TriggerList = EGAM8TriggerListsHelper.Run2TriggerNamesNoTau)
518  # Run 3, or Run 2 with navigation conversion
519  if flags.Trigger.EDMVersion == 3 or (flags.Trigger.EDMVersion == 2 and flags.Trigger.doEDMVersionConversion):
520  from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
522 
523  # Add full CellContainer
524  EGAM8SlimmingHelper.StaticContent = [
525  "CaloCellContainer#AllCalo",
526  "CaloClusterCellLinkContainer#egammaClusters_links",
527  "CaloClusterCellLinkContainer#ForwardElectronClusters_links",
528  ]
529 
530  EGAM8ItemList = EGAM8SlimmingHelper.GetItemList()
531  acc.merge(
533  flags,
534  "DAOD_EGAM8",
535  ItemList=EGAM8ItemList,
536  AcceptAlgs=["EGAM8Kernel"],
537  )
538  )
539  acc.merge(
541  flags,
542  "DAOD_EGAM8",
543  AcceptAlgs=["EGAM8Kernel"],
544  createMetadata=[
545  MetadataCategory.CutFlowMetaData,
546  MetadataCategory.TruthMetaData,
547  ],
548  )
549  )
550 
551  return acc
TrigNavSlimmingMTConfig.AddRun3TrigNavSlimmingCollectionsToSlimmingHelper
def AddRun3TrigNavSlimmingCollectionsToSlimmingHelper(slimmingHelper)
Definition: TrigNavSlimmingMTConfig.py:98
SystemOfUnits
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
python.EGAM8.EGAM8ZeeMassToolCfg
def EGAM8ZeeMassToolCfg(flags)
Definition: EGAM8.py:42
python.EGAM8.EGAM8SkimmingToolCfg
def EGAM8SkimmingToolCfg(flags)
Definition: EGAM8.py:21
python.InDetToolsConfig.TrackParticleThinningCfg
def TrackParticleThinningCfg(flags, name, **kwargs)
Definition: InDetToolsConfig.py:458
python.TriggerMatchingCommonConfig.AddRun2TriggerMatchingToSlimmingHelper
def AddRun2TriggerMatchingToSlimmingHelper(**kwargs)
Definition: TriggerMatchingCommonConfig.py:49
python.InDetToolsConfig.MuonTrackParticleThinningCfg
def MuonTrackParticleThinningCfg(flags, name, **kwargs)
Definition: InDetToolsConfig.py:528
python.InDetToolsConfig.TauTrackParticleThinningCfg
def TauTrackParticleThinningCfg(flags, name, **kwargs)
Definition: InDetToolsConfig.py:539
python.EGAM8.EGAM8KernelCfg
def EGAM8KernelCfg(flags, name="EGAM8Kernel", **kwargs)
Definition: EGAM8.py:124
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.EGAM8.EGAM8ZmueMassToolCfg
def EGAM8ZmueMassToolCfg(flags)
Definition: EGAM8.py:81
python.EGAM8.EGAM8Cfg
def EGAM8Cfg(flags)
Definition: EGAM8.py:361
DerivationFrameworkCaloConfig.CaloDecoratorKernelCfg
def CaloDecoratorKernelCfg(flags, name="CaloDecoratorKernel", **kwargs)
Definition: DerivationFrameworkCaloConfig.py:77
DerivationFrameworkCaloConfig.getClusterEnergyPerLayerDecorations
def getClusterEnergyPerLayerDecorations(acc, kernel)
Definition: DerivationFrameworkCaloConfig.py:159
DerivationFrameworkCaloConfig.getGainDecorations
def getGainDecorations(acc, flags, kernel, collections=None, info=["E", "nCells"])
Definition: DerivationFrameworkCaloConfig.py:127
python.PhysCommonConfig.PhysCommonAugmentationsCfg
def PhysCommonAugmentationsCfg(flags, **kwargs)
Definition: PhysCommonConfig.py:14
dbg::print
void print(std::FILE *stream, std::format_string< Args... > fmt, Args &&... args)
Definition: SGImplSvc.cxx:70
InfileMetaDataConfig.SetupMetaDataForStreamCfg
def SetupMetaDataForStreamCfg(flags, streamName="", AcceptAlgs=None, createMetadata=None, propagateMetadataFromInput=True, *args, **kwargs)
Definition: InfileMetaDataConfig.py:219
SlimmingHelper
Definition: SlimmingHelper.py:1