ATLAS Offline Software
Classes | Functions
python.TrigEgammaFastCaloHypoTool Namespace Reference

Classes

class  TrigEgammaFastCaloHypoToolConfig
 

Functions

def same (val, tool)
 
def electronRingerFastCaloHypoConfig (flags, name, sequenceOut)
 
def photonRingerFastCaloHypoConfig (flags, name, sequenceOut)
 
def createTrigEgammaFastCaloHypoAlg (flags, name, sequenceOut)
 
def TrigEgammaFastCaloHypoAlgCfg (flags, name, CaloClusters)
 
def createTrigEgammaFastCaloHypoAlg_noringer (flags, name, sequenceOut)
 
def treatPidName (pidname)
 
def _IncTool (flags, name, monGroups, cpart, tool=None)
 
def TrigEgammaFastCaloHypoToolFromDict (flags, chainDict, tool=None)
 
def createTrigEgammaFastCaloElectronSelectors (flags, ConfigFilePath=None)
 
def createTrigEgammaFastCaloPhotonSelectors (flags, ConfigFilePath=None)
 

Function Documentation

◆ _IncTool()

def python.TrigEgammaFastCaloHypoTool._IncTool (   flags,
  name,
  monGroups,
  cpart,
  tool = None 
)
private

Definition at line 327 of file TrigEgammaFastCaloHypoTool.py.

327 def _IncTool(flags, name, monGroups, cpart, tool=None):
328  config = TrigEgammaFastCaloHypoToolConfig(flags, name, monGroups, cpart, tool=tool )
329  config.compile(flags)
330  return config.tool()
331 
332 

◆ createTrigEgammaFastCaloElectronSelectors()

def python.TrigEgammaFastCaloHypoTool.createTrigEgammaFastCaloElectronSelectors (   flags,
  ConfigFilePath = None 
)

Definition at line 340 of file TrigEgammaFastCaloHypoTool.py.

340 def createTrigEgammaFastCaloElectronSelectors(flags, ConfigFilePath=None):
341 
342  if not ConfigFilePath:
343  ConfigFilePath = flags.Trigger.egamma.ringerVersion
344 
345 
346  SelectorNames = collections.OrderedDict({
347  'tight' : 'AsgElectronFastCaloRingerTightSelectorTool',
348  'medium' : 'AsgElectronFastCaloRingerMediumSelectorTool',
349  'loose' : 'AsgElectronFastCaloRingerLooseSelectorTool',
350  'vloose' : 'AsgElectronFastCaloRingerVeryLooseSelectorTool',
351  })
352 
353 
354  ToolConfigFile = collections.OrderedDict({
355  'tight' :['ElectronRingerTightTriggerConfig.conf' ],
356  'medium' :['ElectronRingerMediumTriggerConfig.conf' ],
357  'loose' :['ElectronRingerLooseTriggerConfig.conf' ],
358  'vloose' :['ElectronRingerVeryLooseTriggerConfig.conf'],
359  })
360 
361  selectors = []
362 
363  for pidname , name in SelectorNames.items():
364  SelectorTool=CompFactory.Ringer.AsgRingerSelectorTool(name)
365  SelectorTool.ConfigFiles = [ (ConfigFilePath+'/'+path) for path in ToolConfigFile[pidname] ]
366  selectors.append(SelectorTool)
367  return selectors
368 
369 
370 

◆ createTrigEgammaFastCaloHypoAlg()

def python.TrigEgammaFastCaloHypoTool.createTrigEgammaFastCaloHypoAlg (   flags,
  name,
  sequenceOut 
)

Definition at line 52 of file TrigEgammaFastCaloHypoTool.py.

52 def createTrigEgammaFastCaloHypoAlg(flags, name, sequenceOut):
53  if 'Electron' in name:
54  return electronRingerFastCaloHypoConfig(flags, name, sequenceOut)
55  elif 'Photon' in name:
56  return photonRingerFastCaloHypoConfig(flags, name, sequenceOut)
57 
58 

◆ createTrigEgammaFastCaloHypoAlg_noringer()

def python.TrigEgammaFastCaloHypoTool.createTrigEgammaFastCaloHypoAlg_noringer (   flags,
  name,
  sequenceOut 
)

Definition at line 68 of file TrigEgammaFastCaloHypoTool.py.

68 def createTrigEgammaFastCaloHypoAlg_noringer(flags, name, sequenceOut):
69 
70  # make the Hypo
71  theFastCaloHypo = CompFactory.TrigEgammaFastCaloHypoAlg(name)
72  theFastCaloHypo.CaloClusters = sequenceOut
73 
74  # Just for electrons
75  theFastCaloHypo.PidNames = []
76  theFastCaloHypo.RingerNNSelectorTools = []
77 
78 
79  monTool = GenericMonitoringTool(flags, "MonTool_"+name,
80  HistPath = 'FastCaloL2EgammaHypo/'+name)
81  monTool.defineHistogram('TIME_exec', type='TH1F', path='EXPERT', title="Fast Calo Hypo Algtime; time [ us ] ; Nruns", xbins=80, xmin=0.0, xmax=8000.0)
82  monTool.defineHistogram('TIME_NN_exec', type='TH1F', path='EXPERT', title="Fast Calo Hypo NN Algtime; time [ us ] ; Nruns", xbins=20, xmin=0.0, xmax=1000.0)
83 
84  theFastCaloHypo.MonTool=monTool
85  return theFastCaloHypo
86 
87 
88 

◆ createTrigEgammaFastCaloPhotonSelectors()

def python.TrigEgammaFastCaloHypoTool.createTrigEgammaFastCaloPhotonSelectors (   flags,
  ConfigFilePath = None 
)

Definition at line 371 of file TrigEgammaFastCaloHypoTool.py.

371 def createTrigEgammaFastCaloPhotonSelectors(flags, ConfigFilePath=None):
372 
373  if not ConfigFilePath:
374  ConfigFilePath = flags.Trigger.egamma.photonRingerVersion
375 
376 
377  SelectorNames = collections.OrderedDict({
378  'tight' : 'AsgPhotonFastCaloRingerTightSelectorTool',
379  'medium' : 'AsgPhotonFastCaloRingerMediumSelectorTool',
380  'loose' : 'AsgPhotonFastCaloRingerLooseSelectorTool',
381  })
382 
383 
384  ToolConfigFile = collections.OrderedDict({
385  'tight' :['PhotonRingerTightTriggerConfig.conf' ],
386  'medium' :['PhotonRingerMediumTriggerConfig.conf' ],
387  'loose' :['PhotonRingerLooseTriggerConfig.conf' ],
388  })
389 
390  selectors = []
391 
392  for pidname , name in SelectorNames.items():
393  SelectorTool=CompFactory.Ringer.AsgRingerSelectorTool(name)
394  SelectorTool.UseTansigOutput = True # FIXME: Should be removed in the next round
395  SelectorTool.ConfigFiles = [ (ConfigFilePath+'/'+path) for path in ToolConfigFile[pidname] ]
396  selectors.append(SelectorTool)
397  return selectors

◆ electronRingerFastCaloHypoConfig()

def python.TrigEgammaFastCaloHypoTool.electronRingerFastCaloHypoConfig (   flags,
  name,
  sequenceOut 
)

Definition at line 19 of file TrigEgammaFastCaloHypoTool.py.

19 def electronRingerFastCaloHypoConfig(flags, name, sequenceOut):
20  # make the Hypo
21  theFastCaloHypo = CompFactory.TrigEgammaFastCaloHypoAlg(name)
22  theFastCaloHypo.CaloClusters = sequenceOut
23  theFastCaloHypo.PidNames = ["tight", "medium", "loose", "vloose"]
24  theFastCaloHypo.RingerNNSelectorTools = createTrigEgammaFastCaloElectronSelectors(flags)
25 
26  monTool = GenericMonitoringTool(flags, "MonTool_"+name, HistPath = 'FastCaloL2EgammaHypo/'+name)
27  monTool.defineHistogram('TIME_exec', type='TH1F', path='EXPERT', title="Fast Calo Hypo Algtime; time [ us ] ; Nruns", xbins=80, xmin=0.0, xmax=8000.0)
28  monTool.defineHistogram('TIME_NN_exec', type='TH1F', path='EXPERT', title="Fast Calo Hypo NN Algtime; time [ us ] ; Nruns", xbins=50, xmin=0.0, xmax=50)
29 
30  theFastCaloHypo.MonTool=monTool
31  return theFastCaloHypo
32 
33 #
34 # For photons
35 #

◆ photonRingerFastCaloHypoConfig()

def python.TrigEgammaFastCaloHypoTool.photonRingerFastCaloHypoConfig (   flags,
  name,
  sequenceOut 
)

Definition at line 36 of file TrigEgammaFastCaloHypoTool.py.

36 def photonRingerFastCaloHypoConfig(flags, name, sequenceOut):
37  # make the Hypo
38  theFastCaloHypo = CompFactory.TrigEgammaFastCaloHypoAlg(name)
39  theFastCaloHypo.CaloClusters = sequenceOut
40  theFastCaloHypo.PidNames = ["tight", "medium", "loose"]
41  theFastCaloHypo.RingerNNSelectorTools = createTrigEgammaFastCaloPhotonSelectors(flags)
42 
43  monTool = GenericMonitoringTool(flags, "MonTool_"+name, HistPath = 'FastCaloL2EgammaHypo/'+name)
44  monTool.defineHistogram('TIME_exec', type='TH1F', path='EXPERT', title="Fast Calo Hypo Algtime; time [ us ] ; Nruns", xbins=80, xmin=0.0, xmax=8000.0)
45  monTool.defineHistogram('TIME_NN_exec', type='TH1F', path='EXPERT', title="Fast Calo Hypo NN Algtime; time [ us ] ; Nruns", xbins=50, xmin=0.0, xmax=50)
46 
47  theFastCaloHypo.MonTool=monTool
48  return theFastCaloHypo
49 
50 
51 

◆ same()

def python.TrigEgammaFastCaloHypoTool.same (   val,
  tool 
)

Definition at line 12 of file TrigEgammaFastCaloHypoTool.py.

12 def same( val , tool):
13  return [val]*( len( tool.EtaBins ) - 1 )
14 
15 
16 #
17 # For electrons
18 #

◆ treatPidName()

def python.TrigEgammaFastCaloHypoTool.treatPidName (   pidname)

Definition at line 89 of file TrigEgammaFastCaloHypoTool.py.

89 def treatPidName(pidname):
90  if 'tight' in pidname:
91  return 'tight'
92  elif 'medium' in pidname:
93  return 'medium'
94  # this should be before loose to works
95  elif 'vloose' in pidname:
96  return 'vloose'
97  else:
98  return 'loose'
99 
100 #
101 # For electron and photons
102 #

◆ TrigEgammaFastCaloHypoAlgCfg()

def python.TrigEgammaFastCaloHypoTool.TrigEgammaFastCaloHypoAlgCfg (   flags,
  name,
  CaloClusters 
)

Definition at line 59 of file TrigEgammaFastCaloHypoTool.py.

59 def TrigEgammaFastCaloHypoAlgCfg(flags, name, CaloClusters):
60  acc = ComponentAccumulator()
61  acc.addEventAlgo(createTrigEgammaFastCaloHypoAlg(flags, name=name, sequenceOut=CaloClusters))
62  return acc
63 
64 #
65 # For photons only
66 # NOTE: For future, ringer will be applied at the fast photon step
67 #

◆ TrigEgammaFastCaloHypoToolFromDict()

def python.TrigEgammaFastCaloHypoTool.TrigEgammaFastCaloHypoToolFromDict (   flags,
  chainDict,
  tool = None 
)
Use menu decoded chain dictionary to configure the tool 

Definition at line 333 of file TrigEgammaFastCaloHypoTool.py.

333 def TrigEgammaFastCaloHypoToolFromDict(flags, chainDict , tool=None):
334  """ Use menu decoded chain dictionary to configure the tool """
335  cparts = [i for i in chainDict['chainParts'] if ((i['signature']=='Electron') or (i['signature']=='Photon'))]
336  return _IncTool( flags, chainDict['chainName'], chainDict['monGroups'], cparts[0], tool=tool)
337 
338 
339 
python.TrigEgammaFastCaloHypoTool.createTrigEgammaFastCaloHypoAlg_noringer
def createTrigEgammaFastCaloHypoAlg_noringer(flags, name, sequenceOut)
Definition: TrigEgammaFastCaloHypoTool.py:68
python.TrigEgammaFastCaloHypoTool._IncTool
def _IncTool(flags, name, monGroups, cpart, tool=None)
Definition: TrigEgammaFastCaloHypoTool.py:327
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.TrigEgammaFastCaloHypoTool.electronRingerFastCaloHypoConfig
def electronRingerFastCaloHypoConfig(flags, name, sequenceOut)
Definition: TrigEgammaFastCaloHypoTool.py:19
python.TrigEgammaFastCaloHypoTool.TrigEgammaFastCaloHypoToolFromDict
def TrigEgammaFastCaloHypoToolFromDict(flags, chainDict, tool=None)
Definition: TrigEgammaFastCaloHypoTool.py:333
python.TrigEgammaFastCaloHypoTool.treatPidName
def treatPidName(pidname)
Definition: TrigEgammaFastCaloHypoTool.py:89
GenericMonitoringTool
Definition: GenericMonitoringTool.h:53
python.TrigEgammaFastCaloHypoTool.same
def same(val, tool)
Definition: TrigEgammaFastCaloHypoTool.py:12
python.TrigEgammaFastCaloHypoTool.createTrigEgammaFastCaloElectronSelectors
def createTrigEgammaFastCaloElectronSelectors(flags, ConfigFilePath=None)
Definition: TrigEgammaFastCaloHypoTool.py:340
python.TrigEgammaFastCaloHypoTool.photonRingerFastCaloHypoConfig
def photonRingerFastCaloHypoConfig(flags, name, sequenceOut)
Definition: TrigEgammaFastCaloHypoTool.py:36
python.TrigEgammaFastCaloHypoTool.TrigEgammaFastCaloHypoAlgCfg
def TrigEgammaFastCaloHypoAlgCfg(flags, name, CaloClusters)
Definition: TrigEgammaFastCaloHypoTool.py:59
python.TrigEgammaFastCaloHypoTool.createTrigEgammaFastCaloHypoAlg
def createTrigEgammaFastCaloHypoAlg(flags, name, sequenceOut)
Definition: TrigEgammaFastCaloHypoTool.py:52
python.TrigEgammaFastCaloHypoTool.createTrigEgammaFastCaloPhotonSelectors
def createTrigEgammaFastCaloPhotonSelectors(flags, ConfigFilePath=None)
Definition: TrigEgammaFastCaloHypoTool.py:371