for i in xrange(0, events): v1 = random.expovariate(1 / 3.0) if not 0 < v1 < 10: continue x.setVal(v1) dataset4.add(varset4) v2 = 10 - v1 x.setVal(v2) dataset5.add(varset4) import Ostap.FitModels as Models positive = Models.PolyPos_pdf('PP', mass4, power=3) increasing = Models.Monothonic_pdf('PI', mass4, power=3, increasing=True) decreasing = Models.Monothonic_pdf('PD', mass4, power=3, increasing=False) inc_convex = Models.Convex_pdf('PIX', mass4, power=3, increasing=True, convex=True) dec_convex = Models.Convex_pdf('PDX', mass4, power=3, increasing=False, convex=True) convex = Models.ConvexOnly_pdf('PX', mass4, power=3, convex=True) concave = Models.ConvexOnly_pdf('PX', mass4, power=3, convex=False) with timing('Positive 5'), rooSilent():
result, f = m_p4.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_p4.phis: print "\tPoly6: phi= %s " % phi.ve() models.append(m_p4) # ============================================================================= logger.info("Test monothonic Poly(4)-Distribution") # ============================================================================= m_d4 = Models.Monothonic_pdf('D4', x, power=4, increasing=False) with rooSilent(): result, f = m_d4.fitTo(dataset2) result, f = m_d4.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_d4.phis: print "\tPoly4: phi= %s " % phi.ve() models.append(m_d4)