コード例 #1
0
ファイル: dilution_weights.py プロジェクト: GerhardRaven/P2VV
from P2VV.Parameterizations.TimeResolution import Multi_Gauss_TimeResolution as Multi_TimeResolution
tres_args = dict(time = t, sigmat = st, Cache = True)
tres_1 = Multi_TimeResolution(Name = 'tres', ParNamePrefix = 'one',
                              TimeResSFParam = 'linear',
                              timeResMu = dict(Value = 0.),
                              sf_one_offset = dict(Value = 0, Constant = True),
                              sf_one_slope = dict(Value = 1.174),
                              sf_two_offset = dict(Value = 0, Constant = True),
                              sf_two_slope = dict(Value = 2),
                              Fractions = [(2, 0.143)], **tres_args)
tres_2 = TimeResolution(Name = 'tres', ParNamePrefix = 'two', PerEventError = True,
                        timeResSigmaSF = dict(Value = 4.), **tres_args)

# Gaussians for Time
from P2VV.Parameterizations.TimePDFs import Prompt_Peak
g1 = Prompt_Peak(t, tres_1.model(), Name = 'g1')
g2 = Prompt_Peak(t, tres_2.model(), Name = 'g2')

# Mass shapes
from P2VV.Parameterizations.MassPDFs import Background_PsiMass as PsiBkgPdf
bkg_m = PsiBkgPdf(mpsi, Name = 'bkg_mpsi')

from P2VV.Parameterizations.MassPDFs import DoubleCB_Psi_Mass as PsiMassPdf
sig_m = PsiMassPdf(mpsi, Name = 'psi_m', mpsi_alpha_1 = dict(Value = 2, Constant = True),
                   mpsi_sigma_sf = dict(Value = 2.3), mpsi_frac = dict(Value = 0.8))

one = Component('one', [g1.pdf(), sig_m.pdf(), ln], Yield = (25000, 100, 100000))
two = Component('two', [g2.pdf(), bkg_m.pdf(), ln], Yield = (25000, 100, 100000))

sig_pdf = buildPdf(Name = 'sig_pdf', Components = [one], Observables = [mpsi, t, st])
bkg_pdf = buildPdf(Name = 'bkg_pdf', Components = [two], Observables = [mpsi, t, st])
コード例 #2
0
bkg_tres = TimeResolution(Name = 'bkg_tres', ParNamePrefix = 'bkg', time = time_obs, sigmat = st,
                          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())
コード例 #3
0
# now build the actual signal PDF...
from ROOT import RooGaussian as Gaussian
from ROOT import RooExponential as Exponential
from ROOT import RooDecay as Decay

# B time PDF
from P2VV.Parameterizations.TimeResolution import Multi_Gauss_TimeResolution as TimeResolution
tres_args = dict(time = t, sigmat = st, Cache = True,
                 Parameterise = 'RMS',
                 TimeResSFParam = 'linear', SplitFracs = False,
                 ScaleFactors = [(2, 2.1), (1, 1.26)],
                 Fractions = [(2, 0.2)], SplitMean = False)
tres = TimeResolution(Name = 'tres', **tres_args)

from P2VV.Parameterizations.TimePDFs import Single_Exponent_Time as TimePdf
sig_t = TimePdf(t, tres.model())

# B mass pdf
from P2VV.Parameterizations.MassPDFs import DoubleGauss_Signal_Mass as MassPdf
sig_m = MassPdf(m, Name = 'sig_m', AvSigParameterisation = True)
sig_m = sig_m.pdf()

# background
psi_c = RealVar( 'psi_c',  Unit = '1/MeV', Value = -0.0004, MinMax = (-0.1, -0.0000001))
bkg_m = Pdf(Name = 'bkg_m',  Type = Exponential, Parameters = [m, psi_c])

background = Component('background', (bkg_m,), Yield= (200000,500,5000000) )
signal = Component('signal', (sig_m, sig_t.pdf()), Yield= (200000,500,500000) )

from P2VV.Utilities.DataHandling import readData
tree_name = 'DecayTree'