示例#1
0
def test_rasingcosine():

    logger.info("Test RaisingCosine")
    model = Models.Fit1D(signal=Models.RaisingCosine_pdf(
        'RC', xvar=mass, mean=signal_gauss.mean),
                         background=1,
                         S=S,
                         B=B)

    signal = model.signal
    model.S.setVal(5000)
    model.B.setVal(500)

    with rooSilent():
        result, f = model.fitTo(dataset0)
        result, f = model.fitTo(dataset0)
        signal.mean.release()
        signal.scale.release()
        result, f = model.fitTo(dataset0)
        model.draw(dataset0)

    if 0 != result.status() or 3 != result.covQual():
        logger.warning('Fit is not perfect MIGRAD=%d QUAL=%d ' %
                       (result.status(), result.covQual()))

    logger.info("Raising cosine function\n%s" % result.table(prefix="# "))

    models.add(model)
示例#2
0
def test_rasingcosine():

    logger.info("Test RaisingCosine")
    model = Models.Fit1D(signal=Models.RaisingCosine_pdf(
        'RC', xvar=mass, mean=signal_gauss.mean),
                         background=1)

    signal = model.signal
    model.S.setVal(5000)
    model.B.setVal(500)

    with rooSilent():
        result, f = model.fitTo(dataset0)
        result, f = model.fitTo(dataset0)
        signal.mean.release()
        signal.scale.release()
        result, f = model.fitTo(dataset0)

    if 0 != result.status() or 3 != result.covQual():
        logger.warning('Fit is not perfect MIGRAD=%d QUAL=%d ' %
                       (result.status(), result.covQual()))
        print result
    else:
        logger.info('Signal & Background are: %-28s & %-28s ' %
                    (result('S')[0], result('B')[0]))
        logger.info('Mean                 is: %-28s ' % result(signal.mean)[0])
        logger.info('Scale                is: %-28s ' %
                    result(signal.scale)[0])

    models.add(model)