Пример #1
0
                          Cache = True, Parameterise = 'RMS', TimeResSFParam = 'linear_no_offset',
                          timeResMu = mu, ScaleFactors = [(2, 2.1), (1, 1.26)], Fractions = [(2, 0.2)])
# J/psi mass pdf
from P2VV.Parameterizations.MassPDFs import DoubleCB_Psi_Mass as PsiMassPdf
psi_m = PsiMassPdf(mpsi, Name = 'psi_m', mpsi_alpha_1 = dict(Name = 'mpsi_alpha_1', Value = 2., Constant = True))
psi_m = psi_m.pdf()
    
# J/psi background
from P2VV.Parameterizations.MassPDFs import Background_PsiMass as PsiBkgPdf
bkg_mpsi = PsiBkgPdf(mpsi, Name = 'bkg_mpsi')

# Longlived time PDF
from P2VV.Parameterizations.TimePDFs import LP2011_Background_Time as Background_Time
psi_t = Background_Time( Name = 'psi_t', time = time_obs, resolutionModel = sig_tres.model()
                         , psi_t_fml    = dict(Name = 'psi_t_fml',    Value = 6.7195e-01)
                         , psi_t_ll_tau = dict(Name = 'psi_t_ll_tau', Value = 1.3672, MinMax = (0.5,  2.5))
                         , psi_t_ml_tau = dict(Name = 'psi_t_ml_tau', Value = 1.3405e-01, MinMax = (0.01, 0.5))
                         )
psi_t = psi_t.pdf()

# Sigmat PDFs
from P2VV.Parameterizations.SigmatPDFs import DoubleLogNormal
sig_ln = DoubleLogNormal(st, ParNamePrefix = 'sig')
bkg_ln = DoubleLogNormal(st, ParNamePrefix = 'bkg')

# Background time pdf
from P2VV.Parameterizations.TimePDFs import Prompt_Peak
bkg_peak = Prompt_Peak(time_obs, bkg_tres.model(), Name = 'prompt_bkg')
bkg_t = Background_Time(Name = 'bkg_t', time = time_obs, resolutionModel = bkg_tres.model())

# J/psi signal component
Пример #2
0
psi_m = psi_m.pdf()

# J/psi background
from P2VV.Parameterizations.MassPDFs import Background_PsiMass as PsiBkgPdf
bkg_mpsi = PsiBkgPdf(mpsi, Name = 'bkg_mpsi')

# Create combinatorical background component
mean = RealVar(Name = 'mean', Value = 5368, MinMax = (5300, 5400))
sigma = RealVar(Name = 'sigma', Value = 50, MinMax = (1, 500))
bkg_m = Pdf(Name = 'gauss', Type = Gaussian, Parameters = (m, mean, sigma))

# Create psi background component
from P2VV.Parameterizations.TimePDFs import LP2011_Background_Time as Background_Time
psi_t = Background_Time( Name = 'psi_t', time = time_obs, resolutionModel = sig_tres.model()
                         , psi_t_fml    = dict(Name = 'psi_t_fml',    Value = 6.7195e-01)
                         , psi_t_ll_tau = dict(Name = 'psi_t_ll_tau', Value = 1.3672, MinMax = (1,  2.5))
                         , psi_t_ml_tau = dict(Name = 'psi_t_ml_tau', Value = 1.3405e-01, MinMax = (0.01, 2.5))
                         )
psi_t = psi_t.pdf()

# J/psi signal component
psi_ll = Component('psi_ll', (psi_m, bkg_m, psi_t), Yield= (8.5575e+03,100,500000) )

# Background component
from P2VV.Parameterizations.TimePDFs import Prompt_Peak
background = Component('background', (bkg_mpsi.pdf(), bkg_m), Yield = (19620,100,500000) )
if options.add_background:
    bkg_t = Prompt_Peak(time_obs, bkg_tres.model(), Name = 'bkg_prompt_pdf')
    background[t] = bkg_t.pdf()

# B signal component
Пример #3
0
from P2VV.RooFitWrappers import *
from P2VV.Load import P2VVLibrary
from P2VV.Load import LHCbStyle

obj = RooObject( workspace = 'w')
w = obj.ws()

t  = RealVar('time', Title = 'decay time', Unit='ps', Observable = True, MinMax = (0.5, 14))

from P2VV.Parameterizations.TimeResolution import Truth_TimeResolution
tres = Truth_TimeResolution(time = t)

from P2VV.Parameterizations.TimePDFs import LP2011_Background_Time as Background_Time
psi_t = Background_Time( Name = 'psi_t', time = t, resolutionModel = tres.model()
                         , psi_t_fml    = dict(Name = 'psi_t_fml',    Value = 6.7195e-01)
                         , psi_t_ll_tau = dict(Name = 'psi_t_ll_tau', Value = 1.3672, MinMax = (0.1,  10))
                         , psi_t_ml_tau = dict(Name = 'psi_t_ml_tau', Value = 1.3405e-01, MinMax = (0.01, 5))
                         )
psi_t = psi_t.pdf()

from ROOT import TFile
input_file = TFile(input_filename)
sdata = input_file.Get(data_name)
sdata_cut = sdata.reduce('time > %f' % t.getMin())

fitOpts = dict(NumCPU = 4, Timer = 1, Save = True, Minimizer = 'Minuit2', Optimize = 2, Offset = True,
               Verbose = False, Strategy = 1, SumW2Error = False)

result = psi_t.fitTo(sdata_cut, **fitOpts)

from ROOT import TCanvas