ATLAS Offline Software
TrigEgammaForwardFastCaloHypoTool.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
2 
3 from AthenaCommon.SystemOfUnits import GeV
4 
5 #
6 # For electrons only
7 #
9 
10  # make the Hypo alg
11  from AthenaConfiguration.ComponentFactory import CompFactory
12  theFastCaloHypo = CompFactory.TrigEgammaForwardFastCaloHypoAlg(name)
13  theFastCaloHypo.CaloClusters = sequenceOut
14  return theFastCaloHypo
15 
16 
17 
19 
20 
21  __operation_points = [ 'tight' ,
22  'medium' ,
23  'loose' ,
24  'vloose' ,
25  'lhtight' ,
26  'lhmedium' ,
27  'lhloose' ,
28  'lhvloose' ]
29 
30 
31 
32  def __init__(self, name, cand, threshold, sel, trackinfo, noringerinfo):
33 
34  from AthenaCommon.Logging import logging
35  self.__log = logging.getLogger('TrigEgammaForwardFastCaloHypoTool')
36 
37  self.__useRun3 = False
38  self.__name = name
39  self.__cand = cand
40  self.__threshold = float(threshold)
41  self.__sel = sel
42  self.__trackinfo = trackinfo
43  self.__noringerinfo = noringerinfo
44 
45  from AthenaConfiguration.ComponentFactory import CompFactory
46  tool = CompFactory.TrigEgammaForwardFastCaloHypoTool( name )
47  tool.AcceptAll = False
48  tool.EtCut = self.__threshold*GeV
49 
50  self.__tool = tool
51 
52  self.__log.debug( 'Chain :%s', name )
53  self.__log.debug( 'Signature :%s', cand )
54  self.__log.debug( 'Threshold :%s', threshold )
55  self.__log.debug( 'Pidname :%s', sel )
56  self.__log.debug( 'trackinfo :%s', trackinfo )
57  self.__log.debug( 'noringerinfo :%s', noringerinfo )
58 
59  def chain(self):
60  return self.__name
61 
62  def pidname( self ):
63  return self.__sel
64 
65  def etthr(self):
66  return self.__threshold
67 
68  def isElectron(self):
69  return 'e' in self.__cand
70 
71  def isPhoton(self):
72  return 'g' in self.__cand
73 
74  def tool(self):
75  return self.__tool
76 
77 
78  def nocut(self):
79 
80  self.__log.debug( 'Configure nocut' )
81  self.tool().AcceptAll = True
82 
83 
84  def compile(self):
85 
86  self.nocut()
87 
88 
89 
90 def _IncTool(name, cand, threshold, sel, trackinfo, noringerinfo):
91  config = TrigEgammaForwardFastCaloHypoToolConfig(name, cand, threshold, sel, trackinfo, noringerinfo )
92  config.compile()
93  return config.tool()
94 
95 
97  """ Use menu decoded chain dictionary to configure the tool """
98  cparts = [i for i in d['chainParts'] if ((i['signature']=='Electron') or (i['signature']=='Photon'))]
99 
100  def __th(cpart):
101  return cpart['threshold']
102 
103  def __sel(cpart):
104  return cpart['addInfo'][0] if cpart['addInfo'] else cpart['IDinfo']
105 
106  def __cand(cpart):
107  return cpart['trigType']
108 
109  def __trackinfo(cpart):
110  return cpart['trkInfo'] if cpart['trkInfo'] else ''
111 
112  def __noringer(cpart):
113  return cpart['L2IDAlg'] if cpart['trigType']=='e' else ''
114 
115  name = d['chainName']
116 
117  return _IncTool( name, __cand( cparts[0]), __th( cparts[0]), __sel( cparts[0]), __trackinfo(cparts[0]), __noringer(cparts[0]))
118 
119 
SystemOfUnits
TrigEgammaForwardFastCaloHypoTool.TrigEgammaForwardFastCaloHypoToolConfig.nocut
def nocut(self)
Definition: TrigEgammaForwardFastCaloHypoTool.py:78
TrigEgammaForwardFastCaloHypoTool.TrigEgammaForwardFastCaloHypoToolConfig.__trackinfo
__trackinfo
Definition: TrigEgammaForwardFastCaloHypoTool.py:42
TrigEgammaForwardFastCaloHypoTool.TrigEgammaForwardFastCaloHypoToolConfig.etthr
def etthr(self)
Definition: TrigEgammaForwardFastCaloHypoTool.py:65
TrigEgammaForwardFastCaloHypoTool.TrigEgammaForwardFastCaloHypoToolConfig.__init__
def __init__(self, name, cand, threshold, sel, trackinfo, noringerinfo)
Definition: TrigEgammaForwardFastCaloHypoTool.py:32
TrigEgammaForwardFastCaloHypoTool.TrigEgammaForwardFastCaloHypoToolConfig.pidname
def pidname(self)
Definition: TrigEgammaForwardFastCaloHypoTool.py:62
TrigEgammaForwardFastCaloHypoTool._IncTool
def _IncTool(name, cand, threshold, sel, trackinfo, noringerinfo)
Definition: TrigEgammaForwardFastCaloHypoTool.py:90
TrigEgammaForwardFastCaloHypoTool.TrigEgammaForwardFastCaloHypoToolFromDict
def TrigEgammaForwardFastCaloHypoToolFromDict(d)
Definition: TrigEgammaForwardFastCaloHypoTool.py:96
TrigEgammaForwardFastCaloHypoTool.TrigEgammaForwardFastCaloHypoToolConfig.__log
__log
Definition: TrigEgammaForwardFastCaloHypoTool.py:35
TrigEgammaForwardFastCaloHypoTool.createTrigEgammaForwardFastCaloHypoAlg
def createTrigEgammaForwardFastCaloHypoAlg(name, sequenceOut)
Definition: TrigEgammaForwardFastCaloHypoTool.py:8
TrigEgammaForwardFastCaloHypoTool.TrigEgammaForwardFastCaloHypoToolConfig.__tool
__tool
Definition: TrigEgammaForwardFastCaloHypoTool.py:50
TrigEgammaForwardFastCaloHypoTool.TrigEgammaForwardFastCaloHypoToolConfig.isElectron
def isElectron(self)
Definition: TrigEgammaForwardFastCaloHypoTool.py:68
TrigEgammaForwardFastCaloHypoTool.TrigEgammaForwardFastCaloHypoToolConfig.compile
def compile(self)
Definition: TrigEgammaForwardFastCaloHypoTool.py:84
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
TrigEgammaForwardFastCaloHypoTool.TrigEgammaForwardFastCaloHypoToolConfig
Definition: TrigEgammaForwardFastCaloHypoTool.py:18
TrigEgammaForwardFastCaloHypoTool.TrigEgammaForwardFastCaloHypoToolConfig.isPhoton
def isPhoton(self)
Definition: TrigEgammaForwardFastCaloHypoTool.py:71
TrigEgammaForwardFastCaloHypoTool.TrigEgammaForwardFastCaloHypoToolConfig.__useRun3
__useRun3
Definition: TrigEgammaForwardFastCaloHypoTool.py:37
TrigEgammaForwardFastCaloHypoTool.TrigEgammaForwardFastCaloHypoToolConfig.__name
__name
Definition: TrigEgammaForwardFastCaloHypoTool.py:38
TrigEgammaForwardFastCaloHypoTool.TrigEgammaForwardFastCaloHypoToolConfig.__cand
__cand
Definition: TrigEgammaForwardFastCaloHypoTool.py:39
TrigEgammaForwardFastCaloHypoTool.TrigEgammaForwardFastCaloHypoToolConfig.__threshold
__threshold
Definition: TrigEgammaForwardFastCaloHypoTool.py:40
TrigEgammaForwardFastCaloHypoTool.TrigEgammaForwardFastCaloHypoToolConfig.__noringerinfo
__noringerinfo
Definition: TrigEgammaForwardFastCaloHypoTool.py:43
TrigEgammaForwardFastCaloHypoTool.TrigEgammaForwardFastCaloHypoToolConfig.chain
def chain(self)
Definition: TrigEgammaForwardFastCaloHypoTool.py:59
TrigEgammaForwardFastCaloHypoTool.TrigEgammaForwardFastCaloHypoToolConfig.__sel
__sel
Definition: TrigEgammaForwardFastCaloHypoTool.py:41
readCCLHist.float
float
Definition: readCCLHist.py:83
TrigEgammaForwardFastCaloHypoTool.TrigEgammaForwardFastCaloHypoToolConfig.tool
def tool(self)
Definition: TrigEgammaForwardFastCaloHypoTool.py:74