Ejemplo n.º 1
0
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:
    for phi in m_ps.phis:
        print "\tPoly3ps:     phi=  %s " % phi.ve()

models.append(m_ps)

# =============================================================================
logger.info("Test positive spline: order 3 with 4 inner knots ")
# =============================================================================
s3 = cpp.Gaudi.Math.PositiveSpline(x.xmin(), x.xmax(), 4, 3)
m_s3 = Models.PSpline_pdf('S3', x, s3)

with rooSilent():
    result, f = m_s3.fitTo(dataset2)
    result, f = m_s3.fitTo(dataset2)

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:
    for phi in m_s3.phis:
        print "\tSpline3:     phi=  %s " % phi.ve()

models.append(m_s3)
Ejemplo n.º 2
0
## logger.info ( 'Positive   pars: %s' % positive  .pdf.function().pars() )
## logger.info ( 'Decreasing pars: %s' % decreasing.pdf.function().pars() )
## logger.info ( 'Convex     pars: %s' % dec_convex.pdf.function().pars() )

for i in (positive, decreasing, dec_convex, convex):
    pars = i.pdf.function().bernstein().pars()
    pars = list(pars)
    logger.info('Common pars: %s' % list(pars))

pos_sp_ = cpp.Gaudi.Math.PositiveSpline(x.getMin(), x.getMax(), 1, 3)
inc_sp_ = cpp.Gaudi.Math.MonothonicSpline(x.getMin(), x.getMax(), 1, 3, True)
dec_sp_ = cpp.Gaudi.Math.MonothonicSpline(x.getMin(), x.getMax(), 1, 3, False)
ix_sp_ = cpp.Gaudi.Math.ConvexSpline(x.getMin(), x.getMax(), 1, 3, True, True)
dx_sp_ = cpp.Gaudi.Math.ConvexSpline(x.getMin(), x.getMax(), 1, 3, False, True)

pos_sp = Models.PSpline_pdf('SP', mass4, pos_sp_)
inc_sp = Models.MSpline_pdf('SI', mass4, inc_sp_)
dec_sp = Models.MSpline_pdf('SD', mass4, dec_sp_)
ix_sp = Models.CSpline_pdf('SIX', mass4, ix_sp_)
dx_sp = Models.CSpline_pdf('SDX', mass4, dx_sp_)

with timing('Spline Positive   5'), rooSilent():
    r5, f = pos_sp.fitTo(dataset5)
with timing('Spline Increasing 5'), rooSilent():
    i4, f = inc_sp.fitTo(dataset5)
with timing('Spline Convex     5'), rooSilent():
    x4, f = ix_sp.fitTo(dataset5)

## logger.info ( 'Positive   pars: %s' % pos_sp.pdf.function().pars() )
## logger.info ( 'Increasing pars: %s' % inc_sp.pdf.function().pars() )
## logger.info ( 'Convex     pars: %s' %  ix_sp.pdf.function().pars() )