Exemplo n.º 1
0
def test_skewgauss():

    logger.info('Test SkewGauss_pdf: Skew Gaussian function')
    model_gauss_skew = Models.Fit1D(signal=Models.SkewGauss_pdf(
        name='GSk', xvar=mass, mean=signal_gauss.mean),
                                    background=Models.Bkg_pdf('BkgSkG',
                                                              xvar=mass,
                                                              power=0),
                                    S=S,
                                    B=B)

    model_gauss_skew.signal.alpha.fix(0)
    model_gauss_skew.S.setVal(5000)
    model_gauss_skew.B.setVal(500)

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

    models.add(model_gauss_skew)
Exemplo n.º 2
0
def test_skewgauss():

    logger.info('Test SkewGauss_pdf: Skew Gaussian function')
    model_gauss_skew = Models.Fit1D(signal=Models.SkewGauss_pdf(
        name='GSk', xvar=mass, mean=signal_gauss.mean),
                                    background=Models.Bkg_pdf('BkgSkG',
                                                              xvar=mass,
                                                              power=0))

    model_gauss_skew.signal.alpha.fix(0)
    model_gauss_skew.S.setVal(5000)
    model_gauss_skew.B.setVal(500)

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

    models.add(model_gauss_skew)