{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Import" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "c:\\users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\zfit\\util\\execution.py:53: UserWarning: Not running on Linux. Determining available cpus for thread can failand be overestimated. Workaround (only if too many cpus are used):`zfit.run.set_n_cpu(your_cpu_number)`\n", " warnings.warn(\"Not running on Linux. Determining available cpus for thread can fail\"\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "WARNING: The TensorFlow contrib module will not be included in TensorFlow 2.0.\n", "For more information, please see:\n", " * https://github.com/tensorflow/community/blob/master/rfcs/20180907-contrib-sunset.md\n", " * https://github.com/tensorflow/addons\n", "If you depend on functionality not listed there, please file an issue.\n", "\n" ] } ], "source": [ "import numpy as np\n", "from pdg_const import pdg\n", "import matplotlib\n", "import matplotlib.pyplot as plt\n", "import pickle as pkl\n", "import sys\n", "import time\n", "from helperfunctions import display_time, prepare_plot\n", "import cmath as c\n", "import scipy.integrate as integrate\n", "from scipy.optimize import fminbound\n", "from array import array as arr\n", "import collections\n", "from itertools import compress\n", "import tensorflow as tf\n", "import zfit\n", "from zfit import ztf\n", "# from IPython.display import clear_output\n", "import os" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "# chunksize = 1000000\n", "# zfit.run.chunking.active = True\n", "# zfit.run.chunking.max_n_points = chunksize" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Build model and graphs\n", "## Create graphs" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "def formfactor( q2, subscript): #returns real value\n", " #check if subscript is viable\n", "\n", " if subscript != \"0\" and subscript != \"+\" and subscript != \"T\":\n", " raise ValueError('Wrong subscript entered, choose either 0, + or T')\n", "\n", " #get constants\n", "\n", " mK = ztf.constant(pdg['Ks_M'])\n", " mbstar0 = ztf.constant(pdg[\"mbstar0\"])\n", " mbstar = ztf.constant(pdg[\"mbstar\"])\n", " b0 = ztf.constant(pdg[\"b0\"])\n", " bplus = ztf.constant(pdg[\"bplus\"])\n", " bT = ztf.constant(pdg[\"bT\"])\n", "\n", " mmu = ztf.constant(pdg['muon_M'])\n", " mb = ztf.constant(pdg['bquark_M'])\n", " ms = ztf.constant(pdg['squark_M'])\n", " mB = ztf.constant(pdg['Bplus_M'])\n", "\n", " #N comes from derivation in paper\n", "\n", " N = 3\n", "\n", " #some helperfunctions\n", "\n", " tpos = (mB - mK)**2\n", " tzero = (mB + mK)*(ztf.sqrt(mB)-ztf.sqrt(mK))**2\n", "\n", " z_oben = ztf.sqrt(tpos - q2) - ztf.sqrt(tpos - tzero)\n", " z_unten = ztf.sqrt(tpos - q2) + ztf.sqrt(tpos - tzero)\n", " z = tf.divide(z_oben, z_unten)\n", "\n", " #calculate f0\n", "\n", " if subscript == \"0\":\n", " prefactor = 1/(1 - q2/(mbstar0**2))\n", " _sum = 0\n", "\n", " for i in range(N):\n", " _sum += b0[i]*(tf.pow(z,i))\n", "\n", " return tf.complex(prefactor * _sum, ztf.constant(0.0))\n", "\n", " #calculate f+ or fT\n", "\n", " else:\n", " prefactor = 1/(1 - q2/(mbstar**2))\n", " _sum = 0\n", "\n", " if subscript == \"T\":\n", " b = bT\n", " else:\n", " b = bplus\n", "\n", " for i in range(N):\n", " _sum += b[i] * (tf.pow(z, i) - ((-1)**(i-N)) * (i/N) * tf.pow(z, N))\n", "\n", " return tf.complex(prefactor * _sum, ztf.constant(0.0))\n", "\n", "def resonance(q, _mass, width, phase, scale):\n", "\n", " q2 = tf.pow(q, 2)\n", "\n", " mmu = ztf.constant(pdg['muon_M'])\n", "\n", " p = 0.5 * ztf.sqrt(q2 - 4*(mmu**2))\n", "\n", " p0 = 0.5 * ztf.sqrt(_mass**2 - 4*mmu**2)\n", "\n", " gamma_j = tf.divide(p, q2) * _mass * width / p0\n", "\n", " #Calculate the resonance\n", "\n", " _top = tf.complex(_mass * width, ztf.constant(0.0))\n", "\n", " _bottom = tf.complex(_mass**2 - q2, -_mass*gamma_j)\n", "\n", " com = _top/_bottom\n", "\n", " #Rotate by the phase\n", "\n", " r = ztf.to_complex(scale*tf.abs(com))\n", "\n", " _phase = tf.angle(com)\n", "\n", " _phase += phase\n", "\n", " com = r * tf.exp(tf.complex(ztf.constant(0.0), _phase))\n", "\n", " return com\n", "\n", "def bifur_gauss(q, mean, sigma_L, sigma_R, scale):\n", "\n", " _exp = tf.where(q < mean, ztf.exp(- tf.pow((q-mean),2) / (2 * sigma_L**2)), ztf.exp(- tf.pow((q-mean),2) / (2 * sigma_R**2)))\n", "\n", " #Scale so the total area under curve is 1 and the top of the cusp is continuous\n", "\n", " dgamma = scale*_exp/(ztf.sqrt(2*np.pi))*2*(sigma_L*sigma_R)/(sigma_L+sigma_R)\n", "\n", " com = ztf.complex(dgamma, ztf.constant(0.0))\n", "\n", " return com\n", "\n", "def axiv_nonres(q):\n", "\n", " GF = ztf.constant(pdg['GF'])\n", " alpha_ew = ztf.constant(pdg['alpha_ew'])\n", " Vtb = ztf.constant(pdg['Vtb'])\n", " Vts = ztf.constant(pdg['Vts'])\n", " C10eff = ztf.constant(pdg['C10eff'])\n", "\n", " mmu = ztf.constant(pdg['muon_M'])\n", " mb = ztf.constant(pdg['bquark_M'])\n", " ms = ztf.constant(pdg['squark_M'])\n", " mK = ztf.constant(pdg['Ks_M'])\n", " mB = ztf.constant(pdg['Bplus_M'])\n", "\n", " q2 = tf.pow(q, 2)\n", "\n", " #Some helperfunctions\n", "\n", " beta = ztf.sqrt(tf.abs(1. - 4. * mmu**2. / q2))\n", "\n", " kabs = ztf.sqrt(mB**2. +tf.pow(q2, 2)/mB**2. + mK**4./mB**2. - 2. * (mB**2. * mK**2. + mK**2. * q2 + mB**2. * q2) / mB**2.)\n", "\n", " #prefactor in front of whole bracket\n", "\n", " prefactor1 = GF**2. *alpha_ew**2. * (tf.abs(Vtb*Vts))**2. * kabs * beta / (128. * np.pi**5.)\n", "\n", " #left term in bracket\n", "\n", " bracket_left = 2./3. * kabs**2. * beta**2. *tf.abs(tf.complex(C10eff, ztf.constant(0.0))*formfactor(q2, \"+\"))**2.\n", "\n", " #middle term in bracket\n", "\n", " _top = 4. * mmu**2. * (mB**2. - mK**2.) * (mB**2. - mK**2.)\n", "\n", " _under = q2 * mB**2.\n", "\n", " bracket_middle = _top/_under *tf.pow(tf.abs(tf.complex(C10eff, ztf.constant(0.0)) * formfactor(q2, \"0\")), 2)\n", "\n", " #Note sqrt(q2) comes from derivation as we use q2 and plot q\n", "\n", " return prefactor1 * (bracket_left + bracket_middle) * 2 *ztf.sqrt(q2)\n", "\n", "def vec(q, funcs):\n", " \n", " q2 = tf.pow(q, 2)\n", "\n", " GF = ztf.constant(pdg['GF'])\n", " alpha_ew = ztf.constant(pdg['alpha_ew'])\n", " Vtb = ztf.constant(pdg['Vtb'])\n", " Vts = ztf.constant(pdg['Vts'])\n", " C7eff = ztf.constant(pdg['C7eff'])\n", "\n", " mmu = ztf.constant(pdg['muon_M'])\n", " mb = ztf.constant(pdg['bquark_M'])\n", " ms = ztf.constant(pdg['squark_M'])\n", " mK = ztf.constant(pdg['Ks_M'])\n", " mB = ztf.constant(pdg['Bplus_M'])\n", "\n", " #Some helperfunctions\n", "\n", " beta = ztf.sqrt(tf.abs(1. - 4. * mmu**2. / q2))\n", "\n", " kabs = ztf.sqrt(mB**2. + tf.pow(q2, 2)/mB**2. + mK**4./mB**2. - 2 * (mB**2 * mK**2 + mK**2 * q2 + mB**2 * q2) / mB**2)\n", "\n", " #prefactor in front of whole bracket\n", "\n", " prefactor1 = GF**2. *alpha_ew**2. * (tf.abs(Vtb*Vts))**2 * kabs * beta / (128. * np.pi**5.)\n", "\n", " #right term in bracket\n", "\n", " prefactor2 = kabs**2 * (1. - 1./3. * beta**2)\n", "\n", " abs_bracket = tf.abs(c9eff(q, funcs) * formfactor(q2, \"+\") + tf.complex(2.0 * C7eff * (mb + ms)/(mB + mK), ztf.constant(0.0)) * formfactor(q2, \"T\"))**2\n", "\n", " bracket_right = prefactor2 * abs_bracket\n", "\n", " #Note sqrt(q2) comes from derivation as we use q2 and plot q\n", "\n", " return prefactor1 * bracket_right * 2 * ztf.sqrt(q2)\n", "\n", "def c9eff(q, funcs):\n", "\n", " C9eff_nr = tf.complex(ztf.constant(pdg['C9eff']), ztf.constant(0.0))\n", "\n", " c9 = C9eff_nr\n", "\n", " c9 = c9 + funcs\n", "\n", " return c9" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "def G(y):\n", " \n", " def inner_rect_bracket(q):\n", " return tf.log(ztf.to_complex((1+tf.sqrt(q))/(1-tf.sqrt(q)))-tf.complex(ztf.constant(0), -1*ztf.constant(np.pi))) \n", " \n", " def inner_right(q):\n", " return ztf.to_complex(2 * tf.atan(1/tf.sqrt(-q)))\n", " \n", " big_bracket = tf.where(y > ztf.const(0.0), inner_rect_bracket(y), inner_right(y))\n", " \n", " return ztf.to_complex(tf.sqrt(tf.abs(y))) * big_bracket\n", "\n", "def h_S(m, q):\n", " \n", " return ztf.to_complex(2) - G(ztf.to_complex(1) - 4*tf.pow(m, 2) / ztf.to_complex(tf.pow(q, 2)))\n", "\n", "def h_P(m,q):\n", " \n", " return ztf.to_complex(2/3) + (ztf.to_complex(1) - 4*tf.pow(m, 2) / ztf.to_complex(tf.pow(q, 2))) * h_S(m,q)\n", "\n", "def two_p_ccbar(mD, m_D_bar, m_D_star, q):\n", " \n", " \n", " #Load constants\n", " nu_D_bar = ztf.to_complex(pdg[\"nu_D_bar\"])\n", " nu_D = ztf.to_complex(pdg[\"nu_D\"])\n", " nu_D_star = ztf.to_complex(pdg[\"nu_D_star\"])\n", " \n", " phase_D_bar = ztf.to_complex(pdg[\"phase_D_bar\"])\n", " phase_D = ztf.to_complex(pdg[\"phase_D\"])\n", " phase_D_star = ztf.to_complex(pdg[\"phase_D_star\"])\n", " \n", " #Calculation\n", " left_part = nu_D_bar * tf.exp(tf.complex(ztf.constant(0.0), phase_D_bar)) * h_S(m_D_bar, q) \n", " \n", " right_part_D = nu_D * tf.exp(tf.complex(ztf.constant(0.0), phase_D)) * h_P(m_D, q) \n", " \n", " right_part_D_star = nu_D_star * tf.exp(tf.complex(ztf.constant(0.0), phase_D_star)) * h_P(m_D_star, q) \n", "\n", " return left_part + right_part_D + right_part_D_star" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Build pdf" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "class total_pdf(zfit.pdf.ZPDF):\n", " _N_OBS = 1 # dimension, can be omitted\n", " _PARAMS = ['jpsi_mass', 'jpsi_scale', 'jpsi_phase', 'jpsi_width',\n", " 'psi2s_mass', 'psi2s_scale', 'psi2s_phase', 'psi2s_width'#,\n", " #'cusp_mass', 'sigma_L', 'sigma_R', 'cusp_scale'\n", " ] # the name of the parameters\n", "\n", " def _unnormalized_pdf(self, x):\n", " \n", " x = x.unstack_x()\n", "\n", " def jpsi_res(q):\n", " return resonance(q, _mass = self.params['jpsi_mass'], scale = self.params['jpsi_scale'], phase = self.params['jpsi_phase'], width = self.params['jpsi_width'])\n", "\n", " def psi2s_res(q):\n", " return resonance(q, _mass = self.params['psi2s_mass'], scale = self.params['psi2s_scale'], phase = self.params['psi2s_phase'], width = self.params['psi2s_width'])\n", "\n", " def cusp(q):\n", " return bifur_gauss(q, mean = self.params['cusp_mass'], sigma_L = self.params['sigma_L'], sigma_R = self.params['sigma_R'], scale = self.params['cusp_scale'])\n", "\n", " funcs = jpsi_res(x) + psi2s_res(x) #+ cusp(x)\n", "\n", " vec_f = vec(x, funcs)\n", "\n", " axiv_nr = axiv_nonres(x)\n", "\n", " tot = vec_f + axiv_nr\n", "\n", " return tot" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Load data" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "x_min = 2*pdg['muon_M']\n", "x_max = (pdg[\"Bplus_M\"]-pdg[\"Ks_M\"]-0.1)\n", "\n", "obs = zfit.Space('q', limits = (x_min, x_max))\n", "\n", "# with open(r\"./data/slim_points/slim_points_toy_0_range({0}-{1}).pkl\".format(int(x_min), int(x_max)), \"rb\") as input_file:\n", "# part_set = pkl.load(input_file)\n", "\n", "# x_part = part_set['x_part']\n", "\n", "# x_part = x_part.astype('float64')\n", "\n", "# data = zfit.data.Data.from_numpy(array=x_part, obs=obs)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Setup parameters" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "WARNING:tensorflow:From c:\\users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\tensorflow\\python\\ops\\resource_variable_ops.py:435: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.\n", "Instructions for updating:\n", "Colocations handled automatically by placer.\n" ] } ], "source": [ "#jpsi\n", "\n", "jpsi_mass, jpsi_width, jpsi_phase, jpsi_scale = pdg[\"jpsi\"]\n", "# jpsi_scale *= pdg[\"factor_jpsi\"]\n", "\n", "jpsi_m = zfit.Parameter(\"jpsi_m\", ztf.constant(jpsi_mass), floating = False)\n", "jpsi_w = zfit.Parameter(\"jpsi_w\", ztf.constant(jpsi_width), floating = False)\n", "jpsi_p = zfit.Parameter(\"jpsi_p\", ztf.constant(jpsi_phase))\n", "jpsi_s = zfit.Parameter(\"jpsi_s\", ztf.constant(jpsi_scale))\n", "\n", "#psi2s\n", "\n", "psi2s_mass, psi2s_width, psi2s_phase, psi2s_scale = pdg[\"psi2s\"]\n", "\n", "psi2s_m = zfit.Parameter(\"psi2s_m\", ztf.constant(psi2s_mass), floating = False)\n", "psi2s_w = zfit.Parameter(\"psi2s_w\", ztf.constant(psi2s_width), floating = False)\n", "psi2s_p = zfit.Parameter(\"psi2s_p\", ztf.constant(psi2s_phase))\n", "psi2s_s = zfit.Parameter(\"psi2s_s\", ztf.constant(psi2s_scale))\n", "\n", "#cusp\n", "\n", "# cusp_mass, sigma_R, sigma_L, cusp_scale = 3550, 3e-7, 200, 0\n", "\n", "# cusp_m = zfit.Parameter(\"cusp_m\", ztf.constant(cusp_mass), floating = False)\n", "# sig_L = zfit.Parameter(\"sig_L\", ztf.constant(sigma_L), floating = False)\n", "# sig_R = zfit.Parameter(\"sig_R\", ztf.constant(sigma_R), floating = False)\n", "# cusp_s = zfit.Parameter(\"cusp_s\", ztf.constant(cusp_scale), floating = False)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Setup pdf" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "total_f = total_pdf(obs=obs, jpsi_mass = jpsi_m, jpsi_scale = jpsi_s, jpsi_phase = jpsi_p, jpsi_width = jpsi_w,\n", " psi2s_mass = psi2s_m, psi2s_scale = psi2s_s, psi2s_phase = psi2s_p, psi2s_width = psi2s_w)#,\n", " #cusp_mass = cusp_m, sigma_L = sig_L, sigma_R = sig_R, cusp_scale = cusp_s)\n", "\n", "# print(total_pdf.obs)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Test if graphs actually work and compute values" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "def total_test_tf(xq):\n", "\n", " def jpsi_res(q):\n", " return resonance(q, jpsi_m, jpsi_s, jpsi_p, jpsi_w)\n", "\n", " def psi2s_res(q):\n", " return resonance(q, psi2s_m, psi2s_s, psi2s_p, psi2s_w)\n", "\n", " def cusp(q):\n", " return bifur_gauss(q, cusp_m, sig_L, sig_R, cusp_s)\n", "\n", " funcs = jpsi_res(xq) + psi2s_res(xq) + cusp(xq)\n", "\n", " vec_f = vec(xq, funcs)\n", "\n", " axiv_nr = axiv_nonres(xq)\n", "\n", " tot = vec_f + axiv_nr\n", " \n", " return tot\n", "\n", "def jpsi_res(q):\n", " return resonance(q, jpsi_m, jpsi_s, jpsi_p, jpsi_w)\n", "\n", "# calcs = zfit.run(total_test_tf(x_part))\n", "\n", "test_q = np.linspace(x_min, x_max, 2000000)\n", "\n", "probs = total_f.pdf(test_q)\n", "\n", "calcs_test = zfit.run(probs)\n", "res_y = zfit.run(jpsi_res(test_q))" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZkAAAD8CAYAAACl69mTAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3Xl8VfWd//HXJzcbS9gDCGGJEoWguEXq1pZWW9GqdGEqdmyx1Trj6Pj7tdPp1Fm6ONNO/U0fdaatSxmxP/TXCtZx2rSltbVqx7YoRkEqCBpki6AEEsISstzk8/vjfsFrvDf3BnNyk/B+Ph73cc/5nu/5nu+Xc8k7Z7kn5u6IiIhEIS/XHRARkcFLISMiIpFRyIiISGQUMiIiEhmFjIiIREYhIyIikckqZMxsvpltMrNaM/tSiuVFZrYiLH/GzKYnLbs1lG8ys0t60OZ3zexgNtsQEZH+KWPImFkMuBO4FKgErjazyi7VrgMa3X0GcAdwe1i3ElgEzAbmA3eZWSxTm2ZWBYzKZhsiItJ/ZXMkMxeodfdX3b0NWA4s6FJnAbAsTD8MXGRmFsqXu3uru28BakN7adsMAfRvwBez3IaIiPRT+VnUmQzsSJqvA96Vro67x82sCRgbyp/usu7kMJ2uzZuBanff1SVD0m1jT3IlM7sBuAFg2LBhZ8+cOTOLIYpkZ3N94gzuSaXDc9yT3tPY3EZd42FOnlBCUb4u0wo899xze9y9tDfayiZkUh0tdH0WTbo66cpTfZLdzCYBfwbMO8Z+4O5LgCUAVVVVXlNTk2I1kZ5rbosz56u/5rPvOZG/mz94fnl58bUmLv/u7/nG1WdyxemTct0d6QfMbFtvtZXNry11wJSk+TJgZ7o6ZpYPjAQaulk3XfmZwAy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 with 1 Axes>" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "plt.clf()\n", "# plt.plot(x_part, calcs, '.')\n", "plt.plot(test_q, calcs_test, label = 'pdf')\n", "# plt.plot(test_q, res_y, label = 'res')\n", "plt.legend()\n", "plt.ylim(0.0, 4e-4)\n", "# plt.yscale('log')\n", "# plt.xlim(3080, 3110)\n", "plt.savefig('test.png')\n", "# print(jpsi_width)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Adjust scaling of different parts" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [], "source": [ "# total_f.update_integration_options(draws_per_dim=2000000, mc_sampler=None)\n", "# inte = total_f.integrate(limits = (3090, 3102), norm_range=False)\n", "# inte_fl = zfit.run(inte)\n", "# print(inte_fl)\n", "# print(pdg[\"jpsi_BR\"]/pdg[\"NR_BR\"], inte_fl/pdg[\"NR_auc\"])" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "211.4\n", "4781.599999999999\n", "807.8926831881124\n", "Time taken: 2 s\n" ] } ], "source": [ "# print(x_min)\n", "# print(x_max)\n", "# # total_f.update_integration_options(draws_per_dim=2000000, mc_sampler=None)\n", "# total_f.update_integration_options(mc_sampler=lambda dim, num_results,\n", "# dtype: tf.random_uniform(maxval=1., shape=(num_results, dim), dtype=dtype),\n", "# draws_per_dim=1000000)\n", "# # _ = []\n", "\n", "# # for i in range(10):\n", "\n", "# # inte = total_f.integrate(limits = (x_min, x_max))\n", "# # inte_fl = zfit.run(inte)\n", "# # print(inte_fl)\n", "# # _.append(inte_fl)\n", "\n", "# # print(\"mean:\", np.mean(_))\n", "\n", "# _ = time.time()\n", "\n", "# inte = total_f.integrate(limits = (x_min, x_max))\n", "# inte_fl = zfit.run(inte)\n", "# print(inte_fl)\n", "# print(\"Time taken: {}\".format(display_time(int(time.time() - _))))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Tensorflow scaling" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "# def scaling_func(x):\n", "\n", "# funcs = resonance(x, _mass = ztf.constant(jpsi_mass), scale = ztf.constant(jpsi_scale), phase = ztf.constant(jpsi_phase), width = ztf.constant(jpsi_width)) + resonance(x, _mass = ztf.constant(psi2s_mass), scale = ztf.constant(psi2s_scale), phase = ztf.constant(psi2s_phase), width = ztf.constant(psi2s_width))\n", "\n", "# vec_f = vec(x, funcs)\n", "\n", "# axiv_nr = axiv_nonres(x)\n", "\n", "# tot = vec_f + axiv_nr\n", "\n", "# return tot\n", "\n", "\n", "# def s_func(x):\n", " \n", "# q = ztf.constant(x)\n", " \n", "# return zfit.run(scaling_func(q))\n", " \n", "\n", "# print(integrate.quad(s_func, x_min, x_max, limit = 50))" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [], "source": [ "# factor_jpsi = pdg[\"NR_auc\"]*pdg[\"jpsi_BR\"]/(pdg[\"NR_BR\"]*pdg[\"jpsi_auc\"])\n", "# factor_jpsi = pdg[\"NR_auc\"]*pdg[\"jpsi_BR\"]/(pdg[\"NR_BR\"]*inte_fl)\n", "# print(np.sqrt(factor_jpsi)*jpsi_scale)\n", "# print(np.sqrt(factor_jpsi))\n", "# # print(psi2s_scale)\n", "# factor_psi2s = pdg[\"NR_auc\"]*pdg[\"psi2s_BR\"]/(pdg[\"NR_BR\"]*pdg[\"psi2s_auc\"])\n", "# factor_psi2s = pdg[\"NR_auc\"]*pdg[\"psi2s_BR\"]/(pdg[\"NR_BR\"]*inte_fl)\n", "# print(np.sqrt(factor_psi2s)*psi2s_scale)\n", "# print(np.sqrt(factor_psi2s))" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [], "source": [ "# def _t_f(xq):\n", "\n", "# def jpsi_res(q):\n", "# return resonance(q, jpsi_m, jpsi_s, jpsi_p, jpsi_w)\n", "\n", "# def psi2s_res(q):\n", "# return resonance(q, psi2s_m, psi2s_s, psi2s_p, psi2s_w)\n", "\n", "# funcs = psi2s_res(xq) + jpsi_res(xq)\n", "\n", "# vec_f = vec(xq, funcs)\n", "\n", "# axiv_nr = axiv_nonres(xq)\n", "\n", "# tot = vec_f + axiv_nr\n", " \n", "# return tot\n", "\n", "# def t_f(x):\n", "# _ = np.array(x)\n", "# probs = zfit.run(_t_f(_))\n", "# return probs" ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [], "source": [ "# print(36000*(1+ pdg[\"jpsi_BR\"]/pdg[\"NR_BR\"] + pdg[\"psi2s_BR\"]/pdg[\"NR_BR\"]))" ] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "nan nan %\n", "Time: 1000.0239598751068\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "c:\\users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\ipykernel_launcher.py:3: IntegrationWarning: The maximum number of subdivisions (5) has been achieved.\n", " If increasing the limit yields no improvement it is advised to analyze \n", " the integrand in order to determine the difficulties. If the position of a \n", " local difficulty can be determined (singularity, discontinuity) one will \n", " probably gain from splitting up the interval and calling the integrator \n", " on the subranges. Perhaps a special-purpose integrator should be used.\n", " This is separate from the ipykernel package so we can avoid doing imports until\n" ] } ], "source": [ "# start = time.time()\n", "\n", "# result, err = integrate.quad(lambda x: t_f(x), x_min, x_max, limit = 5)\n", "# print(result, \"{0:.2f} %\".format(err/result))\n", "# print(\"Time:\", time.time()-start)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Sampling\n", "## One sample\n", "! total_f.sample() always returns the same set !" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "# nevents = int(pdg[\"number_of_decays\"])\n", "# event_stack = 5000\n", "\n", "# calls = int(nevents/event_stack + 1)\n", "\n", "# total_samp = []\n", "\n", "# start = time.time()\n", "\n", "# samp = total_f.sample(n=event_stack)\n", "# s = samp.unstack_x()\n", "\n", "# for call in range(calls):\n", "\n", "# sam = zfit.run(s)\n", "# clear_output(wait=True)\n", " \n", "# # if call != 0:\n", "# # print(np.sum(_last_sam-sam))\n", " \n", "# # _last_sam = sam\n", " \n", "# c = call + 1 \n", "# print(\"{0}/{1}\".format(c, calls))\n", "# print(\"Time taken: {}\".format(display_time(int(time.time() - start))))\n", "# print(\"Projected time left: {}\".format(display_time(int((time.time() - start)/c*(calls-c)))))\n", " \n", "# with open(\"data/zfit_toys/toy_1/{}.pkl\".format(call), \"wb\") as f:\n", "# pkl.dump(sam, f, pkl.HIGHEST_PROTOCOL)" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [], "source": [ "# print(\"Time to generate full toy: {} s\".format(int(time.time()-start)))\n", "\n", "# total_samp = []\n", "\n", "# for call in range(calls):\n", "# with open(r\"data/zfit_toys/toy_1/{}.pkl\".format(call), \"rb\") as input_file:\n", "# sam = pkl.load(input_file)\n", "# total_samp = np.append(total_samp, sam)\n", "\n", "# total_samp = total_samp.astype('float64')\n", "\n", "# data2 = zfit.data.Data.from_numpy(array=total_samp[:int(nevents)], obs=obs)\n", "\n", "# print(total_samp[:nevents].shape)" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [], "source": [ "# bins = int((x_max-x_min)/7)\n", "\n", "# # calcs = zfit.run(total_test_tf(samp))\n", "\n", "# plt.hist(total_samp[:event_stack], bins = bins, range = (x_min,x_max))\n", "\n", "# # plt.plot(sam, calcs, '.')\n", "# # plt.plot(test_q, calcs_test)\n", "# plt.ylim(0, 20)\n", "# # plt.xlim(3000, 3750)\n", "\n", "# plt.savefig('test2.png')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Toys" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [], "source": [ "nr_of_toys = 1\n", "nevents = int(pdg[\"number_of_decays\"])\n", "event_stack = 100000\n", "\n", "calls = int(nevents/event_stack + 1)\n", "\n", "total_samp = []\n", "\n", "start = time.time()\n", "\n", "sampler = total_f.create_sampler(n=event_stack)\n", "\n", "for toy in range(nr_of_toys):\n", " \n", " dirName = 'data/zfit_toys/toy_{0}'.format(toy)\n", " \n", " if not os.path.exists(dirName):\n", " os.mkdir(dirName)\n", " print(\"Directory \" , dirName , \" Created \")\n", "\n", " for call in range(calls):\n", "\n", " sampler.resample(n=event_stack)\n", " s = sampler.unstack_x()\n", " sam = zfit.run(s)\n", "# clear_output(wait=True)\n", "\n", " c = call + 1 \n", " print(\"{0}/{1}\".format(c, calls))\n", " print(\"Time taken: {}\".format(display_time(int(time.time() - start))))\n", " print(\"Projected time left: {}\".format(display_time(int((time.time() - start)/c*(calls-c)))))\n", "\n", " with open(\"data/zfit_toys/toy_{0}/{1}.pkl\".format(toy, call), \"wb\") as f:\n", " pkl.dump(sam, f, pkl.HIGHEST_PROTOCOL)" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [], "source": [ "# with open(r\"data/zfit_toys/toy_0/0.pkl\", \"rb\") as input_file:\n", "# sam = pkl.load(input_file)\n", "# print(sam[:10])\n", "\n", "# with open(r\"data/zfit_toys/toy_0/1.pkl\", \"rb\") as input_file:\n", "# sam2 = pkl.load(input_file)\n", "# print(sam2[:10])\n", "\n", "# print(np.sum(sam-sam2))" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Time to generate full toy: 0 s\n", "(5404696,)\n" ] } ], "source": [ "print(\"Time to generate full toy: {} s\".format(int(time.time()-start)))\n", "\n", "total_samp = []\n", "\n", "for call in range(calls):\n", " with open(r\"data/zfit_toys/toy_0/{}.pkl\".format(call), \"rb\") as input_file:\n", " sam = pkl.load(input_file)\n", " total_samp = np.append(total_samp, sam)\n", "\n", "total_samp = total_samp.astype('float64')\n", "\n", "data2 = zfit.data.Data.from_numpy(array=total_samp[:int(nevents)], obs=obs)\n", "\n", "data3 = zfit.data.Data.from_numpy(array=total_samp, obs=obs)\n", "\n", "print(total_samp[:nevents].shape)" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZAAAAD8CAYAAABZ/vJZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3XmUVPWd9/H3t6o3tmYVRRqhxVbAJS7tEsWEqCNuEWNMJNGEqNHn5DEzSWaSGR0zj5lJnDEnmZgxJjoojsQxoONKEhNCiE40KgqCyiI7YrMINtACDb1UfZ8/6jYW2Out6r5V1Z/XOX3q3t/93dvf37nd/em71C1zd0RERLoqFnUBIiKSnxQgIiISigJERERCUYCIiEgoChAREQlFASIiIqF0GCBm9qCZbTOzpWltPzKzt83sTTN7yswGpS271czWmNlKM5uc1n5R0LbGzG5Ja680swVmttrMHjWzkmwOUEREukdnjkAeAi46pG0ecIK7nwSsAm4FMLMJwFTg+GCdX5hZ3MziwM+Bi4EJwBeCvgA/BO5y9ypgJ3BDRiMSEZEe0WGAuPufgR2HtP3B3ZuD2VeAimB6CjDb3RvcfT2wBjgj+Frj7uvcvRGYDUwxMwPOAx4P1p8JXJHhmEREpAcUZWEb1wOPBtMjSQVKi5qgDeDdQ9rPBIYCu9LCKL3/R5jZTcBNAP369Ttt3LhxGRcvheutTXVZ29YA6hljW1nrR1JPWda2my0n2Hre94FsZUjG2zpx5MAsVCS5aNiwYcydO3euux96VimUjALEzG4DmoFHWppa6ea0fqTj7fRvlbtPB6YDVFdX+8KFC7tUr/QuY275bda2dW18Hj8o/i/O2P9vbGNw1rabLb8p/TovJE7k75v/T8bbWnjnpVmoSHKVmQ3L1rZCB4iZTQMuA873Dx+oVQOMSutWAWwOpltrfx8YZGZFwVFIen+RnHGk1dLocbaTm/+dv+eDONx2Rl2G9DKhbuM1s4uAfwAud/f6tEV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IaVvvInH0Kb7qWADnK3ou4EumM8ePHM3PmTE466SR27NjBt771LaZPn86ll17KxIkTGT16dNQldkinsETaURXbxF+SJ0RdRqfspi87vf+BNz5KbovFYtx3330HtV100UW8/fbbH+k7adIkJk2a1EOVdV7u/1slEpFy9nKE7WRVMvevf7TY6MMVINJjFCAibaiylgvo+fN023d9OBW2PeoypANjxoxh6dKlUZeRMQWISBuOj20AYFlyTKR1dMXGIEBiJKMuRXoBBYhIG06wDWz3ct5jcNSldNpGH06JJRiBnokl3U8BItKGE2IbWJasBPLn3vx1yREAjI1tjrgS6Q0UICKtKKWRKqthqY+JupQuWRs8cuUYU4BI99NtvCKtONZqKLYES5Pd93Gg3aGWcnZ6f8YqQDptzC2/zer2Ntx5aZfX+d73vkf//v359re/3eryp59+mmOPPZYJEyZkWl5W6QhEpBUnxNYD5N0RCBhr/EiOiW2KuhDJoqeffprly5dHXcZHKEBEWnGiraPO+1Ljh0VdSpetTR6pI5A8cMcdd3DcccdxwQUXsHJl6inK999/P6effjof+9jH+OxnP0t9fT0vvfQSc+bM4Tvf+c6Bx7m31i8KChCRVpwWW83rySry6QJ6izU+kmH2AYPYHXUp0oZFixYxe/ZsFi9ezJNPPslrr70GwJVXXslrr73GG2+8wfjx45kxYwZnn302l19+OT/60Y9YsmQJY8eObbVfFHQNROQQ5ezhuFgNv276eNSlhNLy2SVjbTOL/LiIq5HWvPDCC3zmM5+hb9++AFx++eUALF26lO9+97vs2rWLPXv2MHny5FbX72y/7qYjEJFDnBpbDcAiPzbiSsJZE7xzvkrXQXJaa49u/8pXvsI999zDW2+9xe23387+/ftbXbez/bqbAkTkEKfFVtPsMZYkx0ZdSiibfBi7vQ/j7Z2oS5E2fOITn+Cpp55i37597N69m1//+tcA7N69mxEjRtDU1MQjjzxyoP+AAQPYvfvDU5Jt9etpOoUlcohqW8VyH80+yqIuJRQnxgo/igkxBUhnhLntNlOnnnoqV199NSeffDKjR4/m3HPPBeD73/8+Z555JqNHj+bEE088EBpTp07l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axes>" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "bins = int((x_max-x_min)/7)\n", "\n", "# calcs = zfit.run(total_test_tf(samp))\n", "\n", "plt.hist(total_samp[:nevents], bins = bins, range = (x_min,x_max), label = 'data')\n", "plt.plot(test_q, calcs_test*nevents*4.5 , label = 'pdf')\n", "\n", "# plt.plot(sam, calcs, '.')\n", "# plt.plot(test_q, calcs_test)\n", "# plt.yscale('log')\n", "plt.ylim(0, 12000)\n", "# plt.xlim(3080, 3110)\n", "\n", "plt.legend()\n", "\n", "plt.savefig('test2.png')" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [], "source": [ "# sampler = total_f.create_sampler(n=nevents)\n", "# nll = zfit.loss.UnbinnedNLL(model=total_f, data=sampler, fit_range = (x_min, x_max))\n", "\n", "# # for param in pdf.get_dependents():\n", "# # param.set_value(initial_value)\n", "\n", "# sampler.resample(n=nevents)\n", "\n", "# # Randomise initial values\n", "# # for param in pdf.get_dependents():\n", "# # param.set_value(random value here)\n", "\n", "# # Minimise the NLL\n", "# minimizer = zfit.minimize.MinuitMinimizer(verbosity = 10)\n", "# minimum = minimizer.minimize(nll)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Fitting" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "data": { "text/html": [ "<hr>" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "<table>\n", " <tr>\n", " <td title=\"Minimum value of function\">FCN = 23448660.25141733</td>\n", " <td title=\"Total number of call to FCN so far\">TOTAL NCALL = 73</td>\n", " <td title=\"Number of call in last migrad\">NCALLS = 73</td>\n", " </tr>\n", " <tr>\n", " <td title=\"Estimated distance to minimum\">EDM = nan</td>\n", " <td title=\"Maximum EDM definition of convergence\">GOAL EDM = 5e-06</td>\n", " <td title=\"Error def. Amount of increase in FCN to be defined as 1 standard deviation\">\n", " UP = 0.5</td>\n", " </tr>\n", "</table>\n", "<table>\n", " <tr>\n", " <td align=\"center\" title=\"Validity of the migrad call\">Valid</td>\n", " <td align=\"center\" title=\"Validity of parameters\">Valid Param</td>\n", " <td align=\"center\" title=\"Is Covariance matrix accurate?\">Accurate Covar</td>\n", " <td align=\"center\" title=\"Positive definiteness of covariance matrix\">PosDef</td>\n", " <td align=\"center\" title=\"Was covariance matrix made posdef by adding diagonal element\">Made PosDef</td>\n", " </tr>\n", " <tr>\n", " <td align=\"center\" style=\"background-color:#92CCA6\">True</td>\n", " <td align=\"center\" style=\"background-color:#92CCA6\">True</td>\n", " <td align=\"center\" style=\"background-color:#FF7878\">False</td>\n", " <td align=\"center\" style=\"background-color:#FF7878\">False</td>\n", " <td align=\"center\" style=\"background-color:#FF7878\">True</td>\n", " </tr>\n", " <tr>\n", " <td align=\"center\" title=\"Was last hesse call fail?\">Hesse Fail</td>\n", " <td align=\"center\" title=\"Validity of covariance\">HasCov</td>\n", " <td align=\"center\" title=\"Is EDM above goal EDM?\">Above EDM</td>\n", " <td align=\"center\"></td>\n", " <td align=\"center\" title=\"Did last migrad call reach max call limit?\">Reach calllim</td>\n", " </tr>\n", " <tr>\n", " <td align=\"center\" style=\"background-color:#92CCA6\">False</td>\n", " <td align=\"center\" style=\"background-color:#92CCA6\">True</td>\n", " <td align=\"center\" style=\"background-color:#92CCA6\">False</td>\n", " <td align=\"center\"></td>\n", " <td align=\"center\" style=\"background-color:#92CCA6\">False</td>\n", " </tr>\n", "</table>" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "<table>\n", " <tr>\n", " <td><a href=\"#\" onclick=\"$('#mfLVoBAVNv').toggle()\">+</a></td>\n", " <td title=\"Variable name\">Name</td>\n", " <td title=\"Value of parameter\">Value</td>\n", " <td title=\"Hesse error\">Hesse Error</td>\n", " <td title=\"Minos lower error\">Minos Error-</td>\n", " <td title=\"Minos upper error\">Minos Error+</td>\n", " <td title=\"Lower limit of the parameter\">Limit-</td>\n", " <td title=\"Upper limit of the parameter\">Limit+</td>\n", " <td title=\"Is the parameter fixed in the fit\">Fixed?</td>\n", " </tr>\n", " <tr>\n", " <td>0</td>\n", " <td>jpsi_p</td>\n", " <td>-1.5</td>\n", " <td>nan</td>\n", " <td></td>\n", " <td></td>\n", " <td></td>\n", " <td></td>\n", " <td>No</td>\n", " </tr>\n", " <tr>\n", " <td>1</td>\n", " <td>psi2s_p</td>\n", " <td>-1.5</td>\n", " <td>nan</td>\n", " <td></td>\n", " <td></td>\n", " <td></td>\n", " <td></td>\n", " <td>No</td>\n", " </tr>\n", " <tr>\n", " <td>2</td>\n", " <td>psi2s_s</td>\n", " <td>23.07</td>\n", " <td>nan</td>\n", " <td></td>\n", " <td></td>\n", " <td></td>\n", " <td></td>\n", " <td>No</td>\n", " </tr>\n", " <tr>\n", " <td>3</td>\n", " <td>jpsi_s</td>\n", " <td>184.39</td>\n", " <td>nan</td>\n", " <td></td>\n", " <td></td>\n", " <td></td>\n", " <td></td>\n", " <td>No</td>\n", " </tr>\n", "</table>\n", "<pre id=\"mfLVoBAVNv\" style=\"display:none;\">\n", "<textarea rows=\"14\" cols=\"50\" onclick=\"this.select()\" readonly>\n", "\\begin{tabular}{|c|r|r|r|r|r|r|r|c|}\n", "\\hline\n", " & Name & Value & Hesse Error & Minos Error- & Minos Error+ & Limit- & Limit+ & Fixed?\\\\\n", "\\hline\n", "0 & $jpsi_{p}$ & -1.5 & nan & & & & & No\\\\\n", "\\hline\n", "1 & $psi2s_{p}$ & -1.5 & nan & & & & & No\\\\\n", "\\hline\n", "2 & $psi2s_{s}$ & 23.07 & nan & & & & & No\\\\\n", "\\hline\n", "3 & $jpsi_{s}$ & 184.39 & nan & & & & & No\\\\\n", "\\hline\n", "\\end{tabular}\n", "</textarea>\n", "</pre>" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "<hr>" ] }, "metadata": {}, "output_type": "display_data" }, { "ename": "RuntimeError", "evalue": "exception was raised in user function\nUser function arguments:\n jpsi_p = -nan(ind)\n psi2s_p = +nan\n psi2s_s = +nan\n jpsi_s = +nan\nOriginal python exception in user function:\nKeyboardInterrupt: \n File \"c:\\users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\zfit\\minimizers\\minimizer_minuit.py\", line 48, in func\n loss_evaluated = self.sess.run(loss_val)\n File \"c:\\users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\tensorflow\\python\\client\\session.py\", line 929, in run\n run_metadata_ptr)\n File \"c:\\users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\tensorflow\\python\\client\\session.py\", line 1152, in _run\n feed_dict_tensor, options, run_metadata)\n File \"c:\\users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\tensorflow\\python\\client\\session.py\", line 1328, in _do_run\n run_metadata)\n File \"c:\\users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\tensorflow\\python\\client\\session.py\", line 1334, in _do_call\n return fn(*args)\n File \"c:\\users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\tensorflow\\python\\client\\session.py\", line 1319, in _run_fn\n options, feed_dict, fetch_list, target_list, run_metadata)\n File \"c:\\users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\tensorflow\\python\\client\\session.py\", line 1407, in _call_tf_sessionrun\n run_metadata)\n", "output_type": "error", "traceback": [ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[1;31mRuntimeError\u001b[0m Traceback (most recent call last)", "\u001b[1;32m<ipython-input-26-17821450db47>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[0mresult\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mminimizer\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mminimize\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mnll\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 6\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 7\u001b[1;33m \u001b[0mparam_errors\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mresult\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0merror\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 8\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 9\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mvar\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0merrors\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mparam_errors\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mitems\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32mc:\\users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\zfit\\minimizers\\fitresult.py\u001b[0m in \u001b[0;36merror\u001b[1;34m(self, params, method, error_name, sigma)\u001b[0m\n\u001b[0;32m 227\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 228\u001b[0m \u001b[1;32mif\u001b[0m \u001b[0muncached_params\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 229\u001b[1;33m \u001b[0merror_dict\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_error\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mparams\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0muncached_params\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mmethod\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mmethod\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0msigma\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0msigma\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 230\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0m_cache_errors\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0merror_name\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0merror_name\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0merrors\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0merror_dict\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 231\u001b[0m \u001b[0mall_errors\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mOrderedDict\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mp\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mself\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mparams\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mp\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0merror_name\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mp\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mparams\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32mc:\\users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\zfit\\minimizers\\fitresult.py\u001b[0m in \u001b[0;36m_error\u001b[1;34m(self, params, method, sigma)\u001b[0m\n\u001b[0;32m 238\u001b[0m \u001b[1;32mexcept\u001b[0m \u001b[0mKeyError\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 239\u001b[0m \u001b[1;32mraise\u001b[0m \u001b[0mKeyError\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;34m\"The following method is not a valid, implemented method: {}\"\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mmethod\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m--> 240\u001b[1;33m \u001b[1;32mreturn\u001b[0m \u001b[0mmethod\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mresult\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mself\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mparams\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mparams\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0msigma\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0msigma\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 241\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 242\u001b[0m \u001b[1;31m# def set_error_method(self, method):\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32mc:\\users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\zfit\\minimizers\\fitresult.py\u001b[0m in \u001b[0;36m_minos_minuit\u001b[1;34m(result, params, sigma)\u001b[0m\n\u001b[0;32m 46\u001b[0m \"`MinuitMinimizer`.\")\n\u001b[0;32m 47\u001b[0m result = [minimizer._minuit_minimizer.minos(var=p.name, sigma=sigma)\n\u001b[1;32m---> 48\u001b[1;33m for p in params][-1] # returns every var\n\u001b[0m\u001b[0;32m 49\u001b[0m \u001b[0mresult\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mOrderedDict\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mp\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mresult\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mp\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mparams\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 50\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32mc:\\users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\zfit\\minimizers\\fitresult.py\u001b[0m in \u001b[0;36m<listcomp>\u001b[1;34m(.0)\u001b[0m\n\u001b[0;32m 46\u001b[0m \"`MinuitMinimizer`.\")\n\u001b[0;32m 47\u001b[0m result = [minimizer._minuit_minimizer.minos(var=p.name, sigma=sigma)\n\u001b[1;32m---> 48\u001b[1;33m for p in params][-1] # returns every var\n\u001b[0m\u001b[0;32m 49\u001b[0m \u001b[0mresult\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mOrderedDict\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mp\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mresult\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mname\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mp\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mparams\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 50\u001b[0m \u001b[1;32mreturn\u001b[0m \u001b[0mresult\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;32miminuit\\_libiminuit.pyx\u001b[0m in \u001b[0;36miminuit._libiminuit.Minuit.minos\u001b[1;34m()\u001b[0m\n", "\u001b[1;31mRuntimeError\u001b[0m: exception was raised in user function\nUser function arguments:\n jpsi_p = -nan(ind)\n psi2s_p = +nan\n psi2s_s = +nan\n jpsi_s = +nan\nOriginal python exception in user function:\nKeyboardInterrupt: \n File \"c:\\users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\zfit\\minimizers\\minimizer_minuit.py\", line 48, in func\n loss_evaluated = self.sess.run(loss_val)\n File \"c:\\users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\tensorflow\\python\\client\\session.py\", line 929, in run\n run_metadata_ptr)\n File \"c:\\users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\tensorflow\\python\\client\\session.py\", line 1152, in _run\n feed_dict_tensor, options, run_metadata)\n File \"c:\\users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\tensorflow\\python\\client\\session.py\", line 1328, in _do_run\n run_metadata)\n File \"c:\\users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\tensorflow\\python\\client\\session.py\", line 1334, in _do_call\n return fn(*args)\n File \"c:\\users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\tensorflow\\python\\client\\session.py\", line 1319, in _run_fn\n options, feed_dict, fetch_list, target_list, run_metadata)\n File \"c:\\users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\tensorflow\\python\\client\\session.py\", line 1407, in _call_tf_sessionrun\n run_metadata)\n" ] } ], "source": [ "nll = zfit.loss.UnbinnedNLL(model=total_f, data=data3, fit_range = (x_min, x_max))\n", "\n", "minimizer = zfit.minimize.MinuitMinimizer()\n", "minimizer._use_tfgrad = False\n", "result = minimizer.minimize(nll)\n", "\n", "param_errors = result.error()\n", "\n", "for var, errors in param_errors.items():\n", " print('{}: ^{{+{}}}_{{{}}}'.format(var.name, errors['upper'], errors['lower']))\n", "\n", "print(\"Function minimum:\", result.fmin)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "(-7.95933+2*np.pi)/np.pi+np.pi" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "display_time(int(395*pdg[\"number_of_decays\"]/100000))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "print(display_time(22376))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "# probs = total_f.pdf(test_q)\n", "\n", "calcs_test = zfit.run(probs)\n", "res_y = zfit.run(jpsi_res(test_q))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.clf()\n", "# plt.plot(x_part, calcs, '.')\n", "plt.plot(test_q, calcs_test, label = 'pdf')\n", "# plt.plot(test_q, res_y, label = 'res')\n", "plt.legend()\n", "plt.ylim(0.0, 5e-4)\n", "# plt.yscale('log')\n", "# plt.xlim(3080, 3110)\n", "plt.savefig('test3.png')\n", "print(jpsi_width)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.3" } }, "nbformat": 4, "nbformat_minor": 2 }