diff --git a/.ipynb_checkpoints/raremodel-nb-checkpoint.ipynb b/.ipynb_checkpoints/raremodel-nb-checkpoint.ipynb index 420c66e..47c3623 100644 --- a/.ipynb_checkpoints/raremodel-nb-checkpoint.ipynb +++ b/.ipynb_checkpoints/raremodel-nb-checkpoint.ipynb @@ -83,22 +83,14 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0.46\n" - ] - } - ], + "outputs": [], "source": [] }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -288,7 +280,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -343,7 +335,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -439,7 +431,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -467,7 +459,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -588,46 +580,24 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 9, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "m_c = 1300\n", "\n", - "DDstar_eta = 0\n", - "Dbar_phase = np.random.uniform(0.0, 2*np.pi)\n", - "DDstar_phase = np.random.uniform(0.0, 2*np.pi)\n", + "Dbar_phase = 0.0\n", + "DDstar_phase = 0.0\n", "DDstar_mass = pdg['D0_M']\n", - "\n", - "if Dbar_phase < np.pi:\n", - " Dbar_phase = 0.0\n", - "else:\n", - " Dbar_phase = np.pi\n", " \n", "Dbar_mass = (pdg['D0_M']+pdg['Dst_M'])/2\n", "\n", - "Dbar_eta = R/np.cos(Dbar_phase)*(6*Dbar_mass**2)\n", - "\n", - "Dbar_s = zfit.Parameter(\"Dbar_s\", ztf.constant(Dbar_eta), lower_limit=-1.464, upper_limit=1.464)\n", + "Dbar_s = zfit.Parameter(\"Dbar_s\", ztf.constant(0.0), lower_limit=-1.464, upper_limit=1.464)\n", "Dbar_m = zfit.Parameter(\"Dbar_m\", ztf.constant(Dbar_mass), floating = False)\n", "Dbar_p = zfit.Parameter(\"Dbar_p\", ztf.constant(Dbar_phase), floating = False)\n", - "DDstar_s = zfit.Parameter(\"DDstar_s\", ztf.constant(DDstar_eta), lower_limit=-2.0, upper_limit=2.0)#, floating = False)\n", + "DDstar_s = zfit.Parameter(\"DDstar_s\", ztf.constant(0.0), lower_limit=-2.0, upper_limit=2.0)#, floating = False)\n", "DDstar_m = zfit.Parameter(\"DDstar_m\", ztf.constant(DDstar_mass), floating = False)\n", - "DDstar_p = zfit.Parameter(\"DDstar_p\", ztf.constant(DDstar_phase), floating = False)\n", - "\n", - "Dbar_s.set_value(0.0)\n", - "DDstar_s.set_value(0.0)" + "DDstar_p = zfit.Parameter(\"DDstar_p\", ztf.constant(DDstar_phase), floating = False)" ] }, { @@ -639,7 +609,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ @@ -656,7 +626,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 11, "metadata": {}, "outputs": [], "source": [ @@ -693,7 +663,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 12, "metadata": {}, "outputs": [], "source": [ @@ -739,7 +709,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -773,7 +743,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 14, "metadata": {}, "outputs": [], "source": [ @@ -789,7 +759,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 15, "metadata": {}, "outputs": [], "source": [ @@ -805,7 +775,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ @@ -818,7 +788,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 17, "metadata": {}, "outputs": [], "source": [ @@ -875,7 +845,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 18, "metadata": {}, "outputs": [], "source": [ @@ -959,7 +929,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 19, "metadata": {}, "outputs": [], "source": [ @@ -968,7 +938,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 20, "metadata": {}, "outputs": [], "source": [ @@ -977,7 +947,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 21, "metadata": {}, "outputs": [], "source": [ @@ -986,7 +956,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 22, "metadata": { "scrolled": false }, @@ -1034,7 +1004,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 23, "metadata": {}, "outputs": [], "source": [ @@ -1051,7 +1021,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 24, "metadata": {}, "outputs": [], "source": [ @@ -1075,7 +1045,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 25, "metadata": {}, "outputs": [], "source": [ @@ -1102,7 +1072,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 26, "metadata": {}, "outputs": [], "source": [ @@ -1125,7 +1095,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 27, "metadata": {}, "outputs": [], "source": [ @@ -1134,7 +1104,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 28, "metadata": {}, "outputs": [], "source": [ @@ -1150,7 +1120,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 29, "metadata": {}, "outputs": [], "source": [ @@ -1180,7 +1150,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 30, "metadata": {}, "outputs": [], "source": [ @@ -1194,7 +1164,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 31, "metadata": {}, "outputs": [], "source": [ @@ -1212,7 +1182,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 32, "metadata": {}, "outputs": [], "source": [ @@ -1226,7 +1196,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 33, "metadata": {}, "outputs": [], "source": [ @@ -1247,7 +1217,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 34, "metadata": {}, "outputs": [], "source": [ @@ -1257,7 +1227,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 35, "metadata": {}, "outputs": [], "source": [ @@ -1288,7 +1258,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 36, "metadata": {}, "outputs": [], "source": [ @@ -1305,13 +1275,12 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 43, "metadata": {}, "outputs": [], "source": [ "# 1. Constraint - Real part of sum of Psi contrib and D contribs\n", "\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", @@ -1329,8 +1298,17 @@ " 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" + "constraint1 = zfit.constraint.GaussianConstraint(params = sum_1, mu = ztf.constant(1.7*10**-8), \n", + " sigma = ztf.constant(2.2*10**-8))\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: 10000., lambda: 0.)\n", + "\n", + "# 3. Constraint - Maximum eta of D contribs\n", + "\n", + "constraint3_0 = tf.cond(tf.greater_equal(sum_2, 5.0e-8), lambda: 10000., lambda: 0.)" ] }, { diff --git a/raremodel-nb.ipynb b/raremodel-nb.ipynb index 420c66e..47c3623 100644 --- a/raremodel-nb.ipynb +++ b/raremodel-nb.ipynb @@ -83,22 +83,14 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": null, "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "0.46\n" - ] - } - ], + "outputs": [], "source": [] }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -288,7 +280,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -343,7 +335,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 5, "metadata": {}, "outputs": [], "source": [ @@ -439,7 +431,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -467,7 +459,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 7, "metadata": {}, "outputs": [ { @@ -588,46 +580,24 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 9, "metadata": {}, - "outputs": [ - { - "data": { - "text/plain": [ - "" - ] - }, - "execution_count": 11, - "metadata": {}, - "output_type": "execute_result" - } - ], + "outputs": [], "source": [ "m_c = 1300\n", "\n", - "DDstar_eta = 0\n", - "Dbar_phase = np.random.uniform(0.0, 2*np.pi)\n", - "DDstar_phase = np.random.uniform(0.0, 2*np.pi)\n", + "Dbar_phase = 0.0\n", + "DDstar_phase = 0.0\n", "DDstar_mass = pdg['D0_M']\n", - "\n", - "if Dbar_phase < np.pi:\n", - " Dbar_phase = 0.0\n", - "else:\n", - " Dbar_phase = np.pi\n", " \n", "Dbar_mass = (pdg['D0_M']+pdg['Dst_M'])/2\n", "\n", - "Dbar_eta = R/np.cos(Dbar_phase)*(6*Dbar_mass**2)\n", - "\n", - "Dbar_s = zfit.Parameter(\"Dbar_s\", ztf.constant(Dbar_eta), lower_limit=-1.464, upper_limit=1.464)\n", + "Dbar_s = zfit.Parameter(\"Dbar_s\", ztf.constant(0.0), lower_limit=-1.464, upper_limit=1.464)\n", "Dbar_m = zfit.Parameter(\"Dbar_m\", ztf.constant(Dbar_mass), floating = False)\n", "Dbar_p = zfit.Parameter(\"Dbar_p\", ztf.constant(Dbar_phase), floating = False)\n", - "DDstar_s = zfit.Parameter(\"DDstar_s\", ztf.constant(DDstar_eta), lower_limit=-2.0, upper_limit=2.0)#, floating = False)\n", + "DDstar_s = zfit.Parameter(\"DDstar_s\", ztf.constant(0.0), lower_limit=-2.0, upper_limit=2.0)#, floating = False)\n", "DDstar_m = zfit.Parameter(\"DDstar_m\", ztf.constant(DDstar_mass), floating = False)\n", - "DDstar_p = zfit.Parameter(\"DDstar_p\", ztf.constant(DDstar_phase), floating = False)\n", - "\n", - "Dbar_s.set_value(0.0)\n", - "DDstar_s.set_value(0.0)" + "DDstar_p = zfit.Parameter(\"DDstar_p\", ztf.constant(DDstar_phase), floating = False)" ] }, { @@ -639,7 +609,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 10, "metadata": {}, "outputs": [], "source": [ @@ -656,7 +626,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 11, "metadata": {}, "outputs": [], "source": [ @@ -693,7 +663,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 12, "metadata": {}, "outputs": [], "source": [ @@ -739,7 +709,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 13, "metadata": {}, "outputs": [ { @@ -773,7 +743,7 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 14, "metadata": {}, "outputs": [], "source": [ @@ -789,7 +759,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 15, "metadata": {}, "outputs": [], "source": [ @@ -805,7 +775,7 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 16, "metadata": {}, "outputs": [], "source": [ @@ -818,7 +788,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 17, "metadata": {}, "outputs": [], "source": [ @@ -875,7 +845,7 @@ }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 18, "metadata": {}, "outputs": [], "source": [ @@ -959,7 +929,7 @@ }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 19, "metadata": {}, "outputs": [], "source": [ @@ -968,7 +938,7 @@ }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 20, "metadata": {}, "outputs": [], "source": [ @@ -977,7 +947,7 @@ }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 21, "metadata": {}, "outputs": [], "source": [ @@ -986,7 +956,7 @@ }, { "cell_type": "code", - "execution_count": 24, + "execution_count": 22, "metadata": { "scrolled": false }, @@ -1034,7 +1004,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 23, "metadata": {}, "outputs": [], "source": [ @@ -1051,7 +1021,7 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 24, "metadata": {}, "outputs": [], "source": [ @@ -1075,7 +1045,7 @@ }, { "cell_type": "code", - "execution_count": 27, + "execution_count": 25, "metadata": {}, "outputs": [], "source": [ @@ -1102,7 +1072,7 @@ }, { "cell_type": "code", - "execution_count": 28, + "execution_count": 26, "metadata": {}, "outputs": [], "source": [ @@ -1125,7 +1095,7 @@ }, { "cell_type": "code", - "execution_count": 29, + "execution_count": 27, "metadata": {}, "outputs": [], "source": [ @@ -1134,7 +1104,7 @@ }, { "cell_type": "code", - "execution_count": 30, + "execution_count": 28, "metadata": {}, "outputs": [], "source": [ @@ -1150,7 +1120,7 @@ }, { "cell_type": "code", - "execution_count": 31, + "execution_count": 29, "metadata": {}, "outputs": [], "source": [ @@ -1180,7 +1150,7 @@ }, { "cell_type": "code", - "execution_count": 32, + "execution_count": 30, "metadata": {}, "outputs": [], "source": [ @@ -1194,7 +1164,7 @@ }, { "cell_type": "code", - "execution_count": 33, + "execution_count": 31, "metadata": {}, "outputs": [], "source": [ @@ -1212,7 +1182,7 @@ }, { "cell_type": "code", - "execution_count": 34, + "execution_count": 32, "metadata": {}, "outputs": [], "source": [ @@ -1226,7 +1196,7 @@ }, { "cell_type": "code", - "execution_count": 35, + "execution_count": 33, "metadata": {}, "outputs": [], "source": [ @@ -1247,7 +1217,7 @@ }, { "cell_type": "code", - "execution_count": 36, + "execution_count": 34, "metadata": {}, "outputs": [], "source": [ @@ -1257,7 +1227,7 @@ }, { "cell_type": "code", - "execution_count": 37, + "execution_count": 35, "metadata": {}, "outputs": [], "source": [ @@ -1288,7 +1258,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 36, "metadata": {}, "outputs": [], "source": [ @@ -1305,13 +1275,12 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 43, "metadata": {}, "outputs": [], "source": [ "# 1. Constraint - Real part of sum of Psi contrib and D contribs\n", "\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", @@ -1329,8 +1298,17 @@ " 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" + "constraint1 = zfit.constraint.GaussianConstraint(params = sum_1, mu = ztf.constant(1.7*10**-8), \n", + " sigma = ztf.constant(2.2*10**-8))\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: 10000., lambda: 0.)\n", + "\n", + "# 3. Constraint - Maximum eta of D contribs\n", + "\n", + "constraint3_0 = tf.cond(tf.greater_equal(sum_2, 5.0e-8), lambda: 10000., lambda: 0.)" ] }, {