4 from AthenaMonitoringKernel.GenericMonitoringTool
import GenericMonitoringTool
5 from AthenaConfiguration.ComponentFactory
import CompFactory
11 thePrecisionPhotonCaloIsoHypo = CompFactory.TrigEgammaPrecisionPhotonCaloIsoHypoAlg(name)
12 thePrecisionPhotonCaloIsoHypo.Photons = sequenceIn
13 thePrecisionPhotonCaloIsoHypo.IsoPhotons = sequenceOut
14 return thePrecisionPhotonCaloIsoHypo
32 __caloIsolationCut = {
33 None : [
None,
None,
None],
34 'icaloloose' : [0.1 , 999., 999. ],
35 'icalomedium' : [0.075, 999., 999. ],
36 'icalotight' : [999. , 999., 0.03 ]
40 None : [
None,
None,
None],
41 'icaloloose' : [999., 999., 999.],
42 'icalomedium' : [999., 999., 999.],
43 'icalotight' : [999., 999., 999.]
46 __caloIsolationOffset = {
47 None : [
None,
None,
None],
48 'icaloloose' : [0.,0.,0.],
49 'icalomedium': [0.,0.,0],
50 'icalotight' : [0.,0.,2.45*GeV]
54 def __init__(self, name, monGroups, cpart, tool=None):
56 from AthenaCommon.Logging
import logging
57 self.
__log = logging.getLogger(
'TrigEgammaPrecisionPhotonCaloIsoHypoTool')
63 tool = CompFactory.TrigEgammaPrecisionPhotonCaloIsoHypoTool( name )
65 tool.EtaBins = [0.0, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37, 2.47]
84 self.
tool().AcceptAll =
True
102 self.
__log.
debug(
'Configuring Isolation cut %s for [topoetcone20/et, topoetcone30/et, topoetcone40/et]', self.
isoInfo())
103 self.
__log.
debug(
' with values = %s and offsets = %s',
107 self.
__log.
debug(
'Configuring Isolation to AcceptAll (not applying any cut)')
111 if hasattr(self.
tool(),
"MonTool"):
113 doValidationMonitoring = flags.Trigger.doValidationMonitoring
116 if (any(
'egammaMon:online' in group
for group
in monGroups)
or doValidationMonitoring):
126 HistPath =
'PrecisionPhotonCaloIsoHypo/'+self.
__name)
127 monTool.defineHistogram(
'Et_em', type=
'TH1F', path=
'EXPERT', title=
"PrecisionPhotonCaloIso Hypo cluster E_{T}^{EM};E_{T}^{EM} [MeV]", xbins=50, xmin=-2000, xmax=100000)
128 monTool.defineHistogram(
'Eta', type=
'TH1F', path=
'EXPERT', title=
"PrecisionPhotonCaloIso Hypo entries per Eta;Eta", xbins=100, xmin=-2.5, xmax=2.5)
129 monTool.defineHistogram(
'Phi', type=
'TH1F', path=
'EXPERT', title=
"PrecisionPhotonCaloIso Hypo entries per Phi;Phi", xbins=128, xmin=-3.2, xmax=3.2)
130 monTool.defineHistogram(
'EtaBin', type=
'TH1I', path=
'EXPERT', title=
"PrecisionPhotonCaloIso Hypo entries per Eta bin;Eta bin no.", xbins=11, xmin=-0.5, xmax=10.5)
132 cuts=[
'Input',
'eta',
'Calo Iso']
134 monTool.defineHistogram(
'CutCounter', type=
'TH1I', path=
'EXPERT', title=
"PrecisionPhotonCaloIso Hypo Passed Cuts;Cut",
135 xbins=13, xmin=-1.5, xmax=12.5, opt=
"kCumulative", xlabels=cuts)
137 if flags.Trigger.doValidationMonitoring:
138 monTool.defineHistogram(
'etcone20',type=
'TH1F',path=
'EXPERT',title=
"PrecisionPhotonCaloIso Hypo etcone20; etcone20;", xbins=50, xmin=0, xmax=5.0)
139 monTool.defineHistogram(
'topoetcone20',type=
'TH1F',path=
'EXPERT',title=
"PrecisionPhotonCaloIso Hypo; topoetcone20;", xbins=50, xmin=-10, xmax=10)
140 monTool.defineHistogram(
'reletcone20',type=
'TH1F',path=
'EXPERT',title=
"PrecisionPhotonCaloIso Hypo etcone20/et; etcone20/et;", xbins=50, xmin=-0.5, xmax=0.5)
141 monTool.defineHistogram(
'reltopoetcone20',type=
'TH1F',path=
'EXPERT',title=
"PrecisionPhotonCaloIso Hypo; topoetcone20/pt;", xbins=50, xmin=-0.5, xmax=0.5)
143 self.
tool().MonTool = monTool
147 def _IncTool( flags, name, monGroups, cpart, tool=None ):
149 config.compile(flags)
155 """ Use menu decoded chain dictionary to configure the tool """
156 cparts = [i
for i
in d[
'chainParts']
if ((i[
'signature']==
'Electron')
or (i[
'signature']==
'Photon'))]
157 return _IncTool( flags, d[
'chainName'], d[
'monGroups'], cparts[0], tool=tool )