ATLAS Offline Software
Loading...
Searching...
No Matches
TrigEgammaForwardFastCaloHypoTool.py
Go to the documentation of this file.
1# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
2
3from 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
90def _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
const bool debug
_IncTool(name, cand, threshold, sel, trackinfo, noringerinfo)