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() ) for i in (pos_sp, inc_sp, ix_sp): pars = i.pdf.function().bspline().pars()
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_m3.phis: print "\tSpline3: phi= %s " % phi.ve() models.append(m_m3) # ============================================================================= logger.info("Test positive decreasing convex: order 3 with 2 inner knots ") # ============================================================================= c3 = cpp.Gaudi.Math.ConvexSpline(x.xmin(), x.xmax(), 2, 3, False, True) m_c3 = Models.CSpline_pdf('C3', x, c3) with rooSilent(): result, f = m_c3.fitTo(dataset2) result, f = m_c3.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_c3.phis: print "\tSpline3: phi= %s " % phi.ve() models.append(m_c3)