ATLAS Offline Software
Functions | Variables
LeptonTaggersConfig Namespace Reference

Functions

ComponentAccumulator VtxFittingToolCfg (ConfigFlags, **kwargs)
 
ComponentAccumulator DecorateReFitPrimaryVertexCfg (ConfigFlags, name="PrimaryVertexReFitter", lepton_type="", **kwargs)
 
ComponentAccumulator VtxItrMergingToolCfg (flags, name="VertexIterativeMergingTool", lepton_name="", **kwargs)
 
ComponentAccumulator DecorateNonPromptVertexCfg (flags, name="DecorateNonPromptVertex", lepton_name="", **kwargs)
 
ComponentAccumulator RNNToolCfg (flags, name="RNNTool", RNN_name="RNN_name", lepton_name="", **kwargs)
 
ComponentAccumulator DecoratePromptLeptonRNNCfg (flags, RNN_name="RNN_name", lepton_name="", name="DecoratePromptLeptonRNN", **kwargs)
 
def getStringIntVars (BDT_name)
 
def getStringFloatVars (BDT_name, part_type='')
 
ComponentAccumulator DecoratePLITCfg (flags, Tagger_name="", lepton_name="", **kwargs)
 
ComponentAccumulator DecoratePromptLeptonImprovedCfg (flags, BDT_name="", lepton_name="", track_jet_name="AntiKtVR30Rmax4Rmin02PV0TrackJets", **kwargs)
 
ComponentAccumulator DecorateImprovedPromptLeptonAlgsCfg (ConfigFlags, name="DecorateImprovedPromptLeptonAlgs", lepton_type="", **kwargs)
 
ComponentAccumulator DecoratePLITAlgsCfg (ConfigFlags, name="DecoratePLITAlgsCfg", lepton_type="", **kwargs)
 
def GetExtraPromptVariablesForDxAOD (name='', addSpectators=False, onlyBDT=True)
 
def GetExtraImprovedPromptVariablesForDxAOD (name='', onlyBDT=False)
 
def GetExtraPLITVariablesForDxAOD (name='')
 

Variables

 lep_tag_log = logging.getLogger('LeptonTaggersConfig')
 
 FLAGS = initConfigFlags()
 
 ProductionStep
 
 MaxEvents
 
 Files
 
 ACC = MainServicesCfg(FLAGS)
 
 trigger_lists_helper = TriggerListsHelper(FLAGS)
 
 withDetails
 
 True
 
 summariseProps
 
 status = ACC.run()
 

Function Documentation

◆ DecorateImprovedPromptLeptonAlgsCfg()

ComponentAccumulator LeptonTaggersConfig.DecorateImprovedPromptLeptonAlgsCfg (   ConfigFlags,
  name = "DecorateImprovedPromptLeptonAlgs",
  lepton_type = "",
**  kwargs 
)
CA to decorate with PLIV input algorithms

Definition at line 399 of file LeptonTaggersConfig.py.

400  ConfigFlags, name="DecorateImprovedPromptLeptonAlgs",
401  lepton_type="", **kwargs
402 ) -> ComponentAccumulator:
403  """
404  CA to decorate with PLIV input algorithms
405  """
406  valid_lepton_types = ["", "Electrons", "Muons"]
407  if lepton_type not in valid_lepton_types:
408  lep_tag_log.error("Requested lepton type: %s", lepton_type)
409  lep_tag_log.error("Allowed lepton types: %s", valid_lepton_types)
410  raise ValueError('DecorateImprovedPromptLeptonAlgsCfg - '
411  + f'unknown lepton type: "{lepton_type}"')
412 
413  acc = ComponentAccumulator()
414 
415  if lepton_type in ["", "Electrons"]:
416  acc.merge(DecorateReFitPrimaryVertexCfg(ConfigFlags, lepton_type="Electrons"))
417  acc.merge(DecorateNonPromptVertexCfg(ConfigFlags, lepton_name="Electrons"))
418  acc.merge(DecoratePromptLeptonRNNCfg(ConfigFlags,
419  RNN_name='PromptLeptonRNN',
420  lepton_name='Electrons'))
422  ConfigFlags, BDT_name="PromptLeptonImprovedVetoBARR",
423  lepton_name="Electrons", track_jet_name="AntiKtVR30Rmax4Rmin02PV0TrackJets"
424  ))
426  ConfigFlags, BDT_name="PromptLeptonImprovedVetoECAP",
427  lepton_name="Electrons", track_jet_name="AntiKtVR30Rmax4Rmin02PV0TrackJets"
428  ))
429 
430  if lepton_type in ["", "Muons"]:
431  acc.merge(DecorateReFitPrimaryVertexCfg(ConfigFlags, lepton_type="Muons"))
432  acc.merge(DecorateNonPromptVertexCfg(ConfigFlags, lepton_name="Muons"))
433  acc.merge(DecoratePromptLeptonRNNCfg(ConfigFlags,
434  RNN_name='PromptLeptonRNN',
435  lepton_name='Muons'))
437  ConfigFlags, BDT_name="PromptLeptonImprovedVeto",
438  lepton_name="Muons", track_jet_name="AntiKtVR30Rmax4Rmin02PV0TrackJets"
439  ))
440 
441  return acc
442 

◆ DecorateNonPromptVertexCfg()

ComponentAccumulator LeptonTaggersConfig.DecorateNonPromptVertexCfg (   flags,
  name = "DecorateNonPromptVertex",
  lepton_name = "",
**  kwargs 
)
Configure the non-prompt vertex decorator.

Definition at line 116 of file LeptonTaggersConfig.py.

116 def DecorateNonPromptVertexCfg(flags, name="DecorateNonPromptVertex",
117  lepton_name="", **kwargs) -> ComponentAccumulator:
118  """
119  Configure the non-prompt vertex decorator.
120  """
121  if lepton_name not in ['Electrons', 'Muons']:
122  raise ValueError(f'DecorateNonPromptVertex - unknown lepton type: "{lepton_name}"')
123 
124  acc = ComponentAccumulator()
125 
126  vertex_fitting_tool = acc.popToolsAndMerge(VtxFittingToolCfg(flags))
127 
128  kwargs.setdefault("VertexFittingTool",vertex_fitting_tool)
129 
130  kwargs.setdefault(
131  "VertexMergingTool",
132  acc.popToolsAndMerge(VtxItrMergingToolCfg(
133  flags, lepton_name=lepton_name,
134  VertexFittingTool=vertex_fitting_tool
135  ))
136  )
137 
138  kwargs.setdefault("LeptonContainerName", lepton_name)
139  kwargs.setdefault("ReFitPriVtxContainerName", f"RefittedPriVtx_{lepton_name}")
140  kwargs.setdefault("SVContainerName", f"SecVtxContainer_{lepton_name}")
141 
142  kwargs.setdefault("SecVtxLinksName", "SecVtxLinks")
143  kwargs.setdefault("DeepMergedSecVtxLinksName", "DeepMergedSecVtxLinks")
144  kwargs.setdefault("NoLeptonPriVtxLinkName", f"RefittedPriVtxWithoutLepton_{lepton_name}")
145  kwargs.setdefault("IndexVectorName", "PromptLeptonInput_SecondaryVertexIndexVector")
146 
147  alg = CompFactory.Prompt.NonPromptLeptonVertexingAlg(
148  name=f'NonPromptVtx_decorate_{lepton_name}',
149  **kwargs
150  )
151 
152  acc.addEventAlgo(alg, primary=True)
153 
154  return acc
155 
156 

◆ DecoratePLITAlgsCfg()

ComponentAccumulator LeptonTaggersConfig.DecoratePLITAlgsCfg (   ConfigFlags,
  name = "DecoratePLITAlgsCfg",
  lepton_type = "",
**  kwargs 
)
CA to decorate with PLIT input algorithms

Definition at line 443 of file LeptonTaggersConfig.py.

444  ConfigFlags, name="DecoratePLITAlgsCfg",
445  lepton_type="", **kwargs
446 ) -> ComponentAccumulator:
447  """
448  CA to decorate with PLIT input algorithms
449  """
450  valid_lepton_types = ["", "Electrons", "Muons"]
451  if lepton_type not in valid_lepton_types:
452  lep_tag_log.error("Requested lepton type: %s", lepton_type)
453  lep_tag_log.error("Allowed lepton types: %s", valid_lepton_types)
454  raise ValueError('DecoratePLITAlgsCfg - '
455  + f'unknown lepton type: "{lepton_type}"')
456 
457  acc = ComponentAccumulator()
458 
459  if lepton_type in ["", "Electrons"]:
460  acc.merge(DecoratePLITCfg(ConfigFlags, Tagger_name="PLIT", lepton_name="Electrons"))
461 
462  if lepton_type in ["", "Muons"]:
463  acc.merge(DecoratePLITCfg(ConfigFlags, Tagger_name="PLIT", lepton_name="Muons"))
464 
465  return acc
466 
467 #------------------------------------------------------------------------------

◆ DecoratePLITCfg()

ComponentAccumulator LeptonTaggersConfig.DecoratePLITCfg (   flags,
  Tagger_name = "",
  lepton_name = "",
**  kwargs 
)
Configure the PLIT decorator.

Definition at line 278 of file LeptonTaggersConfig.py.

278 def DecoratePLITCfg(
279  flags, Tagger_name="", lepton_name="",
280  **kwargs
281 ) -> ComponentAccumulator:
282  """
283  Configure the PLIT decorator.
284  """
285  lep_tag_log.info("calling DecoratePLITCfg with BDT_name="+Tagger_name+" lepton_name="+lepton_name)
286 
287  acc = ComponentAccumulator()
288 
289  #
290  # Prepare DecoratePromptLepton alg
291  #
292  kwargs.setdefault("LeptonContainerName", lepton_name)
293  kwargs.setdefault("TrackJetContainerKey", "AntiKtVR30Rmax4Rmin02PV0TrackJets")
294  kwargs.setdefault("TracksContainerKey", "InDetTrackParticles")
295  kwargs.setdefault("CaloClusterContainerKey", "egammaClusters")
296  kwargs.setdefault("ConfigFileVersion", '')
297  kwargs.setdefault("TaggerName", Tagger_name)
298 
299  # check if Run3 configs should be used
300  isRun3 = (flags.GeoModel.Run >= LHCPeriod.Run3)
301 
302  # path on calib area (found by path resolver
303  # /cvmfs/atlas.cern.ch/repo/sw/database/GroupData/
304  kwargs["ConfigPath"] = "IsolationSelection/2024-08-02/PLIT/"
305  if lepton_name == 'Electrons':
306  kwargs["ConfigFileVersion"] = 'network_PLITel_barrel.onnx'
307  kwargs["ConfigFileVersion_endcap"] = 'network_PLITel_endcap.onnx'
308  elif lepton_name == 'Muons':
309  if isRun3:
310  kwargs["ConfigFileVersion"] = 'network_run3_muons.onnx'
311  else:
312  kwargs["ConfigFileVersion"] = 'network_run2_muons.onnx'
313  else:
314  raise ValueError(f'Decorate{Tagger_name} - unknown lepton type: "{lepton_name}"')
315 
316  alg = CompFactory.Prompt.DecoratePLIT(
317  f'{lepton_name}_decorate{Tagger_name}', **kwargs
318  )
319  acc.addEventAlgo(alg, primary=True)
320 
321  lep_tag_log.info(
322  'Decorate%s - prepared %s algorithm for: %s',
323  Tagger_name, Tagger_name, lepton_name
324  )
325 
326  return acc
327 

◆ DecoratePromptLeptonImprovedCfg()

ComponentAccumulator LeptonTaggersConfig.DecoratePromptLeptonImprovedCfg (   flags,
  BDT_name = "",
  lepton_name = "",
  track_jet_name = "AntiKtVR30Rmax4Rmin02PV0TrackJets",
**  kwargs 
)
Configure the PromptLeptonImproved decorator.

Definition at line 328 of file LeptonTaggersConfig.py.

329  flags, BDT_name="", lepton_name="", track_jet_name="AntiKtVR30Rmax4Rmin02PV0TrackJets",
330  **kwargs
331 ) -> ComponentAccumulator:
332  """
333  Configure the PromptLeptonImproved decorator.
334  """
335  lep_tag_log.info("calling DecoratePromptLeptonImprovedCfg with BDT_name="+BDT_name+" lepton_name="+lepton_name+" track_jet_name="+track_jet_name)
336  #
337  # Check track jet container is correct
338  #
339  if track_jet_name != 'AntiKtVR30Rmax4Rmin02PV0TrackJets':
340  raise ValueError(f'Decorate{BDT_name} - unknown track jet collection: "{track_jet_name}"')
341 
342  acc = ComponentAccumulator()
343 
344  #
345  # Prepare DecoratePromptLepton alg
346  #
347  kwargs.setdefault("LeptonContainerName", lepton_name)
348 
349  kwargs.setdefault("TrackJetContainerName", track_jet_name)
350  kwargs.setdefault("PrimaryVertexContainerName", 'PrimaryVertices')
351  kwargs.setdefault("ClusterContainerName", 'CaloCalTopoClusters')
352 
353  kwargs.setdefault("BDTName", BDT_name)
354  kwargs.setdefault("InputVarDecoratePrefix", 'PromptLeptonImprovedInput_')
355  kwargs.setdefault("PrintTime", False)
356 
357  #
358  # Read configuration from AFS for this initial merge request, will switch to cvmfs with second request
359  #
360  if lepton_name == 'Electrons':
361  kwargs.setdefault("MethodTitleMVA", f'BDT_Electron_{BDT_name}')
362  kwargs.setdefault("ConfigFileVersion", 'InputData-2020-02-25/BDT/Electron/' + BDT_name)
363  kwargs.setdefault("accessorRNNVars", ['PromptLeptonRNN_prompt'])
364  elif lepton_name == 'Muons':
365  kwargs.setdefault("MethodTitleMVA", f'BDT_Muon_{BDT_name}')
366  kwargs.setdefault("ConfigFileVersion", 'InputData-2020-02-25/BDT/Muon/' + BDT_name)
367  kwargs.setdefault("accessorRNNVars", ['PromptLeptonRNN_prompt'])
368  else:
369  raise ValueError(f'Decorate{BDT_name} - unknown lepton type: "{lepton_name}"')
370 
371  kwargs.setdefault("stringIntVars", getStringIntVars(BDT_name))
372  kwargs.setdefault("stringFloatVars", getStringFloatVars(BDT_name))
373  kwargs.setdefault("extraDecoratorFloatVars", ['RawPt'])
374  kwargs.setdefault("extraDecoratorShortVars", ['CandVertex_NPassVtx'])
375  kwargs.setdefault("vetoDecoratorFloatVars", ['PromptLeptonRNN_prompt'])
376  kwargs.setdefault("vetoDecoratorShortVars", [])
377 
378  kwargs.setdefault("leptonPtBinsVector", [10.0e3, 15.0e3, 20.0e3, 25.0e3, 32.0e3, 43.0e3, 100.0e3])
379 
380 
381  #
382  # Secondary vertex selection for the PromptLeptonImproved
383  #
384  kwargs.setdefault("VertexLinkName", 'DeepMergedSecVtxLinks')
385 
386  alg = CompFactory.Prompt.DecoratePromptLeptonImproved(
387  f'{lepton_name}_decorate{BDT_name}', **kwargs
388  )
389  acc.addEventAlgo(alg, primary=True)
390 
391  lep_tag_log.info(
392  'Decorate%s - prepared %s algorithm for: %s, %s',
393  BDT_name, BDT_name, lepton_name, track_jet_name
394  )
395 
396  return acc
397 
398 

◆ DecoratePromptLeptonRNNCfg()

ComponentAccumulator LeptonTaggersConfig.DecoratePromptLeptonRNNCfg (   flags,
  RNN_name = "RNN_name",
  lepton_name = "",
  name = "DecoratePromptLeptonRNN",
**  kwargs 
)
Configure the prompt lepton RNN decorator.

Definition at line 191 of file LeptonTaggersConfig.py.

191 def DecoratePromptLeptonRNNCfg(flags, RNN_name="RNN_name", lepton_name="",
192  name="DecoratePromptLeptonRNN",
193  **kwargs) -> ComponentAccumulator:
194  """
195  Configure the prompt lepton RNN decorator.
196  """
197  lep_tag_log.info("calling DecoratePromptLeptonRNNCfg with name"+RNN_name+" with lepton_name="+lepton_name)
198  if lepton_name not in ["Electrons", "Muons"]:
199  raise ValueError(f'DecorateNonPromptVertex - unknown lepton type: "{lepton_name}"')
200 
201  acc = ComponentAccumulator()
202 
203  #
204  # Prepare DecoratePromptLepton alg
205  #
206  kwargs.setdefault("inputContainerLepton", lepton_name)
207  kwargs.setdefault("inputContainerTrack", 'InDetTrackParticles')
208  kwargs.setdefault("inputContainerTrackJet", 'AntiKtVR30Rmax4Rmin02PV0TrackJets')
209  kwargs.setdefault("inputContainerPrimaryVertices", 'PrimaryVertices')
210 
211  kwargs.setdefault("decorationPrefixRNN", 'PromptLeptonRNN_')
212 
213  kwargs.setdefault("debug", False)
214  kwargs.setdefault("outputStream", 'out')
215 
216  kwargs.setdefault("toolRNN", acc.popToolsAndMerge(
217  RNNToolCfg(flags, RNN_name=RNN_name, lepton_name=lepton_name)
218  ))
219 
220  alg = CompFactory.Prompt.DecoratePromptLeptonRNN(
221  name=f'{lepton_name}_decorate_RNN_{RNN_name}', **kwargs
222  )
223  acc.addEventAlgo(alg, primary=True)
224 
225  lep_tag_log.info('Decorate%s - prepared %s algorithm for: %s',
226  RNN_name, RNN_name, lepton_name)
227 
228  return acc
229 
230 

◆ DecorateReFitPrimaryVertexCfg()

ComponentAccumulator LeptonTaggersConfig.DecorateReFitPrimaryVertexCfg (   ConfigFlags,
  name = "PrimaryVertexReFitter",
  lepton_type = "",
**  kwargs 
)
CA to run the PrimaryVertexReFitter algorithm.

Definition at line 59 of file LeptonTaggersConfig.py.

60  ConfigFlags, name="PrimaryVertexReFitter",
61  lepton_type="", **kwargs
62 ) -> ComponentAccumulator:
63  """
64  CA to run the PrimaryVertexReFitter algorithm.
65  """
66 
67  if lepton_type not in ['Electrons', 'Muons']:
68  raise ValueError(f'DecorateReFitPrimaryVertex - unknown lepton type: "{lepton_type}"')
69 
70  acc = ComponentAccumulator()
71 
72  kwargs.setdefault("ReFitPriVtxName", f"RefittedPriVtx_{lepton_type}")
73  kwargs.setdefault("LeptonContainerName", lepton_type)
74 
75  kwargs.setdefault("DistToRefittedPriVtxName", "distToRefittedPriVtx")
76  kwargs.setdefault("NormDistToRefittedPriVtxName", "normDistToRefittedPriVtx")
77  kwargs.setdefault("RefittedVtxLinkName", "RefittedPriVtxLink")
78  kwargs.setdefault("RefittedVtxWithoutLeptonLinkName",
79  f"RefittedPriVtxWithoutLepton_{lepton_type}")
80 
81  alg_name = f'PrimaryVertexReFitter_{lepton_type}_decoratePriVtx'
82 
83  kwargs.setdefault("VertexFittingTool", acc.popToolsAndMerge(
84  VtxFittingToolCfg(ConfigFlags)
85  ))
86 
87  the_alg = CompFactory.Prompt.PrimaryVertexReFitter(alg_name, **kwargs)
88 
89  acc.addEventAlgo(the_alg, primary = True)
90  lep_tag_log.info("end of DecorateReFitPrimaryVertexCfg")
91  return acc
92 
93 

◆ GetExtraImprovedPromptVariablesForDxAOD()

def LeptonTaggersConfig.GetExtraImprovedPromptVariablesForDxAOD (   name = '',
  onlyBDT = False 
)

Definition at line 522 of file LeptonTaggersConfig.py.

522 def GetExtraImprovedPromptVariablesForDxAOD(name='', onlyBDT=False):
523 
524  prompt_lep_vars = []
525 
526  #
527  # Decorate lepton only with the BDT outputs when the onlyBDT flag is true.
528  #
529  if onlyBDT:
530  # Add lepton raw pT and pTBin as default which is needed for the PLIV working points.
531  rawpt_vars ="PromptLeptonImprovedInput_MVAXBin.PromptLeptonImprovedInput_RawPt"
532 
533  if name == "" or name == "Electrons":
534  prompt_lep_vars += ["Electrons.PromptLeptonImprovedVetoBARR.PromptLeptonImprovedVetoECAP.%s"%rawpt_vars]
535 
536  if name == "" or name == "Muons":
537  prompt_lep_vars += ["Muons.PromptLeptonImprovedVeto.%s"%rawpt_vars]
538 
539  return prompt_lep_vars
540 
541  prompt_vars = "PromptLeptonImprovedInput_MVAXBin.PromptLeptonImprovedInput_RawPt."
542  prompt_vars += "PromptLeptonImprovedInput_PtFrac.PromptLeptonImprovedInput_DRlj."
543  prompt_vars += "PromptLeptonImprovedInput_topoetcone30rel.PromptLeptonImprovedInput_ptvarcone30rel."
544 
545  if name == "" or name == "Electrons":
546  # Add PromptLeptonTagger electron RNN and new inputs for PromptLeptonImprovedVetoBARR/PromptLeptonImprovedVetoECAP
547  prompt_el_vars = "PromptLeptonRNN_prompt.PromptLeptonRNN_non_prompt_b.PromptLeptonRNN_non_prompt_c.PromptLeptonRNN_conversion."
548  prompt_el_vars += "PromptLeptonImprovedVetoBARR.PromptLeptonImprovedVetoECAP.PromptLeptonImprovedInput_TrackJetNTrack.PromptLeptonImprovedInput_PtRel.PromptLeptonImprovedInput_CaloClusterSumEtRel.PromptLeptonImprovedInput_CandVertex_normDistToPriVtxLongitudinalBest_ThetaCutVtx"
549 
550  prompt_lep_vars += ["Electrons." + prompt_vars + prompt_el_vars]
551 
552  if name == "" or name == "Muons":
553  # Add PromptLeptonTagger muon RNN and new inputs for PromptLeptonImprovedVeto
554  prompt_mu_vars = "PromptLeptonRNN_prompt.PromptLeptonRNN_non_prompt_b.PromptLeptonRNN_non_prompt_c."
555  prompt_mu_vars += "PromptLeptonImprovedVeto.PromptLeptonImprovedInput_ptvarcone30_TightTTVA_pt500rel.PromptLeptonImprovedInput_CaloClusterERel.PromptLeptonImprovedInput_CandVertex_normDistToPriVtxLongitudinalBest"
556 
557  prompt_lep_vars += ["Muons." + prompt_vars + prompt_mu_vars]
558 
559  return prompt_lep_vars
560 
561 #------------------------------------------------------------------------------

◆ GetExtraPLITVariablesForDxAOD()

def LeptonTaggersConfig.GetExtraPLITVariablesForDxAOD (   name = '')

Definition at line 562 of file LeptonTaggersConfig.py.

562 def GetExtraPLITVariablesForDxAOD(name=''):
563 
564  prompt_lep_vars = []
565 
566  #
567  # Decorate lepton with the score outputs
568  #
569  if name == "" or name == "Electrons":
570  prompt_lep_vars += ["Electrons.PLIT_PLITel_pelxpromp", "Electrons.PLIT_PLITel_pnpxall"]
571 
572  if name == "" or name == "Muons":
573  prompt_lep_vars += ["Muons.PLIT_TPLTmu_pmuxpromp", "Muons.PLIT_TPLTmu_pnpxall"]
574 
575  return prompt_lep_vars
576 
577 
578 # Script to run for testing the config
579 # from https://atlassoftwaredocs.web.cern.ch/guides/ca_configuration/ca/

◆ GetExtraPromptVariablesForDxAOD()

def LeptonTaggersConfig.GetExtraPromptVariablesForDxAOD (   name = '',
  addSpectators = False,
  onlyBDT = True 
)

Definition at line 468 of file LeptonTaggersConfig.py.

468 def GetExtraPromptVariablesForDxAOD(name='', addSpectators=False, onlyBDT=True):
469 
470  prompt_lep_vars = []
471 
472  #
473  # Decorate lepton only with the BDT outputs when the onlyBDT flag is true.
474  #
475  # NOTE: The output score name for BDTname=LowPtPromptLeptonVeto is "LowPtPLV" instead "LowPtPromptLeptonVeto".
476  # This is to harmonize with the variable augmented in CP::IsolationLowPtPLVTool
477  #
478  if onlyBDT:
479  if name == "" or name == "Electrons":
480  prompt_lep_vars += ["Electrons.PromptLeptonVeto.PromptLeptonIso.LowPtPLV."]
481 
482  if name == "" or name == "Muons":
483  prompt_lep_vars += ["Muons.PromptLeptonVeto.PromptLeptonIso.LowPtPLV."]
484 
485  return prompt_lep_vars
486 
487 
488  prompt_vars = "PromptLeptonVeto.PromptLeptonIso.LowPtPLV."
489  prompt_vars += "PromptLeptonInput_TrackJetNTrack.PromptLeptonInput_sv1_jf_ntrkv."
490  prompt_vars += "PromptLeptonInput_ip2.PromptLeptonInput_ip3."
491  prompt_vars += "PromptLeptonInput_LepJetPtFrac.PromptLeptonInput_DRlj."
492  prompt_vars += "PromptLeptonInput_PtFrac.PromptLeptonInput_PtRel."
493  prompt_vars += "PromptLeptonInput_DL1mu.PromptLeptonInput_rnnip."
494  prompt_vars += "PromptLeptonInput_topoetcone20rel.PromptLeptonInput_ptvarcone20rel."
495  prompt_vars += "PromptLeptonInput_topoetcone30rel.PromptLeptonInput_ptvarcone30rel."
496 
497  prompt_vars += "PromptLeptonInput_SecondaryVertexIndexVector.PromptLeptonInput_SecondaryVertexIndexVectorInDet.PromptLeptonInput_SecondaryVertexIndexVectorMerge.PromptLeptonInput_SecondaryVertexIndexVectorDeepMerge."
498  prompt_vars += "rhocen.rhofor.SecVtxLinks.RefittedPriVtxLink.RefittedPriVtxWithoutLeptonLink."
499 
500 
501  secondaryvertex_vars = "SVType.trackParticleLinks.trackWeights.neutralParticleLinks.neutralWeights.SecondaryVertexIndex.SecondaryVertexIndexVectorInput.chiSquared.numberDoF.x.y.z.covariance.vertexType.energyFraction.mass.normDist.ntrk.distToPriVtx.normDistToPriVtx.distToRefittedPriVtx.normDistToRefittedPriVtx.distToRefittedRmLepPriVtx.normDistToRefittedRmLepPriVtx"
502 
503  if addSpectators :
504  prompt_vars += "PromptLeptonInput_JetPt.PromptLeptonInput_JetEta.PromptLeptonInput_JetPhi.PromptLeptonInput_JetM."
505 
506  if name == "" or name == "Electrons":
507  prompt_el_vars = "ptvarcone40.topoetcone20.topoetcone20ptCorrection.ptcone20_TightTTVA_pt500.ptcone20_TightTTVA_pt1000.ptvarcone20_TightTTVA_pt1000.ptvarcone30_TightTTVA_pt500.ptvarcone30_TightTTVA_pt1000.ptvarcone40_TightTTVALooseCone_pt500"
508 
509  prompt_lep_vars += ["Electrons." + prompt_vars + prompt_el_vars]
510  prompt_lep_vars += ["SecVtxContainer_Electrons.%s" %secondaryvertex_vars]
511  prompt_lep_vars += ["SecVtx_ConvVtxContainer_Electrons.%s" %secondaryvertex_vars]
512 
513  if name == "" or name == "Muons":
514  prompt_mu_vars = "ET_Core.ET_EMCore.ET_HECCore.ET_TileCore.EnergyLoss.EnergyLossSigma.MeasEnergyLoss.MeasEnergyLossSigma.ParamEnergyLoss.ParamEnergyLossSigmaMinus.ParamEnergyLossSigmaPlus.neflowisol20.neflowisol30.neflowisol40.ptvarcone20_TightTTVA_pt500.ptvarcone30_TightTTVA_pt500.ptvarcone40_TightTTVA_pt500.ptvarcone20_TightTTVA_pt1000.ptvarcone30_TightTTVA_pt1000.ptvarcone40_TightTTVA_pt1000.caloExt_Decorated.caloExt_eta.caloExt_phi"
515 
516  prompt_lep_vars += ["Muons." + prompt_vars + prompt_mu_vars]
517  prompt_lep_vars += ["SecVtxContainer_Muons.%s" %secondaryvertex_vars]
518 
519  return prompt_lep_vars
520 
521 #------------------------------------------------------------------------------

◆ getStringFloatVars()

def LeptonTaggersConfig.getStringFloatVars (   BDT_name,
  part_type = '' 
)
Get the float variables for the BDT (I think)

Definition at line 248 of file LeptonTaggersConfig.py.

248 def getStringFloatVars(BDT_name, part_type=''):
249  """
250  Get the float variables for the BDT (I think)
251  """
252  float_vars = []
253 
254  if BDT_name == 'PromptLeptonImprovedVeto':
255  float_vars += ['topoetcone30rel',
256  'ptvarcone30_TightTTVA_pt500rel',
257  'PromptLeptonRNN_prompt',
258  'PtFrac',
259  'DRlj',
260  'CaloClusterERel',
261  'CandVertex_normDistToPriVtxLongitudinalBest']
262  elif (BDT_name == 'PromptLeptonImprovedVetoBARR'
263  or BDT_name == 'PromptLeptonImprovedVetoECAP'):
264  float_vars += ['topoetcone30rel',
265  'ptvarcone30rel',
266  'PromptLeptonRNN_prompt',
267  'PtFrac',
268  'DRlj',
269  'CaloClusterSumEtRel',
270  'PtRel',
271  'CandVertex_normDistToPriVtxLongitudinalBest_ThetaCutVtx']
272  else:
273  raise ValueError(f'getStringFloatVars - unknown alg: "{BDT_name}"')
274 
275  return float_vars
276 
277 

◆ getStringIntVars()

def LeptonTaggersConfig.getStringIntVars (   BDT_name)
Get the integer variables for the BDT (I think)

Definition at line 231 of file LeptonTaggersConfig.py.

231 def getStringIntVars(BDT_name):
232  """
233  Get the integer variables for the BDT (I think)
234  """
235  int_vars = []
236 
237  if BDT_name == 'PromptLeptonImprovedVeto':
238  int_vars += ['MVAXBin']
239  elif (BDT_name == 'PromptLeptonImprovedVetoBARR'
240  or BDT_name == 'PromptLeptonImprovedVetoECAP'):
241  int_vars += ['MVAXBin', 'TrackJetNTrack']
242  else:
243  raise ValueError(f'getStringIntVars - unknown alg: "{BDT_name}"')
244 
245  return int_vars
246 
247 

◆ RNNToolCfg()

ComponentAccumulator LeptonTaggersConfig.RNNToolCfg (   flags,
  name = "RNNTool",
  RNN_name = "RNN_name",
  lepton_name = "",
**  kwargs 
)
Configure the RNN tool.

Definition at line 157 of file LeptonTaggersConfig.py.

157 def RNNToolCfg(flags, name="RNNTool",
158  RNN_name="RNN_name", lepton_name="",
159  **kwargs) -> ComponentAccumulator:
160  """
161  Configure the RNN tool.
162  """
163  lep_tag_log.info("calling RNNToolCfg with name"+RNN_name+" with lepton_name="+lepton_name)
164 
165  if lepton_name not in ["Electrons", "Muons"]:
166  raise ValueError(f'RNNTool - unknown lepton type: "{lepton_name}"')
167 
168  acc = ComponentAccumulator()
169 
170  #
171  # Read configuration from AFS for this initial merge request, will switch to cvmfs with second request
172  #
173  if lepton_name == 'Electrons':
174  kwargs.setdefault("configRNNVersion", 'InputData-2020-02-25/RNN/Electron')
175  kwargs.setdefault("configRNNJsonFile",
176  'elecs_feb20_fullrun2_linear_ptraw_ntk5_model_ndense10_nhidden50_nepoch10_nbatch256_use_weights_nn-config.json')
177 
178  elif lepton_name == 'Muons':
179  kwargs.setdefault("configRNNVersion", 'InputData-2020-02-25/RNN/Muon')
180  kwargs.setdefault("configRNNJsonFile",
181  'muons_feb19_fullrun2_linear_ptraw_ntk5_model_ndense10_nhidden50_nepoch10_nbatch256_use_weights_nn-config.json')
182 
183  tool_rnn = CompFactory.Prompt.RNNTool(
184  name=f'{RNN_name}_{lepton_name}_RNNTool', **kwargs
185  )
186  acc.setPrivateTools(tool_rnn)
187 
188  return acc
189 
190 

◆ VtxFittingToolCfg()

ComponentAccumulator LeptonTaggersConfig.VtxFittingToolCfg (   ConfigFlags,
**  kwargs 
)
Generate a vertex fitting tool.

Definition at line 27 of file LeptonTaggersConfig.py.

27 def VtxFittingToolCfg(ConfigFlags, **kwargs) -> ComponentAccumulator:
28  """
29  Generate a vertex fitting tool.
30  """
31  acc = ComponentAccumulator()
32  lep_tag_log.info("creating VtxFittingTool")
33 
34  kwargs.setdefault("doSeedVertexFit", False)
35 
36  kwargs.setdefault("DistToPriVtxName", "distToPriVtx")
37  kwargs.setdefault("NormDistToPriVtxName", "normDistToPriVtx")
38  kwargs.setdefault("DistToRefittedPriVtxName", "distToRefittedPriVtx")
39  kwargs.setdefault("NormDistToRefittedPriVtxName", "normDistToRefittedPriVtx")
40  kwargs.setdefault("DistToRefittedRmLepPriVtxName", "distToRefittedRmLepPriVtx")
41  kwargs.setdefault("NormDistToRefittedRmLepPriVtxName",
42  "normDistToRefittedRmLepPriVtx")
43 
44  from TrkConfig.TrkVertexBilloirToolsConfig import FastVertexFitterCfg
45  fast_vtx_fitter = acc.popToolsAndMerge(FastVertexFitterCfg(ConfigFlags))
46 
47  kwargs.setdefault("vertexFitterTool", fast_vtx_fitter)
48  kwargs.setdefault("seedVertexFitterTool", fast_vtx_fitter)
49 
50  vertex_fitting_tool = CompFactory.Prompt.VertexFittingTool(
51  name="VertexFittingTool", **kwargs
52  )
53 
54  acc.setPrivateTools(vertex_fitting_tool)
55  lep_tag_log.info("end of VtxFittingTool creation")
56  return acc
57 
58 

◆ VtxItrMergingToolCfg()

ComponentAccumulator LeptonTaggersConfig.VtxItrMergingToolCfg (   flags,
  name = "VertexIterativeMergingTool",
  lepton_name = "",
**  kwargs 
)
Generate a VtxItrMergingTool configuration.

Definition at line 94 of file LeptonTaggersConfig.py.

94 def VtxItrMergingToolCfg(flags, name="VertexIterativeMergingTool",
95  lepton_name="", **kwargs) -> ComponentAccumulator:
96  """
97  Generate a VtxItrMergingTool configuration.
98  """
99  lep_tag_log.info("creating VtxItrMergingToolCfg configuration")
100 
101  acc = ComponentAccumulator()
102 
103  kwargs.setdefault("minFitProb", 0.03)
104 
105  tool_name = f'VtxIterFitMergingTool_{lepton_name}'
106 
107  vtxItrMergingTool = CompFactory.Prompt.VertexIterativeFitMergingTool(
108  name=tool_name, **kwargs
109  )
110 
111  acc.setPrivateTools(vtxItrMergingTool)
112 
113  return acc
114 
115 

Variable Documentation

◆ ACC

LeptonTaggersConfig.ACC = MainServicesCfg(FLAGS)

Definition at line 599 of file LeptonTaggersConfig.py.

◆ Files

LeptonTaggersConfig.Files

Definition at line 592 of file LeptonTaggersConfig.py.

◆ FLAGS

LeptonTaggersConfig.FLAGS = initConfigFlags()

Definition at line 583 of file LeptonTaggersConfig.py.

◆ lep_tag_log

LeptonTaggersConfig.lep_tag_log = logging.getLogger('LeptonTaggersConfig')

Definition at line 4 of file LeptonTaggersConfig.py.

◆ MaxEvents

LeptonTaggersConfig.MaxEvents

Definition at line 588 of file LeptonTaggersConfig.py.

◆ ProductionStep

LeptonTaggersConfig.ProductionStep

Definition at line 586 of file LeptonTaggersConfig.py.

◆ status

LeptonTaggersConfig.status = ACC.run()

Definition at line 626 of file LeptonTaggersConfig.py.

◆ summariseProps

LeptonTaggersConfig.summariseProps

Definition at line 623 of file LeptonTaggersConfig.py.

◆ trigger_lists_helper

LeptonTaggersConfig.trigger_lists_helper = TriggerListsHelper(FLAGS)

Definition at line 609 of file LeptonTaggersConfig.py.

◆ True

LeptonTaggersConfig.True

Definition at line 623 of file LeptonTaggersConfig.py.

◆ withDetails

LeptonTaggersConfig.withDetails

Definition at line 623 of file LeptonTaggersConfig.py.

LeptonTaggersConfig.DecoratePromptLeptonImprovedCfg
ComponentAccumulator DecoratePromptLeptonImprovedCfg(flags, BDT_name="", lepton_name="", track_jet_name="AntiKtVR30Rmax4Rmin02PV0TrackJets", **kwargs)
Definition: LeptonTaggersConfig.py:328
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
LeptonTaggersConfig.DecorateNonPromptVertexCfg
ComponentAccumulator DecorateNonPromptVertexCfg(flags, name="DecorateNonPromptVertex", lepton_name="", **kwargs)
Definition: LeptonTaggersConfig.py:116
LeptonTaggersConfig.getStringIntVars
def getStringIntVars(BDT_name)
Definition: LeptonTaggersConfig.py:231
LeptonTaggersConfig.VtxItrMergingToolCfg
ComponentAccumulator VtxItrMergingToolCfg(flags, name="VertexIterativeMergingTool", lepton_name="", **kwargs)
Definition: LeptonTaggersConfig.py:94
LeptonTaggersConfig.GetExtraPLITVariablesForDxAOD
def GetExtraPLITVariablesForDxAOD(name='')
Definition: LeptonTaggersConfig.py:562
LeptonTaggersConfig.GetExtraImprovedPromptVariablesForDxAOD
def GetExtraImprovedPromptVariablesForDxAOD(name='', onlyBDT=False)
Definition: LeptonTaggersConfig.py:522
LeptonTaggersConfig.VtxFittingToolCfg
ComponentAccumulator VtxFittingToolCfg(ConfigFlags, **kwargs)
Definition: LeptonTaggersConfig.py:27
LeptonTaggersConfig.DecorateReFitPrimaryVertexCfg
ComponentAccumulator DecorateReFitPrimaryVertexCfg(ConfigFlags, name="PrimaryVertexReFitter", lepton_type="", **kwargs)
Definition: LeptonTaggersConfig.py:59
python.TrkVertexBilloirToolsConfig.FastVertexFitterCfg
def FastVertexFitterCfg(flags, name="FastVertexFitterTool", **kwargs)
Definition: TrkVertexBilloirToolsConfig.py:6
LeptonTaggersConfig.DecoratePLITCfg
ComponentAccumulator DecoratePLITCfg(flags, Tagger_name="", lepton_name="", **kwargs)
Definition: LeptonTaggersConfig.py:278
LeptonTaggersConfig.DecoratePLITAlgsCfg
ComponentAccumulator DecoratePLITAlgsCfg(ConfigFlags, name="DecoratePLITAlgsCfg", lepton_type="", **kwargs)
Definition: LeptonTaggersConfig.py:443
LeptonTaggersConfig.DecorateImprovedPromptLeptonAlgsCfg
ComponentAccumulator DecorateImprovedPromptLeptonAlgsCfg(ConfigFlags, name="DecorateImprovedPromptLeptonAlgs", lepton_type="", **kwargs)
Definition: LeptonTaggersConfig.py:399
LeptonTaggersConfig.getStringFloatVars
def getStringFloatVars(BDT_name, part_type='')
Definition: LeptonTaggersConfig.py:248
LeptonTaggersConfig.GetExtraPromptVariablesForDxAOD
def GetExtraPromptVariablesForDxAOD(name='', addSpectators=False, onlyBDT=True)
Definition: LeptonTaggersConfig.py:468
LeptonTaggersConfig.DecoratePromptLeptonRNNCfg
ComponentAccumulator DecoratePromptLeptonRNNCfg(flags, RNN_name="RNN_name", lepton_name="", name="DecoratePromptLeptonRNN", **kwargs)
Definition: LeptonTaggersConfig.py:191
LeptonTaggersConfig.RNNToolCfg
ComponentAccumulator RNNToolCfg(flags, name="RNNTool", RNN_name="RNN_name", lepton_name="", **kwargs)
Definition: LeptonTaggersConfig.py:157