Esempio n. 1
0
def test_slash():
    logger.info('Test Slash shape')
    model = Models.Fit1D(signal=Models.Slash_pdf(name='Slash',
                                                 xvar=mass,
                                                 mean=signal_gauss.mean,
                                                 scale=signal_gauss.sigma),
                         background=None,
                         S=S,
                         B=B)

    signal = model.signal
    signal.scale.release()
    signal.mean.fix()

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

    with rooSilent():
        result, frame = model.fitTo(dataset0)
        result, frame = 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("Slash function\n%s" % result.table(prefix="# "))

    models.add(model)
Esempio n. 2
0
def test_slash():
    logger.info('Test Slash shape')
    model = Models.Fit1D(signal=Models.Slash_pdf(name='Slash',
                                                 xvar=mass,
                                                 mean=signal_gauss.mean,
                                                 scale=signal_gauss.sigma),
                         background=None)

    signal = model.signal
    signal.scale.release()
    signal.mean.fix()

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

    with rooSilent():
        result, frame = model.fitTo(dataset0)
        result, frame = 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)