Exemplo n.º 1
0
def getMonTool_TrigJetAlgorithm(path):
  from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
  monTool = GenericMonitoringTool('MonTool')
  monTool.HistPath = path
  monTool.defineHistogram( 'nJets', path='EXPERT', type='TH1F', title='Counts', xbins=100, xmin=0, xmax=100 )
  monTool.defineHistogram( 'pt',    path='EXPERT', type='TH1F', title='Counts', xbins=100, xmin=0, xmax=500 )
  monTool.defineHistogram( 'et',    path='EXPERT', type='TH1F', title='Counts', xbins=100, xmin=0, xmax=500 )
  monTool.defineHistogram( 'eta',   path='EXPERT', type='TH1F', title='Counts', xbins=50, xmin=-5, xmax=5 )
  monTool.defineHistogram( 'phi',   path='EXPERT', type='TH1F', title='Counts', xbins=50, xmin=-3, xmax=3 )
  return monTool
Exemplo n.º 2
0
def PrescalingMonitoring():
    tool = GenericMonitoringTool('PrescalingMonitoring')
    tool.HistPath = "HLTFramework/L1Decoder"
    tool.defineHistogram('LB,HLTPSK',
                         path='EXPERT',
                         type='TH2I',
                         opt='kAddBinsDynamically',
                         title='HLT prescale key used in LB;Lumiblock;HLTPSK',
                         xbins=100,
                         xmin=0,
                         xmax=100,
                         ybins=5,
                         ymin=0,
                         ymax=5)
    return tool
Exemplo n.º 3
0
def CTPUnpackingMonitoring(maxItems, maxChains):
    tool = GenericMonitoringTool('CTPUnpackingMonitoring')
    tool.HistPath = "HLTFramework/L1Decoder"
    tool.Histograms = [
        defineHistogram('TAVItems',
                        path='EXPERT',
                        type='TH1F',
                        title='Number of active L1 TAV items;N Items;N Events',
                        xbins=maxItems,
                        xmin=0,
                        xmax=maxItems),
        defineHistogram('Chains',
                        path='EXPERT',
                        type='TH1F',
                        title='Number of activated Chains;N Chains;N Events',
                        xbins=maxChains,
                        xmin=0,
                        xmax=maxChains)
    ]
    return tool
Exemplo n.º 4
0
def setupFilterMonitoring(filterAlg):
    from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
    monTool = GenericMonitoringTool('MonTool')

    inputKeys = filterAlg.Input

    monTool.HistPath = "HLTFramework/Filters"
    monTool.defineHistogram('name,stat;' + filterAlg.getName(),
                            path='EXPERT',
                            type='TH2I',
                            title='Input activity fraction;;presence',
                            xbins=len(inputKeys),
                            xmin=0,
                            xmax=len(inputKeys) + 2,
                            xlabels=['exec', 'anyvalid'] + inputKeys,
                            ybins=2,
                            ymin=-0.5,
                            ymax=1.5,
                            ylabels=['no', 'yes'])

    filterAlg.MonTool = monTool
Exemplo n.º 5
0
def getMonTool_Algorithm(path):
    from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool
    monTool = GenericMonitoringTool('MonTool')

    #monTool.HistPath = 'MyGroup/MySubDir'  # default is the parent name of MonTool
    monTool.HistPath = path

    monTool.defineHistogram('TIME_execute',
                            path='EXPERT',
                            type='TH1F',
                            title='Counts',
                            xbins=400,
                            xmin=0,
                            xmax=200)
    monTool.defineHistogram('TIME_subtract',
                            path='EXPERT',
                            type='TH1F',
                            title='Counts',
                            xbins=400,
                            xmin=0,
                            xmax=200)
    return monTool
Exemplo n.º 6
0
def RoIsUnpackingMonitoring(prefix, maxCount, maxEta=3.):
    tool = GenericMonitoringTool(prefix + 'RoIsUnpackingMonitoring')
    tool.HistPath = "HLTFramework/L1Decoder/RoIs" + prefix
    tool.Histograms = [
        defineHistogram('count',
                        path='EXPERT',
                        type='TH1F',
                        title='Number of RoIs;N RoIs;N Events',
                        xbins=maxCount,
                        xmin=0,
                        xmax=maxCount),
        defineHistogram('eta',
                        path='EXPERT',
                        type='TH1F',
                        title='Eta distribution;eta;N RoIs',
                        xbins=60,
                        xmin=-maxEta,
                        xmax=maxEta),
        defineHistogram('phi',
                        path='EXPERT',
                        type='TH1F',
                        title='Phi distribution;phi;N RoIs',
                        xbins=64,
                        xmin=-math.pi,
                        xmax=math.pi),
        defineHistogram('eta, phi',
                        path='EXPERT',
                        type='TH2F',
                        title='RoIs map;eta;phi',
                        xbins=30,
                        xmin=-maxEta,
                        xmax=maxEta,
                        ybins=32,
                        ymin=-math.pi,
                        ymax=math.pi)
    ]
    return tool
Exemplo n.º 7
0
def _IncTool(name, threshold, sel):

    log.debug('TrigEgammaPrecisionElectronHypoTool _IncTool("' + name +
              '", threshold = ' + str(threshold) + ', sel = ' + str(sel))

    from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaPrecisionElectronHypoToolInc

    tool = TrigEgammaPrecisionElectronHypoToolInc(name)

    from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool, defineHistogram
    monTool = GenericMonitoringTool("MonTool_" + name)
    monTool.Histograms = [
        defineHistogram(
            'dEta',
            type='TH1F',
            path='EXPERT',
            title=
            "PrecisionElectron Hypo #Delta#eta_{EF L1}; #Delta#eta_{EF L1}",
            xbins=80,
            xmin=-0.01,
            xmax=0.01),
        defineHistogram(
            'dPhi',
            type='TH1F',
            path='EXPERT',
            title=
            "PrecisionElectron Hypo #Delta#phi_{EF L1}; #Delta#phi_{EF L1}",
            xbins=80,
            xmin=-0.01,
            xmax=0.01),
        defineHistogram(
            'Et_em',
            type='TH1F',
            path='EXPERT',
            title="PrecisionElectron Hypo cluster E_{T}^{EM};E_{T}^{EM} [MeV]",
            xbins=50,
            xmin=-2000,
            xmax=100000),
        defineHistogram('Eta',
                        type='TH1F',
                        path='EXPERT',
                        title="PrecisionElectron Hypo entries per Eta;Eta",
                        xbins=100,
                        xmin=-2.5,
                        xmax=2.5),
        defineHistogram('Phi',
                        type='TH1F',
                        path='EXPERT',
                        title="PrecisionElectron Hypo entries per Phi;Phi",
                        xbins=128,
                        xmin=-3.2,
                        xmax=3.2),
        defineHistogram(
            'EtaBin',
            type='TH1I',
            path='EXPERT',
            title="PrecisionElectron Hypo entries per Eta bin;Eta bin no.",
            xbins=11,
            xmin=-0.5,
            xmax=10.5),
        defineHistogram('LikelihoodRatio',
                        type='TH1F',
                        path='EXPERT',
                        title="PrecisionElectron Hypo LH",
                        xbins=100,
                        xmin=-5,
                        xmax=5),
        defineHistogram('mu',
                        type='TH1F',
                        path='EXPERT',
                        title="Average interaction per crossing",
                        xbins=100,
                        xmin=0,
                        xmax=100)
    ]

    cuts = [
        'Input', '#Delta #eta EF-L1', '#Delta #phi EF-L1', 'eta', 'E_{T}^{EM}'
    ]

    monTool.Histograms += [
        defineHistogram('CutCounter',
                        type='TH1I',
                        path='EXPERT',
                        title="PrecisionElectron Hypo Passed Cuts;Cut",
                        xbins=13,
                        xmin=-1.5,
                        xmax=12.5,
                        opt="kCumulative",
                        xlabels=cuts)
    ]

    monTool.HistPath = 'PrecisionElectronHypo/' + tool.name()
    tool.MonTool = monTool

    tool.EtaBins = [0.0, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37, 2.47]

    def same(val):
        return [val] * (len(tool.EtaBins) - 1)

    tool.ETthr = same(float(threshold))
    tool.dETACLUSTERthr = 0.1
    tool.dPHICLUSTERthr = 0.1

    tool.ElectronLHSelector = TrigElectronSelectors(sel)
    #tool.ET2thr         = same( 90.0*GeV )

    if sel == 'nocut':
        tool.AcceptAll = True
        tool.ETthr = same(float(threshold) * GeV)
        tool.dETACLUSTERthr = 9999.
        tool.dPHICLUSTERthr = 9999.

    elif sel == "etcut":
        tool.ETthr = same((float(threshold) - 3) * GeV)
        # No other cuts applied
        tool.dETACLUSTERthr = 9999.
        tool.dPHICLUSTERthr = 9999.

    return tool
Exemplo n.º 8
0
def _IncTool(name, threshold, sel):

    from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaPrecisionCaloHypoToolInc

    tool = TrigEgammaPrecisionCaloHypoToolInc(name)

    from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool, defineHistogram
    monTool = GenericMonitoringTool("MonTool_" + name)
    monTool.Histograms = [
        defineHistogram(
            'dEta',
            type='TH1F',
            path='EXPERT',
            title="PrecisionCalo Hypo #Delta#eta_{L2 L1}; #Delta#eta_{L2 L1}",
            xbins=80,
            xmin=-0.01,
            xmax=0.01),
        defineHistogram(
            'dPhi',
            type='TH1F',
            path='EXPERT',
            title="PrecisionCalo Hypo #Delta#phi_{L2 L1}; #Delta#phi_{L2 L1}",
            xbins=80,
            xmin=-0.01,
            xmax=0.01),
        defineHistogram(
            'Et_em',
            type='TH1F',
            path='EXPERT',
            title="PrecisionCalo Hypo cluster E_{T}^{EM};E_{T}^{EM} [MeV]",
            xbins=50,
            xmin=-2000,
            xmax=100000),
        defineHistogram('Eta',
                        type='TH1F',
                        path='EXPERT',
                        title="PrecisionCalo Hypo entries per Eta;Eta",
                        xbins=100,
                        xmin=-2.5,
                        xmax=2.5),
        defineHistogram('Phi',
                        type='TH1F',
                        path='EXPERT',
                        title="PrecisionCalo Hypo entries per Phi;Phi",
                        xbins=128,
                        xmin=-3.2,
                        xmax=3.2),
        defineHistogram(
            'EtaBin',
            type='TH1I',
            path='EXPERT',
            title="PrecisionCalo Hypo entries per Eta bin;Eta bin no.",
            xbins=11,
            xmin=-0.5,
            xmax=10.5)
    ]

    cuts = [
        'Input', '#Delta #eta L2-L1', '#Delta #phi L2-L1', 'eta', 'E_{T}^{EM}'
    ]

    monTool.Histograms += [
        defineHistogram('CutCounter',
                        type='TH1I',
                        path='EXPERT',
                        title="PrecisionCalo Hypo Passed Cuts;Cut",
                        xbins=13,
                        xmin=-1.5,
                        xmax=12.5,
                        opt="kCumulative",
                        xlabels=cuts)
    ]

    monTool.HistPath = 'PrecisionCaloHypo/' + tool.name()
    tool.MonTool = monTool

    tool.EtaBins = [0.0, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37, 2.47]

    def same(val):
        return [val] * (len(tool.EtaBins) - 1)

    tool.ETthr = same(float(threshold))
    tool.dETACLUSTERthr = 0.1
    tool.dPHICLUSTERthr = 0.1
    tool.ET2thr = same(90.0 * GeV)

    if sel == 'nocut':
        tool.AcceptAll = True
        tool.ETthr = same(float(threshold) * GeV)
        tool.dETACLUSTERthr = 9999.
        tool.dPHICLUSTERthr = 9999.

    elif sel == "etcut":
        tool.ETthr = same((float(threshold) - 3) * GeV)
        # No other cuts applied
        tool.dETACLUSTERthr = 9999.
        tool.dPHICLUSTERthr = 9999.

    etaBinsLen = len(tool.EtaBins) - 1
    for prop in "ETthr ET2thr".split():
        propLen = len(getattr(tool, prop))
        assert propLen == etaBinsLen, "In " + name + " " + prop + " has length " + str(
            propLen
        ) + " which is different from EtaBins which has length " + str(
            etaBinsLen)

    #assert  _l( EtaBins, tool.ETthr, tool.HADETthr, tool.CARCOREthr, tool.CARCOREthr ) , "All list properties should have equal length ( as EtaBins )"
    #print tool
    return tool
Exemplo n.º 9
0
def TrigEgammaFastPhotonHypoToolFromDict(chainDict):
    """ Use menu decoded chain dictionary to configure the tool """
    thresholds = sum([[cpart['threshold']] * int(cpart['multiplicity'])
                      for cpart in chainDict['chainParts']], [])

    name = chainDict['chainName']
    from AthenaConfiguration.ComponentFactory import CompFactory
    tool = CompFactory.TrigEgammaFastPhotonHypoTool(name)

    monTool = GenericMonitoringTool("MonTool" + name)
    monTool.defineHistogram('CutCounter',
                            type='TH1I',
                            path='EXPERT',
                            title="FastPhoton Hypo Cut Counter;Cut Counter",
                            xbins=8,
                            xmin=-1.5,
                            xmax=7.5,
                            opt="kCumulative")
    monTool.defineHistogram(
        'PtCalo',
        type='TH1F',
        path='EXPERT',
        title="FastPhoton Hypo p_{T}^{calo} [MeV];p_{T}^{calo} [MeV];Nevents",
        xbins=50,
        xmin=0,
        xmax=100000)
    monTool.defineHistogram(
        'CaloEta',
        type='TH1F',
        path='EXPERT',
        title="FastPhoton Hypo #eta^{calo} ; #eta^{calo};Nevents",
        xbins=200,
        xmin=-2.5,
        xmax=2.5)
    monTool.defineHistogram(
        'CaloPhi',
        type='TH1F',
        path='EXPERT',
        title="FastPhoton Hypo #phi^{calo} ; #phi^{calo};Nevents",
        xbins=320,
        xmin=-3.2,
        xmax=3.2)

    monTool.HistPath = 'FastPhotonHypo/' + tool.getName()
    tool.MonTool = monTool

    nt = len(thresholds)
    tool.ETthr = [[
        0. * GeV, 0. * GeV, 0. * GeV, 0. * GeV, 0. * GeV, 0. * GeV, 0. * GeV,
        0. * GeV, 0. * GeV
    ]] * nt
    tool.CARCOREthr = [[0., 0., 0., 0., 0., 0., 0., 0., 0.]] * nt
    tool.CAERATIOthr = [[0., 0., 0., 0., 0., 0., 0., 0., 0.]] * nt
    tool.EtaBins = [0, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37, 2.47] * nt
    tool.dETACLUSTERthr = [0.1] * nt
    tool.dPHICLUSTERthr = [0.1] * nt
    tool.F1thr = [0.005] * nt
    tool.ET2thr = [[
        90.0 * GeV, 90.0 * GeV, 90.0 * GeV, 90.0 * GeV, 90.0 * GeV, 90.0 * GeV,
        90.0 * GeV, 90.0 * GeV, 90.0 * GeV
    ]] * nt
    tool.HADET2thr = [[
        999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0
    ]] * nt
    tool.HADETthr = [[
        0.035, 0.035, 0.035, 0.035, 0.035, 0.035, 0.035, 0.035, 0.035
    ]] * nt

    return tool
Exemplo n.º 10
0
def TrigEgammaFastElectronHypoToolFromDict(chainDict):
    """ Use menu decoded chain dictionary to configure the tool """
    cparts = [
        i for i in chainDict['chainParts'] if i['signature'] == 'Electron'
    ]

    thresholds = sum([[cpart['threshold']] * int(cpart['multiplicity'])
                      for cpart in cparts], [])

    name = chainDict['chainName']
    from AthenaConfiguration.ComponentFactory import CompFactory
    tool = CompFactory.TrigEgammaFastElectronHypoTool(name)

    monTool = GenericMonitoringTool("MonTool" + name)
    monTool.defineHistogram('CutCounter',
                            type='TH1I',
                            path='EXPERT',
                            title="FastElectron Hypo Cut Counter;Cut Counter",
                            xbins=8,
                            xmin=-1.5,
                            xmax=7.5,
                            opt="kCumulative")
    monTool.defineHistogram(
        'CaloTrackdEta',
        type='TH1F',
        path='EXPERT',
        title=
        "FastElectron Hypo #Delta #eta between cluster and track;#Delta #eta;Nevents",
        xbins=80,
        xmin=-0.4,
        xmax=0.4)
    monTool.defineHistogram(
        'CaloTrackdPhi',
        type='TH1F',
        path='EXPERT',
        title=
        "FastElectron Hypo #Delta #phi between cluster and track;#Delta #phi;Nevents",
        xbins=80,
        xmin=-0.4,
        xmax=0.4)
    monTool.defineHistogram('CaloTrackEoverP',
                            type='TH1F',
                            path='EXPERT',
                            title="FastElectron Hypo E/p;E/p;Nevents",
                            xbins=120,
                            xmin=0,
                            xmax=12)
    monTool.defineHistogram(
        'PtTrack',
        type='TH1F',
        path='EXPERT',
        title=
        "FastElectron Hypo p_{T}^{track} [MeV];p_{T}^{track} [MeV];Nevents",
        xbins=50,
        xmin=0,
        xmax=100000)
    monTool.defineHistogram(
        'PtCalo',
        type='TH1F',
        path='EXPERT',
        title="FastElectron Hypo p_{T}^{calo} [MeV];p_{T}^{calo} [MeV];Nevents",
        xbins=50,
        xmin=0,
        xmax=100000)
    monTool.defineHistogram(
        'CaloEta',
        type='TH1F',
        path='EXPERT',
        title="FastElectron Hypo #eta^{calo} ; #eta^{calo};Nevents",
        xbins=200,
        xmin=-2.5,
        xmax=2.5)
    monTool.defineHistogram(
        'CaloPhi',
        type='TH1F',
        path='EXPERT',
        title="FastElectron Hypo #phi^{calo} ; #phi^{calo};Nevents",
        xbins=320,
        xmin=-3.2,
        xmax=3.2)

    monTool.HistPath = 'FastElectronHypo/' + tool.getName()
    tool.MonTool = monTool

    nt = len(thresholds)
    tool.TrackPt = [0.0] * nt
    tool.CaloTrackdETA = [0.2] * nt
    tool.CaloTrackdPHI = [990.] * nt
    tool.CaloTrackdEoverPLow = [0.0] * nt
    tool.CaloTrackdEoverPHigh = [999.0] * nt
    tool.TRTRatio = [-999.] * nt

    for th, thvalue in enumerate(thresholds):
        if float(thvalue) < 15:
            tool.TrackPt[th] = 1.0 * GeV
        elif float(thvalue) >= 15 and float(thvalue) < 20:
            tool.TrackPt[th] = 2.0 * GeV
        elif float(thvalue) >= 20 and float(thvalue) < 50:
            tool.TrackPt[th] = 3.0 * GeV
        elif float(thvalue) >= 50:
            tool.TrackPt[th] = 5.0 * GeV
            tool.CaloTrackdETA[th] = 999.
            tool.CaloTrackdPHI[th] = 999.
        else:
            raise RuntimeError('No threshold: Default cut configured')
    return tool
Exemplo n.º 11
0
def _IncTool(name, threshold, sel):

    log.debug('TrigEgammaPrecisionPhotonHypoTool _IncTool("' + name +
              '", threshold = ' + str(threshold) + ', sel = ' + str(sel))

    from TrigEgammaHypo.TrigEgammaHypoConf import TrigEgammaPrecisionPhotonHypoToolInc

    tool = TrigEgammaPrecisionPhotonHypoToolInc(name)

    from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool, defineHistogram
    monTool = GenericMonitoringTool("MonTool_" + name)
    monTool.Histograms = [
        defineHistogram(
            'dEta',
            type='TH1F',
            path='EXPERT',
            title="PrecisionPhoton Hypo #Delta#eta_{EF L1}; #Delta#eta_{EF L1}",
            xbins=80,
            xmin=-0.01,
            xmax=0.01),
        defineHistogram(
            'dPhi',
            type='TH1F',
            path='EXPERT',
            title="PrecisionPhoton Hypo #Delta#phi_{EF L1}; #Delta#phi_{EF L1}",
            xbins=80,
            xmin=-0.01,
            xmax=0.01),
        defineHistogram(
            'Et_em',
            type='TH1F',
            path='EXPERT',
            title="PrecisionPhoton Hypo cluster E_{T}^{EM};E_{T}^{EM} [MeV]",
            xbins=50,
            xmin=-2000,
            xmax=100000),
        defineHistogram('Eta',
                        type='TH1F',
                        path='EXPERT',
                        title="PrecisionPhoton Hypo entries per Eta;Eta",
                        xbins=100,
                        xmin=-2.5,
                        xmax=2.5),
        defineHistogram('Phi',
                        type='TH1F',
                        path='EXPERT',
                        title="PrecisionPhoton Hypo entries per Phi;Phi",
                        xbins=128,
                        xmin=-3.2,
                        xmax=3.2),
        defineHistogram(
            'EtaBin',
            type='TH1I',
            path='EXPERT',
            title="PrecisionPhoton Hypo entries per Eta bin;Eta bin no.",
            xbins=11,
            xmin=-0.5,
            xmax=10.5)
    ]

    cuts = [
        'Input', '#Delta #eta EF-L1', '#Delta #phi EF-L1', 'eta', 'E_{T}^{EM}'
    ]

    monTool.Histograms += [
        defineHistogram('CutCounter',
                        type='TH1I',
                        path='EXPERT',
                        title="PrecisionPhoton Hypo Passed Cuts;Cut",
                        xbins=13,
                        xmin=-1.5,
                        xmax=12.5,
                        opt="kCumulative",
                        xlabels=cuts)
    ]

    monTool.HistPath = 'PrecisionPhotonHypo/' + tool.name()
    tool.MonTool = monTool

    tool.EtaBins = [0.0, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37, 2.47]

    def same(val):
        return [val] * (len(tool.EtaBins) - 1)

    tool.ETthr = same(float(threshold))
    tool.dETACLUSTERthr = 0.1
    tool.dPHICLUSTERthr = 0.1

    # configure the selector tool corresponding the selection set by sel
    tool.PhotonIsEMSelector = TrigPhotonSelectors(sel)

    return tool
Exemplo n.º 12
0
def _IncTool(name, cand, threshold, sel):

    possibleSel = L2CaloCutMaps( threshold ).MapsHADETthr.keys()
    from AthenaConfiguration.ComponentFactory import CompFactory
    tool = CompFactory.TrigEgammaFastCaloHypoToolInc( name )
    tool.AcceptAll = False
    tool.UseRinger = False
    

    if 'Validation' in TriggerFlags.enableMonitoring() or 'Online' in  TriggerFlags.enableMonitoring():
        monTool = GenericMonitoringTool("MonTool_"+name)
        monTool.defineHistogram('dEta', type='TH1F', path='EXPERT', title="L2Calo Hypo #Delta#eta_{L2 L1}; #Delta#eta_{L2 L1}", xbins=80, xmin=-0.01, xmax=0.01)
        monTool.defineHistogram('dPhi', type='TH1F', path='EXPERT', title="L2Calo Hypo #Delta#phi_{L2 L1}; #Delta#phi_{L2 L1}", xbins=80, xmin=-0.01, xmax=0.01)
        monTool.defineHistogram('Et_em', type='TH1F', path='EXPERT', title="L2Calo Hypo cluster E_{T}^{EM};E_{T}^{EM} [MeV]", xbins=50, xmin=-2000, xmax=100000)
        monTool.defineHistogram('Eta', type='TH1F', path='EXPERT', title="L2Calo Hypo entries per Eta;Eta", xbins=100, xmin=-2.5, xmax=2.5)
        monTool.defineHistogram('Phi', type='TH1F', path='EXPERT', title="L2Calo Hypo entries per Phi;Phi", xbins=128, xmin=-3.2, xmax=3.2)

        cuts=['Input','has one TrigEMCluster', '#Delta #eta L2-L1', '#Delta #phi L2-L1','eta','rCore',
              'eRatio','E_{T}^{EM}', 'E_{T}^{Had}','f_{1}','Weta2','Wstot','F3']

        monTool.defineHistogram('CutCounter', type='TH1I', path='EXPERT', title="L2Calo Hypo Passed Cuts;Cut",
                                xbins=13, xmin=-1.5, xmax=12.5,  opt="kCumulative", xlabels=cuts)

        if 'Validation' in TriggerFlags.enableMonitoring():
            monTool.defineHistogram('Et_had', type='TH1F', path='EXPERT', title="L2Calo Hypo E_{T}^{had} in first layer;E_{T}^{had} [MeV]", xbins=50, xmin=-2000, xmax=100000)
            monTool.defineHistogram('Rcore', type='TH1F', path='EXPERT', title="L2Calo Hypo R_{core};E^{3x3}/E^{3x7} in sampling 2", xbins=48, xmin=-0.1, xmax=1.1)
            monTool.defineHistogram('Eratio', type='TH1F', path='EXPERT', title="L2Calo Hypo E_{ratio};E^{max1}-E^{max2}/E^{max1}+E^{max2} in sampling 1 (excl.crack)", xbins=64, xmin=-0.1, xmax=1.5)
            monTool.defineHistogram('EtaBin', type='TH1I', path='EXPERT', title="L2Calo Hypo entries per Eta bin;Eta bin no.", xbins=11, xmin=-0.5, xmax=10.5)
            monTool.defineHistogram('F1', type='TH1F', path='EXPERT', title="L2Calo Hypo f_{1};f_{1}", xbins=34, xmin=-0.5, xmax=1.2)
            monTool.defineHistogram('Weta2', type='TH1F', path='EXPERT', title="L2Calo Hypo Weta2; E Width in sampling 2", xbins=96, xmin=-0.1, xmax=0.61)
            monTool.defineHistogram('Wstot', type='TH1F', path='EXPERT', title="L2Calo Hypo Wstot; E Width in sampling 1", xbins=48, xmin=-0.1, xmax=11.)
            monTool.defineHistogram('F3', type='TH1F', path='EXPERT', title="L2Calo Hypo F3; E3/(E0+E1+E2+E3)", xbins=96, xmin=-0.1, xmax=1.1)

        monTool.HistPath = 'L2CaloHypo/'+tool.getName()
        tool.MonTool = monTool


    tool.EtaBins        = [0.0, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37, 2.47]
    def same( val ):
        return [val]*( len( tool.EtaBins ) - 1 )

    tool.ETthr          = same( float(threshold) )
    tool.dETACLUSTERthr = 0.1
    tool.dPHICLUSTERthr = 0.1
    tool.F1thr          = same( 0.005 )
    tool.ET2thr         = same( 90.0*GeV )
    tool.HADET2thr      = same( 999.0 )
    tool.HADETthr       = same( 0.058 )
    tool.WETA2thr       = same( 99999. )
    tool.WSTOTthr       = same( 99999. )
    tool.F3thr          = same( 99999. )
    tool.CARCOREthr     = same( -9999. )
    tool.CAERATIOthr    = same( -9999. )

    if sel == 'nocut' or 'idperf' in name:
        tool.AcceptAll = True
        tool.UseRinger = False
        tool.ETthr          = same( float( threshold )*GeV )
        tool.dETACLUSTERthr = 9999.
        tool.dPHICLUSTERthr = 9999.
        tool.F1thr          = same( 0.0 )
        tool.HADETthr       = same( 9999. )
        tool.CARCOREthr     = same( -9999. )
        tool.CAERATIOthr    = same( -9999. )

    elif sel == "etcut": # stcut is part of the name, it can as well be etcut1step (test chains)
        tool.UseRinger = False
        tool.ETthr          = same( ( float( threshold ) -  3 )*GeV )
        # No other cuts applied
        tool.dETACLUSTERthr = 9999.
        tool.dPHICLUSTERthr = 9999.
        tool.F1thr          = same( 0.0 )
        tool.HADETthr       = same( 9999. )
        tool.CARCOREthr     = same( -9999. )
        tool.CAERATIOthr    = same( -9999. )

    elif sel in possibleSel and "noringer" in name: # real selection
        tool.UseRinger = False
        tool.ETthr       = same( ( float( threshold ) - 3 )*GeV )
        tool.HADETthr    = L2CaloCutMaps( threshold ).MapsHADETthr[sel]
        tool.CARCOREthr  = L2CaloCutMaps( threshold ).MapsCARCOREthr[sel]
        tool.CAERATIOthr = L2CaloCutMaps( threshold ).MapsCAERATIOthr[sel]

    elif sel in possibleSel and cand=="g": # real selection
        tool.UseRinger = False
        tool.ETthr	  = same( ( float( threshold ) - 3 )*GeV )
        tool.HADETthr    = L2CaloCutMaps( threshold ).MapsHADETthr[sel]
        tool.CARCOREthr  = L2CaloCutMaps( threshold ).MapsCARCOREthr[sel]
        tool.CAERATIOthr = L2CaloCutMaps( threshold ).MapsCAERATIOthr[sel]    

    elif sel in _possibleSel.keys() and not "noringer" in name and cand=="e":
        tool.UseRinger = True
        pconstants, pthresholds = _GetPath( cand, sel )
        tool.ConstantsCalibPath = pconstants
        tool.ThresholdsCalibPath = pthresholds
        tool.MonTool = ""
        tool.EtCut = (float(threshold)-3.)*GeV        

        # monitoring part  
    
        if (('Validation' in TriggerFlags.enableMonitoring()) or
        ('Online' in  TriggerFlags.enableMonitoring())    or 
        (athenaCommonFlags.isOnline)):
            monTool = GenericMonitoringTool('MonTool'+name)
            monTool.Histograms = [
                defineHistogram( "TIME_total", path='EXPERT',title="Total Time;time[ms]",xbins=50, xmin=0,xmax=5,type='TH1F'),
                defineHistogram( "TIME_preproc", path='EXPERT',title="Total Time;time[ms]",xbins=50, xmin=0,xmax=5,type='TH1F'),
                defineHistogram( "TIME_propagate",path='EXPERT', title="Total Time;time[ms]",xbins=50, xmin=0,xmax=5,type='TH1F'),
                defineHistogram('Eta', type='TH1F', path='EXPERT',title="#eta of Clusters; #eta; number of RoIs", xbins=50,xmin=-2.5,xmax=2.5),
                defineHistogram('Phi',type='TH1F', path='EXPERT',title="#phi of Clusters; #phi; number of RoIs", xbins=64,xmin=-3.2,xmax=3.2),
                defineHistogram('Et',type='TH1F', path='EXPERT',title="E_{T} of Clusters; E_{T} [MeV]; number of RoIs", xbins=60,xmin=0,xmax=5e4),
                defineHistogram('RnnOut',type='TH1F', path='EXPERT',title="Neural Network output; NN output; number of RoIs", xbins=100,xmin=-10,xmax=10),
            ]
    
            monTool.HistPath='L2CaloHypo_Ringer/'+monTool.name()
            tool.MonTool=monTool


    
    etaBinsLen = len( tool.EtaBins ) - 1
    for prop in "ETthr HADETthr CARCOREthr CARCOREthr F1thr F3thr WSTOTthr WETA2thr HADETthr HADETthr ET2thr".split():
        propLen = len( getattr( tool, prop ) )
        assert propLen == etaBinsLen , "In " + name + " " + prop + " has length " + str( propLen ) + " which is different from EtaBins which has length " + str( etaBinsLen )

    return tool
Exemplo n.º 13
0
def _IncTool(name, cand, threshold, sel):

    from TrigMultiVarHypo.TrigMultiVarHypoConf import TrigL2CaloRingerHypoToolMT

    tool = TrigL2CaloRingerHypoToolMT(name)
    tool.AcceptAll = False
    tool.MonTool = ""
    tool.EtCut = (float(threshold) - 3.) * GeV

    # monitoring part
    from TriggerJobOpts.TriggerFlags import TriggerFlags
    if (('Validation' in TriggerFlags.enableMonitoring())
            or ('Online' in TriggerFlags.enableMonitoring())
            or (athenaCommonFlags.isOnline)):

        from AthenaMonitoringKernel.GenericMonitoringTool import GenericMonitoringTool, defineHistogram
        monTool = GenericMonitoringTool('MonTool' + name)
        monTool.Histograms = [
            defineHistogram("TIME_total",
                            path='EXPERT',
                            title="Total Time;time[ms]",
                            xbins=50,
                            xmin=0,
                            xmax=5,
                            type='TH1F'),
            defineHistogram("TIME_preproc",
                            path='EXPERT',
                            title="Total Time;time[ms]",
                            xbins=50,
                            xmin=0,
                            xmax=5,
                            type='TH1F'),
            defineHistogram("TIME_propagate",
                            path='EXPERT',
                            title="Total Time;time[ms]",
                            xbins=50,
                            xmin=0,
                            xmax=5,
                            type='TH1F'),
            defineHistogram('Eta',
                            type='TH1F',
                            path='EXPERT',
                            title="#eta of Clusters; #eta; number of RoIs",
                            xbins=50,
                            xmin=-2.5,
                            xmax=2.5),
            defineHistogram('Phi',
                            type='TH1F',
                            path='EXPERT',
                            title="#phi of Clusters; #phi; number of RoIs",
                            xbins=64,
                            xmin=-3.2,
                            xmax=3.2),
            defineHistogram(
                'Et',
                type='TH1F',
                path='EXPERT',
                title="E_{T} of Clusters; E_{T} [MeV]; number of RoIs",
                xbins=60,
                xmin=0,
                xmax=5e4),
            defineHistogram(
                'RnnOut',
                type='TH1F',
                path='EXPERT',
                title="Neural Network output; NN output; number of RoIs",
                xbins=100,
                xmin=-10,
                xmax=10),
        ]

        monTool.HistPath = 'L2CaloHypo_Ringer/' + monTool.name()
        tool.MonTool = monTool

    if sel == 'nocut':
        tool.AcceptAll = True
    elif sel == "etcut":
        tool.EtCut = (float(threshold) - 3.) * GeV
    elif sel in _possibleSel.keys():  # real selection
        pconstants, pthresholds = _GetPath(cand, sel)
        tool.ConstantsCalibPath = pconstants
        tool.ThresholdsCalibPath = pthresholds

    return tool