def __init__( self, name, ## the name mass, ## the variable L, ## L N, ## N left=None, right=None): ## # ## initialize the base PDF.__init__(self, name) # self.mass = mass # mmin = mass.getMin() mmax = mass.getMax() # self.left = makeVar(left, 'left_%s' % name, 'm_{left}(%s)' % name, left, 0.9 * mmin + 0.1 * mmax, mmin, mmax) self.right = makeVar(right, 'right_%s' % name, 'm_{right}(%s)' % name, right, 0.1 * mmin + 0.9 * mmax, mmin, mmax) if self.left.getMin() >= self.mass.getMax(): logger.error('PSNL_pdf(%s): invalid setting!' % name) if self.right.getMax() <= self.mass.getMax(): logger.error('PSNL_pdf(%): invalid setting!' % name) self.pdf = cpp.Analysis.Models.PhaseSpaceNL('psnl_%s' % name, 'PhaseSpaceNL(%s)' % name, self.mass, self.left, self.right, L, N)
def __init__( self, name, ## the name x, ## the variable theta=None, ## theta-parameter alpha=None, ## alpha-parameter beta=None, ## beta-parameter a=None): ## s-parameter # PDF.__init__(self, name) # self.x = x self.mass = x ## ditto # self.theta = makeVar(theta, 'theta_%s' % name, '#theta_{Amoroso}(%s)' % name, theta, 1, 1.e-3, 100) self.alpha = makeVar(alpha, 'alpha_%s' % name, '#alpha_{Amoroso}(%s)' % name, alpha, 1, 1.e-3, 100) self.beta = makeVar(beta, 'beta_%s' % name, '#beta_{Amoroso}(%s) ' % name, beta, 1, 1.e-3, 10) self.a = makeVar(a, 'a_%s' % name, 'a_{Amoroso}(%s)' % name, a, 1, -10, 10) logger.debug('Amoroso theta %s' % self.theta) logger.debug('Amoroso alpha %s' % self.alpha) logger.debug('Amoroso beta %s' % self.beta) logger.debug('Amoroso a %s' % self.a) self.pdf = cpp.Analysis.Models.Amoroso('amo_%s' % name, 'Amoroso(%s)' % name, self.x, self.theta, self.alpha, self.beta, self.a)
def __init__( self, name, ## the name x, ## the variable shape=None, ## shape-parameter high=None, ## high-parameter low=0): ## low-parameter # PDF.__init__(self, name) # self.x = x self.mass = x ## ditto # self.shape = makeVar(shape, 'shape_%s' % name, '#chi_{Argus}(%s)' % name, shape, 1, 1.e-4, 20) self.high = makeVar(high, 'high_%s' % name, 'high_{Argus}(%s)' % name, high, 0.1 * self.x.getMin() + 0.9 * self.x.getMax(), self.x.getMin(), self.x.getMax()) _dm = self.x.getMax() - self.x.getMin() lmin = min(0, self.x.getMin() - 10 * _dm) lmax = self.x.getMax() + 10 * _dm self.low = makeVar(low, 'low_%s' % name, 'low_{Argus}(%s)' % name, low, 0.9 * self.x.getMin() + 0.1 * self.x.getMax(), lmin, lmax) logger.debug('ARGUS shape %s' % self.shape) logger.debug('ARGUS high %s' % self.high) logger.debug('ARGUS low %s' % self.low) self.pdf = cpp.Analysis.Models.Argus('arg_%s' % name, 'Argus(%s)' % name, self.x, self.shape, self.high, self.low)
def __init__( self, name, ## the name x, ## the variable scale=1, ## scale-parameter delta=0): ## shift-parameter # PDF.__init__(self, name) # self.x = x self.mass = x ## ditto # self.scale = makeVar(scale, 'scale_%s' % name, '#theta_{Landau}(%s)' % name, scale, 1, -1000, 1000) _dm = self.x.getMax() - self.x.getMin() self.delta = makeVar(delta, 'delta_%s' % name, '#delta_{Landau}(%s)' % name, delta, 0, self.x.getMin() - 10 * _dm, self.x.getMax() + 10 * _dm) logger.debug('Landau scale %s' % self.scale) logger.debug('Landau delta %s' % self.delta) self.pdf = cpp.Analysis.Models.Landau('land_%s' % name, 'Landau(%s)' % name, self.x, self.scale, self.delta)
def __init__( self, name, ## the name mass, ## the variable power=2, ## degree of the polynomial alpha=None, ## x0=None): # PDF.__init__(self, name) # self.power = power self.mass = mass xmin = mass.getMin() xmax = mass.getMax() dx = xmax - xmin alpmx = 2000.0 / dx self.alpha = makeVar(alpha, 'alpha_%s' % name, 'alpha(%s)' % name, alpha, 0, -alpmx, alpmx) self.x0 = makeVar(x0, 'x0_%s' % name, 'x0(%s)' % name, x0, 0.5 * (xmax + xmin), xmin - 0.1 * dx, xmax + 0.1 * dx) # self.makePhis(power) self.pdf = cpp.Analysis.Models.PolySigmoid('ps_%s' % name, 'PolySigmoid(%s)' % name, self.mass, self.phi_list, self.mass.getMin(), self.mass.getMax(), self.alpha, self.x0)
def __init__( self, name, ## the name x, ## the variable alpha=None, ## shape-parameter delta=None, ## high-parameter x0=0): ## low-parameter # PDF.__init__(self, name) # self.x = x self.mass = x ## ditto # self.alpha = makeVar(alpha, 'alpha_%s' % name, '#alpha_{2e}(%s)' % name, alpha, 1, 1.e-4, 50) self.delta = makeVar(delta, 'delta_%s' % name, '#delta_{2e}(%s)' % name, delta, 1, 1.e-4, 50) xmin = self.x.getMin() xmax = self.x.getMin() dx = xmax - xmin self.x0 = makeVar(x0, 'x0_%s' % name, 'x0_{2e}(%s)' % name, x0, xmin, xmin - 0.1 * dx, xmax + 0.1 * dx) logger.debug('2expos alpha %s' % self.alpha) logger.debug('2expos delta %s' % self.delta) logger.debug('2expos x0 %s' % self.x0) self.pdf = cpp.Analysis.Models.TwoExpos('exp2_%s' % name, '2Expos(%s)' % name, self.x, self.alpha, self.delta, self.x0)
def __init__( self, pt, ## pT-variable (for fitting) mass=0, ## particle mass (may be fixed) n=None, ## shape parameter T=None, ## temperature parameter name=''): ## initialize the base PDF.__init__(self, name) if not isinstance(pt, ROOT.RooAbsReal): raise AttributeError("Tsallis(%s): invalid 'pt'-parameter %s" % (name, pt)) self.pt = pt self.m = self.pt self.mass = self.pt self.m0 = makeVar(mass, 'm0_%s' % name, 'm0(%s)' % name, mass, 0, 1e+6) self.n = makeVar(n, 'n_%s' % name, 'n(%s) ' % name, n, 0.01, 1000) self.n = makeVar(T, 'n_%s' % name, 'n(%s) ' % name, n, 1.e-3, 1e+6) self.pdf = cpp.Analysis.Models.Tsallis('tsallis_' + name, 'Tsallis(%s)' % name, self.pt, self.n, self.T, self.m0)
def __init__( self, name, ## the name x, ## the variable k=None, ## k-parameter theta=None): ## theta-parameter # PDF.__init__(self, name) # self.x = x self.mass = x ## ditto # self.k = makeVar(k, 'k_%s' % name, 'k_{#Gamma}(%s)' % name, k, 1, 1.e-3, 100) self.theta = makeVar(theta, 'theta_%s' % name, '#theta_{#Gamma}(%s)' % name, theta, 1, 1.e-3, 100) if self.k.getMin() <= 0: self.k.setMin(1.e-3) logger.warning('GammaDist(%s): min(k) is set %s ' % (name, self.k.getMin())) if self.theta.getMin() <= 0: theta.setMin(1.e-3) logger.warning('GammaDist(%s): min(theta) is set %s ' % (name, self.theta.getMin())) self.pdf = cpp.Analysis.Models.GammaDist('gd_%s' % name, 'GammaDist(%s)' % name, self.x, self.k, self.theta)
def __init__( self, name, ## the name mass, ## the variable alpha=None, ## the slope of the first exponent delta=None, ## (alpha+delta) is the slope of the first exponent x0=0, ## f(x)=0 for x<x0 power=0, ## degree of polynomial tau=None): ## # PDF.__init__(self, name) # self.mass = mass self.power = power # mn, mx = mass.minmax() mc = 0.5 * (mn + mx) taumax = 100 # 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.alpha = makeVar(alpha, "alpha_%s" % name, "#alpha(%s)" % name, alpha, 1, 0, taumax) self.delta = makeVar(delta, "delta_%s" % name, "#delta(%s)" % name, delta, 1, 0, taumax) self.x0 = makeVar(x0, "x0_%s" % name, "x_{0}(%s)" % name, x0, mn, mn - 0.5 * (mx - mn), mx + 0.5 * (mx - mn)) # # if 0 >= self.power: self.phis = [] self.phi_list = ROOT.RooArgList() self.pdf = ROOT.RooExponential('exp_%s' % name, 'exp(%s)' % name, mass, self.tau) else: # self.makePhis(power) # self.pdf = cpp.Analysis.Models.TwoExpoPositive( '2expopos_%s' % name, '2expopos(%s)' % name, mass, self.alpha, self.delta, self.x0, self.phi_list, mass.getMin(), mass.getMax())
def __init__( self, name, ## the name x, ## the variable alpha=None, ## alpha-parameter beta=None, ## beta-parameter scale=1, ## scale-parameter delta=0): ## shift-parameter # PDF.__init__(self, name) # self.x = x self.mass = x ## ditto # self.alpha = makeVar(alpha, 'alpha_%s' % name, '#alpha_{#beta#prime}(%s)' % name, alpha, 1, 1.e-3, 1000) self.beta = makeVar(beta, 'beta_%s' % name, '#beta_{#beta#prime}(%s)' % name, beta, 1, 1.e-3, 1000) if self.alpha.getMin() <= 0: self.alpha.setMin(1.e-3) logger.warning('BetaPrime(%s): min(alpha) is set %s ' % (name, self.alpha.getMin())) if self.beta.getMin() <= 0: self.beta.setMin(1.e-3) logger.warning('BetaPrime(%s): min(beta) is set %s ' % (name, self.beta.getMin())) self.scale = makeVar(scale, 'scale_%s' % name, '#theta_{#beta#prime}(%s)' % name, scale, 1, -1000, 1000) _dm = self.x.getMax() - self.x.getMin() self.delta = makeVar(delta, 'delta_%s' % name, '#delta_{#beta#prime}(%s)' % name, delta, 0, self.x.getMin() - 10 * _dm, self.x.getMax() + 10 * _dm) logger.debug("Beta' alpha %s" % self.alpha) logger.debug("Beta' beta %s" % self.beta) logger.debug("Beta' scale %s" % self.scale) logger.debug("Beta' sdelta %s" % self.delta) self.pdf = cpp.Analysis.Models.BetaPrime('bp_%s' % name, 'BetaPrime(%s)' % name, self.x, self.alpha, self.beta, self.scale, self.delta)
def __init__( self, name, ## the name mass, ## the variable spline): ## the spline object Gaudi::Math::ConvexOnlySpline # PDF.__init__(self, name) # self.spline = spline self.mass = mass # self.makePhis(spline.npars()) # self.pdf = cpp.Analysis.Models.ConvexOnlySpline( 'is_%s' % name, 'ConvexOnlySpline(%s)' % name, self.mass, self.spline, self.phi_list)
def __init__( self, name, ## the name x, ## the variable k=None, ## k-parameter theta=None, ## theta-parameter p=None, ## p-parameter low=None): ## low-parameter # PDF.__init__(self, name) # self.x = x self.mass = x ## ditto # self.k = makeVar(k, 'k_%s' % name, 'k_{#Gamma}(%s)' % name, k, 1, 1.e-3, 100) self.theta = makeVar(theta, 'theta_%s' % name, '#theta_{#Gamma}(%s)' % name, theta, 1, 1.e-3, 100) self.p = makeVar(p, 'p_%s' % name, 'p_{#Gamma}(%s)' % name, p, 1, 1.e-3, 6) self.low = makeVar(low, 'low_%s' % name, 'l_{#Gamma}(%s)' % name, low, min(0, x.getMin()), x.getMax()) if self.k.getMin() <= 0: self.k.setMin(1.e-3) logger.warning('GenGammaDist(%s): min(k) is set %s ' % (name, self.k.getMin())) if self.theta.getMin() <= 0: self.theta.setMin(1.e-3) logger.warning('GenGammaDist(%s): min(theta) is set %s ' % (name, self.theta.getMin())) if self.p.getMin() <= 0: self.p.setMin(1.e-3) logger.warning('GenGammaDist(%s): min(p) is set %s ' % (name, self.p.getMin())) self.pdf = cpp.Analysis.Models.GenGammaDist('ggd_%s' % name, 'GenGammaDist(%s)' % name, self.x, self.k, self.theta, self.p, self.low)
def __init__( self, name, ## the name mass, ## the varibale m1, ## the first mass (constant) m2): ## the second mass (constant) # ## initialize the base PDF.__init__(self, name) # if mass.getMax() < abs(m1) + abs(m2): logger.error('PS2_pdf(%s): senseless setting of edges/threshold' % self.name) self.mass = mass self.pdf = cpp.Analysis.Models.PhaseSpace2('ps2_%s' % name, 'PhaseSpace2(%s)' % name, self.mass, m1, m2)
def __init__( self, name, ## the name mass, ## the variable power=2, ## degree of the polynomial increasing=True): ## increasing or decreasing ? # PDF.__init__(self, name) # self.power = power self.mass = mass self.increasing = increasing # self.makePhis(power) self.pdf = cpp.Analysis.Models.PolyMonothonic( 'pp_%s' % name, 'PolyMonothonic(%s)' % name, self.mass, self.phi_list, self.mass.getMin(), self.mass.getMax(), self.increasing)
def __init__( self, name, ## the name mass, ## the varibale power=1): ## degree of the polynomial # PDF.__init__(self, name) # self.power = power self.mass = mass # self.makePhis(power) self.pdf = cpp.Analysis.Models.PolyPositive('pp_%s' % name, 'PolyPositive(%s)' % name, self.mass, self.phi_list, self.mass.getMin(), self.mass.getMax())
def __init__( self, name, ## the name mass, ## the variable m1, ## mass the first particle (const) m2, ## mass the second particle (const) m3, ## mass the third particle (const) m, ## mass of the whole system (const) L, ## orbital momenutm between (1,2) and 3 l=0): ## orbital momentum between 1 and 2 # ## initialize the base PDF.__init__(self, name) # self.mass = mass self.pdf = cpp.Analysis.Models.PhaseSpace23L( 'ps23l_%s' % name, 'PhaseSpace23L(%s)' % name, self.mass, m1, m2, m3, m, L, l)
def __init__( self, name, ## the name mass, ## the variable power=0, ## degree of polynomial tau=None): ## # PDF.__init__(self, name) # self.mass = mass self.power = power # mn, mx = mass.minmax() mc = 0.5 * (mn + mx) taumax = 100 # 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) # # if 0 >= self.power: self.phis = [] self.phi_list = ROOT.RooArgList() self.pdf = ROOT.RooExponential('exp_%s' % name, 'exp(%s)' % name, mass, self.tau) else: # self.makePhis(power) # self.pdf = cpp.Analysis.Models.ExpoPositive( 'expopos_%s' % name, 'expopos(%s)' % name, mass, self.tau, self.phi_list, mass.getMin(), mass.getMax())
def __init__( self, name, ## the name mass, ## the variable N, ## N left=None): # ## initialize the base PDF.__init__(self, name) # self.mass = mass self.left = makeVar(left, 'left_%s' % name, 'm_left(%s)' % name, None, mass.getMin(), mass.getMax()) if self.left.getMin() >= self.mass.getMax(): logger.error('PSLeft_pdf(%s): invalid setting!' % name) self.pdf = cpp.Analysis.Models.PhaseSpaceLeft( 'psl_%s' % name, 'PhaseSpaceLeft(%s)' % name, self.mass, self.left, N)
def __init__( self, name, ## the name x, ## the variable nu=None, ## nu-parameter lam=None, ## lambda-parameter alpha=None): ## nu-parameter # PDF.__init__(self, name) # self.x = x self.mass = x ## ditto # xmin = self.x.getMin() xmax = self.x.getMax() dx = xmax - xmin # self.nu = makeVar(nu, 'nu_%s' % name, '#nu_{#log#Gamma}(%s)' % name, nu, 0.5 * (xmin + xmax), xmin - 10 * dx, xmax + 10 * dx) self.lam = makeVar(lam, 'lambda_%s' % name, '#lambda_{#log#Gamma}(%s)' % name, lam, 2, -1000, 1000) self.alpha = makeVar(alpha, 'alpha_%s' % name, '#alpha_{#log#Gamma}(%s)' % name, alpha, 1, 1.e-3, 1000) if self.alpha.getMin() <= 0: self.alpha.setMin(1.e-3) logger.warning('LogGamma(%s): min(alpha) is set %s ' % (name, self.alpha.getMin())) logger.debug('LogGamma nu %s' % self.nu) logger.debug('LogGamma lambda %s' % self.lam) logger.debug('LogGamma alpha %s' % self.alpha) self.pdf = cpp.Analysis.Models.LogGamma('lg_%s' % name, 'LogGamma(%s)' % name, self.x, self.nu, self.lam, self.alpha)
def __init__( self, name, ## the name mass, ## the variable power=2, ## degree of the polynomial convex=True): ## convex or concave ? # PDF.__init__(self, name) # self.power = power self.mass = mass self.convex = convex # self.makePhis(power) self.pdf = cpp.Analysis.Models.PolyConvexOnly('pp_%s' % name, 'PolyConvex(%s)' % name, self.mass, self.phi_list, self.mass.getMin(), self.mass.getMax(), self.convex)
def __init__( self, name, ## the name mass, ## the variable L, ## L N, ## N right=None): # ## initialize the base PDF.__init__(self, name) # self.mass = mass self.right = makeVar(right, 'right_%s' % name, 'm_{right}(%s)' % name, None, mass.getMin(), mass.getMax()) if self.right.getMax() <= self.mass.getMax(): logger.error('PSRight_pdf(%s): invalid setting!' % name) self.pdf = cpp.Analysis.Models.PhaseSpaceRight( 'psr_%s' % name, 'PhaseSpaceRight(%s)' % name, self.mass, self.right, L, N)
def __init__( self, name, ## the name mass, ## the varibale phasespace, ## Gaudi::Math::PhaseSpaceNL power=1): ## degree of the polynomial # PDF.__init__(self, name) # self.mass = mass self.ps = phasespace ## Gaudi::Math::PhaseSpaceNL self.power = power # self.makePhis(power) # self.pdf = cpp.Analysis.Models.PhaseSpacePol( 'pspol_%s' % name, 'PhaseSpacePol(%s)' % name, self.mass, self.ps, ## Gaudi::Math::PhaseSpaceNL self.phi_list)
def __init__( self, pt, ## pT-variable (for fitting) mass=0, ## particle mass (may be fixed) b=None, ## slope parameter name=''): ## initialize the base PDF.__init__(self, name) if not isinstance(pt, ROOT.RooAbsReal): raise AttributeError("QGSM(%s): invalid 'pt'-parameter %s" % (name, pt)) self.pt = pt self.m = self.pt self.mass = self.pt self.m0 = makeVar(mass, 'm0_%s' % name, 'm0(%s)' % name, mass, 0, 1e+6) self.b = makeVar(b, 'b_%s' % name, 'b(%s) ' % name, b, 0., 1e+6) self.pdf = cpp.Analysis.Models.QGSM('qgsm_' + name, 'QGSM(%s)' % name, self.pt, self.b, self.m0)
def __init__(self, mass, name='Y', power=0, m1s=None, sigma=None, a0=1.91, a1=None, a2=None): # PDF.__init__(self, name) # if mass.getMin() < 9.460 and 9.60 <= mass.getMax(): gev_ = 1 elif mass.getMin() < 10. and 10.500 <= mass.getMax(): gev_ = 1 elif mass.getMin() < 10.0 and 10.200 <= mass.getMax(): gev_ = 1 elif mass.getMin() < 9460 and 10355 <= mass.getMax(): gev_ = 1000 elif mass.getMin() < 10000 and 10500 <= mass.getMax(): gev_ = 1000 elif mass.getMin() < 10000 and 10200 <= mass.getMax(): gev_ = 1000 else: raise TypeError("Illegal mass range %s<m<%s" % (mass.getMin(), mass.getMax())) m_y1s = 9.46030 * gev_ s_y1s = 4.3679e-02 * gev_ dm_y2s = 10.02326 * gev_ - m_y1s dm_y3s = 10.3552 * gev_ - m_y1s # self.mass = mass # ===================================================================== from Ostap.FitBasic import makeVar from Ostap.FitSignalModels import Needham_pdf # ===================================================================== ## Y(1S) # ===================================================================== self.a0 = makeVar(a0, 'a0m_%s' % name, "a0 for Needham's function", a0, 1.91, 0.1, 3.0) self.a1 = makeVar(a1, 'a1m_%s' % name, "a1 for Needham's function", a1, 1.1174 / gev_, -10.0 / gev_, 10.0 / gev_) self.a2 = makeVar(a2, 'a2m_%s' % name, "a2 for Needham's function", a2, -5.299 / gev_**2, -100.0 / gev_**2, 100.0 / gev_**2) ## default logic does not work nicely here, therefore we need to be explicit: if a0 is None and not self.a0.isConstant(): self.a0.fix(1.91) if a1 is None and not self.a1.isConstant(): self.a1.fix(1.1174 / gev_) if a2 is None and not self.a2.isConstant(): self.a2.fix(-5.299 / gev_**2) self.m1s = makeVar(m1s, "m1S_%s" % name, "mass Y1S(%s)" % name, m1s, m_y1s, m_y1s - 0.15 * s_y1s, m_y1s + 0.15 * s_y1s) self.s1s = makeVar(sigma, "s1S_%s" % name, "sigma Y1S(%s)" % name, sigma, s_y1s, 0.3 * s_y1s, 4 * s_y1s) self.sigma = self.s1s self.Y1S = Needham_pdf(name + '1S', mass.getMin(), mass.getMax(), mass=self.mass, mean=self.m1s, sigma=self.s1s, a0=self.a0, a1=self.a1, a2=self.a2) # ===================================================================== ## Y(2S) # ===================================================================== self.dm2s = makeVar(None, "dm2s" + name, "dm2s(%s)" % name, dm_y2s, dm_y2s - 0.20 * s_y1s, dm_y2s + 0.20 * s_y1s) self.aset11 = ROOT.RooArgList(self.m1s, self.dm2s) self.m2s = ROOT.RooFormulaVar( "m_" + name + '2S', "m2s(%s)" % name, "%s+%s" % (self.m1s.GetName(), self.dm2s.GetName()), self.aset11) self.aset12 = ROOT.RooArgList(self.sigma, self.m1s, self.m2s) self.s2s = ROOT.RooFormulaVar( "sigma_" + name + '2S', "#sigma_{Y2S}(%s)" % name, "%s*(%s/%s)" % (self.sigma.GetName(), self.m2s.GetName(), self.m1s.GetName()), self.aset12) self.Y2S = Needham_pdf(name + '2S', mass.getMin(), mass.getMax(), mass=self.mass, mean=self.m2s, sigma=self.s2s, a0=self.a0, a1=self.a1, a2=self.a2) # ===================================================================== ## Y(3S) # ===================================================================== self.dm3s = makeVar(None, "dm3s" + name, "dm3s(%s)" % name, dm_y3s, dm_y3s - 0.20 * s_y1s, dm_y3s + 0.20 * s_y1s) self.aset21 = ROOT.RooArgList(self.m1s, self.dm3s) self.m3s = ROOT.RooFormulaVar( "m_" + name + '(3S)', "m3s(%s)" % name, "%s+%s" % (self.m1s.GetName(), self.dm3s.GetName()), self.aset21) self.aset22 = ROOT.RooArgList(self.sigma, self.m1s, self.m3s) self.s3s = ROOT.RooFormulaVar( "sigma_" + name + '3S', "#sigma_{Y3S}(%s)" % name, "%s*(%s/%s)" % (self.sigma.GetName(), self.m3s.GetName(), self.m1s.GetName()), self.aset22) self.Y3S = Needham_pdf(name + '3S', mass.getMin(), mass.getMax(), mass=self.mass, mean=self.m3s, sigma=self.s3s, a0=self.a0, a1=self.a1, a2=self.a2) # ## the actual signal PDFs # self.y1s = self.Y1S.pdf self.y2s = self.Y2S.pdf self.y3s = self.Y3S.pdf ## use helper function to create background from Ostap.FitBkgModels import makeBkg self.background = makeBkg(power, 'Bkg%s' % name, self.mass) self.n1s = makeVar(None, "N1S" + name, "Signal(Y1S)", None, 1000, 0, 1.e+7) self.n2s = makeVar(None, "N2S" + name, "Signal(Y2S)", None, 300, 0, 1.e+6) self.n3s = makeVar(None, "N3S" + name, "Signal(Y3S)", None, 100, 0, 1.e+5) self.b = makeVar(None, "B" + name, "Background", None, 100, 0, 1.e+8) self.alist1 = ROOT.RooArgList(self.y1s, self.y2s, self.y3s) self.alist2 = ROOT.RooArgList(self.n1s, self.n2s, self.n3s) self.alist1.add(self.background.pdf) self.alist2.add(self.b) self.pdf = ROOT.RooAddPdf("manca_%s" % name, "manca(%s)" % name, self.alist1, self.alist2) self.dm2s.setConstant(True) self.dm3s.setConstant(True) self._splots = [] self.s1_name = self.n1s.GetName() self.s2_name = self.n2s.GetName() self.s3_name = self.n3s.GetName() # ## finally declare components # self.signals().add(self.y1s) self.signals().add(self.y2s) self.signals().add(self.y3s) self.backgrounds().add(self.background.pdf)
def __init__(self, mass, name='Y', power=0, m1s=None, sigma=None, alphaL=1.5462, alphaR=1.6952, nL=1.3110, nR=1.5751e+01): # PDF.__init__(self, name) # if mass.getMin() < 9.460 and 9.60 <= mass.getMax(): gev_ = 1 elif mass.getMin() < 10. and 10.500 <= mass.getMax(): gev_ = 1 elif mass.getMin() < 10.0 and 10.200 <= mass.getMax(): gev_ = 1 elif mass.getMin() < 9460 and 10355 <= mass.getMax(): gev_ = 1000 elif mass.getMin() < 10000 and 10500 <= mass.getMax(): gev_ = 1000 elif mass.getMin() < 10000 and 10200 <= mass.getMax(): gev_ = 1000 else: raise TypeError("Illegal mass range %s<m<%s" % (mass.getMin(), mass.getMax())) m_y1s = 9.46030 * gev_ s_y1s = 4.03195e-02 * gev_ dm_y2s = 10.02326 * gev_ - m_y1s dm_y3s = 10.3552 * gev_ - m_y1s # self.mass = mass # ===================================================================== from Ostap.FitBasic import makeVar from Ostap.FitSignalModels import CB2_pdf # ===================================================================== ## Y(1S) # ===================================================================== self.aL = makeVar(alphaL, "aL_%s" % name, "#alpha_{L}(%s)" % name, alphaL, 1.5462, 0, 10) self.nL = makeVar(nL, "nL_%s" % name, "n_{L}(%s)" % name, nL, 1.3119, 0, 10) self.aR = makeVar(alphaR, "aR_%s" % name, "#alpha_{R}(%s)" % name, alphaR, 1.6952e+00, 0, 10) self.nR = makeVar(nR, "nR_%s" % name, "n_{R}(%s)" % name, nR, 1.5751e+01, 0, 25) self.m1s = makeVar(m1s, "m1S_%s" % name, "mass Y1S(%s)" % name, m1s, m_y1s, m_y1s - 0.15 * s_y1s, m_y1s + 0.15 * s_y1s) self.s1s = makeVar(sigma, "s1S_%s" % name, "sigma Y1S(%s)" % name, sigma, s_y1s, 0.3 * s_y1s, 4 * s_y1s) self.sigma = self.s1s self.Y1S = CB2_pdf(name + '1S', mass.getMin(), mass.getMax(), mass=self.mass, mean=self.m1s, sigma=self.s1s, alphaL=self.aL, alphaR=self.aR, nL=self.nL, nR=self.nR) # ===================================================================== ## Y(2S) # ===================================================================== self.dm2s = makeVar(None, "dm2s" + name, "dm2s(%s)" % name, dm_y2s, dm_y2s - 0.20 * s_y1s, dm_y2s + 0.20 * s_y1s) self.aset11 = ROOT.RooArgList(self.m1s, self.dm2s) self.m2s = ROOT.RooFormulaVar( "m_" + name + '2S', "m2s(%s)" % name, "%s+%s" % (self.m1s.GetName(), self.dm2s.GetName()), self.aset11) self.aset12 = ROOT.RooArgList(self.sigma, self.m1s, self.m2s) self.s2s = ROOT.RooFormulaVar( "sigma_" + name + '2S', "#sigma_{Y2S}(%s)" % name, "%s*(%s/%s)" % (self.sigma.GetName(), self.m2s.GetName(), self.m1s.GetName()), self.aset12) self.Y2S = CB2_pdf(name + '2S', mass.getMin(), mass.getMax(), mass=self.mass, mean=self.m2s, sigma=self.s2s, alphaL=self.aL, alphaR=self.aR, nL=self.nL, nR=self.nR) # ===================================================================== ## Y(3S) # ===================================================================== self.dm3s = makeVar(None, "dm3s" + name, "dm3s(%s)" % name, dm_y3s, dm_y3s - 0.20 * s_y1s, dm_y3s + 0.20 * s_y1s) self.aset21 = ROOT.RooArgList(self.m1s, self.dm3s) self.m3s = ROOT.RooFormulaVar( "m_" + name + '(3S)', "m3s(%s)" % name, "%s+%s" % (self.m1s.GetName(), self.dm3s.GetName()), self.aset21) self.aset22 = ROOT.RooArgList(self.sigma, self.m1s, self.m3s) self.s3s = ROOT.RooFormulaVar( "sigma_" + name + '3S', "#sigma_{Y3S}(%s)" % name, "%s*(%s/%s)" % (self.sigma.GetName(), self.m3s.GetName(), self.m1s.GetName()), self.aset22) self.Y3S = CB2_pdf(name + '3S', mass.getMin(), mass.getMax(), mass=self.mass, mean=self.m3s, sigma=self.s3s, alphaL=self.aL, alphaR=self.aR, nL=self.nL, nR=self.nR) # ## the actual signal PDFs # self.y1s = self.Y1S.pdf self.y2s = self.Y2S.pdf self.y3s = self.Y3S.pdf ## use helper function to create background from Ostap.FitBkgModels import makeBkg self.background = makeBkg(power, 'Bkg%s' % name, self.mass) self.n1s = makeVar(None, "N1S" + name, "Signal(Y1S)", None, 1000, 0, 1.e+7) self.n2s = makeVar(None, "N2S" + name, "Signal(Y2S)", None, 300, 0, 1.e+6) self.n3s = makeVar(None, "N3S" + name, "Signal(Y3S)", None, 100, 0, 1.e+6) self.b = makeVar(None, "B" + name, "Background", None, 100, 0, 1.e+8) self.alist1 = ROOT.RooArgList(self.y1s, self.y2s, self.y3s) self.alist2 = ROOT.RooArgList(self.n1s, self.n2s, self.n3s) self.alist1.add(self.background.pdf) self.alist2.add(self.b) self.pdf = ROOT.RooAddPdf("manca_%s" % name, "manca(%s)" % name, self.alist1, self.alist2) self.dm2s.setConstant(True) self.dm3s.setConstant(True) self._splots = [] self.s1_name = self.n1s.GetName() self.s2_name = self.n2s.GetName() self.s3_name = self.n3s.GetName() # ## finally declare components # self.signals().add(self.y1s) self.signals().add(self.y2s) self.signals().add(self.y3s) self.backgrounds().add(self.background.pdf)