Beispiel #1
0
print dataset
# =============================================================================

import Ostap.FitModels as Models
models = []

# =============================================================================
## gauss as signal, const as background
# =============================================================================
logger.info(
    'Simplest (factorized) fit model:  ( Gauss + const ) x ( Gauss + const ) ')
model = Models.Fit2D(signal_1=Models.Gauss_pdf('Gx',
                                               m_x.getMin(),
                                               m_x.getMax(),
                                               mass=m_x),
                     signal_2=Models.Gauss_pdf('Gy',
                                               m_y.getMin(),
                                               m_y.getMax(),
                                               mass=m_y))

model.signal1.sigma.fix(m.error())
model.signal2.sigma.fix(m.error())
model.signal1.mean.fix(m.value())
model.signal2.mean.fix(m.value())
model.signal1.mean.fix(m.value())
model.signal2.mean.fix(m.value())
model.bkg1.tau.fix(0)
model.bkg2.tau.fix(0)
model.bkgA.tau.fix(0)
model.bkgB.tau.fix(0)
Beispiel #2
0
#
## create model
#
import Ostap.FitModels as Models

jpsi = Models.Needham_pdf('N0', mass=m_psi, mean=3.096, sigma=0.013)
D0 = Models.Gauss_pdf('G0', mass=m_D0, mean=1.864, sigma=0.007)

bkg_jpsi = Models.Bkg_pdf('B01', mass=m_psi)
bkg_D0 = Models.Bkg_pdf('B02', mass=m_D0)
bkg_jpsi.tau.fix(-10)
bkg_D0.tau.fix(+5)

model = Models.Fit2D(signal_1=jpsi,
                     signal_2=D0,
                     bkg1=bkg_jpsi,
                     bkgA=bkg_jpsi,
                     bkg2=bkg_D0,
                     bkgB=bkg_D0)

model.ss.fix(5000)
model.sb.fix(2500)
model.bs.fix(2500)
model.bb.fix(10000)

data = model.pdf.generate(varset, 20000)

# ============================================================================
if '__main__' == __name__:

    import Ostap.Line
    logger.info(__file__ + '\n' + Ostap.Line.line)
Beispiel #3
0
bw = cpp.Gaudi.Math.Phi0(1.0195, 0.0043, 0.4937)

sigPhi0 = Models.BreitWigner_pdf('Phi0',
                                 bw,
                                 mean=1.0195,
                                 gamma=0.0043,
                                 mass=m_phi,
                                 convolution=0.0005)

sigPhi = sigPhi0

ps2 = cpp.Gaudi.Math.PhaseSpaceNL(2 * 0.4937, 5.278 - 3.096, 2, 3)
model0 = Models.Fit2D(
    signal_1=sigB,
    signal_2=sigPhi0,
    ##
    bkg2=Models.PSPol_pdf('PSP0', m_phi, ps2, power=1),
    bkgB=Models.PSPol_pdf('PSB0', m_phi, ps2, power=1),
    suffix='_GEN')
model0.bkg1.tau.fix(0)
model0.bkgA.tau.fix(0)

model0.ss.fix(1000)
model0.sb.fix(300)
model0.bs.fix(300)
model0.bb.fix(300)

model1 = Models.Fit2D(
    signal_1=sigB,
    signal_2=sigPhi,
    ##
Beispiel #4
0

## 2) create the model: signnal + background

#
## create model
#
import  Ostap.FitModels as Models

jpsi  = Models.Needham_pdf ( 'N' , mass = m_psi , mean = 3.096  , sigma = 0.013 )
D0    = Models.Gauss_pdf   ( 'G' , mass = m_D0  , mean = 1.864  , sigma = 0.007 )

model = Models.Fit2D (
    signal_1 = jpsi ,
    signal_2 = D0   ,
    power1   = 2    ,
    power2   = 2    ,
    powerA   = 2    ,
    powerB   = 2    )



r,f = model.fitTo  ( data , silence = True , ncpu = 8 ) 
r,f = model.fitTo  ( data , ncpu = 8 , silence = True ) 

model.draw1 ( data  , nbins = 50 )




# ============================================================================