def __init__( self, name, x, ## the first dimension y, ## the second dimension psx, ## phase space in X, Gaudi::Math::PhaseSpaceNL psy, ## phase space in Y, Gaudi::Math::PhaseSpaceNL nx=2, ## polynomial degree in X ny=2): ## polynomial degree in Y PDF2.__init__(self, name, x, y) self.psx = psx self.psy = psy # num = (nx + 1) * (ny + 1) - 1 self.makePhis(num) # # ## finally build PDF # self.pdf = cpp.Analysis.Models.PS2DPol('ps2D_%s' % name, 'PS2DPol(%s)' % name, self.x, self.y, psx, psy, nx, ny, self.phi_list)
def __init__( self, name, x, ## the first dimension y, ## the second dimension n=2): ## polynomial degree if x.getMin() != y.getMin(): logger.warning( 'PolyPos2Dsym: x&y have different low edges %s vs %s' % (x.getMin(), y.getMin())) if x.getMax() != y.getMax(): logger.warning( 'PolyPos2Dsym: x&y have different high edges %s vs %s' % (x.getMax(), y.getMax())) PDF2.__init__(self, name, x, y) # num = (n + 1) * (n + 2) / 2 self.makePhis(num - 1) # ## finally build PDF # self.pdf = cpp.Analysis.Models.Poly2DSymPositive( 'p2Dsp_%s' % name, 'Poly2DSymPositive(%s)' % name, self.x, self.y, n, self.phi_list)
def __init__( self, name, x, ## the first dimension y, ## the second dimension nx=2, ## polynomial degree in X ny=2, ## polynomial degree in Y taux=None, ## the exponent in X tauy=None): ## the exponent in Y PDF2.__init__(self, name, x, y) # ## get tau_x # xtaumax = 100 mn, mx = x.minmax() mc = 0.5 * (mn + mx) # if not iszero(mn): xtaumax = 100.0 / abs(mn) if not iszero(mc): xtaumax = min(xtaumax, 100.0 / abs(mc)) if not iszero(mx): xtaumax = min(xtaumax, 100.0 / abs(mx)) ytaumax = 100 mn, mx = y.minmax() mc = 0.5 * (mn + mx) # if not iszero(mn): ytaumax = 100.0 / abs(mn) if not iszero(mc): ytaumax = min(ytaumax, 100.0 / abs(mc)) if not iszero(mx): ytaumax = min(ytaumax, 100.0 / abs(mx)) # ## the exponential slopes # self.taux = makeVar(taux, "taux_%s" % name, "taux(%s)" % name, taux, 0, -xtaumax, xtaumax) # self.tauy = makeVar(tauy, "tauy_%s" % name, "tauy(%s)" % name, tauy, 0, -ytaumax, ytaumax) # self.m1 = x ## ditto self.m2 = y ## ditto # num = (nx + 1) * (ny + 1) - 1 self.makePhis(num) # # ## finally build PDF # self.pdf = cpp.Analysis.Models.Expo2DPol('exp2D_%s' % name, 'Expo2DPol(%s)' % name, self.x, self.y, self.taux, self.tauy, nx, ny, self.phi_list)
def __init__( self, name, x, ## the first dimension y, ## the second dimension n=2, ## polynomial degree in X and Y tau=None): ## the exponent if x.getMin() != y.getMin(): logger.warning( 'PSPos2Dsym: x&y have different low edges %s vs %s' % (x.getMin(), y.getMin())) if x.getMax() != y.getMax(): logger.warning( 'PSPos2Dsym: x&y have different high edges %s vs %s' % (x.getMax(), y.getMax())) PDF2.__init__(self, name, x, y) # ## get tau # taumax = 100 mn, mx = x.minmax() mc = 0.5 * (mn + mx) # if not iszero(mn): taumax = 100.0 / abs(mn) if not iszero(mc): taumax = min(taumax, 100.0 / abs(mc)) if not iszero(mx): taumax = min(taumax, 100.0 / abs(mx)) # ## the exponential slopes # self.tau = makeVar(tau, "tau_%s" % name, "tau(%s)" % name, tau, 0, -taumax, taumax) # self.m1 = x ## ditto self.m2 = y ## ditto # num = (n + 1) * (n + 2) / 2 - 1 self.makePhis(num) # # ## finally build PDF # self.pdf = cpp.Analysis.Models.Expo2DPolSym('exp2Ds_%s' % name, 'Expo2DPolSym(%s)' % name, self.x, self.y, self.tau, n, self.phi_list)
def __init__( self, name, x, ## the first dimension y, ## the second dimension psy=None, ## phase space in Y, Gaudi::Math::PhaseSpaceNL nx=2, ## polynomial degree in X ny=2, ## polynomial degree in Y tau=None): ## the exponent PDF2.__init__(self, name, x, y) # ## get tau taumax = 100 mn, mx = x.minmax() mc = 0.5 * (mn + mx) # if not iszero(mn): taumax = 100.0 / abs(mn) if not iszero(mc): taumax = min(taumax, 100.0 / abs(mc)) if not iszero(mx): taumax = min(taumax, 100.0 / abs(mx)) # ## the exponential slope # self.tau = makeVar(tau, "tau_%s" % name, "tau(%s)" % name, tau, 0, -taumax, taumax) # self.psy = psy # num = (nx + 1) * (ny + 1) - 1 self.makePhis(num) # # ## finally build PDF # self.pdf = cpp.Analysis.Models.ExpoPS2DPol('ps2D_%s' % name, 'PS2DPol(%s)' % name, self.x, self.y, self.tau, self.psy, nx, ny, self.phi_list)
def __init__( self, name, x, ## the first dimension y, ## the second dimension nx=2, ## polynomial degree in X ny=2): ## polynomial degree in Y PDF2.__init__(self, name, x, y) # self.makePhis((nx + 1) * (ny + 1) - 1) # # ## finally build PDF # self.pdf = cpp.Analysis.Models.Poly2DPositive( 'p2Dp_%s' % name, 'Poly2DPositive(%s)' % name, self.x, self.y, nx, ny, self.phi_list)
def __init__( self, name, x, ## the first dimension y, ## the second dimension spline): ## the spline: Gaudi.Math.Spline2DSym PDF2.__init__(self, name, x, y) self.spline = spline # self.makePhis(spline.npars()) # # ## finally build PDF # self.pdf = cpp.Analysis.Models.Spline2DSym('s2Dp_%s' % name, 'Spline2DSym(%s)' % name, self.x, self.y, self.spline, self.phi_list)
def __init__( self, name, x, ## the first dimension y, ## the second dimension ps, ## phase space in X, Gaudi::Math::PhaseSpaceNL n=2): ## polynomial degree in Y if x.getMin() != y.getMin(): logger.warning( 'PSPos2Dsym: x&y have different low edges %s vs %s' % (x.getMin(), y.getMin())) if x.getMax() != y.getMax(): logger.warning( 'PSPos2Dsym: x&y have different high edges %s vs %s' % (x.getMax(), y.getMax())) PDF2.__init__(self, name, x, y) self.ps = ps self.psx = ps self.psy = ps # num = (n + 1) * (n + 2) / 2 - 1 self.makePhis(num) # # ## finally build PDF # self.pdf = cpp.Analysis.Models.PS2DPolSym('ps2Ds_%s' % name, 'PS2DPolSym(%s)' % name, self.x, self.y, ps, n, self.phi_list)
def __init__( self, manca, ## manca pdf, that defined 3 upsolon peaks charm, ## charm pdf bkg1=0, bkg2=0, bkgA=0, bkgB=0, suffix=''): PDF2.__init__(self, 'MancaX' + suffix, manca.mass, charm.mass) self._crossterms1 = ROOT.RooArgSet() self._crossterms2 = ROOT.RooArgSet() self.suffix = suffix self.signal1 = manca self.signal2 = charm ## use helper function to create background from Ostap.FitBkgModels import makeBkg # ## background components # self.b_Y = makeBkg(bkg1, 'BkgY' + suffix, self.m1) self.b_C = makeBkg(bkg2, 'BkgC' + suffix, self.m2) self.b_A = makeBkg(bkgA, 'BkgA' + suffix, self.m1) self.b_B = makeBkg(bkgB, 'BkgB' + suffix, self.m2) # ## pure signal components: 3 # RPP = ROOT.RooProdPdf self.y1s_c = RPP('Y1SC' + suffix, 'Y(1S)(x)Charm', manca.y1s, charm.pdf) self.y2s_c = RPP('Y2SC' + suffix, 'Y(2S)(x)Charm', manca.y2s, charm.pdf) self.y3s_c = RPP('Y3SC' + suffix, 'Y(3S)(x)Charm', manca.y3s, charm.pdf) ## charm + background self.bs_pdf = RPP('BC' + suffix, 'B(2mu)(x)Charm', self.b_Y.pdf, charm.pdf) ## Y + background self.y1s_b = RPP('Y1SB' + suffix, 'Y(1S)(x)Bkg', manca.y1s, self.b_C.pdf) self.y2s_b = RPP('Y2SB' + suffix, 'Y(2S)(x)Bkg', manca.y2s, self.b_C.pdf) self.y3s_b = RPP('Y3SB' + suffix, 'Y(3S)(x)Bkg', manca.y3s, self.b_C.pdf) ## background + background self.bb_pdf = RPP('BB' + suffix, 'Bkg(x)Bkg', self.b_A.pdf, self.b_B.pdf) ## coefficients from Ostap.FitBasic import makeVar self.s1s = makeVar(None, 'NY1C' + suffix, 'N(Y1S+C)' + suffix, None, 200, 0, 1.e+5) self.s2s = makeVar(None, 'NY2C' + suffix, 'N(Y2S+C)' + suffix, None, 100, 0, 1.e+4) self.s3s = makeVar(None, 'NY3C' + suffix, 'N(Y3S+C)' + suffix, None, 20, 0, 1.e+4) self.bs = makeVar(None, 'NBC' + suffix, 'N(Bkg+C)' + suffix, None, 500, 0, 1.e+5) self.s1b = makeVar(None, 'NY1B' + suffix, 'N(Y1S+B)' + suffix, None, 500, 0, 1.e+5) self.s2b = makeVar(None, 'NY2B' + suffix, 'N(Y2S+B)' + suffix, None, 200, 0, 1.e+4) self.s3b = makeVar(None, 'NY3B' + suffix, 'N(Y3S+B)' + suffix, None, 200, 0, 1.e+4) self.bb = makeVar(None, 'NBB' + suffix, 'N(Bkg+B)' + suffix, None, 500, 0, 1.e+5) self.S1S_name = self.s1s.GetName() self.S2S_name = self.s2s.GetName() self.S3S_name = self.s3s.GetName() self.S1B_name = self.s1b.GetName() self.S2B_name = self.s2b.GetName() self.S3B_name = self.s3b.GetName() self.BS_name = self.bs.GetName() self.BB_name = self.bb.GetName() self.alist1 = ROOT.RooArgList(self.y1s_c, self.y2s_c, self.y3s_c, self.bs_pdf, self.y1s_b, self.y2s_b, self.y3s_b, self.bb_pdf) self.alist2 = ROOT.RooArgList(self.s1s, self.s2s, self.s3s, self.bs, self.s1b, self.s2b, self.s3b, self.bb) # ## build final PDF # self.pdf = ROOT.RooAddPdf("model2D" + suffix, "Model2D(%s)" % suffix, self.alist1, self.alist2) self.name = self.pdf.GetName() ## self.signals().add(self.y1s_c) self.signals().add(self.y2s_c) self.signals().add(self.y3s_c) ## self.backgrounds().add(self.bb_pdf) ## self.crossterms1().add(self.y1s_b) self.crossterms1().add(self.y2s_b) self.crossterms1().add(self.y3s_b) ## self.crossterms2().add(self.bs_pdf)