Newer
Older
Master_thesis / raremodel-nb.ipynb
{
 "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:57: 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 os\n",
    "\n",
    "# os.environ[\"CUDA_VISIBLE_DEVICES\"] = \"-1\"\n",
    "\n",
    "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\n",
    "import tensorflow_probability as tfp\n",
    "tfd = tfp.distributions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# chunksize = 10000\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": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def formfactor(q2, subscript, b0_0, b0_1, b0_2, bplus_0, bplus_1, bplus_2, bT_0, bT_1, bT_2): #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",
    "\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",
    "        b0 = [b0_0, b0_1, b0_2]\n",
    "\n",
    "        for i in range(N):\n",
    "            _sum += b0[i]*(tf.pow(z,i))\n",
    "\n",
    "        return ztf.to_complex(prefactor * _sum)\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",
    "            bT = [bT_0, bT_1, bT_2]\n",
    "            for i in range(N):\n",
    "                _sum += bT[i] * (tf.pow(z, i) - ((-1)**(i-N)) * (i/N) * tf.pow(z, N))\n",
    "        else:\n",
    "            bplus = [bplus_0, bplus_1, bplus_2]\n",
    "            for i in range(N):\n",
    "                _sum += bplus[i] * (tf.pow(z, i) - ((-1)**(i-N)) * (i/N) * tf.pow(z, N))\n",
    "\n",
    "        return ztf.to_complex(prefactor * _sum)\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, q) * _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",
    "\n",
    "def axiv_nonres(q, b0_0, b0_1, b0_2, bplus_0, bplus_1, bplus_2, bT_0, bT_1, bT_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",
    "    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 = 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. * tf.pow(kabs,2) * tf.pow(beta,2) * tf.pow(tf.abs(ztf.to_complex(C10eff)*formfactor(q2, \"+\", b0_0, b0_1, b0_2, bplus_0, bplus_1, bplus_2, bT_0, bT_1, bT_2)),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(ztf.to_complex(C10eff) * formfactor(q2, \"0\", b0_0, b0_1, b0_2, bplus_0, bplus_1, bplus_2, bT_0, bT_1, bT_2)), 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 * q\n",
    "\n",
    "def vec(q, funcs, b0_0, b0_1, b0_2, bplus_0, bplus_1, bplus_2, bT_0, bT_1, bT_2):\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 = 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 = tf.pow(kabs,2) * (1. - 1./3. * beta)\n",
    "\n",
    "    abs_bracket = tf.pow(tf.abs(c9eff(q, funcs) * formfactor(q2, \"+\", b0_0, b0_1, b0_2, bplus_0, bplus_1, bplus_2, bT_0, bT_1, bT_2) + ztf.to_complex(2.0 * C7eff * (mb + ms)/(mB + mK)) * formfactor(q2, \"T\", b0_0, b0_1, b0_2, bplus_0, bplus_1, bplus_2, bT_0, bT_1, bT_2)),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 * q\n",
    "\n",
    "def c9eff(q, funcs):\n",
    "\n",
    "    C9eff_nr = ztf.to_complex(ztf.constant(pdg['C9eff']))\n",
    "\n",
    "    c9 = C9eff_nr + 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(tf.math.real(-q))))\n",
    "    \n",
    "    big_bracket = tf.where(tf.math.real(y) > ztf.constant(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) - ztf.to_complex(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) - ztf.to_complex(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_cut(zfit.pdf.ZPDF):\n",
    "    _N_OBS = 1  # dimension, can be omitted\n",
    "    _PARAMS = ['b0_0', 'b0_1', 'b0_2', \n",
    "               'bplus_0', 'bplus_1', 'bplus_2', \n",
    "               'bT_0', 'bT_1', 'bT_2', \n",
    "               'rho_mass', 'rho_scale', 'rho_phase', 'rho_width',\n",
    "               'jpsi_mass', 'jpsi_scale', 'jpsi_phase', 'jpsi_width',\n",
    "               'psi2s_mass', 'psi2s_scale', 'psi2s_phase', 'psi2s_width',\n",
    "               'p3770_mass', 'p3770_scale', 'p3770_phase', 'p3770_width',\n",
    "               'p4040_mass', 'p4040_scale', 'p4040_phase', 'p4040_width',\n",
    "               'p4160_mass', 'p4160_scale', 'p4160_phase', 'p4160_width',\n",
    "               'p4415_mass', 'p4415_scale', 'p4415_phase', 'p4415_width',\n",
    "               'omega_mass', 'omega_scale', 'omega_phase', 'omega_width',\n",
    "               'phi_mass', 'phi_scale', 'phi_phase', 'phi_width',\n",
    "               'Dbar_mass', 'Dbar_scale', 'Dbar_phase',\n",
    "               'Dstar_mass', 'DDstar_scale', 'DDstar_phase', 'D_mass',\n",
    "               'tau_mass', 'C_tt']\n",
    "# the name of the parameters\n",
    "\n",
    "    def _unnormalized_pdf(self, x):\n",
    "        \n",
    "        x = x.unstack_x()\n",
    "        \n",
    "        b0 = [self.params['b0_0'], self.params['b0_1'], self.params['b0_2']]\n",
    "        bplus = [self.params['bplus_0'], self.params['bplus_1'], self.params['bplus_2']]\n",
    "        bT = [self.params['bT_0'], self.params['bT_1'], self.params['bT_2']]\n",
    "        \n",
    "        def rho_res(q):\n",
    "            return resonance(q, _mass = self.params['rho_mass'], scale = self.params['rho_scale'],\n",
    "                             phase = self.params['rho_phase'], width = self.params['rho_width'])\n",
    "    \n",
    "        def omega_res(q):\n",
    "            return resonance(q, _mass = self.params['omega_mass'], scale = self.params['omega_scale'],\n",
    "                             phase = self.params['omega_phase'], width = self.params['omega_width'])\n",
    "        \n",
    "        def phi_res(q):\n",
    "            return resonance(q, _mass = self.params['phi_mass'], scale = self.params['phi_scale'],\n",
    "                             phase = self.params['phi_phase'], width = self.params['phi_width'])\n",
    "\n",
    "        def jpsi_res(q):\n",
    "            return  ztf.to_complex(tf.pow(q, 2) / tf.pow(self.params['jpsi_mass'], 2)) * resonance(q, _mass = self.params['jpsi_mass'], \n",
    "                                                                                  scale = self.params['jpsi_scale'],\n",
    "                                                                                  phase = self.params['jpsi_phase'], \n",
    "                                                                                  width = self.params['jpsi_width'])\n",
    "        def psi2s_res(q):\n",
    "            return ztf.to_complex(tf.pow(q, 2) / tf.pow(self.params['psi2s_mass'], 2)) * resonance(q, _mass = self.params['psi2s_mass'], \n",
    "                                                                                   scale = self.params['psi2s_scale'],\n",
    "                                                                                   phase = self.params['psi2s_phase'], \n",
    "                                                                                   width = self.params['psi2s_width'])\n",
    "        def p3770_res(q):\n",
    "            return ztf.to_complex(tf.pow(q, 2) / tf.pow(self.params['p3770_mass'], 2)) * resonance(q, _mass = self.params['p3770_mass'], \n",
    "                                                                                   scale = self.params['p3770_scale'],\n",
    "                                                                                   phase = self.params['p3770_phase'], \n",
    "                                                                                   width = self.params['p3770_width'])\n",
    "        \n",
    "        def p4040_res(q):\n",
    "            return ztf.to_complex(tf.pow(q, 2) / tf.pow(self.params['p4040_mass'], 2)) * resonance(q, _mass = self.params['p4040_mass'], \n",
    "                                                                                   scale = self.params['p4040_scale'],\n",
    "                                                                                   phase = self.params['p4040_phase'], \n",
    "                                                                                   width = self.params['p4040_width'])\n",
    "        \n",
    "        def p4160_res(q):\n",
    "            return ztf.to_complex(tf.pow(q, 2) / tf.pow(self.params['p4160_mass'], 2)) * resonance(q, _mass = self.params['p4160_mass'], \n",
    "                                                                                   scale = self.params['p4160_scale'],\n",
    "                                                                                   phase = self.params['p4160_phase'], \n",
    "                                                                                   width = self.params['p4160_width'])\n",
    "        \n",
    "        def p4415_res(q):\n",
    "            return ztf.to_complex(tf.pow(q, 2) / tf.pow(self.params['p4415_mass'], 2)) * resonance(q, _mass = self.params['p4415_mass'], \n",
    "                                                                                   scale = self.params['p4415_scale'],\n",
    "                                                                                   phase = self.params['p4415_phase'], \n",
    "                                                                                   width = self.params['p4415_width'])\n",
    "        \n",
    "        def P2_D(q):\n",
    "            Dbar_contrib = ztf.to_complex(self.params['Dbar_scale'])*tf.exp(tf.complex(ztf.constant(0.0), self.params['Dbar_phase']))*ztf.to_complex(h_S(self.params['Dbar_mass'], q))\n",
    "            DDstar_contrib = ztf.to_complex(self.params['DDstar_scale'])*tf.exp(tf.complex(ztf.constant(0.0), self.params['DDstar_phase']))*(ztf.to_complex(h_P(self.params['Dstar_mass'], q)) + ztf.to_complex(h_P(self.params['D_mass'], q)))\n",
    "            return Dbar_contrib + DDstar_contrib\n",
    "        \n",
    "        def ttau_cusp(q):\n",
    "            return ztf.to_complex(self.params['C_tt'])*(ztf.to_complex((h_S(self.params['tau_mass'], q))) - ztf.to_complex(h_P(self.params['tau_mass'], q)))\n",
    "        \n",
    "\n",
    "        funcs = rho_res(x) + omega_res(x) + phi_res(x) + jpsi_res(x) + psi2s_res(x) + p3770_res(x) + p4040_res(x)+ p4160_res(x) + p4415_res(x) + P2_D(x) + ttau_cusp(x)\n",
    "\n",
    "        vec_f = vec(x, funcs, b0_0, b0_1, b0_2, bplus_0, bplus_1, bplus_2, bT_0, bT_1, bT_2)\n",
    "\n",
    "        axiv_nr = axiv_nonres(x, b0_0, b0_1, b0_2, bplus_0, bplus_1, bplus_2, bT_0, bT_1, bT_2)\n",
    "\n",
    "        tot = vec_f + axiv_nr\n",
    "        \n",
    "        #Cut out jpsi and psi2s\n",
    "        \n",
    "        tot = tf.where(tf.math.logical_or(x < ztf.constant(jpsi_mass-60.), x > ztf.constant(jpsi_mass+70.)), tot, 0.0*tot)\n",
    "        \n",
    "        tot = tf.where(tf.math.logical_or(x < ztf.constant(psi2s_mass-50.), x > ztf.constant(psi2s_mass+50.)), tot, 0.0*tot)\n",
    "        \n",
    "        return tot\n",
    "    \n",
    "class total_pdf_full(zfit.pdf.ZPDF):\n",
    "    _N_OBS = 1  # dimension, can be omitted\n",
    "    _PARAMS = ['b0_0', 'b0_1', 'b0_2', \n",
    "               'bplus_0', 'bplus_1', 'bplus_2', \n",
    "               'bT_0', 'bT_1', 'bT_2', \n",
    "               'rho_mass', 'rho_scale', 'rho_phase', 'rho_width',\n",
    "               'jpsi_mass', 'jpsi_scale', 'jpsi_phase', 'jpsi_width',\n",
    "               'psi2s_mass', 'psi2s_scale', 'psi2s_phase', 'psi2s_width',\n",
    "               'p3770_mass', 'p3770_scale', 'p3770_phase', 'p3770_width',\n",
    "               'p4040_mass', 'p4040_scale', 'p4040_phase', 'p4040_width',\n",
    "               'p4160_mass', 'p4160_scale', 'p4160_phase', 'p4160_width',\n",
    "               'p4415_mass', 'p4415_scale', 'p4415_phase', 'p4415_width',\n",
    "               'omega_mass', 'omega_scale', 'omega_phase', 'omega_width',\n",
    "               'phi_mass', 'phi_scale', 'phi_phase', 'phi_width',\n",
    "               'Dbar_mass', 'Dbar_scale', 'Dbar_phase',\n",
    "               'Dstar_mass', 'DDstar_scale', 'DDstar_phase', 'D_mass',\n",
    "               'tau_mass', 'C_tt']\n",
    "# the name of the parameters\n",
    "\n",
    "    def _unnormalized_pdf(self, x):\n",
    "        \n",
    "        x = x.unstack_x()\n",
    "        \n",
    "        b0 = [self.params['b0_0'], self.params['b0_1'], self.params['b0_2']]\n",
    "        bplus = [self.params['bplus_0'], self.params['bplus_1'], self.params['bplus_2']]\n",
    "        bT = [self.params['bT_0'], self.params['bT_1'], self.params['bT_2']]\n",
    "        \n",
    "        def rho_res(q):\n",
    "            return resonance(q, _mass = self.params['rho_mass'], scale = self.params['rho_scale'],\n",
    "                             phase = self.params['rho_phase'], width = self.params['rho_width'])\n",
    "    \n",
    "        def omega_res(q):\n",
    "            return resonance(q, _mass = self.params['omega_mass'], scale = self.params['omega_scale'],\n",
    "                             phase = self.params['omega_phase'], width = self.params['omega_width'])\n",
    "        \n",
    "        def phi_res(q):\n",
    "            return resonance(q, _mass = self.params['phi_mass'], scale = self.params['phi_scale'],\n",
    "                             phase = self.params['phi_phase'], width = self.params['phi_width'])\n",
    "\n",
    "        def jpsi_res(q):\n",
    "            return  ztf.to_complex(tf.pow(q, 2) / tf.pow(self.params['jpsi_mass'], 2)) * resonance(q, _mass = self.params['jpsi_mass'], \n",
    "                                                                                  scale = self.params['jpsi_scale'],\n",
    "                                                                                  phase = self.params['jpsi_phase'], \n",
    "                                                                                  width = self.params['jpsi_width'])\n",
    "        def psi2s_res(q):\n",
    "            return ztf.to_complex(tf.pow(q, 2) / tf.pow(self.params['psi2s_mass'], 2)) * resonance(q, _mass = self.params['psi2s_mass'], \n",
    "                                                                                   scale = self.params['psi2s_scale'],\n",
    "                                                                                   phase = self.params['psi2s_phase'], \n",
    "                                                                                   width = self.params['psi2s_width'])\n",
    "        def p3770_res(q):\n",
    "            return ztf.to_complex(tf.pow(q, 2) / tf.pow(self.params['p3770_mass'], 2)) * resonance(q, _mass = self.params['p3770_mass'], \n",
    "                                                                                   scale = self.params['p3770_scale'],\n",
    "                                                                                   phase = self.params['p3770_phase'], \n",
    "                                                                                   width = self.params['p3770_width'])\n",
    "        \n",
    "        def p4040_res(q):\n",
    "            return ztf.to_complex(tf.pow(q, 2) / tf.pow(self.params['p4040_mass'], 2)) * resonance(q, _mass = self.params['p4040_mass'], \n",
    "                                                                                   scale = self.params['p4040_scale'],\n",
    "                                                                                   phase = self.params['p4040_phase'], \n",
    "                                                                                   width = self.params['p4040_width'])\n",
    "        \n",
    "        def p4160_res(q):\n",
    "            return ztf.to_complex(tf.pow(q, 2) / tf.pow(self.params['p4160_mass'], 2)) * resonance(q, _mass = self.params['p4160_mass'], \n",
    "                                                                                   scale = self.params['p4160_scale'],\n",
    "                                                                                   phase = self.params['p4160_phase'], \n",
    "                                                                                   width = self.params['p4160_width'])\n",
    "        \n",
    "        def p4415_res(q):\n",
    "            return ztf.to_complex(tf.pow(q, 2) / tf.pow(self.params['p4415_mass'], 2)) * resonance(q, _mass = self.params['p4415_mass'], \n",
    "                                                                                   scale = self.params['p4415_scale'],\n",
    "                                                                                   phase = self.params['p4415_phase'], \n",
    "                                                                                   width = self.params['p4415_width'])\n",
    "        \n",
    "        def P2_D(q):\n",
    "            Dbar_contrib = ztf.to_complex(self.params['Dbar_scale'])*tf.exp(tf.complex(ztf.constant(0.0), self.params['Dbar_phase']))*ztf.to_complex(h_S(self.params['Dbar_mass'], q))\n",
    "            DDstar_contrib = ztf.to_complex(self.params['DDstar_scale'])*tf.exp(tf.complex(ztf.constant(0.0), self.params['DDstar_phase']))*(ztf.to_complex(h_P(self.params['Dstar_mass'], q)) + ztf.to_complex(h_P(self.params['D_mass'], q)))\n",
    "            return Dbar_contrib + DDstar_contrib\n",
    "        \n",
    "        def ttau_cusp(q):\n",
    "            return ztf.to_complex(self.params['C_tt'])*(ztf.to_complex((h_S(self.params['tau_mass'], q))) - ztf.to_complex(h_P(self.params['tau_mass'], q)))\n",
    "        \n",
    "\n",
    "        funcs = rho_res(x) + omega_res(x) + phi_res(x) + jpsi_res(x) + psi2s_res(x) + p3770_res(x) + p4040_res(x)+ p4160_res(x) + p4415_res(x) + P2_D(x) + ttau_cusp(x)\n",
    "\n",
    "        vec_f = vec(x, funcs, b0_0, b0_1, b0_2, bplus_0, bplus_1, bplus_2, bT_0, bT_1, bT_2)\n",
    "\n",
    "        axiv_nr = axiv_nonres(x, b0_0, b0_1, b0_2, bplus_0, bplus_1, bplus_2, bT_0, bT_1, bT_2)\n",
    "\n",
    "        tot = vec_f + axiv_nr\n",
    "        \n",
    "        #Cut out jpsi and psi2s\n",
    "        \n",
    "#         tot = tf.where(tf.math.logical_or(x < ztf.constant(jpsi_mass-60.), x > ztf.constant(jpsi_mass+70.)), tot, 0.0*tot)\n",
    "        \n",
    "#         tot = tf.where(tf.math.logical_or(x < ztf.constant(psi2s_mass-50.), x > ztf.constant(psi2s_mass+50.)), tot, 0.0*tot)\n",
    "        \n",
    "        return tot"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Setup parameters"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "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": [
    "# formfactors\n",
    "\n",
    "b0_0 = zfit.Parameter(\"b0_0\", ztf.constant(0.292), floating = False) #, lower_limit = -2.0, upper_limit= 2.0)\n",
    "b0_1 = zfit.Parameter(\"b0_1\", ztf.constant(0.281), floating = False) #, lower_limit = -2.0, upper_limit= 2.0)\n",
    "b0_2 = zfit.Parameter(\"b0_2\", ztf.constant(0.150), floating = False) #, lower_limit = -2.0, upper_limit= 2.0)\n",
    "\n",
    "bplus_0 = zfit.Parameter(\"bplus_0\", ztf.constant(0.466), floating = False)#, lower_limit = -2.0, upper_limit= 2.0)\n",
    "bplus_1 = zfit.Parameter(\"bplus_1\", ztf.constant(-0.885), floating = False)#, lower_limit = -2.0, upper_limit= 2.0)\n",
    "bplus_2 = zfit.Parameter(\"bplus_2\", ztf.constant(-0.213), floating = False)#, lower_limit = -2.0, upper_limit= 2.0)\n",
    "\n",
    "bT_0 = zfit.Parameter(\"bT_0\", ztf.constant(0.460), floating = False) #, lower_limit = -2.0, upper_limit= 2.0)\n",
    "bT_1 = zfit.Parameter(\"bT_1\", ztf.constant(-1.089), floating = False) #, lower_limit = -2.0, upper_limit= 2.0)\n",
    "bT_2 = zfit.Parameter(\"bT_2\", ztf.constant(-1.114), floating = False) #, lower_limit = -2.0, upper_limit= 2.0)\n",
    "\n",
    "\n",
    "#rho\n",
    "\n",
    "rho_mass, rho_width, rho_phase, rho_scale = pdg[\"rho\"]\n",
    "\n",
    "rho_m = zfit.Parameter(\"rho_m\", ztf.constant(rho_mass), floating = False) #lower_limit = rho_mass - rho_width, upper_limit = rho_mass + rho_width)\n",
    "rho_w = zfit.Parameter(\"rho_w\", ztf.constant(rho_width), floating = False)\n",
    "rho_p = zfit.Parameter(\"rho_p\", ztf.constant(rho_phase), lower_limit=-2*np.pi, upper_limit=2*np.pi)\n",
    "rho_s = zfit.Parameter(\"rho_s\", ztf.constant(rho_scale), lower_limit=rho_scale-np.sqrt(rho_scale), upper_limit=rho_scale+np.sqrt(rho_scale))\n",
    "\n",
    "#omega\n",
    "\n",
    "omega_mass, omega_width, omega_phase, omega_scale = pdg[\"omega\"]\n",
    "\n",
    "omega_m = zfit.Parameter(\"omega_m\", ztf.constant(omega_mass), floating = False)\n",
    "omega_w = zfit.Parameter(\"omega_w\", ztf.constant(omega_width), floating = False)\n",
    "omega_p = zfit.Parameter(\"omega_p\", ztf.constant(omega_phase), lower_limit=-2*np.pi, upper_limit=2*np.pi)\n",
    "omega_s = zfit.Parameter(\"omega_s\", ztf.constant(omega_scale), lower_limit=omega_scale-np.sqrt(omega_scale), upper_limit=omega_scale+np.sqrt(omega_scale))\n",
    "\n",
    "\n",
    "#phi\n",
    "\n",
    "phi_mass, phi_width, phi_phase, phi_scale = pdg[\"phi\"]\n",
    "\n",
    "phi_m = zfit.Parameter(\"phi_m\", ztf.constant(phi_mass), floating = False)\n",
    "phi_w = zfit.Parameter(\"phi_w\", ztf.constant(phi_width), floating = False)\n",
    "phi_p = zfit.Parameter(\"phi_p\", ztf.constant(phi_phase), lower_limit=-2*np.pi, upper_limit=2*np.pi)\n",
    "phi_s = zfit.Parameter(\"phi_s\", ztf.constant(phi_scale), lower_limit=phi_scale-np.sqrt(phi_scale), upper_limit=phi_scale+np.sqrt(phi_scale))\n",
    "\n",
    "#jpsi\n",
    "\n",
    "jpsi_mass, jpsi_width, jpsi_phase, jpsi_scale = pdg[\"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), lower_limit=-2*np.pi, upper_limit=2*np.pi)\n",
    "jpsi_s = zfit.Parameter(\"jpsi_s\", ztf.constant(jpsi_scale), floating = False) #, lower_limit=jpsi_scale-np.sqrt(jpsi_scale), upper_limit=jpsi_scale+np.sqrt(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), lower_limit=-2*np.pi, upper_limit=2*np.pi)\n",
    "psi2s_s = zfit.Parameter(\"psi2s_s\", ztf.constant(psi2s_scale), floating = False) #, lower_limit=psi2s_scale-np.sqrt(psi2s_scale), upper_limit=psi2s_scale+np.sqrt(psi2s_scale))\n",
    "\n",
    "#psi(3770)\n",
    "\n",
    "p3770_mass, p3770_width, p3770_phase, p3770_scale = pdg[\"p3770\"]\n",
    "\n",
    "p3770_m = zfit.Parameter(\"p3770_m\", ztf.constant(p3770_mass), floating = False)\n",
    "p3770_w = zfit.Parameter(\"p3770_w\", ztf.constant(p3770_width), floating = False)\n",
    "p3770_p = zfit.Parameter(\"p3770_p\", ztf.constant(p3770_phase), lower_limit=-2*np.pi, upper_limit=2*np.pi)\n",
    "p3770_s = zfit.Parameter(\"p3770_s\", ztf.constant(p3770_scale), lower_limit=p3770_scale-np.sqrt(p3770_scale), upper_limit=p3770_scale+np.sqrt(p3770_scale))\n",
    "\n",
    "#psi(4040)\n",
    "\n",
    "p4040_mass, p4040_width, p4040_phase, p4040_scale = pdg[\"p4040\"]\n",
    "\n",
    "p4040_m = zfit.Parameter(\"p4040_m\", ztf.constant(p4040_mass), floating = False)\n",
    "p4040_w = zfit.Parameter(\"p4040_w\", ztf.constant(p4040_width), floating = False)\n",
    "p4040_p = zfit.Parameter(\"p4040_p\", ztf.constant(p4040_phase), lower_limit=-2*np.pi, upper_limit=2*np.pi)\n",
    "p4040_s = zfit.Parameter(\"p4040_s\", ztf.constant(p4040_scale), lower_limit=p4040_scale-np.sqrt(p4040_scale), upper_limit=p4040_scale+np.sqrt(p4040_scale))\n",
    "\n",
    "#psi(4160)\n",
    "\n",
    "p4160_mass, p4160_width, p4160_phase, p4160_scale = pdg[\"p4160\"]\n",
    "\n",
    "p4160_m = zfit.Parameter(\"p4160_m\", ztf.constant(p4160_mass), floating = False)\n",
    "p4160_w = zfit.Parameter(\"p4160_w\", ztf.constant(p4160_width), floating = False)\n",
    "p4160_p = zfit.Parameter(\"p4160_p\", ztf.constant(p4160_phase), lower_limit=-2*np.pi, upper_limit=2*np.pi)\n",
    "p4160_s = zfit.Parameter(\"p4160_s\", ztf.constant(p4160_scale), lower_limit=p4160_scale-np.sqrt(p4160_scale), upper_limit=p4160_scale+np.sqrt(p4160_scale))\n",
    "\n",
    "#psi(4415)\n",
    "\n",
    "p4415_mass, p4415_width, p4415_phase, p4415_scale = pdg[\"p4415\"]\n",
    "\n",
    "p4415_m = zfit.Parameter(\"p4415_m\", ztf.constant(p4415_mass), floating = False)\n",
    "p4415_w = zfit.Parameter(\"p4415_w\", ztf.constant(p4415_width), floating = False)\n",
    "p4415_p = zfit.Parameter(\"p4415_p\", ztf.constant(p4415_phase), lower_limit=-2*np.pi, upper_limit=2*np.pi)\n",
    "p4415_s = zfit.Parameter(\"p4415_s\", ztf.constant(p4415_scale), lower_limit=p4415_scale-np.sqrt(p4415_scale), upper_limit=p4415_scale+np.sqrt(p4415_scale))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Dynamic generation of 2 particle contribution"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "m_c = 1300\n",
    "\n",
    "Dbar_phase = 0.0\n",
    "DDstar_phase = 0.0\n",
    "Dstar_mass = pdg['Dst_M']\n",
    "Dbar_mass = pdg['D0_M']\n",
    "D_mass = pdg['D0_M']\n",
    "\n",
    "Dbar_s = zfit.Parameter(\"Dbar_s\", ztf.constant(0.0), lower_limit=-0.3, upper_limit=0.3)\n",
    "Dbar_m = zfit.Parameter(\"Dbar_m\", ztf.constant(Dbar_mass), floating = False)\n",
    "Dbar_p = zfit.Parameter(\"Dbar_p\", ztf.constant(Dbar_phase), lower_limit=-2*np.pi, upper_limit=2*np.pi)#, floating = False)\n",
    "DDstar_s = zfit.Parameter(\"DDstar_s\", ztf.constant(0.0), lower_limit=-0.3, upper_limit=0.3)#, floating = False)\n",
    "Dstar_m = zfit.Parameter(\"Dstar_m\", ztf.constant(Dstar_mass), floating = False)\n",
    "D_m = zfit.Parameter(\"D_m\", ztf.constant(D_mass), floating = False)\n",
    "DDstar_p = zfit.Parameter(\"DDstar_p\", ztf.constant(DDstar_phase), lower_limit=-2*np.pi, upper_limit=2*np.pi)#, floating = False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Tau parameters"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "tau_m = zfit.Parameter(\"tau_m\", ztf.constant(pdg['tau_M']), floating = False)\n",
    "Ctt = zfit.Parameter(\"Ctt\", ztf.constant(0.0), lower_limit=-1.5, upper_limit=1.5)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Load data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "x_min = 2*pdg['muon_M']\n",
    "x_max = (pdg[\"Bplus_M\"]-pdg[\"Ks_M\"]-0.1)\n",
    "\n",
    "# # Full spectrum\n",
    "\n",
    "obs_toy = zfit.Space('q', limits = (x_min, x_max))\n",
    "\n",
    "# Jpsi and Psi2s cut out\n",
    "\n",
    "obs1 = zfit.Space('q', limits = (x_min, jpsi_mass - 60.))\n",
    "obs2 = zfit.Space('q', limits = (jpsi_mass + 70., psi2s_mass - 50.))\n",
    "obs3 = zfit.Space('q', limits = (psi2s_mass + 50., x_max))\n",
    "\n",
    "obs_fit = obs1 + obs2 + obs3\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 pdf"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "total_f = total_pdf_cut(obs=obs_toy, 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",
    "                    p3770_mass = p3770_m, p3770_scale = p3770_s, p3770_phase = p3770_p, p3770_width = p3770_w,\n",
    "                    p4040_mass = p4040_m, p4040_scale = p4040_s, p4040_phase = p4040_p, p4040_width = p4040_w,\n",
    "                    p4160_mass = p4160_m, p4160_scale = p4160_s, p4160_phase = p4160_p, p4160_width = p4160_w,\n",
    "                    p4415_mass = p4415_m, p4415_scale = p4415_s, p4415_phase = p4415_p, p4415_width = p4415_w,\n",
    "                    rho_mass = rho_m, rho_scale = rho_s, rho_phase = rho_p, rho_width = rho_w,\n",
    "                    omega_mass = omega_m, omega_scale = omega_s, omega_phase = omega_p, omega_width = omega_w,\n",
    "                    phi_mass = phi_m, phi_scale = phi_s, phi_phase = phi_p, phi_width = phi_w,\n",
    "                    Dstar_mass = Dstar_m, DDstar_scale = DDstar_s, DDstar_phase = DDstar_p, D_mass = D_m,\n",
    "                    Dbar_mass = Dbar_m, Dbar_scale = Dbar_s, Dbar_phase = Dbar_p,\n",
    "                    tau_mass = tau_m, C_tt = Ctt, b0_0 = b0_0, b0_1 = b0_1, b0_2 = b0_2,\n",
    "                    bplus_0 = bplus_0, bplus_1 = bplus_1, bplus_2 = bplus_2,\n",
    "                    bT_0 = bT_0, bT_1 = bT_1, bT_2 = bT_2)\n",
    "\n",
    "total_f_fit = total_pdf_full(obs=obs_fit, 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",
    "                    p3770_mass = p3770_m, p3770_scale = p3770_s, p3770_phase = p3770_p, p3770_width = p3770_w,\n",
    "                    p4040_mass = p4040_m, p4040_scale = p4040_s, p4040_phase = p4040_p, p4040_width = p4040_w,\n",
    "                    p4160_mass = p4160_m, p4160_scale = p4160_s, p4160_phase = p4160_p, p4160_width = p4160_w,\n",
    "                    p4415_mass = p4415_m, p4415_scale = p4415_s, p4415_phase = p4415_p, p4415_width = p4415_w,\n",
    "                    rho_mass = rho_m, rho_scale = rho_s, rho_phase = rho_p, rho_width = rho_w,\n",
    "                    omega_mass = omega_m, omega_scale = omega_s, omega_phase = omega_p, omega_width = omega_w,\n",
    "                    phi_mass = phi_m, phi_scale = phi_s, phi_phase = phi_p, phi_width = phi_w,\n",
    "                    Dstar_mass = Dstar_m, DDstar_scale = DDstar_s, DDstar_phase = DDstar_p, D_mass = D_m,\n",
    "                    Dbar_mass = Dbar_m, Dbar_scale = Dbar_s, Dbar_phase = Dbar_p,\n",
    "                    tau_mass = tau_m, C_tt = Ctt, b0_0 = b0_0, b0_1 = b0_1, b0_2 = b0_2,\n",
    "                    bplus_0 = bplus_0, bplus_1 = bplus_1, bplus_2 = bplus_2,\n",
    "                    bT_0 = bT_0, bT_1 = bT_1, bT_2 = bT_2)\n",
    "                   \n",
    "# print(total_pdf.obs)\n",
    "\n",
    "# print(calcs_test)\n",
    "\n",
    "# for param in total_f.get_dependents():\n",
    "#     print(zfit.run(param))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<tf.Tensor 'normalization/hook_integrate/hook_numeric_integrate/mul_1:0' shape=() dtype=float64>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "total_f_fit.normalization(obs_toy)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Test if graphs actually work and compute values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "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, int(2e6))\n",
    "\n",
    "probs = total_f_fit.pdf(test_q, norm_range=False)\n",
    "\n",
    "calcs_test = zfit.run(probs)\n",
    "# res_y = zfit.run(jpsi_res(test_q))\n",
    "# b0 = [b0_0, b0_1, b0_2]\n",
    "# bplus = [bplus_0, bplus_1, bplus_2]\n",
    "# bT = [bT_0, bT_1, bT_2]\n",
    "# f0_y = zfit.run(tf.math.real(formfactor(test_q,\"0\", b0, bplus, bT)))\n",
    "# fplus_y = zfit.run(tf.math.real(formfactor(test_q,\"+\", b0, bplus, bT)))\n",
    "# fT_y = zfit.run(tf.math.real(formfactor(test_q,\"T\", b0, bplus, bT)))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\ipykernel_launcher.py:12: UserWarning: Creating legend with loc=\"best\" can be slow with large amounts of data.\n",
      "  if sys.path[0] == '':\n",
      "C:\\Users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\IPython\\core\\pylabtools.py:128: UserWarning: Creating legend with loc=\"best\" can be slow with large amounts of data.\n",
      "  fig.canvas.print_figure(bytes_io, **kw)\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAaUAAAD4CAYAAABMtfkzAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhc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rDn4ejsTfh5UZMgzDMNIGC98ZhmEYaYOJkmEYhpE2mCgZhmEYaYOJkmEYhpE2mCgZhmEYaYOJkmEYhpE2mCgZhmEYacP/Dzlc4oUjVCBMAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 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, f0_y, label = '0')\n",
    "# plt.plot(test_q, fT_y, label = 'T')\n",
    "# plt.plot(test_q, fplus_y, label = '+')\n",
    "# plt.plot(test_q, res_y, label = 'res')\n",
    "plt.legend()\n",
    "plt.ylim(0.0, 1.5e-6)\n",
    "# plt.yscale('log')\n",
    "# plt.xlim(770, 785)\n",
    "plt.savefig('test.png')\n",
    "# print(jpsi_width)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "\n",
    "# probs = mixture.prob(test_q)\n",
    "# probs_np = zfit.run(probs)\n",
    "# probs_np *= np.max(calcs_test) / np.max(probs_np)\n",
    "# plt.figure()\n",
    "# plt.semilogy(test_q, probs_np,label=\"importance sampling\")\n",
    "# plt.semilogy(test_q, calcs_test, label = 'pdf')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 0.213/(0.00133+0.213+0.015)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Adjust scaling of different parts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "total_f.update_integration_options(draws_per_dim=2000000, mc_sampler=None)\n",
    "# inte = total_f.integrate(limits = (950., 1050.), norm_range=False)\n",
    "# inte_fl = zfit.run(inte)\n",
    "# print(inte_fl/4500)\n",
    "# print(pdg[\"jpsi_BR\"]/pdg[\"NR_BR\"], inte_fl*pdg[\"psi2s_auc\"]/pdg[\"NR_auc\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "# # print(\"jpsi:\", inte_fl)\n",
    "# # print(\"Increase am by factor:\", np.sqrt(pdg[\"jpsi_BR\"]/pdg[\"NR_BR\"]*pdg[\"NR_auc\"]/inte_fl))\n",
    "# # print(\"New amp:\", pdg[\"jpsi\"][3]*np.sqrt(pdg[\"jpsi_BR\"]/pdg[\"NR_BR\"]*pdg[\"NR_auc\"]/inte_fl))\n",
    "\n",
    "# # print(\"psi2s:\", inte_fl)\n",
    "# # print(\"Increase am by factor:\", np.sqrt(pdg[\"psi2s_BR\"]/pdg[\"NR_BR\"]*pdg[\"NR_auc\"]/inte_fl))\n",
    "# # print(\"New amp:\", pdg[\"psi2s\"][3]*np.sqrt(pdg[\"psi2s_BR\"]/pdg[\"NR_BR\"]*pdg[\"NR_auc\"]/inte_fl))\n",
    "\n",
    "# name = \"phi\"\n",
    "\n",
    "# print(name+\":\", inte_fl)\n",
    "# print(\"Increase am by factor:\", np.sqrt(pdg[name+\"_BR\"]/pdg[\"NR_BR\"]*pdg[\"NR_auc\"]/inte_fl))\n",
    "# print(\"New amp:\", pdg[name][0]*np.sqrt(pdg[name+\"_BR\"]/pdg[\"NR_BR\"]*pdg[\"NR_auc\"]/inte_fl))\n",
    "\n",
    "\n",
    "# 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() - _))))\n",
    "\n",
    "# print(pdg['NR_BR']/pdg['NR_auc']*inte_fl)\n",
    "# print(0.25**2*4.2/1000)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Sampling\n",
    "## Mixture distribution for sampling"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "    \n",
    "# print(list_of_borders[:9])\n",
    "# print(list_of_borders[-9:])\n",
    "\n",
    "\n",
    "class UniformSampleAndWeights(zfit.util.execution.SessionHolderMixin):\n",
    "    def __call__(self, limits, dtype, n_to_produce):\n",
    "        # n_to_produce = tf.cast(n_to_produce, dtype=tf.int32)\n",
    "        low, high = limits.limit1d\n",
    "        low = tf.cast(low, dtype=dtype)\n",
    "        high = tf.cast(high, dtype=dtype)\n",
    "#         uniform = tfd.Uniform(low=low, high=high)\n",
    "#         uniformjpsi = tfd.Uniform(low=tf.constant(3080, dtype=dtype), high=tf.constant(3112, dtype=dtype))\n",
    "#         uniformpsi2s = tfd.Uniform(low=tf.constant(3670, dtype=dtype), high=tf.constant(3702, dtype=dtype))\n",
    "\n",
    "#         list_of_borders = []\n",
    "#         _p = []\n",
    "#         splits = 10\n",
    "\n",
    "#         _ = np.linspace(x_min, x_max, splits)\n",
    "\n",
    "#         for i in range(splits):\n",
    "#             list_of_borders.append(tf.constant(_[i], dtype=dtype))\n",
    "#             _p.append(tf.constant(1/splits, dtype=dtype))\n",
    "    \n",
    "#         mixture = tfd.MixtureSameFamily(mixture_distribution=tfd.Categorical(probs=_p[:(splits-1)]),\n",
    "#                                         components_distribution=tfd.Uniform(low=list_of_borders[:(splits-1)], \n",
    "#                                                                             high=list_of_borders[-(splits-1):]))\n",
    "        mixture = tfd.MixtureSameFamily(mixture_distribution=tfd.Categorical(probs=[tf.constant(0.05, dtype=dtype),\n",
    "                                                                                    tf.constant(0.93, dtype=dtype),\n",
    "                                                                                    tf.constant(0.05, dtype=dtype),\n",
    "                                                                                    tf.constant(0.065, dtype=dtype),\n",
    "                                                                                    tf.constant(0.04, dtype=dtype),\n",
    "                                                                                    tf.constant(0.05, dtype=dtype)]),\n",
    "                                        components_distribution=tfd.Uniform(low=[tf.constant(x_min, dtype=dtype), \n",
    "                                                                                 tf.constant(3090, dtype=dtype),\n",
    "                                                                                 tf.constant(3681, dtype=dtype), \n",
    "                                                                                 tf.constant(3070, dtype=dtype),\n",
    "                                                                                 tf.constant(1000, dtype=dtype),\n",
    "                                                                                 tf.constant(3660, dtype=dtype)], \n",
    "                                                                            high=[tf.constant(x_max, dtype=dtype),\n",
    "                                                                                  tf.constant(3102, dtype=dtype), \n",
    "                                                                                  tf.constant(3691, dtype=dtype),\n",
    "                                                                                  tf.constant(3110, dtype=dtype),\n",
    "                                                                                  tf.constant(1040, dtype=dtype),\n",
    "                                                                                  tf.constant(3710, dtype=dtype)]))\n",
    "#         dtype = tf.float64\n",
    "#         mixture = tfd.MixtureSameFamily(mixture_distribution=tfd.Categorical(probs=[tf.constant(0.04, dtype=dtype),\n",
    "#                                                                                     tf.constant(0.90, dtype=dtype),\n",
    "#                                                                                     tf.constant(0.02, dtype=dtype),\n",
    "#                                                                                     tf.constant(0.07, dtype=dtype),\n",
    "#                                                                                     tf.constant(0.02, dtype=dtype)]),\n",
    "#                                         components_distribution=tfd.Uniform(low=[tf.constant(x_min, dtype=dtype), \n",
    "#                                                                                  tf.constant(3089, dtype=dtype),\n",
    "#                                                                                  tf.constant(3103, dtype=dtype), \n",
    "#                                                                                  tf.constant(3681, dtype=dtype),\n",
    "#                                                                                  tf.constant(3691, dtype=dtype)], \n",
    "#                                                                             high=[tf.constant(3089, dtype=dtype),\n",
    "#                                                                                   tf.constant(3103, dtype=dtype), \n",
    "#                                                                                   tf.constant(3681, dtype=dtype),\n",
    "#                                                                                   tf.constant(3691, dtype=dtype), \n",
    "#                                                                                   tf.constant(x_max, dtype=dtype)]))\n",
    "#         mixture = tfd.Uniform(tf.constant(x_min, dtype=dtype), tf.constant(x_max, dtype=dtype))\n",
    "#         sample = tf.random.uniform((n_to_produce, 1), dtype=dtype)\n",
    "        sample = mixture.sample((n_to_produce, 1))\n",
    "#         sample = tf.random.uniform((n_to_produce, 1), dtype=dtype)\n",
    "        weights = mixture.prob(sample)[:,0]\n",
    "#         weights = tf.broadcast_to(tf.constant(1., dtype=dtype), shape=(n_to_produce,))\n",
    "        # sample = tf.expand_dims(sample, axis=-1)\n",
    "#         print(sample, weights)\n",
    "        \n",
    "#         weights = tf.ones(shape=(n_to_produce,), dtype=dtype)\n",
    "        weights_max = None\n",
    "        thresholds = tf.random_uniform(shape=(n_to_produce,), dtype=dtype)\n",
    "        return sample, thresholds, weights, weights_max, n_to_produce"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "# total_f._sample_and_weights = UniformSampleAndWeights"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 0.00133/(0.00133+0.213+0.015)*(x_max-3750)/(x_max-x_min)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "# zfit.settings.set_verbosity(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "scrolled": false
   },
   "outputs": [],
   "source": [
    "# # zfit.run.numeric_checks = False   \n",
    "\n",
    "# nr_of_toys = 1\n",
    "# nevents = int(pdg[\"number_of_decays\"])\n",
    "# nevents = pdg[\"number_of_decays\"]\n",
    "# event_stack = 1000000\n",
    "# # zfit.settings.set_verbosity(10)\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",
    "        \n",
    "#         print(\"{0}/{1} of Toy {2}/{3}\".format(c, calls, toy+1, nr_of_toys))\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*(toy))*((nr_of_toys-toy)*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": 23,
   "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": 24,
   "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_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": 25,
   "metadata": {},
   "outputs": [],
   "source": [
    "# plt.clf()\n",
    "\n",
    "# bins = int((x_max-x_min)/7)\n",
    "\n",
    "# # calcs = zfit.run(total_test_tf(samp))\n",
    "# print(total_samp[:nevents].shape)\n",
    "\n",
    "# plt.hist(total_samp[:nevents], bins = bins, range = (x_min,x_max), label = 'data')\n",
    "# # plt.plot(test_q, calcs_test*nevents , label = 'pdf')\n",
    "\n",
    "# # plt.plot(sam, calcs, '.')\n",
    "# # plt.plot(test_q, calcs_test)\n",
    "# # plt.yscale('log')\n",
    "# plt.ylim(0, 200)\n",
    "# # plt.xlim(3080, 3110)\n",
    "\n",
    "# plt.legend()\n",
    "\n",
    "# plt.savefig('test2.png')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "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": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [],
   "source": [
    "# jpsi_width"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "# plt.hist(sample, weights=1 / prob(sample))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Fitting"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "# start = time.time()\n",
    "\n",
    "# for param in total_f.get_dependents():\n",
    "#     param.randomize()\n",
    "    \n",
    "# # for param in total_f.get_dependents():\n",
    "# #     print(zfit.run(param))\n",
    "    \n",
    "# nll = zfit.loss.UnbinnedNLL(model=total_f, data=data2, fit_range = (x_min, x_max))\n",
    "\n",
    "# minimizer = zfit.minimize.MinuitMinimizer(verbosity = 5)\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)\n",
    "# # print(\"Results:\", result.params)\n",
    "# print(\"Hesse errors:\", result.hesse())"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "# print(\"Time taken for fitting: {}\".format(display_time(int(time.time()-start))))\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": 31,
   "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, 10e-6)\n",
    "# # plt.yscale('log')\n",
    "# # plt.xlim(3080, 3110)\n",
    "# plt.savefig('test3.png')\n",
    "# # print(jpsi_width)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [],
   "source": [
    "# _tot = 4.37e-7+6.02e-5+4.97e-6\n",
    "# _probs = []\n",
    "# _probs.append(6.02e-5/_tot)\n",
    "# _probs.append(4.97e-6/_tot)\n",
    "# _probs.append(4.37e-7/_tot)\n",
    "# print(_probs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [],
   "source": [
    "# dtype = 'float64'\n",
    "# # mixture = tfd.Uniform(tf.constant(x_min, dtype=dtype), tf.constant(x_max, dtype=dtype))\n",
    "# mixture = tfd.MixtureSameFamily(mixture_distribution=tfd.Categorical(probs=[tf.constant(0.007, dtype=dtype),\n",
    "#                                                                             tf.constant(0.917, dtype=dtype),\n",
    "#                                                                             tf.constant(0.076, dtype=dtype)]),\n",
    "#                                 components_distribution=tfd.Uniform(low=[tf.constant(x_min, dtype=dtype), \n",
    "#                                                                          tf.constant(3080, dtype=dtype),\n",
    "#                                                                          tf.constant(3670, dtype=dtype)], \n",
    "#                                                                     high=[tf.constant(x_max, dtype=dtype),\n",
    "#                                                                           tf.constant(3112, dtype=dtype), \n",
    "#                                                                           tf.constant(3702, dtype=dtype)]))\n",
    "# # for i in range(10):\n",
    "# #     print(zfit.run(mixture.prob(mixture.sample((10, 1)))))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [],
   "source": [
    "# print((zfit.run(jpsi_p)%(2*np.pi))/np.pi)\n",
    "# print((zfit.run(psi2s_p)%(2*np.pi))/np.pi)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [],
   "source": [
    "#         def jpsi_res(q):\n",
    "#             return resonance(q, _mass = jpsi_mass, scale = jpsi_scale,\n",
    "#                              phase = jpsi_phase, width = jpsi_width)\n",
    "\n",
    "#         def psi2s_res(q):\n",
    "#             return resonance(q, _mass = psi2s_mass, scale = psi2s_scale,\n",
    "#                              phase = psi2s_phase, width = psi2s_width)\n",
    "        \n",
    "#         def p3770_res(q):\n",
    "#             return resonance(q, _mass = p3770_mass, scale = p3770_scale,\n",
    "#                              phase = p3770_phase, width = p3770_width)\n",
    "        \n",
    "#         def p4040_res(q):\n",
    "#             return resonance(q, _mass = p4040_mass, scale = p4040_scale,\n",
    "#                              phase = p4040_phase, width = p4040_width)\n",
    "        \n",
    "#         def p4160_res(q):\n",
    "#             return resonance(q, _mass = p4160_mass, scale = p4160_scale,\n",
    "#                              phase = p4160_phase, width = p4160_width)\n",
    "        \n",
    "#         def p4415_res(q):\n",
    "#             return resonance(q, _mass = p4415_mass, scale = p4415_scale,\n",
    "#                              phase = p4415_phase, width = p4415_width)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 0.15**2*4.2/1000\n",
    "# result.hesse()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Constraints"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 1. Constraint - Real part of sum of Psi contrib and D contribs\n",
    "\n",
    "sum_list = []\n",
    "\n",
    "sum_list.append(ztf.to_complex(jpsi_s) * tf.exp(tf.complex(ztf.constant(0.0), jpsi_p)) * ztf.to_complex(jpsi_w / (tf.pow(jpsi_m,3))))\n",
    "sum_list.append(ztf.to_complex(psi2s_s) * tf.exp(tf.complex(ztf.constant(0.0), psi2s_p)) * ztf.to_complex(psi2s_w / (tf.pow(psi2s_m,3))))\n",
    "sum_list.append(ztf.to_complex(p3770_s) * tf.exp(tf.complex(ztf.constant(0.0), p3770_p)) * ztf.to_complex(p3770_w / (tf.pow(p3770_m,3))))\n",
    "sum_list.append(ztf.to_complex(p4040_s) * tf.exp(tf.complex(ztf.constant(0.0), p4040_p)) * ztf.to_complex(p4040_w / (tf.pow(p4040_m,3))))\n",
    "sum_list.append(ztf.to_complex(p4160_s) * tf.exp(tf.complex(ztf.constant(0.0), p4160_p)) * ztf.to_complex(p4160_w / (tf.pow(p4160_m,3))))\n",
    "sum_list.append(ztf.to_complex(p4415_s) * tf.exp(tf.complex(ztf.constant(0.0), p4415_p)) * ztf.to_complex(p4415_w / (tf.pow(p4415_m,3))))\n",
    "sum_list.append(ztf.to_complex(DDstar_s) * tf.exp(tf.complex(ztf.constant(0.0), DDstar_p)) * (ztf.to_complex(1.0 / (10.0*tf.pow(Dstar_m,2)) + 1.0 / (10.0*tf.pow(D_m,2)))))\n",
    "sum_list.append(ztf.to_complex(Dbar_s) * tf.exp(tf.complex(ztf.constant(0.0), Dbar_p)) * ztf.to_complex(1.0 / (6.0*tf.pow(Dbar_m,2))))\n",
    "\n",
    "sum_ru_1 = ztf.to_complex(ztf.constant(0.0))\n",
    "\n",
    "for part in sum_list:\n",
    "    sum_ru_1 += part\n",
    "\n",
    "sum_1 = tf.math.real(sum_ru_1)\n",
    "# constraint1 = zfit.constraint.GaussianConstraint(params = sum_1, mu = ztf.constant(1.7*10**-8), \n",
    "#                                                  sigma = ztf.constant(2.2*10**-8))\n",
    "\n",
    "constraint1 = tf.pow((sum_1-ztf.constant(1.7*10**-8))/ztf.constant(2.2*10**-8),2)/ztf.constant(2.)\n",
    "\n",
    "# 2. Constraint - Abs. of sum of Psi contribs and D contribs\n",
    "\n",
    "sum_2 = tf.abs(sum_ru_1)\n",
    "constraint2 = tf.cond(tf.greater_equal(sum_2, 5.0e-8), lambda: 100000., lambda: 0.)\n",
    "\n",
    "# 3. Constraint - Maximum eta of D contribs\n",
    "\n",
    "constraint3_0 = tf.cond(tf.greater_equal(tf.abs(Dbar_s), 0.2), lambda: 100000., lambda: 0.)\n",
    "\n",
    "constraint3_1 = tf.cond(tf.greater_equal(tf.abs(DDstar_s), 0.2), lambda: 100000., lambda: 0.)\n",
    "\n",
    "# 4. Constraint - Formfactor multivariant gaussian covariance fplus\n",
    "\n",
    "Cov_matrix = [[ztf.constant(   1.), ztf.constant( 0.45), ztf.constant( 0.19), ztf.constant(0.857), ztf.constant(0.598), ztf.constant(0.531), ztf.constant(0.752), ztf.constant(0.229), ztf.constant(0,117)],\n",
    "              [ztf.constant( 0.45), ztf.constant(   1.), ztf.constant(0.677), ztf.constant(0.708), ztf.constant(0.958), ztf.constant(0.927), ztf.constant(0.227), ztf.constant(0.443), ztf.constant(0.287)],\n",
    "              [ztf.constant( 0.19), ztf.constant(0.677), ztf.constant(   1.), ztf.constant(0.595), ztf.constant(0.770), ztf.constant(0.819),ztf.constant(-0.023), ztf.constant( 0.07), ztf.constant(0.196)],\n",
    "              [ztf.constant(0.857), ztf.constant(0.708), ztf.constant(0.595), ztf.constant(   1.), ztf.constant( 0.83), ztf.constant(0.766), ztf.constant(0.582), ztf.constant(0.237), ztf.constant(0.192)],\n",
    "              [ztf.constant(0.598), ztf.constant(0.958), ztf.constant(0.770), ztf.constant( 0.83), ztf.constant(   1.), ztf.constant(0.973), ztf.constant(0.324), ztf.constant(0.372), ztf.constant(0.272)],\n",
    "              [ztf.constant(0.531), ztf.constant(0.927), ztf.constant(0.819), ztf.constant(0.766), ztf.constant(0.973), ztf.constant(   1.), ztf.constant(0.268), ztf.constant(0.332), ztf.constant(0.269)],\n",
    "              [ztf.constant(0.752), ztf.constant(0.227),ztf.constant(-0.023), ztf.constant(0.582), ztf.constant(0.324), ztf.constant(0.268), ztf.constant(   1.), ztf.constant( 0.59), ztf.constant(0.515)],\n",
    "              [ztf.constant(0.229), ztf.constant(0.443), ztf.constant( 0.07), ztf.constant(0.237), ztf.constant(0.372), ztf.constant(0.332), ztf.constant( 0.59), ztf.constant(   1.), ztf.constant(0.897)],\n",
    "              [ztf.constant(0.117), ztf.constant(0.287), ztf.constant(0.196), ztf.constant(0.192), ztf.constant(0.272), ztf.constant(0.269), ztf.constant(0.515), ztf.constant(0.897), ztf.constant(   1.)]]\n",
    "\n",
    "def triGauss(val1,val2,val3,m = Cov_matrix):\n",
    "\n",
    "    mean1 = ztf.constant(0.466)\n",
    "    mean2 = ztf.constant(-0.885)\n",
    "    mean3 = ztf.constant(-0.213)\n",
    "    sigma1 = ztf.constant(0.014)\n",
    "    sigma2 = ztf.constant(0.128)\n",
    "    sigma3 = ztf.constant(0.548)\n",
    "    x1 = (val1-mean1)/sigma1\n",
    "    x2 = (val2-mean2)/sigma2\n",
    "    x3 = (val3-mean3)/sigma3\n",
    "    rho12 = m[0][1]\n",
    "    rho13 = m[0][2]\n",
    "    rho23 = m[1][2]\n",
    "    w = x1*x1*(rho23*rho23-1) + x2*x2*(rho13*rho13-1)+x3*x3*(rho12*rho12-1)+2*(x1*x2*(rho12-rho13*rho23)+x1*x3*(rho13-rho12*rho23)+x2*x3*(rho23-rho12*rho13))\n",
    "    d = 2*(rho12*rho12+rho13*rho13+rho23*rho23-2*rho12*rho13*rho23-1)\n",
    "    \n",
    "    fcn = -w/d\n",
    "    chisq = -2*fcn\n",
    "    return chisq\n",
    "\n",
    "constraint4 = triGauss(bplus_0, bplus_1, bplus_2)\n",
    "\n",
    "# mean1 = ztf.constant(0.466)\n",
    "# mean2 = ztf.constant(-0.885)\n",
    "# mean3 = ztf.constant(-0.213)\n",
    "# sigma1 = ztf.constant(0.014)\n",
    "# sigma2 = ztf.constant(0.128)\n",
    "# sigma3 = ztf.constant(0.548)\n",
    "# constraint4_0 = tf.pow((bplus_0-mean1)/sigma1,2)/ztf.constant(2.)\n",
    "# constraint4_1 = tf.pow((bplus_1-mean2)/sigma2,2)/ztf.constant(2.)\n",
    "# constraint4_2 = tf.pow((bplus_2-mean3)/sigma3,2)/ztf.constant(2.)\n",
    "\n",
    "# 5. Constraint - Abs. of sum of light contribs\n",
    "\n",
    "sum_list_5 = []\n",
    "\n",
    "sum_list_5.append(rho_s*rho_w/rho_m)\n",
    "sum_list_5.append(omega_s*omega_w/omega_m)\n",
    "sum_list_5.append(phi_s*phi_w/phi_m)\n",
    "\n",
    "\n",
    "sum_ru_5 = ztf.constant(0.0)\n",
    "\n",
    "for part in sum_list_5:\n",
    "    sum_ru_5 += part\n",
    "\n",
    "constraint5 = tf.cond(tf.greater_equal(tf.abs(sum_ru_5), ztf.constant(0.02)), lambda: 100000., lambda: 0.)\n",
    "\n",
    "# 6. Constraint on phases of Jpsi and Psi2s for cut out fit\n",
    "\n",
    "\n",
    "# constraint6_0 = zfit.constraint.GaussianConstraint(params = jpsi_p, mu = ztf.constant(pdg[\"jpsi_phase_unc\"]),\n",
    "#                                                    sigma = ztf.constant(jpsi_phase))\n",
    "# constraint6_1 = zfit.constraint.GaussianConstraint(params = psi2s_p, mu = ztf.constant(pdg[\"psi2s_phase_unc\"]),\n",
    "#                                                    sigma = ztf.constant(psi2s_phase))\n",
    "\n",
    "constraint6_0  =  tf.pow((jpsi_p-ztf.constant(jpsi_phase))/ztf.constant(pdg[\"jpsi_phase_unc\"]),2)/ztf.constant(2.)\n",
    "constraint6_1  =  tf.pow((psi2s_p-ztf.constant(psi2s_phase))/ztf.constant(pdg[\"psi2s_phase_unc\"]),2)/ztf.constant(2.)\n",
    "\n",
    "# 7. Constraint on Ctt with higher limits\n",
    "\n",
    "constraint7 = tf.cond(tf.greater_equal(Ctt*Ctt, 0.25), lambda: 100000., lambda: 0.)\n",
    "\n",
    "constraint7dtype = tf.float64\n",
    "\n",
    "# zfit.run(constraint6_0)\n",
    "\n",
    "# ztf.convert_to_tensor(constraint6_0)\n",
    "\n",
    "#List of all constraints\n",
    "\n",
    "constraints = [constraint1, constraint2, constraint3_0, constraint3_1,# constraint4, #constraint4_0, constraint4_1, constraint4_2,\n",
    "               constraint6_0, constraint6_1]#, constraint7]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Reset params"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [],
   "source": [
    "def reset_param_values():   \n",
    "    jpsi_m.set_value(jpsi_mass)\n",
    "    jpsi_s.set_value(jpsi_scale)\n",
    "    jpsi_p.set_value(jpsi_phase)\n",
    "    jpsi_w.set_value(jpsi_width)\n",
    "    psi2s_m.set_value(psi2s_mass)\n",
    "    psi2s_s.set_value(psi2s_scale)\n",
    "    psi2s_p.set_value(psi2s_phase)\n",
    "    psi2s_w.set_value(psi2s_width)\n",
    "    p3770_m.set_value(p3770_mass)\n",
    "    p3770_s.set_value(p3770_scale)\n",
    "    p3770_p.set_value(p3770_phase)\n",
    "    p3770_w.set_value(p3770_width)\n",
    "    p4040_m.set_value(p4040_mass)\n",
    "    p4040_s.set_value(p4040_scale)\n",
    "    p4040_p.set_value(p4040_phase)\n",
    "    p4040_w.set_value(p4040_width)\n",
    "    p4160_m.set_value(p4160_mass)\n",
    "    p4160_s.set_value(p4160_scale)\n",
    "    p4160_p.set_value(p4160_phase)\n",
    "    p4160_w.set_value(p4160_width)\n",
    "    p4415_m.set_value(p4415_mass)\n",
    "    p4415_s.set_value(p4415_scale)\n",
    "    p4415_p.set_value(p4415_phase)\n",
    "    p4415_w.set_value(p4415_width)\n",
    "    rho_m.set_value(rho_mass)\n",
    "    rho_s.set_value(rho_scale)\n",
    "    rho_p.set_value(rho_phase)\n",
    "    rho_w.set_value(rho_width)\n",
    "    omega_m.set_value(omega_mass)\n",
    "    omega_s.set_value(omega_scale)\n",
    "    omega_p.set_value(omega_phase)\n",
    "    omega_w.set_value(omega_width)\n",
    "    phi_m.set_value(phi_mass)\n",
    "    phi_s.set_value(phi_scale)\n",
    "    phi_p.set_value(phi_phase)\n",
    "    phi_w.set_value(phi_width)\n",
    "    Dstar_m.set_value(Dstar_mass)\n",
    "    DDstar_s.set_value(0.0)\n",
    "    DDstar_p.set_value(0.0)\n",
    "    D_m.set_value(D_mass)\n",
    "    Dbar_m.set_value(Dbar_mass)\n",
    "    Dbar_s.set_value(0.0)\n",
    "    Dbar_p.set_value(0.0)\n",
    "    tau_m.set_value(pdg['tau_M'])\n",
    "    Ctt.set_value(0.0)\n",
    "    b0_0.set_value(0.292)\n",
    "    b0_1.set_value(0.281)\n",
    "    b0_2.set_value(0.150)\n",
    "    bplus_0.set_value(0.466)\n",
    "    bplus_1.set_value(-0.885)\n",
    "    bplus_2.set_value(-0.213)\n",
    "    bT_0.set_value(0.460)\n",
    "    bT_1.set_value(-1.089)\n",
    "    bT_2.set_value(-1.114)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Analysis"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "WARNING:tensorflow:From C:\\Users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\zfit\\core\\sample.py:163: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.\n",
      "Instructions for updating:\n",
      "Use tf.cast instead.\n",
      "Toy 0: Generating data...\n",
      "Toy 0: Data generation finished\n",
      "Toy 0: Loading data...\n",
      "Toy 0: Loading data finished\n",
      "Toy 0: Fitting pdf...\n",
      "------------------------------------------------------------------\n",
      "| FCN = 2.978E+05               |    Ncalls=1266 (1266 total)    |\n",
      "| EDM = 0.00226 (Goal: 5E-06)   |            up = 0.5            |\n",
      "------------------------------------------------------------------\n",
      "|  Valid Min.   | Valid Param.  | Above EDM | Reached call limit |\n",
      "------------------------------------------------------------------\n",
      "|     False     |     True      |   True    |       False        |\n",
      "------------------------------------------------------------------\n",
      "| Hesse failed  |   Has cov.    | Accurate  | Pos. def. | Forced |\n",
      "------------------------------------------------------------------\n",
      "|     False     |     True      |   False   |   False   |  True  |\n",
      "------------------------------------------------------------------\n",
      "Function minimum: 297802.6007923239\n",
      "----------------------------------------------------------------------------------------------\n",
      "|   | Name     |   Value   | Hesse Err | Minos Err- | Minos Err+ | Limit-  | Limit+  | Fixed |\n",
      "----------------------------------------------------------------------------------------------\n",
      "| 0 | DDstar_s |  -0.300   |   0.026   |            |            |  -0.3   |   0.3   |       |\n",
      "| 1 | psi2s_p  |   -2.12   |    0.11   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 2 | p3770_s  |    2.0    |    0.4    |            |            |0.918861 | 4.08114 |       |\n",
      "| 3 | phi_p    |   -0.43   |    0.19   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 4 | Dbar_p   |    5.1    |    0.4    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 5 | omega_p  |   6.28    |   0.14    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 6 | p4160_p  |  -6.283   |   0.010   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 7 | omega_s  |    5.0    |    0.9    |            |            | 4.19232 | 9.40768 |       |\n",
      "| 8 | rho_s    |   1.33    |   0.28    |            |            |0.0253049| 2.0747  |       |\n",
      "| 9 | p4415_s  |   0.45    |   0.19    |            |            |0.126447 | 2.35355 |       |\n",
      "| 10| p3770_p  |   -2.10   |    0.22   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 11| p4040_s  |   1.77    |   0.15    |            |            |0.00501244| 2.01499 |       |\n",
      "| 12| p4160_s  |   0.717   |   0.012   |            |            | 0.71676 | 3.68324 |       |\n",
      "| 13| rho_p    |   5.75    |   0.25    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 14| DDstar_p |   -2.7    |    0.5    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 15| jpsi_p   |   -4.76   |    0.12   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 16| phi_s    |   15.8    |    0.9    |            |            | 14.8182 | 23.5818 |       |\n",
      "| 17| p4040_p  |   3.02    |   0.19    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 18| Ctt      |   0.021   |   0.636   |            |            |  -1.5   |   1.5   |       |\n",
      "| 19| p4415_p  |    4.3    |    0.4    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 20| Dbar_s   |   -0.30   |    0.54   |            |            |  -0.3   |   0.3   |       |\n",
      "----------------------------------------------------------------------------------------------\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "|          | DDstar_s  psi2s_p  p3770_s    phi_p   Dbar_p  omega_p  p4160_p  omega_s    rho_s  p4415_s  p3770_p  p4040_s  p4160_s    rho_p DDstar_p   jpsi_p    phi_s  p4040_p      Ctt  p4415_p   Dbar_s |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "| DDstar_s |    1.000    0.287   -0.239    0.026    0.199   -0.002   -0.001    0.011   -0.032    0.176    0.246    0.054    0.015    0.060   -0.237    0.292   -0.014    0.260    0.285   -0.062   -0.300 |\n",
      "|  psi2s_p |    0.287    1.000   -0.725    0.076    0.792   -0.007   -0.004    0.031   -0.097    0.461    0.840    0.059    0.053    0.151   -0.646    0.937   -0.039    0.864    0.918   -0.174   -0.952 |\n",
      "|  p3770_s |   -0.239   -0.725    1.000   -0.060   -0.622    0.006    0.002   -0.022    0.072   -0.381   -0.705   -0.039   -0.042   -0.105    0.533   -0.776    0.025   -0.657   -0.786    0.174    0.781 |\n",
      "|    phi_p |    0.026    0.076   -0.060    1.000    0.084   -0.001   -0.000   -0.011    0.002    0.035    0.070    0.000    0.005    0.111   -0.042    0.079    0.497    0.077    0.075   -0.011   -0.081 |\n",
      "|   Dbar_p |    0.199    0.792   -0.622    0.084    1.000   -0.008   -0.006    0.036   -0.093    0.499    0.723    0.100    0.046    0.214   -0.731    0.872   -0.050    0.822    0.897   -0.117   -0.901 |\n",
      "|  omega_p |   -0.002   -0.007    0.006   -0.001   -0.008    1.000    0.000   -0.122    0.028   -0.004   -0.007   -0.000   -0.000    0.020    0.005   -0.008   -0.003   -0.007   -0.007    0.001    0.008 |\n",
      "|  p4160_p |   -0.001   -0.004    0.002   -0.000   -0.006    0.000    1.000   -0.000    0.001   -0.007   -0.004    0.008   -0.002   -0.001    0.000   -0.004    0.000   -0.005   -0.004    0.002    0.004 |\n",
      "|  omega_s |    0.011    0.031   -0.022   -0.011    0.036   -0.122   -0.000    1.000   -0.439    0.014    0.029   -0.002    0.002    0.171   -0.017    0.032    0.027    0.033    0.029   -0.003   -0.033 |\n",
      "|    rho_s |   -0.032   -0.097    0.072    0.002   -0.093    0.028    0.001   -0.439    1.000   -0.052   -0.088   -0.007   -0.006    0.147    0.065   -0.104    0.020   -0.096   -0.095    0.015    0.102 |\n",
      "|  p4415_s |    0.176    0.461   -0.381    0.035    0.499   -0.004   -0.007    0.014   -0.052    1.000    0.395    0.085    0.030    0.057   -0.243    0.496   -0.018    0.510    0.550   -0.117   -0.502 |\n",
      "|  p3770_p |    0.246    0.840   -0.705    0.070    0.723   -0.007   -0.004    0.029   -0.088    0.395    1.000    0.013    0.047    0.147   -0.611    0.823   -0.037    0.789    0.796   -0.131   -0.842 |\n",
      "|  p4040_s |    0.054    0.059   -0.039    0.000    0.100   -0.000    0.008   -0.002   -0.007    0.085    0.013    1.000    0.000   -0.023    0.009    0.104    0.003   -0.022    0.169   -0.159   -0.097 |\n",
      "|  p4160_s |    0.015    0.053   -0.042    0.005    0.046   -0.000   -0.002    0.002   -0.006    0.030    0.047    0.000    1.000    0.011   -0.034    0.053   -0.003    0.045    0.049   -0.003   -0.052 |\n",
      "|    rho_p |    0.060    0.151   -0.105    0.111    0.214    0.020   -0.001    0.171    0.147    0.057    0.147   -0.023    0.011    1.000   -0.055    0.172    0.127    0.175    0.139   -0.007   -0.163 |\n",
      "| DDstar_p |   -0.237   -0.646    0.533   -0.042   -0.731    0.005    0.000   -0.017    0.065   -0.243   -0.611    0.009   -0.034   -0.055    1.000   -0.628    0.016   -0.536   -0.705    0.202    0.743 |\n",
      "|   jpsi_p |    0.292    0.937   -0.776    0.079    0.872   -0.008   -0.004    0.032   -0.104    0.496    0.823    0.104    0.053    0.172   -0.628    1.000   -0.048    0.876    0.954   -0.184   -0.974 |\n",
      "|    phi_s |   -0.014   -0.039    0.025    0.497   -0.050   -0.003    0.000    0.027    0.020   -0.018   -0.037    0.003   -0.003    0.127    0.016   -0.048    1.000   -0.045   -0.034    0.001    0.040 |\n",
      "|  p4040_p |    0.260    0.864   -0.657    0.077    0.822   -0.007   -0.005    0.033   -0.096    0.510    0.789   -0.022    0.045    0.175   -0.536    0.876   -0.045    1.000    0.856   -0.151   -0.881 |\n",
      "|      Ctt |    0.285    0.918   -0.786    0.075    0.897   -0.007   -0.004    0.029   -0.095    0.550    0.796    0.169    0.049    0.139   -0.705    0.954   -0.034    0.856    1.000   -0.205   -0.982 |\n",
      "|  p4415_p |   -0.062   -0.174    0.174   -0.011   -0.117    0.001    0.002   -0.003    0.015   -0.117   -0.131   -0.159   -0.003   -0.007    0.202   -0.184    0.001   -0.151   -0.205    1.000    0.197 |\n",
      "|   Dbar_s |   -0.300   -0.952    0.781   -0.081   -0.901    0.008    0.004   -0.033    0.102   -0.502   -0.842   -0.097   -0.052   -0.163    0.743   -0.974    0.040   -0.881   -0.982    0.197    1.000 |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "Hesse errors: OrderedDict([(<zfit.Parameter 'DDstar_s' floating=True>, {'error': 0.026438535718194017}), (<zfit.Parameter 'psi2s_p' floating=True>, {'error': 0.10588983666642804}), (<zfit.Parameter 'p3770_s' floating=True>, {'error': 0.36086317466917783}), (<zfit.Parameter 'phi_p' floating=True>, {'error': 0.19079655937529916}), (<zfit.Parameter 'Dbar_p' floating=True>, {'error': 0.41574684528752126}), (<zfit.Parameter 'omega_p' floating=True>, {'error': 0.1355520007630746}), (<zfit.Parameter 'p4160_p' floating=True>, {'error': 0.00974483767324763}), (<zfit.Parameter 'omega_s' floating=True>, {'error': 0.8613276945009707}), (<zfit.Parameter 'rho_s' floating=True>, {'error': 0.28158617876977865}), (<zfit.Parameter 'p4415_s' floating=True>, {'error': 0.1915630526465161}), (<zfit.Parameter 'p3770_p' floating=True>, {'error': 0.2235655443212885}), (<zfit.Parameter 'p4040_s' floating=True>, {'error': 0.15287528678279771}), (<zfit.Parameter 'p4160_s' floating=True>, {'error': 0.01199094350809532}), (<zfit.Parameter 'rho_p' floating=True>, {'error': 0.2488236198489755}), (<zfit.Parameter 'DDstar_p' floating=True>, {'error': 0.5201072657958499}), (<zfit.Parameter 'jpsi_p' floating=True>, {'error': 0.11857038746341875}), (<zfit.Parameter 'phi_s' floating=True>, {'error': 0.8693077060488239}), (<zfit.Parameter 'p4040_p' floating=True>, {'error': 0.18924469739929783}), (<zfit.Parameter 'Ctt' floating=True>, {'error': 0.6358539317359582}), (<zfit.Parameter 'p4415_p' floating=True>, {'error': 0.40875048069118236}), (<zfit.Parameter 'Dbar_s' floating=True>, {'error': 0.5430910159955151})])\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\sa_li\\.conda\\envs\\rmd\\lib\\site-packages\\ipykernel_launcher.py:196: UserWarning: Creating legend with loc=\"best\" can be slow with large amounts of data.\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Toy 1/15\n",
      "Time taken: 2 min, 3 s\n",
      "Projected time left: 28 min, 42 s\n",
      "Toy 1: Generating data...\n",
      "Toy 1: Data generation finished\n",
      "Toy 1: Loading data...\n",
      "Toy 1: Loading data finished\n",
      "Toy 1: Fitting pdf...\n",
      "------------------------------------------------------------------\n",
      "| FCN = 2.977E+05               |    Ncalls=1118 (1118 total)    |\n",
      "| EDM = 0.000159 (Goal: 5E-06)  |            up = 0.5            |\n",
      "------------------------------------------------------------------\n",
      "|  Valid Min.   | Valid Param.  | Above EDM | Reached call limit |\n",
      "------------------------------------------------------------------\n",
      "|     True      |     True      |   False   |       False        |\n",
      "------------------------------------------------------------------\n",
      "| Hesse failed  |   Has cov.    | Accurate  | Pos. def. | Forced |\n",
      "------------------------------------------------------------------\n",
      "|     False     |     True      |   True    |   True    | False  |\n",
      "------------------------------------------------------------------\n",
      "Function minimum: 297712.9015097967\n",
      "----------------------------------------------------------------------------------------------\n",
      "|   | Name     |   Value   | Hesse Err | Minos Err- | Minos Err+ | Limit-  | Limit+  | Fixed |\n",
      "----------------------------------------------------------------------------------------------\n",
      "| 0 | DDstar_s |   0.300   |   0.022   |            |            |  -0.3   |   0.3   |       |\n",
      "| 1 | psi2s_p  |   -2.06   |    0.03   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 2 | p3770_s  |   1.97    |   0.23    |            |            |0.918861 | 4.08114 |       |\n",
      "| 3 | phi_p    |   6.20    |   0.26    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 4 | Dbar_p   |   -5.07   |    0.30   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 5 | omega_p  |   -6.0    |    0.6    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 6 | p4160_p  |   4.12    |   0.09    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 7 | omega_s  |    5.1    |    3.0    |            |            | 4.19232 | 9.40768 |       |\n",
      "| 8 | rho_s    |    1.5    |    0.3    |            |            |0.0253049| 2.0747  |       |\n",
      "| 9 | p4415_s  |   1.53    |   0.18    |            |            |0.126447 | 2.35355 |       |\n",
      "| 10| p3770_p  |   -2.00   |    0.13   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 11| p4040_s  |   1.06    |   0.17    |            |            |0.00501244| 2.01499 |       |\n",
      "| 12| p4160_s  |   2.55    |   0.16    |            |            | 0.71676 | 3.68324 |       |\n",
      "| 13| rho_p    |   6.16    |   0.22    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 14| DDstar_p |   4.89    |   0.22    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 15| jpsi_p   |   4.527   |   0.026   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 16| phi_s    |   16.5    |    1.1    |            |            | 14.8182 | 23.5818 |       |\n",
      "| 17| p4040_p  |   -2.34   |    0.17   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 18| Ctt      |   0.30    |   0.16    |            |            |  -1.5   |   1.5   |       |\n",
      "| 19| p4415_p  |   3.95    |   0.14    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 20| Dbar_s   |  -0.300   |   0.014   |            |            |  -0.3   |   0.3   |       |\n",
      "----------------------------------------------------------------------------------------------\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "|          | DDstar_s  psi2s_p  p3770_s    phi_p   Dbar_p  omega_p  p4160_p  omega_s    rho_s  p4415_s  p3770_p  p4040_s  p4160_s    rho_p DDstar_p   jpsi_p    phi_s  p4040_p      Ctt  p4415_p   Dbar_s |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "| DDstar_s |    1.000    0.026   -0.011   -0.000   -0.010   -0.001    0.034   -0.001   -0.000    0.004    0.009    0.007    0.003   -0.003    0.028    0.062    0.001    0.010    0.024    0.026   -0.001 |\n",
      "|  psi2s_p |    0.026    1.000    0.250   -0.004    0.142   -0.005    0.286   -0.005    0.000   -0.186    0.259   -0.202   -0.111   -0.003    0.165   -0.073   -0.005    0.224   -0.461    0.117    0.028 |\n",
      "|  p3770_s |   -0.011    0.250    1.000    0.003   -0.122    0.012   -0.003    0.013   -0.006    0.060   -0.148    0.183    0.093    0.031   -0.064   -0.083   -0.009    0.016   -0.056    0.035   -0.016 |\n",
      "|    phi_p |   -0.000   -0.004    0.003    1.000   -0.003    0.025    0.001    0.010    0.032   -0.003    0.000   -0.002   -0.002    0.084   -0.009   -0.027    0.664    0.002   -0.011    0.000    0.000 |\n",
      "|   Dbar_p |   -0.010    0.142   -0.122   -0.003    1.000   -0.005   -0.211   -0.004   -0.010   -0.036   -0.019   -0.069   -0.090   -0.025   -0.634   -0.206    0.006   -0.173   -0.521   -0.174    0.005 |\n",
      "|  omega_p |   -0.001   -0.005    0.012    0.025   -0.005    1.000    0.006    0.872   -0.232   -0.004    0.002   -0.001    0.001    0.118   -0.025   -0.064    0.082    0.010   -0.035    0.005   -0.000 |\n",
      "|  p4160_p |    0.034    0.286   -0.003    0.001   -0.211    0.006    1.000    0.006    0.004   -0.017    0.247   -0.494   -0.160    0.029    0.286   -0.036   -0.010    0.226   -0.302    0.309    0.004 |\n",
      "|  omega_s |   -0.001   -0.005    0.013    0.010   -0.004    0.872    0.006    1.000   -0.399   -0.003    0.002   -0.001    0.001    0.245   -0.024   -0.067    0.082    0.009   -0.035    0.004   -0.000 |\n",
      "|    rho_s |   -0.000    0.000   -0.006    0.032   -0.010   -0.232    0.004   -0.399    1.000   -0.008    0.000   -0.005   -0.010    0.149   -0.021    0.009    0.020   -0.000   -0.010    0.001   -0.001 |\n",
      "|  p4415_s |    0.004   -0.186    0.060   -0.003   -0.036   -0.004   -0.017   -0.003   -0.008    1.000   -0.113    0.160    0.317   -0.014   -0.260    0.010   -0.000    0.064    0.281   -0.134    0.006 |\n",
      "|  p3770_p |    0.009    0.259   -0.148    0.000   -0.019    0.002    0.247    0.002    0.000   -0.113    1.000   -0.116   -0.030    0.008    0.184   -0.033   -0.003    0.244   -0.289    0.122    0.006 |\n",
      "|  p4040_s |    0.007   -0.202    0.183   -0.002   -0.069   -0.001   -0.494   -0.001   -0.005    0.160   -0.116    1.000    0.060   -0.003   -0.248    0.001   -0.003   -0.186    0.326   -0.193    0.006 |\n",
      "|  p4160_s |    0.003   -0.111    0.093   -0.002   -0.090    0.001   -0.160    0.001   -0.010    0.317   -0.030    0.060    1.000   -0.002   -0.244   -0.019   -0.004    0.361    0.212   -0.150    0.000 |\n",
      "|    rho_p |   -0.003   -0.003    0.031    0.084   -0.025    0.118    0.029    0.245    0.149   -0.014    0.008   -0.003   -0.002    1.000   -0.107   -0.145    0.137    0.034   -0.118    0.021   -0.002 |\n",
      "| DDstar_p |    0.028    0.165   -0.064   -0.009   -0.634   -0.025    0.286   -0.024   -0.021   -0.260    0.184   -0.248   -0.244   -0.107    1.000    0.408    0.027    0.092    0.227    0.042   -0.031 |\n",
      "|   jpsi_p |    0.062   -0.073   -0.083   -0.027   -0.206   -0.064   -0.036   -0.067    0.009    0.010   -0.033    0.001   -0.019   -0.145    0.408    1.000    0.016   -0.080    0.452   -0.026    0.035 |\n",
      "|    phi_s |    0.001   -0.005   -0.009    0.664    0.006    0.082   -0.010    0.082    0.020   -0.000   -0.003   -0.003   -0.004    0.137    0.027    0.016    1.000   -0.011    0.028   -0.008    0.001 |\n",
      "|  p4040_p |    0.010    0.224    0.016    0.002   -0.173    0.010    0.226    0.009   -0.000    0.064    0.244   -0.186    0.361    0.034    0.092   -0.080   -0.011    1.000   -0.225    0.173   -0.004 |\n",
      "|      Ctt |    0.024   -0.461   -0.056   -0.011   -0.521   -0.035   -0.302   -0.035   -0.010    0.281   -0.289    0.326    0.212   -0.118    0.227    0.452    0.028   -0.225    1.000   -0.089    0.004 |\n",
      "|  p4415_p |    0.026    0.117    0.035    0.000   -0.174    0.005    0.309    0.004    0.001   -0.134    0.122   -0.193   -0.150    0.021    0.042   -0.026   -0.008    0.173   -0.089    1.000    0.002 |\n",
      "|   Dbar_s |   -0.001    0.028   -0.016    0.000    0.005   -0.000    0.004   -0.000   -0.001    0.006    0.006    0.006    0.000   -0.002   -0.031    0.035    0.001   -0.004    0.004    0.002    1.000 |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "Hesse errors: OrderedDict([(<zfit.Parameter 'DDstar_s' floating=True>, {'error': 0.02215974098551443}), (<zfit.Parameter 'psi2s_p' floating=True>, {'error': 0.0321947897928192}), (<zfit.Parameter 'p3770_s' floating=True>, {'error': 0.22720056394069743}), (<zfit.Parameter 'phi_p' floating=True>, {'error': 0.26154840400711254}), (<zfit.Parameter 'Dbar_p' floating=True>, {'error': 0.30060561154625143}), (<zfit.Parameter 'omega_p' floating=True>, {'error': 0.5931485753481085}), (<zfit.Parameter 'p4160_p' floating=True>, {'error': 0.08739229819390726}), (<zfit.Parameter 'omega_s' floating=True>, {'error': 3.0061071278032503}), (<zfit.Parameter 'rho_s' floating=True>, {'error': 0.3259333401663742}), (<zfit.Parameter 'p4415_s' floating=True>, {'error': 0.1802244607762047}), (<zfit.Parameter 'p3770_p' floating=True>, {'error': 0.13140700738119193}), (<zfit.Parameter 'p4040_s' floating=True>, {'error': 0.16797069161014594}), (<zfit.Parameter 'p4160_s' floating=True>, {'error': 0.1626269650701777}), (<zfit.Parameter 'rho_p' floating=True>, {'error': 0.2218389047264795}), (<zfit.Parameter 'DDstar_p' floating=True>, {'error': 0.21726966084368993}), (<zfit.Parameter 'jpsi_p' floating=True>, {'error': 0.025613247486178103}), (<zfit.Parameter 'phi_s' floating=True>, {'error': 1.0532597652043885}), (<zfit.Parameter 'p4040_p' floating=True>, {'error': 0.17297013054059907}), (<zfit.Parameter 'Ctt' floating=True>, {'error': 0.15724705228223068}), (<zfit.Parameter 'p4415_p' floating=True>, {'error': 0.1366323222455872}), (<zfit.Parameter 'Dbar_s' floating=True>, {'error': 0.014237440675381602})])\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Toy 2/15\n",
      "Time taken: 3 min, 44 s\n",
      "Projected time left: 24 min, 16 s\n",
      "Toy 2: Generating data...\n",
      "Toy 2: Data generation finished\n",
      "Toy 2: Loading data...\n",
      "Toy 2: Loading data finished\n",
      "Toy 2: Fitting pdf...\n",
      "------------------------------------------------------------------\n",
      "| FCN = 2.977E+05               |    Ncalls=1017 (1017 total)    |\n",
      "| EDM = 1.43E-05 (Goal: 5E-06)  |            up = 0.5            |\n",
      "------------------------------------------------------------------\n",
      "|  Valid Min.   | Valid Param.  | Above EDM | Reached call limit |\n",
      "------------------------------------------------------------------\n",
      "|     True      |     True      |   False   |       False        |\n",
      "------------------------------------------------------------------\n",
      "| Hesse failed  |   Has cov.    | Accurate  | Pos. def. | Forced |\n",
      "------------------------------------------------------------------\n",
      "|     False     |     True      |   True    |   True    | False  |\n",
      "------------------------------------------------------------------\n",
      "Function minimum: 297696.73191606125\n",
      "----------------------------------------------------------------------------------------------\n",
      "|   | Name     |   Value   | Hesse Err | Minos Err- | Minos Err+ | Limit-  | Limit+  | Fixed |\n",
      "----------------------------------------------------------------------------------------------\n",
      "| 0 | DDstar_s |   -0.30   |    0.06   |            |            |  -0.3   |   0.3   |       |\n",
      "| 1 | psi2s_p  |   -2.12   |    0.03   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 2 | p3770_s  |   0.919   |   0.016   |            |            |0.918861 | 4.08114 |       |\n",
      "| 3 | phi_p    |    -6     |     8     |            |            |-6.28319 | 6.28319 |       |\n",
      "| 4 | Dbar_p   |   -1.5    |    0.4    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 5 | omega_p  |    0.6    |    0.3    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 6 | p4160_p  |   4.15    |   0.10    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 7 | omega_s  |    8.5    |    1.4    |            |            | 4.19232 | 9.40768 |       |\n",
      "| 8 | rho_s    |    0.8    |    0.3    |            |            |0.0253049| 2.0747  |       |\n",
      "| 9 | p4415_s  |   1.23    |   0.18    |            |            |0.126447 | 2.35355 |       |\n",
      "| 10| p3770_p  |  -6.283   |   0.023   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 11| p4040_s  |   0.96    |   0.17    |            |            |0.00501244| 2.01499 |       |\n",
      "| 12| p4160_s  |   2.13    |   0.16    |            |            | 0.71676 | 3.68324 |       |\n",
      "| 13| rho_p    |   -0.18   |    0.45   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 14| DDstar_p |   -4.4    |    0.3    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 15| jpsi_p   |  -1.709   |   0.025   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 16| phi_s    |    17     |     5     |            |            | 14.8182 | 23.5818 |       |\n",
      "| 17| p4040_p  |   -2.61   |    0.18   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 18| Ctt      |   0.40    |   0.16    |            |            |  -1.5   |   1.5   |       |\n",
      "| 19| p4415_p  |   -2.39   |    0.17   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 20| Dbar_s   |   0.30    |   0.05    |            |            |  -0.3   |   0.3   |       |\n",
      "----------------------------------------------------------------------------------------------\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "|          | DDstar_s  psi2s_p  p3770_s    phi_p   Dbar_p  omega_p  p4160_p  omega_s    rho_s  p4415_s  p3770_p  p4040_s  p4160_s    rho_p DDstar_p   jpsi_p    phi_s  p4040_p      Ctt  p4415_p   Dbar_s |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "| DDstar_s |    1.000    0.057    0.001    0.015   -0.078    0.006    0.106   -0.000    0.000   -0.003   -0.000    0.011    0.010   -0.008    0.142    0.160    0.015    0.056    0.078    0.076   -0.013 |\n",
      "|  psi2s_p |    0.057    1.000    0.005   -0.034    0.355   -0.012    0.174    0.001   -0.005   -0.150   -0.009   -0.189   -0.127   -0.008   -0.115   -0.002   -0.033    0.064   -0.529    0.039    0.099 |\n",
      "|  p3770_s |    0.001    0.005    1.000    0.000   -0.001    0.000    0.006    0.000   -0.000   -0.003   -0.001   -0.005   -0.001   -0.000    0.004    0.001    0.000    0.006   -0.006    0.003    0.000 |\n",
      "|    phi_p |    0.015   -0.034    0.000    1.000    0.033    0.302   -0.036   -0.108    0.027   -0.003    0.001   -0.006   -0.015   -0.161    0.059   -0.121    0.997   -0.047    0.060   -0.033    0.011 |\n",
      "|   Dbar_p |   -0.078    0.355   -0.001    0.033    1.000    0.010   -0.314   -0.000   -0.014    0.123    0.010    0.153   -0.004   -0.016   -0.851   -0.108    0.033   -0.254   -0.600   -0.197    0.035 |\n",
      "|  omega_p |    0.006   -0.012    0.000    0.302    0.010    1.000   -0.013    0.674    0.320   -0.003    0.001   -0.003   -0.008   -0.143    0.025   -0.037    0.303   -0.019    0.027   -0.013    0.004 |\n",
      "|  p4160_p |    0.106    0.174    0.006   -0.036   -0.314   -0.013    1.000   -0.000    0.006   -0.064   -0.006   -0.515   -0.160    0.024    0.370    0.010   -0.037    0.095   -0.150    0.303    0.019 |\n",
      "|  omega_s |   -0.000    0.001    0.000   -0.108   -0.000    0.674   -0.000    1.000   -0.019    0.000    0.000    0.000    0.000    0.070    0.001    0.006   -0.103   -0.000    0.002   -0.000   -0.000 |\n",
      "|    rho_s |    0.000   -0.005   -0.000    0.027   -0.014    0.320    0.006   -0.019    1.000   -0.010   -0.000   -0.008   -0.008    0.216   -0.023   -0.033    0.028    0.006   -0.030    0.003   -0.000 |\n",
      "|  p4415_s |   -0.003   -0.150   -0.003   -0.003    0.123   -0.003   -0.064    0.000   -0.010    1.000    0.001    0.132    0.326   -0.010   -0.291   -0.035   -0.003    0.076    0.175   -0.156    0.026 |\n",
      "|  p3770_p |   -0.000   -0.009   -0.001    0.001    0.010    0.001   -0.006    0.000   -0.000    0.001    1.000   -0.001   -0.003   -0.002   -0.007    0.004    0.001   -0.008    0.004   -0.004    0.001 |\n",
      "|  p4040_s |    0.011   -0.189   -0.005   -0.006    0.153   -0.003   -0.515    0.000   -0.008    0.132   -0.001    1.000   -0.083   -0.013   -0.281   -0.003   -0.006   -0.232    0.229   -0.234    0.037 |\n",
      "|  p4160_s |    0.010   -0.127   -0.001   -0.015   -0.004   -0.008   -0.160    0.000   -0.008    0.326   -0.003   -0.083    1.000    0.007   -0.204   -0.063   -0.016    0.366    0.162   -0.155    0.014 |\n",
      "|    rho_p |   -0.008   -0.008   -0.000   -0.161   -0.016   -0.143    0.024    0.070    0.216   -0.010   -0.002   -0.013    0.007    1.000   -0.099   -0.146   -0.152    0.041   -0.138    0.022   -0.001 |\n",
      "| DDstar_p |    0.142   -0.115    0.004    0.059   -0.851    0.025    0.370    0.001   -0.023   -0.291   -0.007   -0.281   -0.204   -0.099    1.000    0.296    0.061    0.147    0.456    0.115   -0.058 |\n",
      "|   jpsi_p |    0.160   -0.002    0.001   -0.121   -0.108   -0.037    0.010    0.006   -0.033   -0.035    0.004   -0.003   -0.063   -0.146    0.296    1.000   -0.117   -0.074    0.354   -0.020    0.107 |\n",
      "|    phi_s |    0.015   -0.033    0.000    0.997    0.033    0.303   -0.037   -0.103    0.028   -0.003    0.001   -0.006   -0.016   -0.152    0.061   -0.117    1.000   -0.048    0.063   -0.033    0.011 |\n",
      "|  p4040_p |    0.056    0.064    0.006   -0.047   -0.254   -0.019    0.095   -0.000    0.006    0.076   -0.008   -0.232    0.366    0.041    0.147   -0.074   -0.048    1.000   -0.042    0.120    0.011 |\n",
      "|      Ctt |    0.078   -0.529   -0.006    0.060   -0.600    0.027   -0.150    0.002   -0.030    0.175    0.004    0.229    0.162   -0.138    0.456    0.354    0.063   -0.042    1.000   -0.016    0.020 |\n",
      "|  p4415_p |    0.076    0.039    0.003   -0.033   -0.197   -0.013    0.303   -0.000    0.003   -0.156   -0.004   -0.234   -0.155    0.022    0.115   -0.020   -0.033    0.120   -0.016    1.000    0.016 |\n",
      "|   Dbar_s |   -0.013    0.099    0.000    0.011    0.035    0.004    0.019   -0.000   -0.000    0.026    0.001    0.037    0.014   -0.001   -0.058    0.107    0.011    0.011    0.020    0.016    1.000 |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "Hesse errors: OrderedDict([(<zfit.Parameter 'DDstar_s' floating=True>, {'error': 0.058875377015676786}), (<zfit.Parameter 'psi2s_p' floating=True>, {'error': 0.033521499395147814}), (<zfit.Parameter 'p3770_s' floating=True>, {'error': 0.016184203328837576}), (<zfit.Parameter 'phi_p' floating=True>, {'error': 8.37432462843211}), (<zfit.Parameter 'Dbar_p' floating=True>, {'error': 0.42560897291060407}), (<zfit.Parameter 'omega_p' floating=True>, {'error': 0.34790325392731125}), (<zfit.Parameter 'p4160_p' floating=True>, {'error': 0.10193439480943578}), (<zfit.Parameter 'omega_s' floating=True>, {'error': 1.3772448323544637}), (<zfit.Parameter 'rho_s' floating=True>, {'error': 0.33342944119029977}), (<zfit.Parameter 'p4415_s' floating=True>, {'error': 0.18280504617565851}), (<zfit.Parameter 'p3770_p' floating=True>, {'error': 0.022860061316435143}), (<zfit.Parameter 'p4040_s' floating=True>, {'error': 0.16920777712131063}), (<zfit.Parameter 'p4160_s' floating=True>, {'error': 0.164649848922645}), (<zfit.Parameter 'rho_p' floating=True>, {'error': 0.45380181319300217}), (<zfit.Parameter 'DDstar_p' floating=True>, {'error': 0.3425344799465915}), (<zfit.Parameter 'jpsi_p' floating=True>, {'error': 0.02521702369783352}), (<zfit.Parameter 'phi_s' floating=True>, {'error': 5.467375909610385}), (<zfit.Parameter 'p4040_p' floating=True>, {'error': 0.184064395689175}), (<zfit.Parameter 'Ctt' floating=True>, {'error': 0.1556835475337608}), (<zfit.Parameter 'p4415_p' floating=True>, {'error': 0.16856690415841125}), (<zfit.Parameter 'Dbar_s' floating=True>, {'error': 0.049215801838525364})])\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Toy 3/15\n",
      "Time taken: 5 min, 21 s\n",
      "Projected time left: 21 min, 24 s\n",
      "Toy 3: Generating data...\n",
      "Toy 3: Data generation finished\n",
      "Toy 3: Loading data...\n",
      "Toy 3: Loading data finished\n",
      "Toy 3: Fitting pdf...\n",
      "------------------------------------------------------------------\n",
      "| FCN = 2.976E+05               |    Ncalls=1133 (1133 total)    |\n",
      "| EDM = 0.00433 (Goal: 5E-06)   |            up = 0.5            |\n",
      "------------------------------------------------------------------\n",
      "|  Valid Min.   | Valid Param.  | Above EDM | Reached call limit |\n",
      "------------------------------------------------------------------\n",
      "|     False     |     True      |   True    |       False        |\n",
      "------------------------------------------------------------------\n",
      "| Hesse failed  |   Has cov.    | Accurate  | Pos. def. | Forced |\n",
      "------------------------------------------------------------------\n",
      "|     False     |     True      |   True    |   True    | False  |\n",
      "------------------------------------------------------------------\n",
      "Function minimum: 297609.29390604334\n",
      "----------------------------------------------------------------------------------------------\n",
      "|   | Name     |   Value   | Hesse Err | Minos Err- | Minos Err+ | Limit-  | Limit+  | Fixed |\n",
      "----------------------------------------------------------------------------------------------\n",
      "| 0 | DDstar_s |   -0.30   |    0.04   |            |            |  -0.3   |   0.3   |       |\n",
      "| 1 | psi2s_p  |   -2.11   |    0.03   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 2 | p3770_s  |   2.32    |   0.23    |            |            |0.918861 | 4.08114 |       |\n",
      "| 3 | phi_p    |   -6.0    |    2.3    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 4 | Dbar_p   |   -5.2    |    0.4    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 5 | omega_p  |    0.6    |    1.9    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 6 | p4160_p  |   -2.06   |    0.09   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 7 | omega_s  |    7.4    |    3.1    |            |            | 4.19232 | 9.40768 |       |\n",
      "| 8 | rho_s    |   0.78    |   0.31    |            |            |0.0253049| 2.0747  |       |\n",
      "| 9 | p4415_s  |   1.35    |   0.18    |            |            |0.126447 | 2.35355 |       |\n",
      "| 10| p3770_p  |   4.07    |   0.11    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 11| p4040_s  |   1.32    |   0.17    |            |            |0.00501244| 2.01499 |       |\n",
      "| 12| p4160_s  |   2.57    |   0.16    |            |            | 0.71676 | 3.68324 |       |\n",
      "| 13| rho_p    |    5.6    |    0.6    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 14| DDstar_p |   -4.51   |    0.26   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 15| jpsi_p   |  -1.745   |   0.027   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 16| phi_s    |    19     |     6     |            |            | 14.8182 | 23.5818 |       |\n",
      "| 17| p4040_p  |   -2.76   |    0.14   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 18| Ctt      |   0.68    |   0.17    |            |            |  -1.5   |   1.5   |       |\n",
      "| 19| p4415_p  |   -2.68   |    0.16   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 20| Dbar_s   |  -0.300   |   0.021   |            |            |  -0.3   |   0.3   |       |\n",
      "----------------------------------------------------------------------------------------------\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "|          | DDstar_s  psi2s_p  p3770_s    phi_p   Dbar_p  omega_p  p4160_p  omega_s    rho_s  p4415_s  p3770_p  p4040_s  p4160_s    rho_p DDstar_p   jpsi_p    phi_s  p4040_p      Ctt  p4415_p   Dbar_s |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "| DDstar_s |    1.000    0.057   -0.020    0.018   -0.024   -0.012    0.084   -0.012    0.009    0.004    0.026    0.015    0.003   -0.017    0.076    0.134    0.018    0.041    0.050    0.056   -0.005 |\n",
      "|  psi2s_p |    0.057    1.000    0.218   -0.014    0.086   -0.010    0.280   -0.009   -0.001   -0.182    0.291   -0.226   -0.092   -0.000    0.159   -0.052   -0.015    0.163   -0.403    0.058    0.040 |\n",
      "|  p3770_s |   -0.020    0.218    1.000   -0.034   -0.125    0.038   -0.032    0.040   -0.030    0.065   -0.180    0.172    0.084    0.047   -0.060   -0.060   -0.034    0.049    0.007    0.042   -0.022 |\n",
      "|    phi_p |    0.018   -0.014   -0.034    1.000    0.021   -0.534   -0.038   -0.575    0.295    0.011   -0.018    0.008   -0.009   -0.580    0.193    0.100    0.993   -0.059    0.167   -0.037    0.006 |\n",
      "|   Dbar_p |   -0.024    0.086   -0.125    0.021    1.000   -0.017   -0.321   -0.017    0.005    0.020   -0.109    0.006   -0.073   -0.029   -0.704   -0.335    0.021   -0.278   -0.591   -0.218    0.018 |\n",
      "|  omega_p |   -0.012   -0.010    0.038   -0.534   -0.017    1.000    0.023    0.993   -0.177   -0.013    0.011   -0.014    0.008    0.519   -0.146   -0.195   -0.499    0.042   -0.148    0.023   -0.003 |\n",
      "|  p4160_p |    0.084    0.280   -0.032   -0.038   -0.321    0.023    1.000    0.024   -0.017   -0.116    0.273   -0.458   -0.145    0.040    0.374    0.060   -0.039    0.083   -0.176    0.310   -0.001 |\n",
      "|  omega_s |   -0.012   -0.009    0.040   -0.575   -0.017    0.993    0.024    1.000   -0.245   -0.013    0.011   -0.014    0.008    0.536   -0.153   -0.197   -0.541    0.044   -0.154    0.024   -0.003 |\n",
      "|    rho_s |    0.009   -0.001   -0.030    0.295    0.005   -0.177   -0.017   -0.245    1.000    0.003   -0.010    0.005   -0.014   -0.132    0.095    0.109    0.284   -0.034    0.099   -0.021    0.002 |\n",
      "|  p4415_s |    0.004   -0.182    0.065    0.011    0.020   -0.013   -0.116   -0.013    0.003    1.000   -0.127    0.140    0.347   -0.018   -0.211   -0.003    0.010    0.079    0.232   -0.157    0.012 |\n",
      "|  p3770_p |    0.026    0.291   -0.180   -0.018   -0.109    0.011    0.273    0.011   -0.010   -0.127    1.000   -0.162   -0.012    0.018    0.217   -0.003   -0.019    0.237   -0.234    0.104    0.007 |\n",
      "|  p4040_s |    0.015   -0.226    0.172    0.008    0.006   -0.014   -0.458   -0.014    0.005    0.140   -0.162    1.000   -0.138   -0.016   -0.195    0.021    0.007   -0.208    0.310   -0.185    0.014 |\n",
      "|  p4160_s |    0.003   -0.092    0.084   -0.009   -0.073    0.008   -0.145    0.008   -0.014    0.347   -0.012   -0.138    1.000    0.009   -0.219   -0.032   -0.010    0.352    0.176   -0.031   -0.000 |\n",
      "|    rho_p |   -0.017   -0.000    0.047   -0.580   -0.029    0.519    0.040    0.536   -0.132   -0.018    0.018   -0.016    0.009    1.000   -0.215   -0.205   -0.560    0.063   -0.203    0.037   -0.006 |\n",
      "| DDstar_p |    0.076    0.159   -0.060    0.193   -0.704   -0.146    0.374   -0.153    0.095   -0.211    0.217   -0.195   -0.219   -0.215    1.000    0.511    0.195    0.092    0.377    0.009   -0.056 |\n",
      "|   jpsi_p |    0.134   -0.052   -0.060    0.100   -0.335   -0.195    0.060   -0.197    0.109   -0.003   -0.003    0.021   -0.032   -0.205    0.511    1.000    0.098   -0.024    0.517    0.011    0.038 |\n",
      "|    phi_s |    0.018   -0.015   -0.034    0.993    0.021   -0.499   -0.039   -0.541    0.284    0.010   -0.019    0.007   -0.010   -0.560    0.195    0.098    1.000   -0.060    0.168   -0.038    0.006 |\n",
      "|  p4040_p |    0.041    0.163    0.049   -0.059   -0.278    0.042    0.083    0.044   -0.034    0.079    0.237   -0.208    0.352    0.063    0.092   -0.024   -0.060    1.000   -0.046    0.156   -0.004 |\n",
      "|      Ctt |    0.050   -0.403    0.007    0.167   -0.591   -0.148   -0.176   -0.154    0.099    0.232   -0.234    0.310    0.176   -0.203    0.377    0.517    0.168   -0.046    1.000    0.041   -0.008 |\n",
      "|  p4415_p |    0.056    0.058    0.042   -0.037   -0.218    0.023    0.310    0.024   -0.021   -0.157    0.104   -0.185   -0.031    0.037    0.009    0.011   -0.038    0.156    0.041    1.000    0.002 |\n",
      "|   Dbar_s |   -0.005    0.040   -0.022    0.006    0.018   -0.003   -0.001   -0.003    0.002    0.012    0.007    0.014   -0.000   -0.006   -0.056    0.038    0.006   -0.004   -0.008    0.002    1.000 |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "Hesse errors: OrderedDict([(<zfit.Parameter 'DDstar_s' floating=True>, {'error': 0.03524416571678421}), (<zfit.Parameter 'psi2s_p' floating=True>, {'error': 0.03192586753092641}), (<zfit.Parameter 'p3770_s' floating=True>, {'error': 0.23078604668528513}), (<zfit.Parameter 'phi_p' floating=True>, {'error': 2.3034720157616433}), (<zfit.Parameter 'Dbar_p' floating=True>, {'error': 0.38400607179445245}), (<zfit.Parameter 'omega_p' floating=True>, {'error': 1.9476455591121122}), (<zfit.Parameter 'p4160_p' floating=True>, {'error': 0.08929096342456022}), (<zfit.Parameter 'omega_s' floating=True>, {'error': 3.0827282684748614}), (<zfit.Parameter 'rho_s' floating=True>, {'error': 0.3083021366687284}), (<zfit.Parameter 'p4415_s' floating=True>, {'error': 0.18482338032297452}), (<zfit.Parameter 'p3770_p' floating=True>, {'error': 0.11321675656139174}), (<zfit.Parameter 'p4040_s' floating=True>, {'error': 0.16824203498940749}), (<zfit.Parameter 'p4160_s' floating=True>, {'error': 0.1610182945570724}), (<zfit.Parameter 'rho_p' floating=True>, {'error': 0.5790348685907372}), (<zfit.Parameter 'DDstar_p' floating=True>, {'error': 0.260347443531447}), (<zfit.Parameter 'jpsi_p' floating=True>, {'error': 0.027273035239154808}), (<zfit.Parameter 'phi_s' floating=True>, {'error': 6.2273177854787285}), (<zfit.Parameter 'p4040_p' floating=True>, {'error': 0.1391734951545407}), (<zfit.Parameter 'Ctt' floating=True>, {'error': 0.16546627766698574}), (<zfit.Parameter 'p4415_p' floating=True>, {'error': 0.15748540864362015}), (<zfit.Parameter 'Dbar_s' floating=True>, {'error': 0.021117800010118787})])\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Toy 4/15\n",
      "Time taken: 7 min, 10 s\n",
      "Projected time left: 19 min, 37 s\n",
      "Toy 4: Generating data...\n",
      "Toy 4: Data generation finished\n",
      "Toy 4: Loading data...\n",
      "Toy 4: Loading data finished\n",
      "Toy 4: Fitting pdf...\n",
      "------------------------------------------------------------------\n",
      "| FCN = 2.979E+05               |     Ncalls=982 (982 total)     |\n",
      "| EDM = 6.3E-05 (Goal: 5E-06)   |            up = 0.5            |\n",
      "------------------------------------------------------------------\n",
      "|  Valid Min.   | Valid Param.  | Above EDM | Reached call limit |\n",
      "------------------------------------------------------------------\n",
      "|     True      |     True      |   False   |       False        |\n",
      "------------------------------------------------------------------\n",
      "| Hesse failed  |   Has cov.    | Accurate  | Pos. def. | Forced |\n",
      "------------------------------------------------------------------\n",
      "|     False     |     True      |   True    |   True    | False  |\n",
      "------------------------------------------------------------------\n",
      "Function minimum: 297861.7701022822\n",
      "----------------------------------------------------------------------------------------------\n",
      "|   | Name     |   Value   | Hesse Err | Minos Err- | Minos Err+ | Limit-  | Limit+  | Fixed |\n",
      "----------------------------------------------------------------------------------------------\n",
      "| 0 | DDstar_s |   -0.30   |    0.07   |            |            |  -0.3   |   0.3   |       |\n",
      "| 1 | psi2s_p  |   -2.19   |    0.03   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 2 | p3770_s  |   0.919   |   0.021   |            |            |0.918861 | 4.08114 |       |\n",
      "| 3 | phi_p    |   -5.58   |    0.21   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 4 | Dbar_p   |    1.3    |    0.5    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 5 | omega_p  |   0.20    |   0.40    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 6 | p4160_p  |   -2.00   |    0.12   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 7 | omega_s  |    6.9    |    1.3    |            |            | 4.19232 | 9.40768 |       |\n",
      "| 8 | rho_s    |    1.3    |    0.3    |            |            |0.0253049| 2.0747  |       |\n",
      "| 9 | p4415_s  |   1.38    |   0.18    |            |            |0.126447 | 2.35355 |       |\n",
      "| 10| p3770_p  |  -6.283   |   0.016   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 11| p4040_s  |   0.90    |   0.18    |            |            |0.00501244| 2.01499 |       |\n",
      "| 12| p4160_s  |   2.07    |   0.17    |            |            | 0.71676 | 3.68324 |       |\n",
      "| 13| rho_p    |   -6.28   |    0.09   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 14| DDstar_p |    5.1    |    0.3    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 15| jpsi_p   |   1.568   |   0.026   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 16| phi_s    |   17.7    |    1.1    |            |            | 14.8182 | 23.5818 |       |\n",
      "| 17| p4040_p  |   -2.72   |    0.20   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 18| Ctt      |   0.33    |   0.19    |            |            |  -1.5   |   1.5   |       |\n",
      "| 19| p4415_p  |   4.08    |   0.16    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 20| Dbar_s   |   0.30    |   0.05    |            |            |  -0.3   |   0.3   |       |\n",
      "----------------------------------------------------------------------------------------------\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "|          | DDstar_s  psi2s_p  p3770_s    phi_p   Dbar_p  omega_p  p4160_p  omega_s    rho_s  p4415_s  p3770_p  p4040_s  p4160_s    rho_p DDstar_p   jpsi_p    phi_s  p4040_p      Ctt  p4415_p   Dbar_s |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "| DDstar_s |    1.000   -0.093   -0.002   -0.002   -0.093   -0.003   -0.125    0.000    0.002    0.004   -0.000   -0.012   -0.013   -0.002    0.119   -0.204    0.004   -0.071   -0.105   -0.106   -0.024 |\n",
      "|  psi2s_p |   -0.093    1.000    0.009   -0.001   -0.160   -0.006    0.230   -0.002   -0.002   -0.201   -0.008   -0.252   -0.149   -0.003   -0.057   -0.047    0.003    0.068   -0.394    0.076   -0.107 |\n",
      "|  p3770_s |   -0.002    0.009    1.000   -0.000    0.005    0.000    0.010   -0.000   -0.000   -0.005   -0.002   -0.008   -0.001    0.000   -0.009    0.004   -0.000    0.008   -0.005    0.006   -0.001 |\n",
      "|    phi_p |   -0.002   -0.001   -0.000    1.000   -0.004   -0.059   -0.006   -0.068    0.017    0.003    0.000    0.004    0.000   -0.037   -0.015   -0.021    0.665   -0.006    0.016   -0.005   -0.001 |\n",
      "|   Dbar_p |   -0.093   -0.160    0.005   -0.004    1.000    0.004    0.435   -0.007    0.008   -0.098   -0.006   -0.155    0.027    0.007   -0.866    0.484   -0.023    0.316    0.726    0.315    0.024 |\n",
      "|  omega_p |   -0.003   -0.006    0.000   -0.059    0.004    1.000    0.004    0.790   -0.115   -0.004   -0.000   -0.005   -0.001    0.029    0.002   -0.011    0.004    0.004   -0.010    0.003   -0.002 |\n",
      "|  p4160_p |   -0.125    0.230    0.010   -0.006    0.435    0.004    1.000   -0.007    0.006   -0.072   -0.005   -0.489   -0.146    0.007   -0.463    0.273   -0.024    0.100    0.019    0.378    0.010 |\n",
      "|  omega_s |    0.000   -0.002   -0.000   -0.068   -0.007    0.790   -0.007    1.000   -0.364    0.003    0.000    0.002    0.001    0.068   -0.005   -0.023   -0.000   -0.005    0.006   -0.005   -0.000 |\n",
      "|    rho_s |    0.002   -0.002   -0.000    0.017    0.008   -0.115    0.006   -0.364    1.000   -0.009   -0.000   -0.005   -0.008   -0.010    0.012   -0.009   -0.030    0.001   -0.009    0.002    0.002 |\n",
      "|  p4415_s |    0.004   -0.201   -0.005    0.003   -0.098   -0.004   -0.072    0.003   -0.009    1.000    0.001    0.090    0.325   -0.004    0.265   -0.160    0.010    0.086    0.149   -0.156   -0.028 |\n",
      "|  p3770_p |   -0.000   -0.008   -0.002    0.000   -0.006   -0.000   -0.005    0.000   -0.000    0.001    1.000    0.000   -0.002   -0.000    0.004   -0.001    0.001   -0.007    0.002   -0.004   -0.001 |\n",
      "|  p4040_s |   -0.012   -0.252   -0.008    0.004   -0.155   -0.005   -0.489    0.002   -0.005    0.090    0.000    1.000   -0.171   -0.006    0.245   -0.116    0.014   -0.280    0.192   -0.261   -0.040 |\n",
      "|  p4160_s |   -0.013   -0.149   -0.001    0.000    0.027   -0.001   -0.146    0.001   -0.008    0.325   -0.002   -0.171    1.000   -0.001    0.174   -0.102   -0.000    0.360    0.152   -0.140   -0.007 |\n",
      "|    rho_p |   -0.002   -0.003    0.000   -0.037    0.007    0.029    0.007    0.068   -0.010   -0.004   -0.000   -0.006   -0.001    1.000    0.007    0.007   -0.015    0.007   -0.013    0.005   -0.001 |\n",
      "| DDstar_p |    0.119   -0.057   -0.009   -0.015   -0.866    0.002   -0.463   -0.005    0.012    0.265    0.004    0.245    0.174    0.007    1.000   -0.375   -0.022   -0.187   -0.583   -0.226   -0.125 |\n",
      "|   jpsi_p |   -0.204   -0.047    0.004   -0.021    0.484   -0.011    0.273   -0.023   -0.009   -0.160   -0.001   -0.116   -0.102    0.007   -0.375    1.000   -0.051    0.101    0.157    0.155   -0.072 |\n",
      "|    phi_s |    0.004    0.003   -0.000    0.665   -0.023    0.004   -0.024   -0.000   -0.030    0.010    0.001    0.014   -0.000   -0.015   -0.022   -0.051    1.000   -0.023    0.038   -0.018    0.003 |\n",
      "|  p4040_p |   -0.071    0.068    0.008   -0.006    0.316    0.004    0.100   -0.005    0.001    0.086   -0.007   -0.280    0.360    0.007   -0.187    0.101   -0.023    1.000    0.085    0.151    0.006 |\n",
      "|      Ctt |   -0.105   -0.394   -0.005    0.016    0.726   -0.010    0.019    0.006   -0.009    0.149    0.002    0.192    0.152   -0.013   -0.583    0.157    0.038    0.085    1.000    0.099    0.012 |\n",
      "|  p4415_p |   -0.106    0.076    0.006   -0.005    0.315    0.003    0.378   -0.005    0.002   -0.156   -0.004   -0.261   -0.140    0.005   -0.226    0.155   -0.018    0.151    0.099    1.000    0.004 |\n",
      "|   Dbar_s |   -0.024   -0.107   -0.001   -0.001    0.024   -0.002    0.010   -0.000    0.002   -0.028   -0.001   -0.040   -0.007   -0.001   -0.125   -0.072    0.003    0.006    0.012    0.004    1.000 |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "Hesse errors: OrderedDict([(<zfit.Parameter 'DDstar_s' floating=True>, {'error': 0.07250574713180283}), (<zfit.Parameter 'psi2s_p' floating=True>, {'error': 0.03279041312803477}), (<zfit.Parameter 'p3770_s' floating=True>, {'error': 0.020719833031209278}), (<zfit.Parameter 'phi_p' floating=True>, {'error': 0.21175256962140443}), (<zfit.Parameter 'Dbar_p' floating=True>, {'error': 0.5390515014418154}), (<zfit.Parameter 'omega_p' floating=True>, {'error': 0.40002243029553286}), (<zfit.Parameter 'p4160_p' floating=True>, {'error': 0.1151446388573687}), (<zfit.Parameter 'omega_s' floating=True>, {'error': 1.3429633705852222}), (<zfit.Parameter 'rho_s' floating=True>, {'error': 0.3253633071849332}), (<zfit.Parameter 'p4415_s' floating=True>, {'error': 0.18278371576538566}), (<zfit.Parameter 'p3770_p' floating=True>, {'error': 0.01612767486210931}), (<zfit.Parameter 'p4040_s' floating=True>, {'error': 0.17727931046353868}), (<zfit.Parameter 'p4160_s' floating=True>, {'error': 0.16648879605894396}), (<zfit.Parameter 'rho_p' floating=True>, {'error': 0.09259387220435267}), (<zfit.Parameter 'DDstar_p' floating=True>, {'error': 0.32315355867066486}), (<zfit.Parameter 'jpsi_p' floating=True>, {'error': 0.026430330865767182}), (<zfit.Parameter 'phi_s' floating=True>, {'error': 1.0669074106060332}), (<zfit.Parameter 'p4040_p' floating=True>, {'error': 0.20395627218059165}), (<zfit.Parameter 'Ctt' floating=True>, {'error': 0.1888635165891296}), (<zfit.Parameter 'p4415_p' floating=True>, {'error': 0.15778078698680265}), (<zfit.Parameter 'Dbar_s' floating=True>, {'error': 0.0485814882950763})])\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Toy 5/15\n",
      "Time taken: 8 min, 54 s\n",
      "Projected time left: 17 min, 40 s\n",
      "Toy 5: Generating data...\n",
      "Toy 5: Data generation finished\n",
      "Toy 5: Loading data...\n",
      "Toy 5: Loading data finished\n",
      "Toy 5: Fitting pdf...\n",
      "------------------------------------------------------------------\n",
      "| FCN = 2.978E+05               |    Ncalls=1105 (1105 total)    |\n",
      "| EDM = 0.000113 (Goal: 5E-06)  |            up = 0.5            |\n",
      "------------------------------------------------------------------\n",
      "|  Valid Min.   | Valid Param.  | Above EDM | Reached call limit |\n",
      "------------------------------------------------------------------\n",
      "|     True      |     True      |   False   |       False        |\n",
      "------------------------------------------------------------------\n",
      "| Hesse failed  |   Has cov.    | Accurate  | Pos. def. | Forced |\n",
      "------------------------------------------------------------------\n",
      "|     False     |     True      |   True    |   True    | False  |\n",
      "------------------------------------------------------------------\n",
      "Function minimum: 297792.7390274959\n",
      "----------------------------------------------------------------------------------------------\n",
      "|   | Name     |   Value   | Hesse Err | Minos Err- | Minos Err+ | Limit-  | Limit+  | Fixed |\n",
      "----------------------------------------------------------------------------------------------\n",
      "| 0 | DDstar_s |   0.30    |   0.04    |            |            |  -0.3   |   0.3   |       |\n",
      "| 1 | psi2s_p  |   -2.10   |    0.03   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 2 | p3770_s  |   0.919   |   0.016   |            |            |0.918861 | 4.08114 |       |\n",
      "| 3 | phi_p    |   -0.07   |    0.43   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 4 | Dbar_p   |   -5.1    |    0.4    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 5 | omega_p  |   6.14    |   0.25    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 6 | p4160_p  |   4.26    |   0.14    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 7 | omega_s  |    6.0    |    1.0    |            |            | 4.19232 | 9.40768 |       |\n",
      "| 8 | rho_s    |   1.06    |   0.30    |            |            |0.0253049| 2.0747  |       |\n",
      "| 9 | p4415_s  |   0.126   |   0.019   |            |            |0.126447 | 2.35355 |       |\n",
      "| 10| p3770_p  |  -6.283   |   0.015   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 11| p4040_s  |   0.92    |   0.17    |            |            |0.00501244| 2.01499 |       |\n",
      "| 12| p4160_s  |   1.46    |   0.16    |            |            | 0.71676 | 3.68324 |       |\n",
      "| 13| rho_p    |    5.8    |    0.3    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 14| DDstar_p |   -0.19   |    0.40   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 15| jpsi_p   |   -1.68   |    0.03   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 16| phi_s    |   15.9    |    1.6    |            |            | 14.8182 | 23.5818 |       |\n",
      "| 17| p4040_p  |   -3.06   |    0.20   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 18| Ctt      |   0.43    |   0.16    |            |            |  -1.5   |   1.5   |       |\n",
      "| 19| p4415_p  |   -6.28   |    0.10   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 20| Dbar_s   |   -0.30   |    0.06   |            |            |  -0.3   |   0.3   |       |\n",
      "----------------------------------------------------------------------------------------------\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "|          | DDstar_s  psi2s_p  p3770_s    phi_p   Dbar_p  omega_p  p4160_p  omega_s    rho_s  p4415_s  p3770_p  p4040_s  p4160_s    rho_p DDstar_p   jpsi_p    phi_s  p4040_p      Ctt  p4415_p   Dbar_s |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "| DDstar_s |    1.000    0.039   -0.000    0.001    0.184    0.001   -0.030    0.001   -0.001   -0.001    0.001    0.032    0.007    0.004    0.020   -0.017    0.000   -0.012   -0.094   -0.000    0.009 |\n",
      "|  psi2s_p |    0.039    1.000    0.008   -0.008    0.100   -0.003    0.298   -0.006    0.005    0.010   -0.008   -0.209   -0.077   -0.016    0.268    0.134   -0.007    0.076   -0.280    0.001    0.097 |\n",
      "|  p3770_s |   -0.000    0.008    1.000    0.000   -0.000    0.000    0.006    0.000   -0.000    0.000   -0.002   -0.005    0.001    0.000    0.005    0.002   -0.000    0.005   -0.005   -0.000    0.001 |\n",
      "|    phi_p |    0.001   -0.008    0.000    1.000   -0.040    0.062    0.013    0.025    0.025    0.000   -0.000   -0.010    0.002    0.202    0.005   -0.034    0.884    0.011   -0.003   -0.000   -0.001 |\n",
      "|   Dbar_p |    0.184    0.100   -0.000   -0.040    1.000   -0.024   -0.241   -0.033    0.002   -0.014    0.005   -0.047   -0.365   -0.171   -0.594   -0.370   -0.011   -0.521   -0.699    0.015   -0.077 |\n",
      "|  omega_p |    0.001   -0.003    0.000    0.062   -0.024    1.000    0.009    0.435   -0.082    0.000   -0.000   -0.006    0.003   -0.008    0.002   -0.015    0.069    0.009   -0.003   -0.000   -0.001 |\n",
      "|  p4160_p |   -0.030    0.298    0.006    0.013   -0.241    0.009    1.000    0.011   -0.003    0.014   -0.002   -0.237   -0.049    0.057    0.384    0.193    0.002   -0.052   -0.056   -0.010   -0.005 |\n",
      "|  omega_s |    0.001   -0.006    0.000    0.025   -0.033    0.435    0.011    1.000   -0.436    0.000   -0.000   -0.011    0.004    0.244   -0.003   -0.031    0.053    0.011   -0.011   -0.000   -0.001 |\n",
      "|    rho_s |   -0.001    0.005   -0.000    0.025    0.002   -0.082   -0.003   -0.436    1.000   -0.000    0.000    0.007   -0.006    0.130    0.006    0.037    0.011   -0.007    0.020    0.000   -0.001 |\n",
      "|  p4415_s |   -0.001    0.010    0.000    0.000   -0.014    0.000    0.014    0.000   -0.000    1.000   -0.000   -0.004   -0.006    0.002    0.017    0.010    0.000    0.005    0.004   -0.011   -0.001 |\n",
      "|  p3770_p |    0.001   -0.008   -0.002   -0.000    0.005   -0.000   -0.002   -0.000    0.000   -0.000    1.000   -0.000   -0.004   -0.002   -0.000    0.002   -0.000   -0.006    0.003    0.000    0.001 |\n",
      "|  p4040_s |    0.032   -0.209   -0.005   -0.010   -0.047   -0.006   -0.237   -0.011    0.007   -0.004   -0.000    1.000   -0.355   -0.046    0.040    0.112   -0.003   -0.194    0.316    0.004    0.029 |\n",
      "|  p4160_s |    0.007   -0.077    0.001    0.002   -0.365    0.003   -0.049    0.004   -0.006   -0.006   -0.004   -0.355    1.000    0.017    0.091    0.092   -0.003    0.366    0.307   -0.006   -0.016 |\n",
      "|    rho_p |    0.004   -0.016    0.000    0.202   -0.171   -0.008    0.057    0.244    0.130    0.002   -0.002   -0.046    0.017    1.000   -0.008   -0.081    0.229    0.058   -0.030   -0.001   -0.009 |\n",
      "| DDstar_p |    0.020    0.268    0.005    0.005   -0.594    0.002    0.384   -0.003    0.006    0.017   -0.000    0.040    0.091   -0.008    1.000    0.712    0.004    0.331    0.541   -0.008   -0.097 |\n",
      "|   jpsi_p |   -0.017    0.134    0.002   -0.034   -0.370   -0.015    0.193   -0.031    0.037    0.010    0.002    0.112    0.092   -0.081    0.712    1.000   -0.021    0.207    0.565   -0.007    0.075 |\n",
      "|    phi_s |    0.000   -0.007   -0.000    0.884   -0.011    0.069    0.002    0.053    0.011    0.000   -0.000   -0.003   -0.003    0.229    0.004   -0.021    1.000   -0.001    0.002    0.000    0.000 |\n",
      "|  p4040_p |   -0.012    0.076    0.005    0.011   -0.521    0.009   -0.052    0.011   -0.007    0.005   -0.006   -0.194    0.366    0.058    0.331    0.207   -0.001    1.000    0.311   -0.008   -0.003 |\n",
      "|      Ctt |   -0.094   -0.280   -0.005   -0.003   -0.699   -0.003   -0.056   -0.011    0.020    0.004    0.003    0.316    0.307   -0.030    0.541    0.565    0.002    0.311    1.000   -0.012    0.019 |\n",
      "|  p4415_p |   -0.000    0.001   -0.000   -0.000    0.015   -0.000   -0.010   -0.000    0.000   -0.011    0.000    0.004   -0.006   -0.001   -0.008   -0.007    0.000   -0.008   -0.012    1.000   -0.000 |\n",
      "|   Dbar_s |    0.009    0.097    0.001   -0.001   -0.077   -0.001   -0.005   -0.001   -0.001   -0.001    0.001    0.029   -0.016   -0.009   -0.097    0.075    0.000   -0.003    0.019   -0.000    1.000 |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "Hesse errors: OrderedDict([(<zfit.Parameter 'DDstar_s' floating=True>, {'error': 0.03611647284244096}), (<zfit.Parameter 'psi2s_p' floating=True>, {'error': 0.03361463855214586}), (<zfit.Parameter 'p3770_s' floating=True>, {'error': 0.016189965772745674}), (<zfit.Parameter 'phi_p' floating=True>, {'error': 0.43060182206921915}), (<zfit.Parameter 'Dbar_p' floating=True>, {'error': 0.37411696369559655}), (<zfit.Parameter 'omega_p' floating=True>, {'error': 0.25300874115736693}), (<zfit.Parameter 'p4160_p' floating=True>, {'error': 0.1375721295162542}), (<zfit.Parameter 'omega_s' floating=True>, {'error': 1.0455409341279083}), (<zfit.Parameter 'rho_s' floating=True>, {'error': 0.3044715720220663}), (<zfit.Parameter 'p4415_s' floating=True>, {'error': 0.019118551309253037}), (<zfit.Parameter 'p3770_p' floating=True>, {'error': 0.014952751370907347}), (<zfit.Parameter 'p4040_s' floating=True>, {'error': 0.1711715112588067}), (<zfit.Parameter 'p4160_s' floating=True>, {'error': 0.16401303752038732}), (<zfit.Parameter 'rho_p' floating=True>, {'error': 0.3275399678824087}), (<zfit.Parameter 'DDstar_p' floating=True>, {'error': 0.4048736766079224}), (<zfit.Parameter 'jpsi_p' floating=True>, {'error': 0.031929473072436654}), (<zfit.Parameter 'phi_s' floating=True>, {'error': 1.6281233502938468}), (<zfit.Parameter 'p4040_p' floating=True>, {'error': 0.19778506090355275}), (<zfit.Parameter 'Ctt' floating=True>, {'error': 0.16399723635012453}), (<zfit.Parameter 'p4415_p' floating=True>, {'error': 0.10329236710642187}), (<zfit.Parameter 'Dbar_s' floating=True>, {'error': 0.05637441538376442})])\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Toy 6/15\n",
      "Time taken: 10 min, 50 s\n",
      "Projected time left: 16 min, 12 s\n",
      "Toy 6: Generating data...\n",
      "Toy 6: Data generation finished\n",
      "Toy 6: Loading data...\n",
      "Toy 6: Loading data finished\n",
      "Toy 6: Fitting pdf...\n",
      "------------------------------------------------------------------\n",
      "| FCN = 2.978E+05               |    Ncalls=1624 (1624 total)    |\n",
      "| EDM = 9.17E-06 (Goal: 5E-06)  |            up = 0.5            |\n",
      "------------------------------------------------------------------\n",
      "|  Valid Min.   | Valid Param.  | Above EDM | Reached call limit |\n",
      "------------------------------------------------------------------\n",
      "|     True      |     True      |   False   |       False        |\n",
      "------------------------------------------------------------------\n",
      "| Hesse failed  |   Has cov.    | Accurate  | Pos. def. | Forced |\n",
      "------------------------------------------------------------------\n",
      "|     False     |     True      |   True    |   True    | False  |\n",
      "------------------------------------------------------------------\n",
      "Function minimum: 297821.96716519614\n",
      "----------------------------------------------------------------------------------------------\n",
      "|   | Name     |   Value   | Hesse Err | Minos Err- | Minos Err+ | Limit-  | Limit+  | Fixed |\n",
      "----------------------------------------------------------------------------------------------\n",
      "| 0 | DDstar_s |   0.11    |   0.44    |            |            |  -0.3   |   0.3   |       |\n",
      "| 1 | psi2s_p  |   -2.21   |    0.04   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 2 | p3770_s  |   2.14    |   0.24    |            |            |0.918861 | 4.08114 |       |\n",
      "| 3 | phi_p    |   6.28    |   0.27    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 4 | Dbar_p   |    2.7    |    1.9    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 5 | omega_p  |   6.28    |   0.05    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 6 | p4160_p  |   -1.98   |    0.23   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 7 | omega_s  |    6.3    |    0.8    |            |            | 4.19232 | 9.40768 |       |\n",
      "| 8 | rho_s    |   1.07    |   0.30    |            |            |0.0253049| 2.0747  |       |\n",
      "| 9 | p4415_s  |    1.4    |    0.4    |            |            |0.126447 | 2.35355 |       |\n",
      "| 10| p3770_p  |   -1.89   |    0.15   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 11| p4040_s  |   0.88    |   0.31    |            |            |0.00501244| 2.01499 |       |\n",
      "| 12| p4160_s  |   2.16    |   0.25    |            |            | 0.71676 | 3.68324 |       |\n",
      "| 13| rho_p    |   -0.3    |    0.4    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 14| DDstar_p |     6     |    12     |            |            |-6.28319 | 6.28319 |       |\n",
      "| 15| jpsi_p   |   1.49    |   0.03    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 16| phi_s    |   17.8    |    0.8    |            |            | 14.8182 | 23.5818 |       |\n",
      "| 17| p4040_p  |   -2.79   |    0.20   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 18| Ctt      |   0.22    |   0.17    |            |            |  -1.5   |   1.5   |       |\n",
      "| 19| p4415_p  |   -2.26   |    0.17   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 20| Dbar_s   |   0.23    |   0.14    |            |            |  -0.3   |   0.3   |       |\n",
      "----------------------------------------------------------------------------------------------\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "|          | DDstar_s  psi2s_p  p3770_s    phi_p   Dbar_p  omega_p  p4160_p  omega_s    rho_s  p4415_s  p3770_p  p4040_s  p4160_s    rho_p DDstar_p   jpsi_p    phi_s  p4040_p      Ctt  p4415_p   Dbar_s |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "| DDstar_s |    1.000    0.305    0.350    0.044    0.969    0.001    0.896   -0.044   -0.094   -0.904    0.607   -0.866   -0.809   -0.612   -0.973   -0.426    0.227    0.215    0.222    0.529    0.679 |\n",
      "|  psi2s_p |    0.305    1.000    0.180    0.013    0.187    0.000    0.421   -0.015   -0.033   -0.319    0.421   -0.314   -0.287   -0.194   -0.322    0.154    0.068    0.220    0.053    0.306    0.427 |\n",
      "|  p3770_s |    0.350    0.180    1.000    0.015    0.393    0.000    0.309   -0.012   -0.038   -0.309    0.083   -0.266   -0.225   -0.191   -0.343   -0.307    0.069    0.181   -0.169    0.214    0.168 |\n",
      "|    phi_p |    0.044    0.013    0.015    1.000    0.044    0.001    0.038    0.013   -0.016   -0.038    0.025   -0.037   -0.034   -0.053   -0.043   -0.016   -0.386    0.007    0.014    0.022    0.023 |\n",
      "|   Dbar_p |    0.969    0.187    0.393    0.044    1.000    0.001    0.859   -0.044   -0.090   -0.882    0.538   -0.850   -0.774   -0.598   -0.973   -0.517    0.222    0.208    0.137    0.514    0.544 |\n",
      "|  omega_p |    0.001    0.000    0.000    0.001    0.001    1.000    0.001   -0.054    0.010   -0.001    0.000   -0.001   -0.001    0.007   -0.001   -0.000   -0.002    0.000    0.000    0.000    0.000 |\n",
      "|  p4160_p |    0.896    0.421    0.309    0.038    0.859    0.001    1.000   -0.038   -0.082   -0.814    0.638   -0.856   -0.749   -0.531   -0.906   -0.268    0.196    0.217    0.125    0.611    0.688 |\n",
      "|  omega_s |   -0.044   -0.015   -0.012    0.013   -0.044   -0.054   -0.038    1.000   -0.390    0.039   -0.026    0.037    0.036    0.207    0.044    0.016    0.024   -0.007   -0.017   -0.022   -0.026 |\n",
      "|    rho_s |   -0.094   -0.033   -0.038   -0.016   -0.090    0.010   -0.082   -0.390    1.000    0.080   -0.055    0.077    0.069    0.210    0.092    0.028   -0.022   -0.024   -0.027   -0.051   -0.057 |\n",
      "|  p4415_s |   -0.904   -0.319   -0.309   -0.038   -0.882   -0.001   -0.814    0.039    0.080    1.000   -0.571    0.790    0.796    0.539    0.898    0.351   -0.201   -0.160   -0.088   -0.532   -0.574 |\n",
      "|  p3770_p |    0.607    0.421    0.083    0.025    0.538    0.000    0.638   -0.026   -0.055   -0.571    1.000   -0.571   -0.491   -0.360   -0.609   -0.091    0.133    0.284    0.088    0.426    0.531 |\n",
      "|  p4040_s |   -0.866   -0.314   -0.266   -0.037   -0.850   -0.001   -0.856    0.037    0.077    0.790   -0.571    1.000    0.623    0.516    0.858    0.371   -0.193   -0.294   -0.023   -0.550   -0.539 |\n",
      "|  p4160_s |   -0.809   -0.287   -0.225   -0.034   -0.774   -0.001   -0.749    0.036    0.069    0.796   -0.491    0.623    1.000    0.485    0.799    0.278   -0.182    0.017   -0.125   -0.495   -0.511 |\n",
      "|    rho_p |   -0.612   -0.194   -0.191   -0.053   -0.598    0.007   -0.531    0.207    0.210    0.539   -0.360    0.516    0.485    1.000    0.606    0.278   -0.060   -0.105   -0.212   -0.311   -0.360 |\n",
      "| DDstar_p |   -0.973   -0.322   -0.343   -0.043   -0.973   -0.001   -0.906    0.044    0.092    0.898   -0.609    0.858    0.799    0.606    1.000    0.386   -0.224   -0.231   -0.225   -0.555   -0.658 |\n",
      "|   jpsi_p |   -0.426    0.154   -0.307   -0.016   -0.517   -0.000   -0.268    0.016    0.028    0.351   -0.091    0.371    0.278    0.278    0.386    1.000   -0.123   -0.049    0.129   -0.124    0.151 |\n",
      "|    phi_s |    0.227    0.068    0.069   -0.386    0.222   -0.002    0.196    0.024   -0.022   -0.201    0.133   -0.193   -0.182   -0.060   -0.224   -0.123    1.000    0.035    0.079    0.113    0.133 |\n",
      "|  p4040_p |    0.215    0.220    0.181    0.007    0.208    0.000    0.217   -0.007   -0.024   -0.160    0.284   -0.294    0.017   -0.105   -0.231   -0.049    0.035    1.000   -0.064    0.218    0.284 |\n",
      "|      Ctt |    0.222    0.053   -0.169    0.014    0.137    0.000    0.125   -0.017   -0.027   -0.088    0.088   -0.023   -0.125   -0.212   -0.225    0.129    0.079   -0.064    1.000    0.082    0.578 |\n",
      "|  p4415_p |    0.529    0.306    0.214    0.022    0.514    0.000    0.611   -0.022   -0.051   -0.532    0.426   -0.550   -0.495   -0.311   -0.555   -0.124    0.113    0.218    0.082    1.000    0.486 |\n",
      "|   Dbar_s |    0.679    0.427    0.168    0.023    0.544    0.000    0.688   -0.026   -0.057   -0.574    0.531   -0.539   -0.511   -0.360   -0.658    0.151    0.133    0.284    0.578    0.486    1.000 |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "Hesse errors: OrderedDict([(<zfit.Parameter 'DDstar_s' floating=True>, {'error': 0.44432734035601773}), (<zfit.Parameter 'psi2s_p' floating=True>, {'error': 0.036878739372118385}), (<zfit.Parameter 'p3770_s' floating=True>, {'error': 0.24163170716043492}), (<zfit.Parameter 'phi_p' floating=True>, {'error': 0.26685061243518327}), (<zfit.Parameter 'Dbar_p' floating=True>, {'error': 1.8938003749931651}), (<zfit.Parameter 'omega_p' floating=True>, {'error': 0.054040277888346644}), (<zfit.Parameter 'p4160_p' floating=True>, {'error': 0.22973618802672702}), (<zfit.Parameter 'omega_s' floating=True>, {'error': 0.829485303113572}), (<zfit.Parameter 'rho_s' floating=True>, {'error': 0.2989728525092007}), (<zfit.Parameter 'p4415_s' floating=True>, {'error': 0.38666282968402443}), (<zfit.Parameter 'p3770_p' floating=True>, {'error': 0.15417732883821156}), (<zfit.Parameter 'p4040_s' floating=True>, {'error': 0.31470454090350336}), (<zfit.Parameter 'p4160_s' floating=True>, {'error': 0.25436916099940765}), (<zfit.Parameter 'rho_p' floating=True>, {'error': 0.3612520088186706}), (<zfit.Parameter 'DDstar_p' floating=True>, {'error': 12.198321041217582}), (<zfit.Parameter 'jpsi_p' floating=True>, {'error': 0.0341789794736318}), (<zfit.Parameter 'phi_s' floating=True>, {'error': 0.8446426355961574}), (<zfit.Parameter 'p4040_p' floating=True>, {'error': 0.20400260325872943}), (<zfit.Parameter 'Ctt' floating=True>, {'error': 0.1702500087999711}), (<zfit.Parameter 'p4415_p' floating=True>, {'error': 0.17438998662216543}), (<zfit.Parameter 'Dbar_s' floating=True>, {'error': 0.14016386934785113})])\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Toy 7/15\n",
      "Time taken: 13 min, 21 s\n",
      "Projected time left: 15 min, 12 s\n",
      "Toy 7: Generating data...\n",
      "Toy 7: Data generation finished\n",
      "Toy 7: Loading data...\n",
      "Toy 7: Loading data finished\n",
      "Toy 7: Fitting pdf...\n",
      "------------------------------------------------------------------\n",
      "| FCN = 2.978E+05               |     Ncalls=639 (639 total)     |\n",
      "| EDM = 0.000874 (Goal: 5E-06)  |            up = 0.5            |\n",
      "------------------------------------------------------------------\n",
      "|  Valid Min.   | Valid Param.  | Above EDM | Reached call limit |\n",
      "------------------------------------------------------------------\n",
      "|     True      |     True      |   False   |       False        |\n",
      "------------------------------------------------------------------\n",
      "| Hesse failed  |   Has cov.    | Accurate  | Pos. def. | Forced |\n",
      "------------------------------------------------------------------\n",
      "|     False     |     True      |   True    |   True    | False  |\n",
      "------------------------------------------------------------------\n",
      "Function minimum: 297772.108219668\n",
      "----------------------------------------------------------------------------------------------\n",
      "|   | Name     |   Value   | Hesse Err | Minos Err- | Minos Err+ | Limit-  | Limit+  | Fixed |\n",
      "----------------------------------------------------------------------------------------------\n",
      "| 0 | DDstar_s |  -0.300   |   0.021   |            |            |  -0.3   |   0.3   |       |\n",
      "| 1 | psi2s_p  |   -2.06   |    0.03   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 2 | p3770_s  |   2.59    |   0.22    |            |            |0.918861 | 4.08114 |       |\n",
      "| 3 | phi_p    |    6.3    |    0.6    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 4 | Dbar_p   |   -5.21   |    0.29   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 5 | omega_p  |    0.8    |    0.5    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 6 | p4160_p  |   -2.13   |    0.10   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 7 | omega_s  |    8.4    |    1.6    |            |            | 4.19232 | 9.40768 |       |\n",
      "| 8 | rho_s    |    1.2    |    0.3    |            |            |0.0253049| 2.0747  |       |\n",
      "| 9 | p4415_s  |   1.34    |   0.18    |            |            |0.126447 | 2.35355 |       |\n",
      "| 10| p3770_p  |   4.19    |   0.10    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 11| p4040_s  |   1.33    |   0.17    |            |            |0.00501244| 2.01499 |       |\n",
      "| 12| p4160_s  |   2.14    |   0.17    |            |            | 0.71676 | 3.68324 |       |\n",
      "| 13| rho_p    |   -6.28   |    0.28   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 14| DDstar_p |   -4.80   |    0.21   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 15| jpsi_p   |   4.483   |   0.025   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 16| phi_s    |   17.0    |    0.9    |            |            | 14.8182 | 23.5818 |       |\n",
      "| 17| p4040_p  |   -2.48   |    0.14   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 18| Ctt      |   0.31    |   0.16    |            |            |  -1.5   |   1.5   |       |\n",
      "| 19| p4415_p  |   -2.26   |    0.16   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 20| Dbar_s   |  -0.300   |   0.012   |            |            |  -0.3   |   0.3   |       |\n",
      "----------------------------------------------------------------------------------------------\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "|          | DDstar_s  psi2s_p  p3770_s    phi_p   Dbar_p  omega_p  p4160_p  omega_s    rho_s  p4415_s  p3770_p  p4040_s  p4160_s    rho_p DDstar_p   jpsi_p    phi_s  p4040_p      Ctt  p4415_p   Dbar_s |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "| DDstar_s |    1.000    0.028   -0.013   -0.000   -0.013    0.001    0.031    0.002   -0.001   -0.001    0.015    0.004   -0.002   -0.003    0.003    0.066    0.002    0.014    0.024    0.021   -0.002 |\n",
      "|  psi2s_p |    0.028    1.000    0.259    0.002    0.088   -0.006    0.280   -0.007   -0.003   -0.180    0.290   -0.217   -0.104    0.000    0.202   -0.097   -0.005    0.225   -0.450    0.125    0.026 |\n",
      "|  p3770_s |   -0.013    0.259    1.000   -0.001   -0.084   -0.001   -0.030   -0.003   -0.005    0.066   -0.186    0.182    0.088    0.012   -0.099   -0.063   -0.013    0.013   -0.044    0.015   -0.015 |\n",
      "|    phi_p |   -0.000    0.002   -0.001    1.000    0.001   -0.007    0.000    0.007   -0.007    0.001    0.000    0.001    0.001   -0.019    0.001    0.011   -0.457    0.000    0.003    0.000   -0.000 |\n",
      "|   Dbar_p |   -0.013    0.088   -0.084    0.001    1.000   -0.001   -0.171    0.002   -0.006   -0.024   -0.061   -0.035   -0.058   -0.005   -0.593   -0.244    0.005   -0.171   -0.496   -0.127    0.006 |\n",
      "|  omega_p |    0.001   -0.006   -0.001   -0.007   -0.001    1.000   -0.004    0.860    0.456   -0.002   -0.003   -0.003   -0.003   -0.018    0.010   -0.018    0.060   -0.005    0.006   -0.004    0.001 |\n",
      "|  p4160_p |    0.031    0.280   -0.030    0.000   -0.171   -0.004    1.000   -0.009    0.004    0.013    0.253   -0.497   -0.150    0.015    0.225   -0.060   -0.016    0.158   -0.322    0.289    0.001 |\n",
      "|  omega_s |    0.002   -0.007   -0.003    0.007    0.002    0.860   -0.009    1.000    0.183   -0.001   -0.005   -0.002   -0.003    0.027    0.030   -0.004    0.059   -0.010    0.022   -0.008    0.001 |\n",
      "|    rho_s |   -0.001   -0.003   -0.005   -0.007   -0.006    0.456    0.004    0.183    1.000   -0.007    0.000   -0.004   -0.008    0.112   -0.028   -0.015    0.036    0.000   -0.017    0.002   -0.000 |\n",
      "|  p4415_s |   -0.001   -0.180    0.066    0.001   -0.024   -0.002    0.013   -0.001   -0.007    1.000   -0.124    0.144    0.324   -0.003   -0.314    0.025   -0.000    0.082    0.290   -0.106    0.006 |\n",
      "|  p3770_p |    0.015    0.290   -0.186    0.000   -0.061   -0.003    0.253   -0.005    0.000   -0.124    1.000   -0.152   -0.042    0.006    0.220   -0.052   -0.007    0.249   -0.312    0.126    0.007 |\n",
      "|  p4040_s |    0.004   -0.217    0.182    0.001   -0.035   -0.003   -0.497   -0.002   -0.004    0.144   -0.152    1.000    0.015   -0.001   -0.284    0.033   -0.002   -0.213    0.355   -0.195    0.007 |\n",
      "|  p4160_s |   -0.002   -0.104    0.088    0.001   -0.058   -0.003   -0.150   -0.003   -0.008    0.324   -0.042    0.015    1.000    0.002   -0.306   -0.005   -0.006    0.356    0.213   -0.154    0.001 |\n",
      "|    rho_p |   -0.003    0.000    0.012   -0.019   -0.005   -0.018    0.015    0.027    0.112   -0.003    0.006   -0.001    0.002    1.000   -0.060   -0.068    0.053    0.017   -0.058    0.012   -0.001 |\n",
      "| DDstar_p |    0.003    0.202   -0.099    0.001   -0.593    0.010    0.225    0.030   -0.028   -0.314    0.220   -0.284   -0.306   -0.060    1.000    0.364    0.056    0.041    0.137   -0.017   -0.034 |\n",
      "|   jpsi_p |    0.066   -0.097   -0.063    0.011   -0.244   -0.018   -0.060   -0.004   -0.015    0.025   -0.052    0.033   -0.005   -0.068    0.364    1.000    0.046   -0.083    0.467   -0.033    0.031 |\n",
      "|    phi_s |    0.002   -0.005   -0.013   -0.457    0.005    0.060   -0.016    0.059    0.036   -0.000   -0.007   -0.002   -0.006    0.053    0.056    0.046    1.000   -0.020    0.053   -0.014    0.001 |\n",
      "|  p4040_p |    0.014    0.225    0.013    0.000   -0.171   -0.005    0.158   -0.010    0.000    0.082    0.249   -0.213    0.356    0.017    0.041   -0.083   -0.020    1.000   -0.212    0.140   -0.002 |\n",
      "|      Ctt |    0.024   -0.450   -0.044    0.003   -0.496    0.006   -0.322    0.022   -0.017    0.290   -0.312    0.355    0.213   -0.058    0.137    0.467    0.053   -0.212    1.000   -0.113    0.000 |\n",
      "|  p4415_p |    0.021    0.125    0.015    0.000   -0.127   -0.004    0.289   -0.008    0.002   -0.106    0.126   -0.195   -0.154    0.012   -0.017   -0.033   -0.014    0.140   -0.113    1.000    0.001 |\n",
      "|   Dbar_s |   -0.002    0.026   -0.015   -0.000    0.006    0.001    0.001    0.001   -0.000    0.006    0.007    0.007    0.001   -0.001   -0.034    0.031    0.001   -0.002    0.000    0.001    1.000 |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "Hesse errors: OrderedDict([(<zfit.Parameter 'DDstar_s' floating=True>, {'error': 0.02099265254406224}), (<zfit.Parameter 'psi2s_p' floating=True>, {'error': 0.031985686677148184}), (<zfit.Parameter 'p3770_s' floating=True>, {'error': 0.22422202104896494}), (<zfit.Parameter 'phi_p' floating=True>, {'error': 0.629860846787544}), (<zfit.Parameter 'Dbar_p' floating=True>, {'error': 0.2897974450867711}), (<zfit.Parameter 'omega_p' floating=True>, {'error': 0.4533501907734814}), (<zfit.Parameter 'p4160_p' floating=True>, {'error': 0.0995713895967607}), (<zfit.Parameter 'omega_s' floating=True>, {'error': 1.617330652551181}), (<zfit.Parameter 'rho_s' floating=True>, {'error': 0.344499363289316}), (<zfit.Parameter 'p4415_s' floating=True>, {'error': 0.18359678355700648}), (<zfit.Parameter 'p3770_p' floating=True>, {'error': 0.10372422017612504}), (<zfit.Parameter 'p4040_s' floating=True>, {'error': 0.16911810203173783}), (<zfit.Parameter 'p4160_s' floating=True>, {'error': 0.16635223490472117}), (<zfit.Parameter 'rho_p' floating=True>, {'error': 0.27793624202621325}), (<zfit.Parameter 'DDstar_p' floating=True>, {'error': 0.21326674855152516}), (<zfit.Parameter 'jpsi_p' floating=True>, {'error': 0.02491082064701633}), (<zfit.Parameter 'phi_s' floating=True>, {'error': 0.8710227308396323}), (<zfit.Parameter 'p4040_p' floating=True>, {'error': 0.13813721431423853}), (<zfit.Parameter 'Ctt' floating=True>, {'error': 0.15508536610717105}), (<zfit.Parameter 'p4415_p' floating=True>, {'error': 0.156953300068557}), (<zfit.Parameter 'Dbar_s' floating=True>, {'error': 0.012042467227299236})])\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Toy 8/15\n",
      "Time taken: 15 min, 6 s\n",
      "Projected time left: 13 min, 11 s\n",
      "Toy 8: Generating data...\n",
      "Toy 8: Data generation finished\n",
      "Toy 8: Loading data...\n",
      "Toy 8: Loading data finished\n",
      "Toy 8: Fitting pdf...\n",
      "------------------------------------------------------------------\n",
      "| FCN = 2.976E+05               |    Ncalls=1062 (1062 total)    |\n",
      "| EDM = 6.61E-05 (Goal: 5E-06)  |            up = 0.5            |\n",
      "------------------------------------------------------------------\n",
      "|  Valid Min.   | Valid Param.  | Above EDM | Reached call limit |\n",
      "------------------------------------------------------------------\n",
      "|     True      |     True      |   False   |       False        |\n",
      "------------------------------------------------------------------\n",
      "| Hesse failed  |   Has cov.    | Accurate  | Pos. def. | Forced |\n",
      "------------------------------------------------------------------\n",
      "|     False     |     True      |   True    |   True    | False  |\n",
      "------------------------------------------------------------------\n",
      "Function minimum: 297565.8770833331\n",
      "----------------------------------------------------------------------------------------------\n",
      "|   | Name     |   Value   | Hesse Err | Minos Err- | Minos Err+ | Limit-  | Limit+  | Fixed |\n",
      "----------------------------------------------------------------------------------------------\n",
      "| 0 | DDstar_s |   0.300   |   0.020   |            |            |  -0.3   |   0.3   |       |\n",
      "| 1 | psi2s_p  |   -2.05   |    0.03   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 2 | p3770_s  |   1.97    |   0.23    |            |            |0.918861 | 4.08114 |       |\n",
      "| 3 | phi_p    |    6.3    |    0.7    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 4 | Dbar_p   |   -1.87   |    0.28   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 5 | omega_p  |   -5.57   |    0.31   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 6 | p4160_p  |   4.19    |   0.10    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 7 | omega_s  |     9     |     4     |            |            | 4.19232 | 9.40768 |       |\n",
      "| 8 | rho_s    |    0.7    |    0.4    |            |            |0.0253049| 2.0747  |       |\n",
      "| 9 | p4415_s  |   1.24    |   0.18    |            |            |0.126447 | 2.35355 |       |\n",
      "| 10| p3770_p  |   -2.19   |    0.13   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 11| p4040_s  |   1.29    |   0.17    |            |            |0.00501244| 2.01499 |       |\n",
      "| 12| p4160_s  |   2.15    |   0.16    |            |            | 0.71676 | 3.68324 |       |\n",
      "| 13| rho_p    |   -6.28   |    0.14   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 14| DDstar_p |   -1.04   |    0.22   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 15| jpsi_p   |  -1.729   |   0.026   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 16| phi_s    |   17.1    |    1.1    |            |            | 14.8182 | 23.5818 |       |\n",
      "| 17| p4040_p  |   -2.92   |    0.14   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 18| Ctt      |   0.44    |   0.15    |            |            |  -1.5   |   1.5   |       |\n",
      "| 19| p4415_p  |   -2.54   |    0.16   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 20| Dbar_s   |   0.300   |   0.014   |            |            |  -0.3   |   0.3   |       |\n",
      "----------------------------------------------------------------------------------------------\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "|          | DDstar_s  psi2s_p  p3770_s    phi_p   Dbar_p  omega_p  p4160_p  omega_s    rho_s  p4415_s  p3770_p  p4040_s  p4160_s    rho_p DDstar_p   jpsi_p    phi_s  p4040_p      Ctt  p4415_p   Dbar_s |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "| DDstar_s |    1.000    0.019   -0.007   -0.000    0.004    0.000    0.022   -0.000    0.000    0.008    0.003    0.012    0.007   -0.000    0.047    0.048    0.000    0.017    0.018    0.021   -0.001 |\n",
      "|  psi2s_p |    0.019    1.000    0.209    0.004    0.140   -0.004    0.277    0.003   -0.004   -0.187    0.298   -0.228   -0.103   -0.000    0.182   -0.032   -0.003    0.132   -0.446    0.076    0.024 |\n",
      "|  p3770_s |   -0.007    0.209    1.000   -0.001   -0.127    0.005   -0.046    0.001    0.001    0.067   -0.151    0.153    0.088    0.004   -0.081   -0.084   -0.012    0.071   -0.017    0.024   -0.013 |\n",
      "|    phi_p |   -0.000    0.004   -0.001    1.000    0.002   -0.051    0.000    0.000   -0.032    0.002    0.000    0.002    0.002   -0.006    0.002    0.020   -0.716    0.002    0.005    0.001   -0.000 |\n",
      "|   Dbar_p |    0.004    0.140   -0.127    0.002    1.000   -0.014   -0.203    0.000   -0.020   -0.041   -0.031   -0.017   -0.118   -0.003   -0.622   -0.228    0.010   -0.245   -0.540   -0.194    0.003 |\n",
      "|  omega_p |    0.000   -0.004    0.005   -0.051   -0.014    1.000    0.006   -0.641    0.634   -0.009    0.003   -0.008   -0.006   -0.070   -0.031   -0.043    0.059    0.004   -0.033    0.001   -0.000 |\n",
      "|  p4160_p |    0.022    0.277   -0.046    0.000   -0.203    0.006    1.000    0.001    0.006   -0.060    0.232   -0.423   -0.152    0.002    0.313    0.024   -0.009   -0.037   -0.264    0.296    0.002 |\n",
      "|  omega_s |   -0.000    0.003    0.001    0.000    0.000   -0.641    0.001    1.000   -0.194    0.001    0.001    0.001    0.002    0.013   -0.003    0.008   -0.025    0.003   -0.002    0.002   -0.000 |\n",
      "|    rho_s |    0.000   -0.004    0.001   -0.032   -0.020    0.634    0.006   -0.194    1.000   -0.013    0.002   -0.010   -0.012   -0.060   -0.041   -0.031    0.038    0.001   -0.035   -0.001   -0.001 |\n",
      "|  p4415_s |    0.008   -0.187    0.067    0.002   -0.041   -0.009   -0.060    0.001   -0.013    1.000   -0.104    0.065    0.330   -0.001   -0.215   -0.011    0.002    0.111    0.268   -0.131    0.006 |\n",
      "|  p3770_p |    0.003    0.298   -0.151    0.000   -0.031    0.003    0.232    0.001    0.002   -0.104    1.000   -0.162    0.001    0.002    0.166   -0.025   -0.006    0.213   -0.294    0.107    0.004 |\n",
      "|  p4040_s |    0.012   -0.228    0.153    0.002   -0.017   -0.008   -0.423    0.001   -0.010    0.065   -0.162    1.000   -0.220   -0.002   -0.140    0.039    0.006   -0.232    0.337   -0.211    0.009 |\n",
      "|  p4160_s |    0.007   -0.103    0.088    0.002   -0.118   -0.006   -0.152    0.002   -0.012    0.330    0.001   -0.220    1.000    0.001   -0.220   -0.050   -0.004    0.342    0.190   -0.098   -0.001 |\n",
      "|    rho_p |   -0.000   -0.000    0.004   -0.006   -0.003   -0.070    0.002    0.013   -0.060   -0.001    0.002   -0.002    0.001    1.000   -0.011   -0.017    0.012    0.004   -0.013    0.002   -0.000 |\n",
      "| DDstar_p |    0.047    0.182   -0.081    0.002   -0.622   -0.031    0.313   -0.003   -0.041   -0.215    0.166   -0.140   -0.220   -0.011    1.000    0.482    0.035    0.034    0.266    0.025   -0.029 |\n",
      "|   jpsi_p |    0.048   -0.032   -0.084    0.020   -0.228   -0.043    0.024    0.008   -0.031   -0.011   -0.025    0.039   -0.050   -0.017    0.482    1.000    0.030   -0.059    0.441   -0.007    0.030 |\n",
      "|    phi_s |    0.000   -0.003   -0.012   -0.716    0.010    0.059   -0.009   -0.025    0.038    0.002   -0.006    0.006   -0.004    0.012    0.035    0.030    1.000   -0.014    0.039   -0.007    0.001 |\n",
      "|  p4040_p |    0.017    0.132    0.071    0.002   -0.245    0.004   -0.037    0.003    0.001    0.111    0.213   -0.232    0.342    0.004    0.034   -0.059   -0.014    1.000   -0.057    0.084    0.001 |\n",
      "|      Ctt |    0.018   -0.446   -0.017    0.005   -0.540   -0.033   -0.264   -0.002   -0.035    0.268   -0.294    0.337    0.190   -0.013    0.266    0.441    0.039   -0.057    1.000   -0.020    0.004 |\n",
      "|  p4415_p |    0.021    0.076    0.024    0.001   -0.194    0.001    0.296    0.002   -0.001   -0.131    0.107   -0.211   -0.098    0.002    0.025   -0.007   -0.007    0.084   -0.020    1.000    0.001 |\n",
      "|   Dbar_s |   -0.001    0.024   -0.013   -0.000    0.003   -0.000    0.002   -0.000   -0.001    0.006    0.004    0.009   -0.001   -0.000   -0.029    0.030    0.001    0.001    0.004    0.001    1.000 |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "Hesse errors: OrderedDict([(<zfit.Parameter 'DDstar_s' floating=True>, {'error': 0.0196453830464568}), (<zfit.Parameter 'psi2s_p' floating=True>, {'error': 0.03230487708659302}), (<zfit.Parameter 'p3770_s' floating=True>, {'error': 0.23404874264246}), (<zfit.Parameter 'phi_p' floating=True>, {'error': 0.7067191467603697}), (<zfit.Parameter 'Dbar_p' floating=True>, {'error': 0.28341234260322423}), (<zfit.Parameter 'omega_p' floating=True>, {'error': 0.3088682394090321}), (<zfit.Parameter 'p4160_p' floating=True>, {'error': 0.09801873202794731}), (<zfit.Parameter 'omega_s' floating=True>, {'error': 3.910501005534545}), (<zfit.Parameter 'rho_s' floating=True>, {'error': 0.3960136927170923}), (<zfit.Parameter 'p4415_s' floating=True>, {'error': 0.180877756504227}), (<zfit.Parameter 'p3770_p' floating=True>, {'error': 0.13009166875793632}), (<zfit.Parameter 'p4040_s' floating=True>, {'error': 0.16996293376167626}), (<zfit.Parameter 'p4160_s' floating=True>, {'error': 0.16444745642292513}), (<zfit.Parameter 'rho_p' floating=True>, {'error': 0.14323434555829495}), (<zfit.Parameter 'DDstar_p' floating=True>, {'error': 0.2246140163504724}), (<zfit.Parameter 'jpsi_p' floating=True>, {'error': 0.02588339558115038}), (<zfit.Parameter 'phi_s' floating=True>, {'error': 1.1110094800179695}), (<zfit.Parameter 'p4040_p' floating=True>, {'error': 0.13729111230658964}), (<zfit.Parameter 'Ctt' floating=True>, {'error': 0.15034744218220908}), (<zfit.Parameter 'p4415_p' floating=True>, {'error': 0.1643743026523572}), (<zfit.Parameter 'Dbar_s' floating=True>, {'error': 0.01437065786054098})])\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Toy 9/15\n",
      "Time taken: 17 min, 18 s\n",
      "Projected time left: 11 min, 30 s\n",
      "Toy 9: Generating data...\n",
      "Toy 9: Data generation finished\n",
      "Toy 9: Loading data...\n",
      "Toy 9: Loading data finished\n",
      "Toy 9: Fitting pdf...\n",
      "------------------------------------------------------------------\n",
      "| FCN = 2.977E+05               |    Ncalls=1118 (1118 total)    |\n",
      "| EDM = 0.00108 (Goal: 5E-06)   |            up = 0.5            |\n",
      "------------------------------------------------------------------\n",
      "|  Valid Min.   | Valid Param.  | Above EDM | Reached call limit |\n",
      "------------------------------------------------------------------\n",
      "|     False     |     True      |   True    |       False        |\n",
      "------------------------------------------------------------------\n",
      "| Hesse failed  |   Has cov.    | Accurate  | Pos. def. | Forced |\n",
      "------------------------------------------------------------------\n",
      "|     False     |     True      |   False   |   False   |  True  |\n",
      "------------------------------------------------------------------\n",
      "Function minimum: 297715.0895674021\n",
      "----------------------------------------------------------------------------------------------\n",
      "|   | Name     |   Value   | Hesse Err | Minos Err- | Minos Err+ | Limit-  | Limit+  | Fixed |\n",
      "----------------------------------------------------------------------------------------------\n",
      "| 0 | DDstar_s |   -0.30   |    0.58   |            |            |  -0.3   |   0.3   |       |\n",
      "| 1 | psi2s_p  |   -2.21   |    0.04   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 2 | p3770_s  |   2.66    |   0.22    |            |            |0.918861 | 4.08114 |       |\n",
      "| 3 | phi_p    |   -6.02   |    0.28   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 4 | Dbar_p   |   -3.4    |    1.4    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 5 | omega_p  |   0.62    |   0.31    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 6 | p4160_p  |   4.09    |   0.24    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 7 | omega_s  |    6.9    |    1.5    |            |            | 4.19232 | 9.40768 |       |\n",
      "| 8 | rho_s    |   1.24    |   0.26    |            |            |0.0253049| 2.0747  |       |\n",
      "| 9 | p4415_s  |   1.14    |   0.25    |            |            |0.126447 | 2.35355 |       |\n",
      "| 10| p3770_p  |   -2.44   |    0.12   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 11| p4040_s  |   0.96    |   0.18    |            |            |0.00501244| 2.01499 |       |\n",
      "| 12| p4160_s  |   2.24    |   0.19    |            |            | 0.71676 | 3.68324 |       |\n",
      "| 13| rho_p    |   -0.84   |    0.31   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 14| DDstar_p |   -5.21   |    0.31   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 15| jpsi_p   |   -4.84   |    0.05   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 16| phi_s    |   17.8    |    1.2    |            |            | 14.8182 | 23.5818 |       |\n",
      "| 17| p4040_p  |   3.19    |   0.19    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 18| Ctt      |   -0.19   |    0.25   |            |            |  -1.5   |   1.5   |       |\n",
      "| 19| p4415_p  |   -2.86   |    0.19   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 20| Dbar_s   |   -0.30   |    0.47   |            |            |  -0.3   |   0.3   |       |\n",
      "----------------------------------------------------------------------------------------------\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "|          | DDstar_s  psi2s_p  p3770_s    phi_p   Dbar_p  omega_p  p4160_p  omega_s    rho_s  p4415_s  p3770_p  p4040_s  p4160_s    rho_p DDstar_p   jpsi_p    phi_s  p4040_p      Ctt  p4415_p   Dbar_s |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "| DDstar_s |    1.000    0.700   -0.182    0.051   -0.977   -0.042    0.936   -0.047    0.275   -0.743    0.640   -0.562   -0.652   -0.494    0.717    0.817    0.158    0.479    0.803    0.473    0.946 |\n",
      "|  psi2s_p |    0.700    1.000   -0.055    0.036   -0.613   -0.032    0.709   -0.036    0.202   -0.545    0.591   -0.425   -0.476   -0.364    0.492    0.643    0.113    0.401    0.529    0.370    0.647 |\n",
      "|  p3770_s |   -0.182   -0.055    1.000   -0.009    0.148    0.011   -0.176    0.013   -0.069    0.139   -0.235    0.171    0.166    0.110   -0.105   -0.206   -0.035   -0.032   -0.225   -0.063   -0.138 |\n",
      "|    phi_p |    0.051    0.036   -0.009    1.000   -0.047   -0.001    0.048   -0.053    0.068   -0.037    0.033   -0.028   -0.033   -0.034    0.036    0.034    0.805    0.024    0.043    0.024    0.048 |\n",
      "|   Dbar_p |   -0.977   -0.613    0.148   -0.047    1.000    0.042   -0.897    0.048   -0.270    0.732   -0.586    0.563    0.634    0.488   -0.708   -0.728   -0.153   -0.446   -0.742   -0.443   -0.900 |\n",
      "|  omega_p |   -0.042   -0.032    0.011   -0.001    0.042    1.000   -0.037    0.777    0.130    0.030   -0.026    0.023    0.027    0.040   -0.037   -0.035    0.016   -0.016   -0.039   -0.017   -0.037 |\n",
      "|  p4160_p |    0.936    0.709   -0.176    0.048   -0.897   -0.037    1.000   -0.043    0.251   -0.706    0.654   -0.619   -0.629   -0.450    0.703    0.791    0.145    0.435    0.704    0.517    0.904 |\n",
      "|  omega_s |   -0.047   -0.036    0.013   -0.053    0.048    0.777   -0.043    1.000   -0.182    0.034   -0.030    0.026    0.032    0.014   -0.041   -0.042   -0.015   -0.019   -0.045   -0.020   -0.043 |\n",
      "|    rho_s |    0.275    0.202   -0.069    0.068   -0.270    0.130    0.251   -0.182    1.000   -0.201    0.173   -0.153   -0.185   -0.074    0.222    0.208    0.052    0.113    0.250    0.118    0.253 |\n",
      "|  p4415_s |   -0.743   -0.545    0.139   -0.037    0.732    0.030   -0.706    0.034   -0.201    1.000   -0.513    0.477    0.628    0.357   -0.635   -0.596   -0.116   -0.303   -0.501   -0.431   -0.708 |\n",
      "|  p3770_p |    0.640    0.591   -0.235    0.033   -0.586   -0.026    0.654   -0.030    0.173   -0.513    1.000   -0.412   -0.409   -0.311    0.522    0.557    0.099    0.427    0.442    0.353    0.627 |\n",
      "|  p4040_s |   -0.562   -0.425    0.171   -0.028    0.563    0.023   -0.619    0.026   -0.153    0.477   -0.412    1.000    0.233    0.272   -0.543   -0.414   -0.088   -0.371   -0.305   -0.355   -0.537 |\n",
      "|  p4160_s |   -0.652   -0.476    0.166   -0.033    0.634    0.027   -0.629    0.032   -0.185    0.628   -0.409    0.233    1.000    0.322   -0.577   -0.542   -0.105   -0.122   -0.471   -0.317   -0.603 |\n",
      "|    rho_p |   -0.494   -0.364    0.110   -0.034    0.488    0.040   -0.450    0.014   -0.074    0.357   -0.311    0.272    0.322    1.000   -0.413   -0.384   -0.054   -0.210   -0.446   -0.217   -0.452 |\n",
      "| DDstar_p |    0.717    0.492   -0.105    0.036   -0.708   -0.037    0.703   -0.041    0.222   -0.635    0.522   -0.543   -0.577   -0.413    1.000    0.508    0.125    0.313    0.624    0.250    0.813 |\n",
      "|   jpsi_p |    0.817    0.643   -0.206    0.034   -0.728   -0.035    0.791   -0.042    0.208   -0.596    0.557   -0.414   -0.542   -0.384    0.508    1.000    0.111    0.413    0.700    0.419    0.820 |\n",
      "|    phi_s |    0.158    0.113   -0.035    0.805   -0.153    0.016    0.145   -0.015    0.052   -0.116    0.099   -0.088   -0.105   -0.054    0.125    0.111    1.000    0.067    0.140    0.069    0.146 |\n",
      "|  p4040_p |    0.479    0.401   -0.032    0.024   -0.446   -0.016    0.435   -0.019    0.113   -0.303    0.427   -0.371   -0.122   -0.210    0.313    0.413    0.067    1.000    0.342    0.303    0.501 |\n",
      "|      Ctt |    0.803    0.529   -0.225    0.043   -0.742   -0.039    0.704   -0.045    0.250   -0.501    0.442   -0.305   -0.471   -0.446    0.624    0.700    0.140    0.342    1.000    0.385    0.855 |\n",
      "|  p4415_p |    0.473    0.370   -0.063    0.024   -0.443   -0.017    0.517   -0.020    0.118   -0.431    0.353   -0.355   -0.317   -0.217    0.250    0.419    0.069    0.303    0.385    1.000    0.476 |\n",
      "|   Dbar_s |    0.946    0.647   -0.138    0.048   -0.900   -0.037    0.904   -0.043    0.253   -0.708    0.627   -0.537   -0.603   -0.452    0.813    0.820    0.146    0.501    0.855    0.476    1.000 |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "Hesse errors: OrderedDict([(<zfit.Parameter 'DDstar_s' floating=True>, {'error': 0.5821715334008924}), (<zfit.Parameter 'psi2s_p' floating=True>, {'error': 0.04131640537273462}), (<zfit.Parameter 'p3770_s' floating=True>, {'error': 0.21984161750024045}), (<zfit.Parameter 'phi_p' floating=True>, {'error': 0.28365082285628107}), (<zfit.Parameter 'Dbar_p' floating=True>, {'error': 1.3684345206099042}), (<zfit.Parameter 'omega_p' floating=True>, {'error': 0.31132304587782933}), (<zfit.Parameter 'p4160_p' floating=True>, {'error': 0.23649579119102704}), (<zfit.Parameter 'omega_s' floating=True>, {'error': 1.46496914321241}), (<zfit.Parameter 'rho_s' floating=True>, {'error': 0.26326614530101033}), (<zfit.Parameter 'p4415_s' floating=True>, {'error': 0.2529375597528801}), (<zfit.Parameter 'p3770_p' floating=True>, {'error': 0.11866854842053187}), (<zfit.Parameter 'p4040_s' floating=True>, {'error': 0.17949338688015137}), (<zfit.Parameter 'p4160_s' floating=True>, {'error': 0.1854967201844855}), (<zfit.Parameter 'rho_p' floating=True>, {'error': 0.310067244364181}), (<zfit.Parameter 'DDstar_p' floating=True>, {'error': 0.3064972492246345}), (<zfit.Parameter 'jpsi_p' floating=True>, {'error': 0.04636879091167945}), (<zfit.Parameter 'phi_s' floating=True>, {'error': 1.238688047530701}), (<zfit.Parameter 'p4040_p' floating=True>, {'error': 0.18812051585423983}), (<zfit.Parameter 'Ctt' floating=True>, {'error': 0.24667793938365867}), (<zfit.Parameter 'p4415_p' floating=True>, {'error': 0.1850483940597778}), (<zfit.Parameter 'Dbar_s' floating=True>, {'error': 0.4686880034091037})])\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Toy 10/15\n",
      "Time taken: 19 min, 40 s\n",
      "Projected time left: 9 min, 50 s\n",
      "Toy 10: Generating data...\n",
      "Toy 10: Data generation finished\n",
      "Toy 10: Loading data...\n",
      "Toy 10: Loading data finished\n",
      "Toy 10: Fitting pdf...\n",
      "------------------------------------------------------------------\n",
      "| FCN = 2.979E+05               |    Ncalls=1418 (1418 total)    |\n",
      "| EDM = 4.91E-05 (Goal: 5E-06)  |            up = 0.5            |\n",
      "------------------------------------------------------------------\n",
      "|  Valid Min.   | Valid Param.  | Above EDM | Reached call limit |\n",
      "------------------------------------------------------------------\n",
      "|     True      |     True      |   False   |       False        |\n",
      "------------------------------------------------------------------\n",
      "| Hesse failed  |   Has cov.    | Accurate  | Pos. def. | Forced |\n",
      "------------------------------------------------------------------\n",
      "|     False     |     True      |   True    |   True    | False  |\n",
      "------------------------------------------------------------------\n",
      "Function minimum: 297904.0635656783\n",
      "----------------------------------------------------------------------------------------------\n",
      "|   | Name     |   Value   | Hesse Err | Minos Err- | Minos Err+ | Limit-  | Limit+  | Fixed |\n",
      "----------------------------------------------------------------------------------------------\n",
      "| 0 | DDstar_s |  -0.300   |   0.015   |            |            |  -0.3   |   0.3   |       |\n",
      "| 1 | psi2s_p  |   -2.01   |    0.03   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 2 | p3770_s  |   0.919   |   0.022   |            |            |0.918861 | 4.08114 |       |\n",
      "| 3 | phi_p    |   -6.28   |    0.28   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 4 | Dbar_p   |   4.93    |   0.20    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 5 | omega_p  |   6.28    |   0.27    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 6 | p4160_p  |  -6.283   |   0.009   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 7 | omega_s  |    5.8    |    0.9    |            |            | 4.19232 | 9.40768 |       |\n",
      "| 8 | rho_s    |    1.0    |    0.3    |            |            |0.0253049| 2.0747  |       |\n",
      "| 9 | p4415_s  |   0.52    |   0.17    |            |            |0.126447 | 2.35355 |       |\n",
      "| 10| p3770_p  |  -6.283   |   0.018   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 11| p4040_s  |   1.32    |   0.16    |            |            |0.00501244| 2.01499 |       |\n",
      "| 12| p4160_s  |   0.717   |   0.017   |            |            | 0.71676 | 3.68324 |       |\n",
      "| 13| rho_p    |   6.21    |   0.28    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 14| DDstar_p |    3.3    |    0.3    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 15| jpsi_p   |  -1.663   |   0.028   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 16| phi_s    |   16.8    |    0.9    |            |            | 14.8182 | 23.5818 |       |\n",
      "| 17| p4040_p  |   2.99    |   0.12    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 18| Ctt      |   -0.05   |    0.12   |            |            |  -1.5   |   1.5   |       |\n",
      "| 19| p4415_p  |   -1.7    |    0.4    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 20| Dbar_s   |   0.30    |   0.06    |            |            |  -0.3   |   0.3   |       |\n",
      "----------------------------------------------------------------------------------------------\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "|          | DDstar_s  psi2s_p  p3770_s    phi_p   Dbar_p  omega_p  p4160_p  omega_s    rho_s  p4415_s  p3770_p  p4040_s  p4160_s    rho_p DDstar_p   jpsi_p    phi_s  p4040_p      Ctt  p4415_p   Dbar_s |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "| DDstar_s |    1.000    0.018   -0.000    0.000    0.112   -0.000   -0.000   -0.000    0.002    0.021    0.000    0.018   -0.001    0.004   -0.006   -0.009   -0.002    0.003   -0.040   -0.007    0.003 |\n",
      "|  psi2s_p |    0.018    1.000    0.010   -0.002    0.420    0.001    0.001   -0.000   -0.006   -0.152   -0.007   -0.187    0.013   -0.016    0.239    0.177    0.003    0.071   -0.409    0.080    0.083 |\n",
      "|  p3770_s |   -0.000    0.010    1.000   -0.000    0.006   -0.000   -0.000   -0.000   -0.000   -0.002   -0.002   -0.007    0.000    0.000    0.002    0.000   -0.000    0.006   -0.012    0.003    0.001 |\n",
      "|    phi_p |    0.000   -0.002   -0.000    1.000   -0.004   -0.007    0.000   -0.008    0.018   -0.002   -0.000   -0.002    0.000    0.038    0.000   -0.010    0.424   -0.001   -0.003    0.001   -0.000 |\n",
      "|   Dbar_p |    0.112    0.420    0.006   -0.004    1.000    0.006    0.006    0.022   -0.079   -0.290    0.008    0.015   -0.001   -0.141   -0.107    0.289    0.070   -0.354   -0.357   -0.127   -0.068 |\n",
      "|  omega_p |   -0.000    0.001   -0.000   -0.007    0.006    1.000    0.000   -0.238    0.054    0.001    0.000    0.002   -0.000    0.005   -0.002    0.007   -0.016   -0.001    0.004   -0.001   -0.000 |\n",
      "|  p4160_p |   -0.000    0.001   -0.000    0.000    0.006    0.000    1.000    0.000   -0.000   -0.005    0.000    0.008   -0.002   -0.000   -0.002    0.000    0.000   -0.002   -0.003    0.003   -0.000 |\n",
      "|  omega_s |   -0.000   -0.000   -0.000   -0.008    0.022   -0.238    0.000    1.000   -0.355    0.002    0.000    0.004   -0.000    0.272   -0.004   -0.004    0.029   -0.005    0.004   -0.003    0.001 |\n",
      "|    rho_s |    0.002   -0.006   -0.000    0.018   -0.079    0.054   -0.000   -0.355    1.000   -0.013   -0.000   -0.017    0.001    0.137    0.008   -0.009    0.017    0.009   -0.013    0.009   -0.003 |\n",
      "|  p4415_s |    0.021   -0.152   -0.002   -0.002   -0.290    0.001   -0.005    0.002   -0.013    1.000   -0.001   -0.053    0.008   -0.022    0.148    0.097    0.008    0.180    0.388   -0.005    0.021 |\n",
      "|  p3770_p |    0.000   -0.007   -0.002   -0.000    0.008    0.000    0.000    0.000   -0.000   -0.001    1.000    0.000   -0.000   -0.002    0.002    0.006    0.001   -0.007    0.006   -0.002    0.001 |\n",
      "|  p4040_s |    0.018   -0.187   -0.007   -0.002    0.015    0.002    0.008    0.004   -0.017   -0.053    0.000    1.000   -0.007   -0.040    0.030    0.117    0.020   -0.208    0.367   -0.151    0.015 |\n",
      "|  p4160_s |   -0.001    0.013    0.000    0.000   -0.001   -0.000   -0.002   -0.000    0.001    0.008   -0.000   -0.007    1.000    0.002    0.016    0.004   -0.001   -0.005   -0.012    0.009    0.002 |\n",
      "|    rho_p |    0.004   -0.016    0.000    0.038   -0.141    0.005   -0.000    0.272    0.137   -0.022   -0.002   -0.040    0.002    1.000    0.020   -0.084    0.088    0.028   -0.066    0.023   -0.003 |\n",
      "| DDstar_p |   -0.006    0.239    0.002    0.000   -0.107   -0.002   -0.002   -0.004    0.008    0.148    0.002    0.030    0.016    0.020    1.000    0.493   -0.014    0.361    0.263    0.077   -0.018 |\n",
      "|   jpsi_p |   -0.009    0.177    0.000   -0.010    0.289    0.007    0.000   -0.004   -0.009    0.097    0.006    0.117    0.004   -0.084    0.493    1.000    0.030    0.089    0.331   -0.014    0.124 |\n",
      "|    phi_s |   -0.002    0.003   -0.000    0.424    0.070   -0.016    0.000    0.029    0.017    0.008    0.001    0.020   -0.001    0.088   -0.014    0.030    1.000   -0.020    0.034   -0.012    0.000 |\n",
      "|  p4040_p |    0.003    0.071    0.006   -0.001   -0.354   -0.001   -0.002   -0.005    0.009    0.180   -0.007   -0.208   -0.005    0.028    0.361    0.089   -0.020    1.000    0.135   -0.017    0.050 |\n",
      "|      Ctt |   -0.040   -0.409   -0.012   -0.003   -0.357    0.004   -0.003    0.004   -0.013    0.388    0.006    0.367   -0.012   -0.066    0.263    0.331    0.034    0.135    1.000   -0.099    0.100 |\n",
      "|  p4415_p |   -0.007    0.080    0.003    0.001   -0.127   -0.001    0.003   -0.003    0.009   -0.005   -0.002   -0.151    0.009    0.023    0.077   -0.014   -0.012   -0.017   -0.099    1.000   -0.006 |\n",
      "|   Dbar_s |    0.003    0.083    0.001   -0.000   -0.068   -0.000   -0.000    0.001   -0.003    0.021    0.001    0.015    0.002   -0.003   -0.018    0.124    0.000    0.050    0.100   -0.006    1.000 |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "Hesse errors: OrderedDict([(<zfit.Parameter 'DDstar_s' floating=True>, {'error': 0.015469631748245116}), (<zfit.Parameter 'psi2s_p' floating=True>, {'error': 0.034695428084363655}), (<zfit.Parameter 'p3770_s' floating=True>, {'error': 0.022194210202051645}), (<zfit.Parameter 'phi_p' floating=True>, {'error': 0.2780672627857754}), (<zfit.Parameter 'Dbar_p' floating=True>, {'error': 0.19976666949371236}), (<zfit.Parameter 'omega_p' floating=True>, {'error': 0.2671937212382529}), (<zfit.Parameter 'p4160_p' floating=True>, {'error': 0.008580998223017389}), (<zfit.Parameter 'omega_s' floating=True>, {'error': 0.9308826751044559}), (<zfit.Parameter 'rho_s' floating=True>, {'error': 0.3211034332540267}), (<zfit.Parameter 'p4415_s' floating=True>, {'error': 0.1749638492204419}), (<zfit.Parameter 'p3770_p' floating=True>, {'error': 0.018367254946825007}), (<zfit.Parameter 'p4040_s' floating=True>, {'error': 0.15837229358404126}), (<zfit.Parameter 'p4160_s' floating=True>, {'error': 0.016571663411109938}), (<zfit.Parameter 'rho_p' floating=True>, {'error': 0.2805341149071232}), (<zfit.Parameter 'DDstar_p' floating=True>, {'error': 0.3200735521877265}), (<zfit.Parameter 'jpsi_p' floating=True>, {'error': 0.027568144333935507}), (<zfit.Parameter 'phi_s' floating=True>, {'error': 0.8688869085260684}), (<zfit.Parameter 'p4040_p' floating=True>, {'error': 0.11813129607659967}), (<zfit.Parameter 'Ctt' floating=True>, {'error': 0.12382067380795514}), (<zfit.Parameter 'p4415_p' floating=True>, {'error': 0.3551574054217759}), (<zfit.Parameter 'Dbar_s' floating=True>, {'error': 0.05842372924645711})])\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Toy 11/15\n",
      "Time taken: 22 min, 21 s\n",
      "Projected time left: 8 min, 4 s\n",
      "Toy 11: Generating data...\n",
      "Toy 11: Data generation finished\n",
      "Toy 11: Loading data...\n",
      "Toy 11: Loading data finished\n",
      "Toy 11: Fitting pdf...\n",
      "------------------------------------------------------------------\n",
      "| FCN = 2.979E+05               |     Ncalls=982 (982 total)     |\n",
      "| EDM = 3.91E-05 (Goal: 5E-06)  |            up = 0.5            |\n",
      "------------------------------------------------------------------\n",
      "|  Valid Min.   | Valid Param.  | Above EDM | Reached call limit |\n",
      "------------------------------------------------------------------\n",
      "|     True      |     True      |   False   |       False        |\n",
      "------------------------------------------------------------------\n",
      "| Hesse failed  |   Has cov.    | Accurate  | Pos. def. | Forced |\n",
      "------------------------------------------------------------------\n",
      "|     False     |     True      |   True    |   True    | False  |\n",
      "------------------------------------------------------------------\n",
      "Function minimum: 297919.27944936405\n",
      "----------------------------------------------------------------------------------------------\n",
      "|   | Name     |   Value   | Hesse Err | Minos Err- | Minos Err+ | Limit-  | Limit+  | Fixed |\n",
      "----------------------------------------------------------------------------------------------\n",
      "| 0 | DDstar_s |   -0.30   |    0.04   |            |            |  -0.3   |   0.3   |       |\n",
      "| 1 | psi2s_p  |   -2.10   |    0.03   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 2 | p3770_s  |   0.919   |   0.020   |            |            |0.918861 | 4.08114 |       |\n",
      "| 3 | phi_p    |   0.73    |   0.16    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 4 | Dbar_p   |    1.4    |    0.4    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 5 | omega_p  |   0.05    |   0.33    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 6 | p4160_p  |   -2.08   |    0.12   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 7 | omega_s  |    6.5    |    1.1    |            |            | 4.19232 | 9.40768 |       |\n",
      "| 8 | rho_s    |    0.9    |    0.4    |            |            |0.0253049| 2.0747  |       |\n",
      "| 9 | p4415_s  |   0.95    |   0.19    |            |            |0.126447 | 2.35355 |       |\n",
      "| 10| p3770_p  |  -6.283   |   0.016   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 11| p4040_s  |   0.88    |   0.17    |            |            |0.00501244| 2.01499 |       |\n",
      "| 12| p4160_s  |   1.93    |   0.16    |            |            | 0.71676 | 3.68324 |       |\n",
      "| 13| rho_p    |   -6.28   |    0.07   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 14| DDstar_p |    2.3    |    0.4    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 15| jpsi_p   |   4.566   |   0.028   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 16| phi_s    |   20.8    |    0.9    |            |            | 14.8182 | 23.5818 |       |\n",
      "| 17| p4040_p  |   3.63    |   0.20    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 18| Ctt      |   0.34    |   0.17    |            |            |  -1.5   |   1.5   |       |\n",
      "| 19| p4415_p  |   -2.71   |    0.21   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 20| Dbar_s   |   -0.30   |    0.04   |            |            |  -0.3   |   0.3   |       |\n",
      "----------------------------------------------------------------------------------------------\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "|          | DDstar_s  psi2s_p  p3770_s    phi_p   Dbar_p  omega_p  p4160_p  omega_s    rho_s  p4415_s  p3770_p  p4040_s  p4160_s    rho_p DDstar_p   jpsi_p    phi_s  p4040_p      Ctt  p4415_p   Dbar_s |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "| DDstar_s |    1.000    0.062    0.000    0.002    0.021    0.001    0.044   -0.000    0.002    0.021    0.001    0.035    0.025    0.000    0.093    0.098   -0.000    0.030    0.020    0.047   -0.005 |\n",
      "|  psi2s_p |    0.062    1.000    0.009   -0.000    0.195   -0.005    0.241   -0.000   -0.002   -0.196   -0.008   -0.257   -0.158   -0.001    0.083    0.018    0.005    0.081   -0.432    0.002    0.088 |\n",
      "|  p3770_s |    0.000    0.009    1.000    0.000   -0.002   -0.000    0.009   -0.000   -0.000   -0.004   -0.002   -0.006   -0.001   -0.000    0.007    0.002    0.000    0.007   -0.007    0.003    0.001 |\n",
      "|    phi_p |    0.002   -0.000    0.000    1.000    0.002   -0.060   -0.001   -0.048    0.014    0.002    0.000    0.002    0.000   -0.020    0.018    0.006    0.539   -0.004    0.015   -0.001    0.002 |\n",
      "|   Dbar_p |    0.021    0.195   -0.002    0.002    1.000   -0.007   -0.364    0.011   -0.028    0.038    0.005    0.018   -0.126   -0.001   -0.816   -0.349    0.021   -0.327   -0.678   -0.279    0.025 |\n",
      "|  omega_p |    0.001   -0.005   -0.000   -0.060   -0.007    1.000    0.004    0.640   -0.054   -0.005   -0.000   -0.006   -0.001    0.009   -0.009   -0.032    0.001    0.005   -0.018    0.001    0.000 |\n",
      "|  p4160_p |    0.044    0.241    0.009   -0.001   -0.364    0.004    1.000   -0.006    0.011   -0.112   -0.003   -0.458   -0.131    0.001    0.436    0.144   -0.014    0.082   -0.054    0.324   -0.004 |\n",
      "|  omega_s |   -0.000   -0.000   -0.000   -0.048    0.011    0.640   -0.006    1.000   -0.344    0.004    0.000    0.004    0.001    0.052    0.009    0.007    0.010   -0.006    0.013   -0.003    0.001 |\n",
      "|    rho_s |    0.002   -0.002   -0.000    0.014   -0.028   -0.054    0.011   -0.344    1.000   -0.012   -0.000   -0.010   -0.009   -0.055   -0.010   -0.008   -0.038    0.006   -0.014    0.001   -0.002 |\n",
      "|  p4415_s |    0.021   -0.196   -0.004    0.002    0.038   -0.005   -0.112    0.004   -0.012    1.000    0.000    0.133    0.325   -0.001   -0.163   -0.030    0.011    0.072    0.196   -0.184    0.023 |\n",
      "|  p3770_p |    0.001   -0.008   -0.002    0.000    0.005   -0.000   -0.003    0.000   -0.000    0.000    1.000   -0.002   -0.003   -0.000   -0.002    0.002    0.001   -0.005    0.003   -0.003    0.001 |\n",
      "|  p4040_s |    0.035   -0.257   -0.006    0.002    0.018   -0.006   -0.458    0.004   -0.010    0.133   -0.002    1.000   -0.151   -0.002   -0.140    0.005    0.012   -0.216    0.287   -0.205    0.031 |\n",
      "|  p4160_s |    0.025   -0.158   -0.001    0.000   -0.126   -0.001   -0.131    0.001   -0.009    0.325   -0.003   -0.151    1.000    0.000   -0.098   -0.039   -0.002    0.383    0.212   -0.057    0.006 |\n",
      "|    rho_p |    0.000   -0.001   -0.000   -0.020   -0.001    0.009    0.001    0.052   -0.055   -0.001   -0.000   -0.002    0.000    1.000   -0.004   -0.011   -0.004    0.002   -0.007    0.001   -0.000 |\n",
      "| DDstar_p |    0.093    0.083    0.007    0.018   -0.816   -0.009    0.436    0.009   -0.010   -0.163   -0.002   -0.140   -0.098   -0.004    1.000    0.560    0.038    0.205    0.518    0.146   -0.081 |\n",
      "|   jpsi_p |    0.098    0.018    0.002    0.006   -0.349   -0.032    0.144    0.007   -0.008   -0.030    0.002    0.005   -0.039   -0.011    0.560    1.000    0.058    0.023    0.489    0.053    0.068 |\n",
      "|    phi_s |   -0.000    0.005    0.000    0.539    0.021    0.001   -0.014    0.010   -0.038    0.011    0.001    0.012   -0.002   -0.004    0.038    0.058    1.000   -0.020    0.055   -0.008    0.002 |\n",
      "|  p4040_p |    0.030    0.081    0.007   -0.004   -0.327    0.005    0.082   -0.006    0.006    0.072   -0.005   -0.216    0.383    0.002    0.205    0.023   -0.020    1.000    0.058    0.153   -0.004 |\n",
      "|      Ctt |    0.020   -0.432   -0.007    0.015   -0.678   -0.018   -0.054    0.013   -0.014    0.196    0.003    0.287    0.212   -0.007    0.518    0.489    0.055    0.058    1.000    0.125   -0.000 |\n",
      "|  p4415_p |    0.047    0.002    0.003   -0.001   -0.279    0.001    0.324   -0.003    0.001   -0.184   -0.003   -0.205   -0.057    0.001    0.146    0.053   -0.008    0.153    0.125    1.000    0.002 |\n",
      "|   Dbar_s |   -0.005    0.088    0.001    0.002    0.025    0.000   -0.004    0.001   -0.002    0.023    0.001    0.031    0.006   -0.000   -0.081    0.068    0.002   -0.004   -0.000    0.002    1.000 |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "Hesse errors: OrderedDict([(<zfit.Parameter 'DDstar_s' floating=True>, {'error': 0.04269675798502981}), (<zfit.Parameter 'psi2s_p' floating=True>, {'error': 0.03295027318935739}), (<zfit.Parameter 'p3770_s' floating=True>, {'error': 0.019589913888333033}), (<zfit.Parameter 'phi_p' floating=True>, {'error': 0.15776014718292242}), (<zfit.Parameter 'Dbar_p' floating=True>, {'error': 0.41003776802528913}), (<zfit.Parameter 'omega_p' floating=True>, {'error': 0.32998494255338917}), (<zfit.Parameter 'p4160_p' floating=True>, {'error': 0.1152429073373713}), (<zfit.Parameter 'omega_s' floating=True>, {'error': 1.11942191194206}), (<zfit.Parameter 'rho_s' floating=True>, {'error': 0.3522002172587729}), (<zfit.Parameter 'p4415_s' floating=True>, {'error': 0.18623974523802644}), (<zfit.Parameter 'p3770_p' floating=True>, {'error': 0.015596842409330236}), (<zfit.Parameter 'p4040_s' floating=True>, {'error': 0.16661550354684507}), (<zfit.Parameter 'p4160_s' floating=True>, {'error': 0.16454055772411424}), (<zfit.Parameter 'rho_p' floating=True>, {'error': 0.06541999076036031}), (<zfit.Parameter 'DDstar_p' floating=True>, {'error': 0.35128954875854923}), (<zfit.Parameter 'jpsi_p' floating=True>, {'error': 0.02793445015393825}), (<zfit.Parameter 'phi_s' floating=True>, {'error': 0.9393211426628945}), (<zfit.Parameter 'p4040_p' floating=True>, {'error': 0.20192246953664483}), (<zfit.Parameter 'Ctt' floating=True>, {'error': 0.16512026872995733}), (<zfit.Parameter 'p4415_p' floating=True>, {'error': 0.21350743532878758}), (<zfit.Parameter 'Dbar_s' floating=True>, {'error': 0.04423388950774243})])\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Toy 12/15\n",
      "Time taken: 24 min, 48 s\n",
      "Projected time left: 6 min, 12 s\n",
      "Toy 12: Generating data...\n",
      "Toy 12: Data generation finished\n",
      "Toy 12: Loading data...\n",
      "Toy 12: Loading data finished\n",
      "Toy 12: Fitting pdf...\n",
      "------------------------------------------------------------------\n",
      "| FCN = 2.974E+05               |    Ncalls=1032 (1032 total)    |\n",
      "| EDM = 1.69E-05 (Goal: 5E-06)  |            up = 0.5            |\n",
      "------------------------------------------------------------------\n",
      "|  Valid Min.   | Valid Param.  | Above EDM | Reached call limit |\n",
      "------------------------------------------------------------------\n",
      "|     True      |     True      |   False   |       False        |\n",
      "------------------------------------------------------------------\n",
      "| Hesse failed  |   Has cov.    | Accurate  | Pos. def. | Forced |\n",
      "------------------------------------------------------------------\n",
      "|     False     |     True      |   True    |   True    | False  |\n",
      "------------------------------------------------------------------\n",
      "Function minimum: 297448.96448540484\n",
      "----------------------------------------------------------------------------------------------\n",
      "|   | Name     |   Value   | Hesse Err | Minos Err- | Minos Err+ | Limit-  | Limit+  | Fixed |\n",
      "----------------------------------------------------------------------------------------------\n",
      "| 0 | DDstar_s |   0.015   |   0.457   |            |            |  -0.3   |   0.3   |       |\n",
      "| 1 | psi2s_p  |   -2.09   |    0.04   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 2 | p3770_s  |   1.93    |   0.24    |            |            |0.918861 | 4.08114 |       |\n",
      "| 3 | phi_p    |   -6.1    |    0.3    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 4 | Dbar_p   |    4.3    |    1.3    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 5 | omega_p  |   0.58    |   0.29    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 6 | p4160_p  |   -1.95   |    0.13   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 7 | omega_s  |    9.3    |    1.1    |            |            | 4.19232 | 9.40768 |       |\n",
      "| 8 | rho_s    |    0.5    |    0.4    |            |            |0.0253049| 2.0747  |       |\n",
      "| 9 | p4415_s  |    1.7    |    0.4    |            |            |0.126447 | 2.35355 |       |\n",
      "| 10| p3770_p  |   4.44    |   0.21    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 11| p4040_s  |    0.9    |    0.4    |            |            |0.00501244| 2.01499 |       |\n",
      "| 12| p4160_s  |    2.8    |    0.4    |            |            | 0.71676 | 3.68324 |       |\n",
      "| 13| rho_p    |    -6     |     7     |            |            |-6.28319 | 6.28319 |       |\n",
      "| 14| DDstar_p |    -6     |     8     |            |            |-6.28319 | 6.28319 |       |\n",
      "| 15| jpsi_p   |   4.56    |   0.06    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 16| phi_s    |   19.0    |    1.6    |            |            | 14.8182 | 23.5818 |       |\n",
      "| 17| p4040_p  |   -2.37   |    0.19   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 18| Ctt      |   0.55    |   0.22    |            |            |  -1.5   |   1.5   |       |\n",
      "| 19| p4415_p  |   -2.24   |    0.15   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 20| Dbar_s   |   0.300   |   0.018   |            |            |  -0.3   |   0.3   |       |\n",
      "----------------------------------------------------------------------------------------------\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "|          | DDstar_s  psi2s_p  p3770_s    phi_p   Dbar_p  omega_p  p4160_p  omega_s    rho_s  p4415_s  p3770_p  p4040_s  p4160_s    rho_p DDstar_p   jpsi_p    phi_s  p4040_p      Ctt  p4415_p   Dbar_s |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "| DDstar_s |    1.000    0.694   -0.377    0.198   -0.982    0.361    0.820    0.020   -0.425   -0.908    0.797   -0.906   -0.906   -0.785   -0.989    0.922    0.292   -0.034    0.778   -0.556   -0.301 |\n",
      "|  psi2s_p |    0.694    1.000   -0.069    0.129   -0.652    0.244    0.668    0.012   -0.288   -0.666    0.635   -0.674   -0.637   -0.532   -0.683    0.600    0.192    0.115    0.324   -0.321   -0.182 |\n",
      "|  p3770_s |   -0.377   -0.069    1.000   -0.075    0.335   -0.148   -0.294   -0.007    0.157    0.356   -0.363    0.405    0.367    0.314    0.370   -0.362   -0.113    0.051   -0.325    0.243    0.091 |\n",
      "|    phi_p |    0.198    0.129   -0.075    1.000   -0.190    0.167    0.153   -0.017   -0.101   -0.177    0.154   -0.178   -0.177   -0.227   -0.196    0.174    0.866   -0.014    0.162   -0.115   -0.057 |\n",
      "|   Dbar_p |   -0.982   -0.652    0.335   -0.190    1.000   -0.345   -0.819   -0.019    0.406    0.875   -0.774    0.873    0.867    0.750    0.970   -0.901   -0.280   -0.007   -0.818    0.508    0.291 |\n",
      "|  omega_p |    0.361    0.244   -0.148    0.167   -0.345    1.000    0.280    0.364    0.186   -0.322    0.281   -0.323   -0.324   -0.585   -0.357    0.350    0.161   -0.030    0.307   -0.210   -0.105 |\n",
      "|  p4160_p |    0.820    0.668   -0.294    0.153   -0.819    0.280    1.000    0.015   -0.332   -0.731    0.718   -0.844   -0.758   -0.611   -0.806    0.726    0.226    0.047    0.512   -0.302   -0.238 |\n",
      "|  omega_s |    0.020    0.012   -0.007   -0.017   -0.019    0.364    0.015    1.000    0.011   -0.018    0.015   -0.018   -0.018   -0.005   -0.020    0.015   -0.000   -0.001    0.015   -0.012   -0.006 |\n",
      "|    rho_s |   -0.425   -0.288    0.157   -0.101    0.406    0.186   -0.332    0.011    1.000    0.375   -0.332    0.378    0.374    0.356    0.420   -0.395   -0.128    0.023   -0.349    0.241    0.124 |\n",
      "|  p4415_s |   -0.908   -0.666    0.356   -0.177    0.875   -0.322   -0.731   -0.018    0.375    1.000   -0.737    0.833    0.868    0.698    0.898   -0.817   -0.261    0.074   -0.619    0.459    0.271 |\n",
      "|  p3770_p |    0.797    0.635   -0.363    0.154   -0.774    0.281    0.718    0.015   -0.332   -0.737    1.000   -0.743   -0.712   -0.612   -0.787    0.713    0.227    0.099    0.506   -0.389   -0.230 |\n",
      "|  p4040_s |   -0.906   -0.674    0.405   -0.178    0.873   -0.323   -0.844   -0.018    0.378    0.833   -0.743    1.000    0.798    0.701    0.896   -0.818   -0.262   -0.039   -0.604    0.438    0.271 |\n",
      "|  p4160_s |   -0.906   -0.637    0.367   -0.177    0.867   -0.324   -0.758   -0.018    0.374    0.868   -0.712    0.798    1.000    0.701    0.896   -0.819   -0.261    0.200   -0.639    0.465    0.266 |\n",
      "|    rho_p |   -0.785   -0.532    0.314   -0.227    0.750   -0.585   -0.611   -0.005    0.356    0.698   -0.612    0.701    0.701    1.000    0.776   -0.757   -0.243    0.060   -0.663    0.453    0.229 |\n",
      "| DDstar_p |   -0.989   -0.683    0.370   -0.196    0.970   -0.357   -0.806   -0.020    0.420    0.898   -0.787    0.896    0.896    0.776    1.000   -0.906   -0.289    0.036   -0.765    0.554    0.297 |\n",
      "|   jpsi_p |    0.922    0.600   -0.362    0.174   -0.901    0.350    0.726    0.015   -0.395   -0.817    0.713   -0.818   -0.819   -0.757   -0.906    1.000    0.264   -0.059    0.809   -0.514   -0.253 |\n",
      "|    phi_s |    0.292    0.192   -0.113    0.866   -0.280    0.161    0.226   -0.000   -0.128   -0.261    0.227   -0.262   -0.261   -0.243   -0.289    0.264    1.000   -0.022    0.241   -0.170   -0.085 |\n",
      "|  p4040_p |   -0.034    0.115    0.051   -0.014   -0.007   -0.030    0.047   -0.001    0.023    0.074    0.099   -0.039    0.200    0.060    0.036   -0.059   -0.022    1.000   -0.137    0.145    0.004 |\n",
      "|      Ctt |    0.778    0.324   -0.325    0.162   -0.818    0.307    0.512    0.015   -0.349   -0.619    0.506   -0.604   -0.639   -0.663   -0.765    0.809    0.241   -0.137    1.000   -0.459   -0.226 |\n",
      "|  p4415_p |   -0.556   -0.321    0.243   -0.115    0.508   -0.210   -0.302   -0.012    0.241    0.459   -0.389    0.438    0.465    0.453    0.554   -0.514   -0.170    0.145   -0.459    1.000    0.167 |\n",
      "|   Dbar_s |   -0.301   -0.182    0.091   -0.057    0.291   -0.105   -0.238   -0.006    0.124    0.271   -0.230    0.271    0.266    0.229    0.297   -0.253   -0.085    0.004   -0.226    0.167    1.000 |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "Hesse errors: OrderedDict([(<zfit.Parameter 'DDstar_s' floating=True>, {'error': 0.4570813567467453}), (<zfit.Parameter 'psi2s_p' floating=True>, {'error': 0.04276468242962217}), (<zfit.Parameter 'p3770_s' floating=True>, {'error': 0.23535527190975092}), (<zfit.Parameter 'phi_p' floating=True>, {'error': 0.33903875113051374}), (<zfit.Parameter 'Dbar_p' floating=True>, {'error': 1.2553712896283908}), (<zfit.Parameter 'omega_p' floating=True>, {'error': 0.28903345127045776}), (<zfit.Parameter 'p4160_p' floating=True>, {'error': 0.13344387479478304}), (<zfit.Parameter 'omega_s' floating=True>, {'error': 1.0671033307425422}), (<zfit.Parameter 'rho_s' floating=True>, {'error': 0.36959565819129037}), (<zfit.Parameter 'p4415_s' floating=True>, {'error': 0.39399942891736994}), (<zfit.Parameter 'p3770_p' floating=True>, {'error': 0.21066787774312523}), (<zfit.Parameter 'p4040_s' floating=True>, {'error': 0.3676230434786605}), (<zfit.Parameter 'p4160_s' floating=True>, {'error': 0.3504468146871518}), (<zfit.Parameter 'rho_p' floating=True>, {'error': 7.372019677146743}), (<zfit.Parameter 'DDstar_p' floating=True>, {'error': 7.600345377502435}), (<zfit.Parameter 'jpsi_p' floating=True>, {'error': 0.057372644196525435}), (<zfit.Parameter 'phi_s' floating=True>, {'error': 1.5675168407012787}), (<zfit.Parameter 'p4040_p' floating=True>, {'error': 0.1868822492484279}), (<zfit.Parameter 'Ctt' floating=True>, {'error': 0.218952990206583}), (<zfit.Parameter 'p4415_p' floating=True>, {'error': 0.1520251297285382}), (<zfit.Parameter 'Dbar_s' floating=True>, {'error': 0.01769015278674363})])\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Toy 13/15\n",
      "Time taken: 27 min, 25 s\n",
      "Projected time left: 4 min, 12 s\n",
      "Toy 13: Generating data...\n",
      "Toy 13: Data generation finished\n",
      "Toy 13: Loading data...\n",
      "Toy 13: Loading data finished\n",
      "Toy 13: Fitting pdf...\n",
      "------------------------------------------------------------------\n",
      "| FCN = 2.978E+05               |    Ncalls=1177 (1177 total)    |\n",
      "| EDM = 4.07E-05 (Goal: 5E-06)  |            up = 0.5            |\n",
      "------------------------------------------------------------------\n",
      "|  Valid Min.   | Valid Param.  | Above EDM | Reached call limit |\n",
      "------------------------------------------------------------------\n",
      "|     True      |     True      |   False   |       False        |\n",
      "------------------------------------------------------------------\n",
      "| Hesse failed  |   Has cov.    | Accurate  | Pos. def. | Forced |\n",
      "------------------------------------------------------------------\n",
      "|     False     |     True      |   True    |   True    | False  |\n",
      "------------------------------------------------------------------\n",
      "Function minimum: 297823.64034128044\n",
      "----------------------------------------------------------------------------------------------\n",
      "|   | Name     |   Value   | Hesse Err | Minos Err- | Minos Err+ | Limit-  | Limit+  | Fixed |\n",
      "----------------------------------------------------------------------------------------------\n",
      "| 0 | DDstar_s |   0.30    |   0.44    |            |            |  -0.3   |   0.3   |       |\n",
      "| 1 | psi2s_p  |   -2.20   |    0.04   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 2 | p3770_s  |   2.53    |   0.24    |            |            |0.918861 | 4.08114 |       |\n",
      "| 3 | phi_p    |   0.56    |   0.23    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 4 | Dbar_p   |   -3.8    |    0.5    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 5 | omega_p  |   1.27    |   0.23    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 6 | p4160_p  |   4.32    |   0.10    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 7 | omega_s  |    9.4    |    0.7    |            |            | 4.19232 | 9.40768 |       |\n",
      "| 8 | rho_s    |    1.6    |    0.4    |            |            |0.0253049| 2.0747  |       |\n",
      "| 9 | p4415_s  |   1.36    |   0.18    |            |            |0.126447 | 2.35355 |       |\n",
      "| 10| p3770_p  |   -2.24   |    0.11   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 11| p4040_s  |   0.005   |   0.019   |            |            |0.00501244| 2.01499 |       |\n",
      "| 12| p4160_s  |   2.28    |   0.15    |            |            | 0.71676 | 3.68324 |       |\n",
      "| 13| rho_p    |   -6.28   |    0.13   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 14| DDstar_p |   -1.5    |    0.4    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 15| jpsi_p   |   -4.93   |    0.04   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 16| phi_s    |   19.6    |    1.1    |            |            | 14.8182 | 23.5818 |       |\n",
      "| 17| p4040_p  |    -6     |     10    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 18| Ctt      |   -0.71   |    0.21   |            |            |  -1.5   |   1.5   |       |\n",
      "| 19| p4415_p  |   3.87    |   0.16    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 20| Dbar_s   |   -0.30   |    0.58   |            |            |  -0.3   |   0.3   |       |\n",
      "----------------------------------------------------------------------------------------------\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "|          | DDstar_s  psi2s_p  p3770_s    phi_p   Dbar_p  omega_p  p4160_p  omega_s    rho_s  p4415_s  p3770_p  p4040_s  p4160_s    rho_p DDstar_p   jpsi_p    phi_s  p4040_p      Ctt  p4415_p   Dbar_s |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "| DDstar_s |    1.000   -0.032    0.036    0.008   -0.480   -0.000    0.228   -0.003    0.001   -0.083   -0.003    0.005   -0.023   -0.008    0.443    0.079    0.019   -0.005    0.080    0.163   -0.071 |\n",
      "|  psi2s_p |   -0.032    1.000    0.002    0.007    0.599    0.004    0.307   -0.000    0.002   -0.001    0.400    0.006   -0.033   -0.001   -0.151    0.438    0.003   -0.010    0.045    0.151    0.287 |\n",
      "|  p3770_s |    0.036    0.002    1.000   -0.005   -0.272   -0.005    0.061    0.002   -0.009   -0.082   -0.183    0.002    0.033    0.006    0.141   -0.239   -0.014   -0.008   -0.278    0.051   -0.107 |\n",
      "|    phi_p |    0.008    0.007   -0.005    1.000   -0.002    0.075   -0.004    0.000    0.007    0.004    0.002   -0.000    0.001   -0.050    0.022   -0.010    0.711    0.000    0.026   -0.003    0.007 |\n",
      "|   Dbar_p |   -0.480    0.599   -0.272   -0.002    1.000    0.013    0.045    0.005    0.010    0.198    0.298   -0.007    0.086    0.020   -0.705    0.517   -0.030   -0.002    0.007    0.025    0.218 |\n",
      "|  omega_p |   -0.000    0.004   -0.005    0.075    0.013    1.000    0.006   -0.183    0.715   -0.001    0.004    0.000   -0.003   -0.035   -0.011    0.002    0.041   -0.000   -0.001    0.003    0.011 |\n",
      "|  p4160_p |    0.228    0.307    0.061   -0.004    0.045    0.006    1.000    0.003    0.003   -0.051    0.311    0.019   -0.121    0.010    0.251    0.260   -0.020   -0.001   -0.107    0.344    0.289 |\n",
      "|  omega_s |   -0.003   -0.000    0.002    0.000    0.005   -0.183    0.003    1.000   -0.048   -0.001    0.001    0.000    0.001    0.003   -0.010    0.007   -0.006   -0.000   -0.010    0.002    0.000 |\n",
      "|    rho_s |    0.001    0.002   -0.009    0.007    0.010    0.715    0.003   -0.048    1.000   -0.004    0.003   -0.000   -0.008    0.039   -0.010   -0.010   -0.018    0.000    0.003    0.000    0.011 |\n",
      "|  p4415_s |   -0.083   -0.001   -0.082    0.004    0.198   -0.001   -0.051   -0.001   -0.004    1.000   -0.076   -0.006    0.373   -0.002   -0.313    0.081    0.004   -0.007    0.283   -0.102    0.080 |\n",
      "|  p3770_p |   -0.003    0.400   -0.183    0.002    0.298    0.004    0.311    0.001    0.003   -0.076    1.000    0.010   -0.047    0.003    0.038    0.272   -0.004   -0.015   -0.039    0.154    0.233 |\n",
      "|  p4040_s |    0.005    0.006    0.002   -0.000   -0.007    0.000    0.019    0.000   -0.000   -0.006    0.010    1.000    0.015    0.000    0.013   -0.002   -0.001   -0.158   -0.015    0.012    0.001 |\n",
      "|  p4160_s |   -0.023   -0.033    0.033    0.001    0.086   -0.003   -0.121    0.001   -0.008    0.373   -0.047    0.015    1.000    0.001   -0.242    0.026   -0.003   -0.021    0.201   -0.152    0.069 |\n",
      "|    rho_p |   -0.008   -0.001    0.006   -0.050    0.020   -0.035    0.010    0.003    0.039   -0.002    0.003    0.000    0.001    1.000   -0.030    0.011   -0.023   -0.001   -0.028    0.007    0.005 |\n",
      "| DDstar_p |    0.443   -0.151    0.141    0.022   -0.705   -0.011    0.251   -0.010   -0.010   -0.313    0.038    0.013   -0.242   -0.030    1.000   -0.115    0.063   -0.001    0.298    0.057    0.359 |\n",
      "|   jpsi_p |    0.079    0.438   -0.239   -0.010    0.517    0.002    0.260    0.007   -0.010    0.081    0.272   -0.002    0.026    0.011   -0.115    1.000   -0.040   -0.005    0.297    0.155    0.595 |\n",
      "|    phi_s |    0.019    0.003   -0.014    0.711   -0.030    0.041   -0.020   -0.006   -0.018    0.004   -0.004   -0.001   -0.003   -0.023    0.063   -0.040    1.000    0.002    0.063   -0.015   -0.002 |\n",
      "|  p4040_p |   -0.005   -0.010   -0.008    0.000   -0.002   -0.000   -0.001   -0.000    0.000   -0.007   -0.015   -0.158   -0.021   -0.001   -0.001   -0.005    0.002    1.000    0.006   -0.008   -0.012 |\n",
      "|      Ctt |    0.080    0.045   -0.278    0.026    0.007   -0.001   -0.107   -0.010    0.003    0.283   -0.039   -0.015    0.201   -0.028    0.298    0.297    0.063    0.006    1.000   -0.005    0.699 |\n",
      "|  p4415_p |    0.163    0.151    0.051   -0.003    0.025    0.003    0.344    0.002    0.000   -0.102    0.154    0.012   -0.152    0.007    0.057    0.155   -0.015   -0.008   -0.005    1.000    0.181 |\n",
      "|   Dbar_s |   -0.071    0.287   -0.107    0.007    0.218    0.011    0.289    0.000    0.011    0.080    0.233    0.001    0.069    0.005    0.359    0.595   -0.002   -0.012    0.699    0.181    1.000 |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "Hesse errors: OrderedDict([(<zfit.Parameter 'DDstar_s' floating=True>, {'error': 0.4351676537588786}), (<zfit.Parameter 'psi2s_p' floating=True>, {'error': 0.04090041910625741}), (<zfit.Parameter 'p3770_s' floating=True>, {'error': 0.24208435639383685}), (<zfit.Parameter 'phi_p' floating=True>, {'error': 0.22941688567627283}), (<zfit.Parameter 'Dbar_p' floating=True>, {'error': 0.49040939423149}), (<zfit.Parameter 'omega_p' floating=True>, {'error': 0.22580633660172378}), (<zfit.Parameter 'p4160_p' floating=True>, {'error': 0.09702051595701366}), (<zfit.Parameter 'omega_s' floating=True>, {'error': 0.6741268669711005}), (<zfit.Parameter 'rho_s' floating=True>, {'error': 0.3625062390111441}), (<zfit.Parameter 'p4415_s' floating=True>, {'error': 0.1836061867717459}), (<zfit.Parameter 'p3770_p' floating=True>, {'error': 0.11416570357170674}), (<zfit.Parameter 'p4040_s' floating=True>, {'error': 0.01883356472198352}), (<zfit.Parameter 'p4160_s' floating=True>, {'error': 0.14777467234880293}), (<zfit.Parameter 'rho_p' floating=True>, {'error': 0.128121692024874}), (<zfit.Parameter 'DDstar_p' floating=True>, {'error': 0.35043613437600696}), (<zfit.Parameter 'jpsi_p' floating=True>, {'error': 0.03797613150837309}), (<zfit.Parameter 'phi_s' floating=True>, {'error': 1.1098995970140706}), (<zfit.Parameter 'p4040_p' floating=True>, {'error': 10.022366753195268}), (<zfit.Parameter 'Ctt' floating=True>, {'error': 0.2133309989282856}), (<zfit.Parameter 'p4415_p' floating=True>, {'error': 0.15649631119914353}), (<zfit.Parameter 'Dbar_s' floating=True>, {'error': 0.5783453513291319})])\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Toy 14/15\n",
      "Time taken: 30 min, 20 s\n",
      "Projected time left: 2 min, 10 s\n",
      "Toy 14: Generating data...\n",
      "Toy 14: Data generation finished\n",
      "Toy 14: Loading data...\n",
      "Toy 14: Loading data finished\n",
      "Toy 14: Fitting pdf...\n",
      "------------------------------------------------------------------\n",
      "| FCN = 2.978E+05               |    Ncalls=1079 (1079 total)    |\n",
      "| EDM = 0.0142 (Goal: 5E-06)    |            up = 0.5            |\n",
      "------------------------------------------------------------------\n",
      "|  Valid Min.   | Valid Param.  | Above EDM | Reached call limit |\n",
      "------------------------------------------------------------------\n",
      "|     False     |     True      |   True    |       False        |\n",
      "------------------------------------------------------------------\n",
      "| Hesse failed  |   Has cov.    | Accurate  | Pos. def. | Forced |\n",
      "------------------------------------------------------------------\n",
      "|     False     |     True      |   False   |   False   |  True  |\n",
      "------------------------------------------------------------------\n",
      "Function minimum: 297806.12169336\n",
      "----------------------------------------------------------------------------------------------\n",
      "|   | Name     |   Value   | Hesse Err | Minos Err- | Minos Err+ | Limit-  | Limit+  | Fixed |\n",
      "----------------------------------------------------------------------------------------------\n",
      "| 0 | DDstar_s |   0.29    |   0.07    |            |            |  -0.3   |   0.3   |       |\n",
      "| 1 | psi2s_p  |   -2.21   |    0.04   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 2 | p3770_s  |   2.55    |   0.26    |            |            |0.918861 | 4.08114 |       |\n",
      "| 3 | phi_p    |   -5.55   |    0.19   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 4 | Dbar_p   |   6.28    |   0.19    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 5 | omega_p  |   -6.28   |    0.10   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 6 | p4160_p  |   4.28    |   0.11    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 7 | omega_s  |    4.7    |    0.9    |            |            | 4.19232 | 9.40768 |       |\n",
      "| 8 | rho_s    |   1.59    |   0.31    |            |            |0.0253049| 2.0747  |       |\n",
      "| 9 | p4415_s  |   0.126   |   0.016   |            |            |0.126447 | 2.35355 |       |\n",
      "| 10| p3770_p  |   4.41    |   0.11    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 11| p4040_s  |   0.82    |   0.17    |            |            |0.00501244| 2.01499 |       |\n",
      "| 12| p4160_s  |   2.04    |   0.16    |            |            | 0.71676 | 3.68324 |       |\n",
      "| 13| rho_p    |    6.3    |    0.4    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 14| DDstar_p |    6.3    |    0.6    |            |            |-6.28319 | 6.28319 |       |\n",
      "| 15| jpsi_p   |  -4.830   |   0.026   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 16| phi_s    |   20.1    |    1.0    |            |            | 14.8182 | 23.5818 |       |\n",
      "| 17| p4040_p  |   -2.50   |    0.24   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 18| Ctt      |   -0.12   |    0.16   |            |            |  -1.5   |   1.5   |       |\n",
      "| 19| p4415_p  |   -6.28   |    0.15   |            |            |-6.28319 | 6.28319 |       |\n",
      "| 20| Dbar_s   |   -0.30   |    0.43   |            |            |  -0.3   |   0.3   |       |\n",
      "----------------------------------------------------------------------------------------------\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "|          | DDstar_s  psi2s_p  p3770_s    phi_p   Dbar_p  omega_p  p4160_p  omega_s    rho_s  p4415_s  p3770_p  p4040_s  p4160_s    rho_p DDstar_p   jpsi_p    phi_s  p4040_p      Ctt  p4415_p   Dbar_s |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "| DDstar_s |    1.000   -0.403    0.325   -0.019   -0.737    0.000    0.132   -0.011    0.014    0.006   -0.170   -0.109    0.138   -0.012   -0.290   -0.353   -0.026    0.233    0.009    0.000   -0.699 |\n",
      "|  psi2s_p |   -0.403    1.000   -0.102    0.031    0.663   -0.001    0.209    0.028   -0.029    0.001    0.387   -0.173   -0.208    0.034    0.157    0.216    0.057   -0.027   -0.268    0.005    0.593 |\n",
      "|  p3770_s |    0.325   -0.102    1.000   -0.027   -0.459    0.001    0.079   -0.028    0.014    0.004   -0.208    0.130    0.234   -0.033   -0.140   -0.237   -0.060    0.254   -0.273   -0.006   -0.386 |\n",
      "|    phi_p |   -0.019    0.031   -0.027    1.000    0.049   -0.004   -0.016   -0.024    0.019   -0.001    0.012    0.005   -0.013    0.075    0.015    0.000    0.646   -0.025    0.032    0.000    0.044 |\n",
      "|   Dbar_p |   -0.737    0.663   -0.459    0.049    1.000   -0.001   -0.015    0.043   -0.039   -0.005    0.361   -0.089   -0.347    0.047    0.454    0.339    0.090   -0.296   -0.029    0.009    0.741 |\n",
      "|  omega_p |    0.000   -0.001    0.001   -0.004   -0.001    1.000    0.001    0.070   -0.019    0.000   -0.000   -0.000    0.000   -0.003   -0.001   -0.001    0.001    0.001   -0.002   -0.000   -0.001 |\n",
      "|  p4160_p |    0.132    0.209    0.079   -0.016   -0.015    0.001    1.000   -0.021    0.013    0.010    0.219   -0.462   -0.037   -0.023   -0.151    0.103   -0.041    0.156   -0.501   -0.009   -0.001 |\n",
      "|  omega_s |   -0.011    0.028   -0.028   -0.024    0.043    0.070   -0.021    1.000   -0.406   -0.001    0.009    0.008   -0.012   -0.154    0.019    0.003    0.002   -0.027    0.044    0.000    0.040 |\n",
      "|    rho_s |    0.014   -0.029    0.014    0.019   -0.039   -0.019    0.013   -0.406    1.000    0.000   -0.010   -0.009    0.003   -0.073   -0.016   -0.034   -0.027    0.014   -0.019    0.000   -0.035 |\n",
      "|  p4415_s |    0.006    0.001    0.004   -0.001   -0.005    0.000    0.010   -0.001    0.000    1.000    0.003   -0.007   -0.005   -0.001   -0.005    0.001   -0.001    0.005   -0.011   -0.010   -0.004 |\n",
      "|  p3770_p |   -0.170    0.387   -0.208    0.012    0.361   -0.000    0.219    0.009   -0.010    0.003    1.000   -0.160   -0.074    0.011    0.074    0.152    0.020    0.115   -0.280    0.002    0.321 |\n",
      "|  p4040_s |   -0.109   -0.173    0.130    0.005   -0.089   -0.000   -0.462    0.008   -0.009   -0.007   -0.160    1.000   -0.167    0.010   -0.052   -0.094    0.013   -0.217    0.359    0.003   -0.130 |\n",
      "|  p4160_s |    0.138   -0.208    0.234   -0.013   -0.347    0.000   -0.037   -0.012    0.003   -0.005   -0.074   -0.167    1.000   -0.013   -0.143   -0.208   -0.028    0.469    0.005   -0.009   -0.323 |\n",
      "|    rho_p |   -0.012    0.034   -0.033    0.075    0.047   -0.003   -0.023   -0.154   -0.073   -0.001    0.011    0.010   -0.013    1.000    0.019    0.015    0.036   -0.031    0.054    0.000    0.043 |\n",
      "| DDstar_p |   -0.290    0.157   -0.140    0.015    0.454   -0.001   -0.151    0.019   -0.016   -0.005    0.074   -0.052   -0.143    0.019    1.000   -0.119    0.035   -0.162   -0.129    0.007    0.393 |\n",
      "|   jpsi_p |   -0.353    0.216   -0.237    0.000    0.339   -0.001    0.103    0.003   -0.034    0.001    0.152   -0.094   -0.208    0.015   -0.119    1.000   -0.007   -0.128   -0.141    0.006    0.193 |\n",
      "|    phi_s |   -0.026    0.057   -0.060    0.646    0.090    0.001   -0.041    0.002   -0.027   -0.001    0.020    0.013   -0.028    0.036    0.035   -0.007    1.000   -0.056    0.089    0.001    0.082 |\n",
      "|  p4040_p |    0.233   -0.027    0.254   -0.025   -0.296    0.001    0.156   -0.027    0.014    0.005    0.115   -0.217    0.469   -0.031   -0.162   -0.128   -0.056    1.000   -0.399   -0.009   -0.251 |\n",
      "|      Ctt |    0.009   -0.268   -0.273    0.032   -0.029   -0.002   -0.501    0.044   -0.019   -0.011   -0.280    0.359    0.005    0.054   -0.129   -0.141    0.089   -0.399    1.000   -0.003   -0.199 |\n",
      "|  p4415_p |    0.000    0.005   -0.006    0.000    0.009   -0.000   -0.009    0.000    0.000   -0.010    0.002    0.003   -0.009    0.000    0.007    0.006    0.001   -0.009   -0.003    1.000    0.010 |\n",
      "|   Dbar_s |   -0.699    0.593   -0.386    0.044    0.741   -0.001   -0.001    0.040   -0.035   -0.004    0.321   -0.130   -0.323    0.043    0.393    0.193    0.082   -0.251   -0.199    0.010    1.000 |\n",
      "-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------\n",
      "Hesse errors: OrderedDict([(<zfit.Parameter 'DDstar_s' floating=True>, {'error': 0.06688722453938811}), (<zfit.Parameter 'psi2s_p' floating=True>, {'error': 0.04149382929381229}), (<zfit.Parameter 'p3770_s' floating=True>, {'error': 0.2550664889635734}), (<zfit.Parameter 'phi_p' floating=True>, {'error': 0.19013215462474609}), (<zfit.Parameter 'Dbar_p' floating=True>, {'error': 0.1885248342997956}), (<zfit.Parameter 'omega_p' floating=True>, {'error': 0.10232506987486989}), (<zfit.Parameter 'p4160_p' floating=True>, {'error': 0.10563918790834137}), (<zfit.Parameter 'omega_s' floating=True>, {'error': 0.9152925069710411}), (<zfit.Parameter 'rho_s' floating=True>, {'error': 0.3127593208064462}), (<zfit.Parameter 'p4415_s' floating=True>, {'error': 0.015928954497738665}), (<zfit.Parameter 'p3770_p' floating=True>, {'error': 0.11425790661196267}), (<zfit.Parameter 'p4040_s' floating=True>, {'error': 0.16621689464617262}), (<zfit.Parameter 'p4160_s' floating=True>, {'error': 0.1612227852060888}), (<zfit.Parameter 'rho_p' floating=True>, {'error': 0.446496431419928}), (<zfit.Parameter 'DDstar_p' floating=True>, {'error': 0.6144703705613441}), (<zfit.Parameter 'jpsi_p' floating=True>, {'error': 0.025977194618548083}), (<zfit.Parameter 'phi_s' floating=True>, {'error': 1.005919398835962}), (<zfit.Parameter 'p4040_p' floating=True>, {'error': 0.24279549889988083}), (<zfit.Parameter 'Ctt' floating=True>, {'error': 0.15727258201923489}), (<zfit.Parameter 'p4415_p' floating=True>, {'error': 0.15182849144352994}), (<zfit.Parameter 'Dbar_s' floating=True>, {'error': 0.4291193487086542})])\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Toy 15/15\n",
      "Time taken: 33 min, 14 s\n",
      "Projected time left: \n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAaUAAAD4CAYAAABMtfkzAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nOydeXzU5bX/32dmMtkhEALImgBhVQRFEHFBwIJLRa0Ltra29db2Vr22dlHbW/urrW1tvXrrrVqttnVpRWq14r6BOyKIILKHRQhbyE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432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# zfit.run.numeric_checks = False   \n",
    "\n",
    "fitting_range = 'cut'\n",
    "total_BR = 1.7e-10 + 4.9e-10 + 2.5e-9 + 6.02e-5 + 4.97e-6 + 1.38e-9 + 4.2e-10 + 2.6e-9 + 6.1e-10 + 4.37e-7\n",
    "cut_BR = 1.0 - (6.02e-5 + 4.97e-6)/total_BR\n",
    "\n",
    "Ctt_list = []\n",
    "Ctt_error_list = []\n",
    "\n",
    "nr_of_toys = 15\n",
    "if fitting_range == 'cut':\n",
    "    nevents = int(pdg[\"number_of_decays\"]*cut_BR)\n",
    "else:\n",
    "    nevents = int(pdg[\"number_of_decays\"])\n",
    "# nevents = pdg[\"number_of_decays\"]\n",
    "event_stack = 1000000\n",
    "# nevents *= 41\n",
    "# zfit.settings.set_verbosity(10)\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",
    "    ### Generate data\n",
    "    \n",
    "#     clear_output(wait=True)\n",
    "    \n",
    "    print(\"Toy {}: Generating data...\".format(toy))\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",
    "    reset_param_values()\n",
    "    \n",
    "    if fitting_range == 'cut':\n",
    "        \n",
    "        sampler.resample(n=nevents)\n",
    "        s = sampler.unstack_x()\n",
    "        sam = zfit.run(s)\n",
    "        calls = 0\n",
    "        c = 1\n",
    "        \n",
    "    else:    \n",
    "        for call in range(calls):\n",
    "\n",
    "            sampler.resample(n=event_stack)\n",
    "            s = sampler.unstack_x()\n",
    "            sam = zfit.run(s)\n",
    "\n",
    "            c = call + 1\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)\n",
    "            \n",
    "    print(\"Toy {}: Data generation finished\".format(toy))\n",
    "        \n",
    "    ### Load data\n",
    "    \n",
    "    print(\"Toy {}: Loading data...\".format(toy))\n",
    "    \n",
    "    if fitting_range == 'cut':\n",
    "        \n",
    "        total_samp = sam\n",
    "    \n",
    "    else:\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",
    "    if fitting_range == 'full':\n",
    "\n",
    "        data = zfit.data.Data.from_numpy(array=total_samp[:int(nevents)], obs=obs)\n",
    "    \n",
    "        print(\"Toy {}: Loading data finished\".format(toy))\n",
    "\n",
    "        ### Fit data\n",
    "\n",
    "        print(\"Toy {}: Fitting pdf...\".format(toy))\n",
    "\n",
    "        for param in total_f.get_dependents():\n",
    "            param.randomize()\n",
    "\n",
    "        nll = zfit.loss.UnbinnedNLL(model=total_f, data=data, fit_range = (x_min, x_max), constraints = constraints)\n",
    "\n",
    "        minimizer = zfit.minimize.MinuitMinimizer(verbosity = 5)\n",
    "        # minimizer._use_tfgrad = False\n",
    "        result = minimizer.minimize(nll)\n",
    "\n",
    "        print(\"Toy {}: Fitting finished\".format(toy))\n",
    "\n",
    "        print(\"Function minimum:\", result.fmin)\n",
    "        print(\"Hesse errors:\", result.hesse())\n",
    "\n",
    "        params = result.params\n",
    "        Ctt_list.append(params[Ctt]['value'])\n",
    "        Ctt_error_list.append(params[Ctt]['minuit_hesse']['error'])\n",
    "\n",
    "        #plotting the result\n",
    "\n",
    "        plotdirName = 'data/plots'.format(toy)\n",
    "\n",
    "        if not os.path.exists(plotdirName):\n",
    "            os.mkdir(plotdirName)\n",
    "#             print(\"Directory \" , dirName ,  \" Created \")\n",
    "        \n",
    "        probs = total_f.pdf(test_q, norm_range=False)\n",
    "        calcs_test = zfit.run(probs)\n",
    "        plt.clf()\n",
    "        plt.plot(test_q, calcs_test, label = 'pdf')\n",
    "        plt.legend()\n",
    "        plt.ylim(0.0, 6e-6)\n",
    "        plt.savefig(plotdirName + '/toy_fit_full_range{}.png'.format(toy))\n",
    "\n",
    "        print(\"Toy {0}/{1}\".format(toy+1, nr_of_toys))\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*(toy))*((nr_of_toys-toy)*calls-c)))))\n",
    "    \n",
    "    if fitting_range == 'cut':\n",
    "        \n",
    "        _1 = np.where((total_samp >= x_min) & (total_samp <= (jpsi_mass - 60.)))\n",
    "        \n",
    "        tot_sam_1 = total_samp[_1]\n",
    "    \n",
    "        _2 = np.where((total_samp >= (jpsi_mass + 70.)) & (total_samp <= (psi2s_mass - 50.)))\n",
    "        \n",
    "        tot_sam_2 = total_samp[_2]\n",
    "\n",
    "        _3 = np.where((total_samp >= (psi2s_mass + 50.)) & (total_samp <= x_max))\n",
    "        \n",
    "        tot_sam_3 = total_samp[_3]\n",
    "\n",
    "        tot_sam = np.append(tot_sam_1, tot_sam_2)\n",
    "        tot_sam = np.append(tot_sam, tot_sam_3)\n",
    "    \n",
    "        data = zfit.data.Data.from_numpy(array=tot_sam[:int(nevents)], obs=obs_fit)\n",
    "        \n",
    "        print(\"Toy {}: Loading data finished\".format(toy))\n",
    "        \n",
    "        ### Fit data\n",
    "\n",
    "        print(\"Toy {}: Fitting pdf...\".format(toy))\n",
    "\n",
    "        for param in total_f_fit.get_dependents():\n",
    "            param.randomize()\n",
    "\n",
    "        nll = zfit.loss.UnbinnedNLL(model=total_f_fit, data=data, constraints = constraints)\n",
    "\n",
    "        minimizer = zfit.minimize.MinuitMinimizer(verbosity = 5)\n",
    "        # minimizer._use_tfgrad = False\n",
    "        result = minimizer.minimize(nll)\n",
    "\n",
    "        print(\"Function minimum:\", result.fmin)\n",
    "        print(\"Hesse errors:\", result.hesse())\n",
    "\n",
    "        params = result.params\n",
    "        \n",
    "        if result.converged:\n",
    "            Ctt_list.append(params[Ctt]['value'])\n",
    "            Ctt_error_list.append(params[Ctt]['minuit_hesse']['error'])\n",
    "\n",
    "        #plotting the result\n",
    "\n",
    "        plotdirName = 'data/plots'.format(toy)\n",
    "\n",
    "        if not os.path.exists(plotdirName):\n",
    "            os.mkdir(plotdirName)\n",
    "        #         print(\"Directory \" , dirName ,  \" Created \")\n",
    "        \n",
    "        plt.clf()\n",
    "        plt.hist(tot_sam, bins = int((x_max-x_min)/7.), label = 'toy data')\n",
    "        plt.savefig(plotdirName + '/toy_histo_cut_region{}.png'.format(toy))\n",
    "\n",
    "        \n",
    "        probs = total_f_fit.pdf(test_q, norm_range=False)\n",
    "        calcs_test = zfit.run(probs)\n",
    "        plt.clf()\n",
    "        plt.plot(test_q, calcs_test, label = 'pdf')\n",
    "        plt.axvline(x=jpsi_mass-60.,color='red', linewidth=0.7, linestyle = 'dotted')\n",
    "        plt.axvline(x=jpsi_mass+70.,color='red', linewidth=0.7, linestyle = 'dotted')\n",
    "        plt.axvline(x=psi2s_mass-50.,color='red', linewidth=0.7, linestyle = 'dotted')\n",
    "        plt.axvline(x=psi2s_mass+50.,color='red', linewidth=0.7, linestyle = 'dotted')\n",
    "        plt.legend()\n",
    "        plt.ylim(0.0, 1.5e-6)\n",
    "        plt.savefig(plotdirName + '/toy_fit_cut_region{}.png'.format(toy))\n",
    "        \n",
    "        print(\"Toy {0}/{1}\".format(toy+1, nr_of_toys))\n",
    "        print(\"Time taken: {}\".format(display_time(int(time.time() - start))))\n",
    "        print(\"Projected time left: {}\".format(display_time(int((time.time() - start)/(toy+1))*((nr_of_toys-toy-1)))))\n",
    "        "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [],
   "source": [
    "with open(\"data/results/Ctt_list.pkl\", \"wb\") as f:\n",
    "    pkl.dump(Ctt_list, f, pkl.HIGHEST_PROTOCOL)\n",
    "with open(\"data/results/Ctt_error_list.pkl\", \"wb\") as f:\n",
    "    pkl.dump(Ctt_error_list, f, pkl.HIGHEST_PROTOCOL)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "11/15 fits converged\n",
      "Mean Ctt value = 0.23121554511336265\n",
      "Mean Ctt error = 0.16933628195612527\n",
      "95 Sensitivy = 0.00048173624329696924\n"
     ]
    }
   ],
   "source": [
    "print('{0}/{1} fits converged'.format(len(Ctt_list), nr_of_toys))\n",
    "print('Mean Ctt value = {}'.format(np.mean(Ctt_list)))\n",
    "print('Mean Ctt error = {}'.format(np.mean(Ctt_error_list)))\n",
    "print('95 Sensitivy = {}'.format(((2*np.mean(Ctt_error_list))**2)*4.2/1000))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD4CAYAAAAXUaZHAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAQWElEQVR4nO3df4gc533H8c+nkuOUOlRSfBZCEj25iBAFGkccrsAlNHH9Q3apXEhBptQiNQgSBZK0UM4NlPYPgxJoWgytg1KbyJDacZMUi8hNKhQXE4jtnhJZliscnR03vkroLlXjpBTc2vn2j33Otzrtafd2Z3Zmnnm/YJmZZ2d3v/Pc7mfnnp2ddUQIAJCXX6i6AABA8Qh3AMgQ4Q4AGSLcASBDhDsAZGht1QVI0rXXXhuTk5NVlwEAjXLixIkfR8REr+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5P8+ur3rYh+mKTpJ1p/l2SfqDOKSpa1R9pe65J81dJejZt3+OS9qb2L0j6WJr/uKQvpPm9kr6S5nek183Vkral19OaqrdvyD75I0l/L+kbabm1fVHEpeo997GdpqBKEfG0pIvLmvdIOpzmD0u6q6v9keh4RtI625sk3SbpWERcjIj/knRM0u3lV1+siDgfEd9L8z+TdEadbzS3qj/S9vx3WrwqXULShyV9NbUv74fF/vmqpJttO7U/FhFvRMQPJc2q87pqFNtbJN0p6e/SstXSvihK1eHe6zQFmyuqZdw2RsR5qRN4kq5L7Sv1SXZ9lf6d/oA6e62t6480DHFS0rw6b04vS/pJRLyZVunepre3N13/uqR3K4N+SP5a0p9I+nlafrfa2xeFqDrc+56moIVW6pOs+sr2NZK+JulTEfHTK63aoy2L/oiItyLiBnW+wX2jpPf2Wi1Ns+0H278taT4iTnQ391g1+74oUtXh3ubTFFxIwwtK0/nUvlKfZNNXtq9SJ9i/HBFfT82t7Y+I+Imkf1FnzH2d7cUvF3Zv09vbm67/ZXWG+nLoh5sk/Y7tV9UZmv2wOnvybeyLwlQd7m0+TcERSYtHeOyT9ERX+z3pKJFdkl5PwxTfknSr7fXpSJJbU1ujpLHRhySdiYjPd13Vqv6wPWF7XZr/RUm/pc7nD09J+khabXk/LPbPRyR9OzqfIh6RtDcdQbJN0nZJz41nK4oREfdFxJaImFQnA74dEb+vFvZFoar+RFedoyF+oM5442eqrqekbXxU0nlJ/6fO3sW96owRHpd0Nk03pHWtzg+dvCzpBUlTXffzh+p8SDQr6aNVb9eQffEb6vyrfErSyXS5o239IenXJH0/9cNpSX+W2q9XJ5BmJf2DpKtT+zvT8my6/vqu+/pM6p+XJO2uettG7Jff1NLRMq3ui1EvnH4AADJU9bAMAKAEhDsAZIhwB4AMEe4AkCHCHQAyRLgDQIYIdwDI0P8DpOv046LwAdMAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "(36668,)"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "plt.hist(tot_sam, bins = int((x_max-x_min)/7.))\n",
    "\n",
    "plt.show()\n",
    "\n",
    "# _ = np.where((total_samp >= x_min) & (total_samp <= (jpsi_mass - 50.)))\n",
    "\n",
    "tot_sam.shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [],
   "source": [
    "# sample from original values"
   ]
  }
 ],
 "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
}