import sys import os from P2VV.ToyMCUtils import Toy toy = Toy() parser = toy.parser() (options, args) = toy.configure() from itertools import product from P2VV.RooFitWrappers import * from P2VV.Load import P2VVLibrary from ROOT import RooCBShape as CrystalBall from P2VV.Parameterizations.GeneralUtils import valid_combinations obj = RooObject(workspace="w") w = obj.ws() from math import pi t = RealVar("time", Title="decay time", Unit="ps", Observable=True, MinMax=(0.3, 14)) m = RealVar("mass", Title="B mass", Unit="MeV", Observable=True, MinMax=(5250, 5550)) nPV = RealVar("nPV", Title="nPV", Observable=True, MinMax=(0, 15)) mpsi = RealVar("mdau1", Title="J/psi mass", Unit="MeV", Observable=True, MinMax=(3030, 3150)) st = RealVar("sigmat", Title="#sigma(t)", Unit="ps", Observable=True, MinMax=(0.0001, 0.12)) # Categories hlt1_biased = Category("hlt1_biased", States={"biased": 1, "not_biased": 0}, Observable=True) hlt1_unbiased = Category("hlt1_unbiased", States={"unbiased": 1, "not_unbiased": 0}, Observable=True) hlt1_excl_biased = Category("hlt1_excl_biased", States={"excl_biased": 1, "unbiased": 0}, Observable=True) hlt2_biased = Category("hlt2_biased", States={"biased": 1, "not_biased": 0}, Observable=True) hlt2_unbiased = Category("hlt2_unbiased", States={"unbiased": 1, "not_unbiased": 0}, Observable=True)
import sys import os from P2VV.ToyMCUtils import Toy toy = Toy() parser = toy.parser() (options, args) = toy.configure() from P2VV.RooFitWrappers import * generate = True obj = RooObject( workspace = 'w') w = obj.ws() t_minmax = (-1.5, 8) t = RealVar('time', Title = 'decay time', Unit='ps', Observable = True, MinMax = t_minmax) st = RealVar('sigmat',Title = '#sigma(t)', Unit = 'ps', Observable = True, MinMax = (0.01, 0.07)) t_true = RealVar('truetime', Title = 'true decay time', Unit='ps', Observable = True, MinMax=(-1100, 14)) m = RealVar('mass', Title = 'B mass', Unit = 'MeV', Observable = True, MinMax = (5200, 5550)) observables = [m, t, st, t_true] cut = 'sel == 1 && triggerDecisionUnbiasedPrescaled == 1 && ' cut += ' && '.join(['%s < 4' % e for e in ['muplus_track_chi2ndof', 'muminus_track_chi2ndof', 'Kplus_track_chi2ndof', 'Kminus_track_chi2ndof']]) cut += ' && sel_cleantail == 1' cut += ' && abs(trueid) == 531' if not generate: prefix = '/stuff/PhD' if os.path.exists('/stuff') else '/bfys/raaij' filename = os.path.join(prefix, 'p2vv/data/Bs2JpsiPhiPrescaled_MC11a_ntupleB_for_fitting_20130222.root')