コード例 #1
0
ファイル: install.py プロジェクト: ringer-atlas/prometheus
def installPhotonL2CaloRingerSelector_v1():
    '''
  This tuning is the very medium tuning which was adjusted to operate in the knee of the ROC curve given the best balance between PD and FR.
  '''
    from TrigEgammaEmulationTool import RingerSelectorTool
    import os
    calibpath = os.environ['PRT_PATH'] + '/trigger/data/zrad/TrigL2_20211102_v1'

    def getPatterns(context):
        def norm1(data):
            return (data / abs(sum(data))).reshape((1, 100))

        fc = context.getHandler("HLT__TrigEMClusterContainer")
        rings = norm1(fc.ringsE())
        return [rings]

    hypos = [
        RingerSelectorTool("T0HLTPhotonRingerTight_v1",
                           getPatterns,
                           ConfigFile=calibpath +
                           '/PhotonRingerTightTriggerConfig.conf'),
        RingerSelectorTool("T0HLTPhotonRingerMedium_v1",
                           getPatterns,
                           ConfigFile=calibpath +
                           '/PhotonRingerMediumTriggerConfig.conf'),
        RingerSelectorTool("T0HLTPhotonRingerLoose_v1",
                           getPatterns,
                           ConfigFile=calibpath +
                           '/PhotonRingerLooseTriggerConfig.conf'),
    ]

    return attach(hypos)
コード例 #2
0
ファイル: install.py プロジェクト: ringer-atlas/prometheus
def installLowEnergyElectronL2CaloRingerSelector_v1():

    from TrigEgammaEmulationTool import RingerSelectorTool
    import os
    calibpath = os.environ['PRT_PATH'] + '/trigger/data/jpsi/TrigL2_20210227_v1'

    def getPatterns(context):
        def norm1(data):
            return (data / abs(sum(data))).reshape((1, 100))

        fc = context.getHandler("HLT__TrigEMClusterContainer")
        rings = norm1(fc.ringsE())
        return [rings]

    hypos = [
        RingerSelectorTool("T0HLTLowEnergyElectronRingerTight_v1",
                           getPatterns,
                           ConfigFile=calibpath +
                           '/ElectronRingerTightTriggerConfig.conf'),
        RingerSelectorTool("T0HLTLowEnergyElectronRingerMedium_v1",
                           getPatterns,
                           ConfigFile=calibpath +
                           '/ElectronRingerMediumTriggerConfig.conf'),
        RingerSelectorTool("T0HLTLowEnergyElectronRingerLoose_v1",
                           getPatterns,
                           ConfigFile=calibpath +
                           '/ElectronRingerLooseTriggerConfig.conf'),
        RingerSelectorTool("T0HLTLowEnergyElectronRingerVeryLoose_v1",
                           getPatterns,
                           ConfigFile=calibpath +
                           '/ElectronRingerVeryLooseTriggerConfig.conf'),
    ]

    return attach(hypos)
コード例 #3
0
ファイル: install.py プロジェクト: ringer-atlas/prometheus
def installElectronL2CaloRingerSelector_v11():

    # Using shower shapes + rings here

    from TrigEgammaEmulationTool import RingerSelectorTool
    import os
    calibpath = os.environ['PRT_PATH'] + '/trigger/data/zee/TrigL2_20210306_v11'

    def getPatterns(context):
        def norm1(data):
            return (data / abs(sum(data))).reshape((1, 100))

        fc = context.getHandler("HLT__TrigEMClusterContainer")
        rings = norm1(fc.ringsE())
        reta = fc.reta()
        eratio = fc.eratio()
        f1 = fc.f1() / 0.6
        f3 = fc.f3() / 0.04
        weta2 = fc.weta2() / 0.02
        wstot = fc.wstot()
        if eratio > 10.0:
            eratio = 0.0
        elif eratio > 1.0:
            eratio = 1.0
        if wstot < -99:
            wstot = 0.0

        return [rings, np.array([[reta, eratio, f1, f3, weta2, wstot]])]

    hypos = [
        RingerSelectorTool("T0HLTElectronRingerTight_v11",
                           getPatterns,
                           ConfigFile=calibpath +
                           '/ElectronRingerTightTriggerConfig.conf'),
        RingerSelectorTool("T0HLTElectronRingerMedium_v11",
                           getPatterns,
                           ConfigFile=calibpath +
                           '/ElectronRingerMediumTriggerConfig.conf'),
        RingerSelectorTool("T0HLTElectronRingerLoose_v11",
                           getPatterns,
                           ConfigFile=calibpath +
                           '/ElectronRingerLooseTriggerConfig.conf'),
        RingerSelectorTool("T0HLTElectronRingerVeryLoose_v11",
                           getPatterns,
                           ConfigFile=calibpath +
                           '/ElectronRingerVeryLooseTriggerConfig.conf'),
    ]

    return attach(hypos)
コード例 #4
0
def installElectronL2RingerSelector_v2_el():

  # Using shower shapes + rings here

  from TrigEgammaEmulationTool import RingerSelectorTool
  import os
  calibpath = os.environ['PRT_PATH'] + '/trigger/data/zee/TrigL2_20201204_v2_el'

  def getPatterns( context ):
    def norm1( data ):
      return (data/abs(sum(data))).reshape((1,100))
    fc = context.getHandler("HLT__TrigEMClusterContainer")
    rings = norm1( fc.ringsE() )
    reta = fc.reta()
    eratio = fc.eratio()
    f1 = fc.f1()/0.6
    f3 = fc.f3()/0.04
    weta2 =fc.weta2()/0.02
    wstot = fc.wstot()
    if eratio>10.0:
      eratio = 0.0
    elif eratio>1.0:
      eratio=1.0
    if wstot<-99:
      wstot=0.0

    el = context.getHandler("HLT__TrigElectronContainer" )

    # treat cases where we have container but it's empty. In this case, we are not be able to propagate.
    if el.size() == 0:
      return None

    el.setToBeClosestThanCluster()
    deta = el.trkClusDeta()
    dphi = el.trkClusDphi()
    etOverPt = el.etOverPt()

    return [rings, np.array([[reta,eratio,f1,f3,weta2,wstot]]), np.array([[etOverPt, deta, dphi]]) ]


  hypos = [
      RingerSelectorTool( "T0HLTElectronRingerTight_v2_el"    , getPatterns, ConfigFile = calibpath+'/ElectronRingerTightTriggerConfig.conf'     ),
      RingerSelectorTool( "T0HLTElectronRingerMedium_v2_el"   , getPatterns, ConfigFile = calibpath+'/ElectronRingerMediumTriggerConfig.conf'    ),
      RingerSelectorTool( "T0HLTElectronRingerLoose_v2_el"    , getPatterns, ConfigFile = calibpath+'/ElectronRingerLooseTriggerConfig.conf'     ),
      RingerSelectorTool( "T0HLTElectronRingerVeryLoose_v2_el", getPatterns, ConfigFile = calibpath+'/ElectronRingerVeryLooseTriggerConfig.conf' ),
    ]

  return attach(hypos)