Esempio n. 1
0
    logger.warning('Fit is not perfect MIGRAD=%d QUAL=%d ' %
                   (result.status(), result.covQual()))
    print result
else:
    print 'Signal & Background are: ', result('S')[0], result('B')[0]
    print 'Mean   & Sigma      are: ', result('mean_Gauss')[0], result(
        'sigma_Gauss')[0]

models.append(model_cbrs)

# =============================================================================
## double sided CrystalBall PDF
# =============================================================================
logger.info('Test CrystalBallDS_pdf')
model_cbds = Models.Fit1D(signal=Models.CB2_pdf(name='CB2',
                                                mass=mass,
                                                sigma=signal_gauss.sigma,
                                                mean=signal_gauss.mean),
                          background=model_gauss.background)

model_cbds.signal.aL.fix(2)
model_cbds.signal.nL.fix(10)
model_cbds.signal.aR.fix(2.5)
model_cbds.signal.nR.fix(10)

model_cbds.s.setVal(5000)
model_cbds.b.setVal(500)

with rooSilent():
    result, frame = model_cbds.fitTo(dataset0)
    model_cbds.signal.aL.release()
    model_cbds.signal.aR.release()
Esempio n. 2
0
"""
# =========================================================================================
import ROOT
from   Ostap.PyRoUts         import * 
from   AnalysisPython.Logger import getLogger
# ==========================================================================================
if '__main__' == __name__ : logger = getLogger('OstapTutor/yfits')
else                      : logger = getLogger( __name__          )
# ==========================================================================================


from    OstapTutor.TestVars1   import m_psi,m_ups
import  Ostap.FitModels        as     Models

signal_psi = Models.CB2_pdf('Jpsi' ,
                            mass  = m_psi ,
                            sigma = 0.013 ,
                            mean  = 3.096 )
signal_psi.aL.fix(1.8)
signal_psi.aR.fix(1.8)
signal_psi.nL.fix(1.8)
signal_psi.nR.fix(1.8)

## define model for J/psi
model_psi = Models.Fit1D(  signal      = signal_psi ,
                           background  = Models.Bkg_pdf  ( 'BJpsi'  , mass = m_psi ) )

##  define the model for Y 
model_Y   = Models.Manca2_pdf ( m_ups , power = 0    , 
                                m1s    = 9.4539e+00  ,
                                sigma  = 4.03195e-02 )