コード例 #1
0
def theConfig(Nj, mcdir='', initFile='', mH=400, mvaCut=None, qgCut=None):
    if Nj == 3:
        optPars = HWWconfig.getOptimalPars(mH, optimalPars3)
    else:
        optPars = HWWconfig.getOptimalPars(mH, optimalPars2)

    mvaVarNames = optPars[1]
    mvaCutValues = optPars[2]
    HWWconfig.minMlvjj = optPars[3]
    HWWconfig.maxMlvjj = optPars[4]

    fitterPars = HWWconfig.theConfig(Nj, mcdir, initFile)
    fitterPars.includeMuons = False
    fitterPars.includeElectrons = True

    fitterPars.cuts += '&& (abs(JetPFCor_dphiMET[0])>0.8) ' + \
        '&& (W_electron_pt > 35) '
    fitterPars.QCDcuts = fitterPars.cuts + '&& (W_electron_pfIsoEA > 0.3) '

    if (mvaCut):
        mvaCutValues = mvaCut

    fitterPars.cuts += '&& (%s > %f) ' % (mvaVarNames,mvaCutValues) + \
                      '&& (fit_mlvjj > %0.1f) && (fit_mlvjj < %0.1f) ' % \
                      (optPars[3], optPars[4])

    # if not qgCut:
    #     qgCut = optPars[11]
    # fitterPars.cuts += '&& (%s > %f) ' % ("qgld_Summer11CHS[1]",qgCut)

    print '2-body cuts:', fitterPars.cuts

    return fitterPars
コード例 #2
0
def the4BodyConfig(twoBodyConfig, mH=400, syst=0, alphaOverride = None):
    if twoBodyConfig.njets == 3:
        optPars = HWWconfig.getOptimalPars(mH, optimalPars3)
    else:
        optPars = HWWconfig.getOptimalPars(mH, optimalPars2)
    HWWconfig.minMlvjj = optPars[3]
    HWWconfig.maxMlvjj = optPars[4]
    alpha = optPars[6+syst]
    alphaDown = optPars[6+1]
    alphaUp = optPars[6+2]
    if alphaOverride:
        alpha = alphaOverride
        alphaDown = alphaOverride
        alphaUp = alphaOverride
    fitterPars = HWWconfig.the4BodyConfig(twoBodyConfig, alpha, optPars[9],
                                          optPars[10],
                                          alphaRange = (alphaDown,alphaUp))
    fitterPars.nbins = optPars[5]
    fitterPars.model = 1
    if (mH >= 500) and (twoBodyConfig.njets == 2):
        fitterPars.model = 1
    if (mH <= 200): # and (twoBodyConfig.njets == 2):
        fitterPars.model = 7
    if (mH <= 170):
        fitterPars.model = 7
    if (mH <= 250) and (twoBodyConfig.njets == 3):
        fitterPars.model = 5
    return fitterPars
コード例 #3
0
def the4BodyConfig(twoBodyConfig, mH=400, syst=0, alphaOverride=None):
    if twoBodyConfig.njets == 3:
        optPars = HWWconfig.getOptimalPars(mH, optimalPars3)
    else:
        optPars = HWWconfig.getOptimalPars(mH, optimalPars2)
    HWWconfig.minMlvjj = optPars[3]
    HWWconfig.maxMlvjj = optPars[4]
    alpha = optPars[6 + syst]
    alphaDown = optPars[6 + 1]
    alphaUp = optPars[6 + 2]
    if alphaOverride:
        alpha = alphaOverride
        alphaDown = alphaOverride
        alphaUp = alphaOverride
    fitterPars = HWWconfig.the4BodyConfig(twoBodyConfig,
                                          alpha,
                                          optPars[9],
                                          optPars[10],
                                          alphaRange=(alphaDown, alphaUp))
    fitterPars.nbins = optPars[5]
    fitterPars.model = 1
    if (mH <= 200):  # and (twoBodyConfig.njets == 2):
        fitterPars.model = 7
    if (mH <= 170):
        fitterPars.model = 7
    if (mH <= 180) and (twoBodyConfig.njets == 2):
        fitterPars.model = 5
    if (mH <= 250) and (twoBodyConfig.njets == 3):
        fitterPars.model = 5

    return fitterPars
コード例 #4
0
def theConfig(Nj, mcdir = '', initFile = '', mH=400, mvaCut = None,
              qgCut = None):

    if Nj == 3:
        optPars = HWWconfig.getOptimalPars(mH, optimalPars3)
    else:
        optPars = HWWconfig.getOptimalPars(mH, optimalPars2)
    
    mvaVarNames  = optPars[1]
    mvaCutValues = optPars[2]
    HWWconfig.minMlvjj = optPars[3]
    HWWconfig.maxMlvjj = optPars[4]

    fitterPars = HWWconfig.theConfig(Nj, mcdir, initFile)
    fitterPars.includeMuons = True
    fitterPars.includeElectrons = False

    if (mH == 500) and (len(initFile) > 0):
        fitterPars.constraintParamsFile = initFile
        fitterPars.constrainWpJShape = True
    fitterPars.cuts += '&& (abs(JetPFCor_dphiMET[0])>0.4) ' + \
        '&& (abs(W_muon_eta) < 2.1) '
    fitterPars.QCDcuts = fitterPars.cuts #+ '&& (W_muon_pfIsoEA > 0.3) '

    if mvaCut:
        mvaCutValues = mvaCut
    
    fitterPars.cuts += '&& (%s > %f) ' % (mvaVarNames,mvaCutValues) + \
                      '&& (fit_mlvjj > %0.1f) && (fit_mlvjj < %0.1f) ' % \
                      (optPars[3], optPars[4])

    # if not qgCut:
    #     qgCut = optPars[11]
    # fitterPars.cuts += '&& (%s > %f) ' % ("qgld_Summer11CHS[1]",qgCut)

    print '2-body cuts:', fitterPars.cuts
    
    return fitterPars