Пример #1
0
def test_sinhasinh():

    logger.info("Test  SinhAsinh-Distribution")
    model = Models.Fit1D(signal=Models.SinhAsinh_pdf('SASH',
                                                     mass=mass,
                                                     mean=signal_gauss.mean),
                         background=Models.Bkg_pdf('BkgSAS',
                                                   mass=mass,
                                                   power=0))

    signal = model.signal

    model.s.setVal(5000)
    model.b.setVal(500)

    signal.mu.setVal(3.10)
    signal.sigma.setVal(0.015)
    signal.epsilon.setVal(0.021)
    signal.delta.setVal(1.0)

    with rooSilent():
        result, f = model.fitTo(dataset0)
        result, f = model.fitTo(dataset0)
        signal.delta.release()
        result, f = model.fitTo(dataset0)
        signal.epsilon.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('Mu                   is: %-28s ' % result(signal.mu)[0])
        logger.info('Sigma                is: %-28s ' %
                    result(signal.sigma)[0])
        logger.info('Epsilon              is: %-28s ' %
                    result(signal.epsilon)[0])
        logger.info('delta                is: %-28s ' %
                    result(signal.delta)[0])

    models.add(model)
Пример #2
0
def test_sinhasinh():

    logger.info("Test  SinhAsinh-Distribution")
    model = Models.Fit1D(signal=Models.SinhAsinh_pdf('SASH',
                                                     xvar=mass,
                                                     mean=signal_gauss.mean),
                         background=Models.Bkg_pdf('BkgSAS',
                                                   xvar=mass,
                                                   power=0),
                         S=S,
                         B=B)

    signal = model.signal

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

    signal.mu.setVal(3.10)
    signal.sigma.setVal(0.015)
    signal.epsilon.setVal(0.021)
    signal.delta.setVal(1.0)

    with rooSilent():
        result, f = model.fitTo(dataset0)
        result, f = model.fitTo(dataset0)
        signal.delta.release()
        result, f = model.fitTo(dataset0)
        signal.epsilon.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("SinhAsinh function\n%s" % result.table(prefix="# "))

    models.add(model)