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

Classes

class  TrigEgammaFastCaloHypoToolConfig

Functions

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

Function Documentation

◆ _IncTool()

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

Definition at line 325 of file TrigEgammaFastCaloHypoTool.py.

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

◆ createTrigEgammaFastCaloElectronSelectors()

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

Definition at line 338 of file TrigEgammaFastCaloHypoTool.py.

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

◆ createTrigEgammaFastCaloHypoAlg()

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

Definition at line 50 of file TrigEgammaFastCaloHypoTool.py.

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

◆ createTrigEgammaFastCaloHypoAlg_noringer()

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

Definition at line 66 of file TrigEgammaFastCaloHypoTool.py.

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

◆ createTrigEgammaFastCaloPhotonSelectors()

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

Definition at line 369 of file TrigEgammaFastCaloHypoTool.py.

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

◆ electronRingerFastCaloHypoConfig()

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

Definition at line 17 of file TrigEgammaFastCaloHypoTool.py.

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

◆ photonRingerFastCaloHypoConfig()

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

Definition at line 34 of file TrigEgammaFastCaloHypoTool.py.

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

◆ same()

python.TrigEgammaFastCaloHypoTool.same ( val,
tool )

Definition at line 10 of file TrigEgammaFastCaloHypoTool.py.

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

◆ treatPidName()

python.TrigEgammaFastCaloHypoTool.treatPidName ( pidname)

Definition at line 87 of file TrigEgammaFastCaloHypoTool.py.

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

◆ TrigEgammaFastCaloHypoAlgCfg()

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

Definition at line 57 of file TrigEgammaFastCaloHypoTool.py.

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

◆ TrigEgammaFastCaloHypoToolFromDict()

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

Definition at line 331 of file TrigEgammaFastCaloHypoTool.py.

331def TrigEgammaFastCaloHypoToolFromDict(flags, chainDict , tool=None):
332 """ Use menu decoded chain dictionary to configure the tool """
333 cparts = [i for i in chainDict['chainParts'] if ((i['signature']=='Electron') or (i['signature']=='Photon'))]
334 return _IncTool( flags, chainDict['chainName'], chainDict['monGroups'], cparts[0], tool=tool)
335
336
337