In [1]:
import sys
sys.path.append('../../FourVector')
sys.path.append('../project')

from FourVector import FourVector
from ThreeVector import ThreeVector

from FutureColliderTools import SmearVertex, GetCorrectedMass, GetMissingMass2, GetQ2
from FutureColliderDataLoader import LoadData_KMuNu, LoadData_DsMuNu
from FutureColliderVariables import *
from FutureColliderFitter import FutureFitter

import numpy as np
import ROOT

ROOT.enableJSVis()
ROOT.gStyle.SetOptStat(0)
from IPython.display import Image

Yields = []


Welcome to JupyROOT 6.08/02

Primary Vertex precision (neglecting the Y axis)

2012 Run3 courtesy of Mark

Secondary Vertex resolution.

There are no projections for Run3 SV precision so I will assume the scaling is the same between the PV and SV.

2012 X 2012 Z

PV Resolution:

Run1(2)

There is no significant difference between the two modes $$\sigma_{x,y,z}: \sigma_{xy} = 0.0144, \sigma_z = 0.078$$

PV resolution with RF foil:

$$\sigma_{x,y,z}: \sigma_{xy} = 0.0161, \sigma_z = 0.0932$$

PV resolution with no RF foil:

$$\sigma_{x,y,z}: \sigma_{xy} = 0.0106, \sigma_z = 0.0705$$

SV Resolution:

Run1(2)

$$\sigma_{x,y,z} (k^- \mu^+ \nu_\mu): \sigma_{xy} = 0.0256, \sigma_z = 0.267$$$$\sigma_{x,y,z} (D_s^- \mu^+ \nu_\mu): \sigma_{xy} = 0.0277, \sigma_z = 0.300$$

SV resolution with RF foil:

$$\sigma_{x,y,z} (k^- \mu^+ \nu_\mu): \sigma_{xy} = 0.0286, \sigma_z = 0.319$$$$\sigma_{x,y,z} (D_s^- \mu^+ \nu_\mu): \sigma_{xy} = 0.0310, \sigma_z = 0.358$$

SV resolution without RF foil:

$$\sigma_{x,y,z} (k^- \mu^+ \nu_\mu): \sigma_{xy} = 0.0188, \sigma_z = 0.241$$$$\sigma_{x,y,z} (D_s^- \mu^+ \nu_\mu): \sigma_{xy} = 0.0204, \sigma_z = 0.271$$

The Run5 vertex precision is slightly worse than Run1. With the removal of the RF foil there is a significant improvement in performance over Run1.

Perform $B_s \rightarrow k^- \mu^+ \nu_\mu$ fit using Run1 vertex resolution


In [2]:
Fitter = FutureFitter("../output/Data_Histograms_Run1_LHCb.root", "MCORR_Data_KMuNu",  "../output/Source_Histograms_KMu_Run1_LHCb_Merged.root", True)
Fitter.Fit()

c1 = ROOT.TCanvas("c1", "c1", 900,900)

Fitter.Plot(c1)

c1.Draw()

c1.Print("ExampleFit_KMuNu_Run1.pdf")
Yields += [Fitter.GetYield()["13512010"]]


 **********
 **    1 **SET PRINT           0
 **********
 **********
 **    2 **SET NOGRAD
 **********
 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 frac0        2.00000e-01  1.00000e-02    0.00000e+00  1.00000e+01
     2 frac1        2.00000e-01  1.00000e-02    0.00000e+00  1.00000e+01
     3 frac2        2.00000e-01  1.00000e-02    0.00000e+00  1.00000e+01
     4 frac3        1.00000e-01  1.00000e-02    0.00000e+00  1.00000e+01
     5 frac4        6.50000e-02  1.00000e-02    0.00000e+00  1.00000e+01
 **********
 **    3 **SET ERR         0.5
 **********
 **********
 **    4 **SET PRINT           0
 **********
 **********
 **    5 **SET STR           1
 **********
 **********
 **    6 **MIGRAD        1625        0.01
 **********
 MACHINE ACCURACY LIMITS FURTHER IMPROVEMENT.
 MIGRAD MINIMIZATION HAS CONVERGED.
 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.
 EIGENVALUES OF SECOND-DERIVATIVE MATRIX:
        -8.9830e-02  6.4095e-02  4.2986e-01  1.8426e+00  2.7533e+00
 MINUIT WARNING IN MIGRAD  
 ============== MATRIX FORCED POS-DEF BY ADDING 0.092583 TO DIAGONAL.
 MACHINE ACCURACY LIMITS FURTHER IMPROVEMENT.
 MIGRAD MINIMIZATION HAS CONVERGED.
 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.
 MIGRAD TERMINATED WITHOUT CONVERGENCE.
 FCN=-1.97148e+06 FROM MIGRAD    STATUS=FAILED        372 CALLS         373 TOTAL
                     EDM=1.41398e-05    STRATEGY= 1      ERR MATRIX APPROXIMATE
  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME      VALUE            ERROR          SIZE      DERIVATIVE 
   1  frac0        1.35371e-01   1.05637e-02   2.18943e-03   5.82229e-03
   2  frac1        2.01782e-01   1.35655e-02   2.24119e-03   3.83045e-02
   3  frac2        5.00756e-01   2.34987e-02   1.63463e-03   1.76871e-01
   4  frac3        9.03237e-02   1.79306e-02   3.47289e-03  -1.01139e-01
   5  frac4        7.17671e-02   5.17896e-03   2.68164e-03  -1.12047e-01
                               ERR DEF= 0.5
+------------------+----------+-----------+
|     Template     | Fraction | Error [%] |
+------------------+----------+-----------+
|     13512010     |  0.135   |    7.8    |
|     13512400     |  0.201   |    6.72   |
| 13774000_DsX_Tau |   0.5    |    4.69   |
|  13774000_Ds01   |   0.09   |   19.85   |
| Combinatorial_K  |  0.071   |    7.21   |
+------------------+----------+-----------+
Info in ROOT::Math::ParameterSettings>: lower/upper bounds outside current parameter value. The value will be set to (low+up)/2 
Info in ROOT::Math::ParameterSettings>: lower/upper bounds outside current parameter value. The value will be set to (low+up)/2 
Warning in <TFractionFitter::Fit>: Abnormal termination of minimization.
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Info in <TCanvas::Print>: pdf file ExampleFit_KMuNu_Run1.pdf has been created

Perform $B_s \rightarrow k^- \mu^+ \nu_\mu$ fit using Run5 vertex resolution with RF foil


In [3]:
Fitter = FutureFitter("../output/Data_Histograms_Run5_RF_LHCb.root", "MCORR_Data_KMuNu",  "../output/Source_Histograms_KMu_Run5_RF_LHCb_Merged.root", True)
Fitter.Fit()

c1 = ROOT.TCanvas("c1", "c1", 900,900)

Fitter.Plot(c1)

c1.Draw()

c1.Print("ExampleFit_KMuNu_Run5_RF.pdf")
Yields += [Fitter.GetYield()["13512010"]]


 **********
 **    7 **SET PRINT           0
 **********
 **********
 **    8 **SET NOGRAD
 **********
 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 frac0        2.00000e-01  1.00000e-02    0.00000e+00  1.00000e+01
     2 frac1        2.00000e-01  1.00000e-02    0.00000e+00  1.00000e+01
     3 frac2        2.00000e-01  1.00000e-02    0.00000e+00  1.00000e+01
     4 frac3        1.00000e-01  1.00000e-02    0.00000e+00  1.00000e+01
     5 frac4        6.50000e-02  1.00000e-02    0.00000e+00  1.00000e+01
 **********
 **    9 **SET ERR         0.5
 **********
 **********
 **   10 **SET PRINT           0
 **********
 **********
 **   11 **SET STR           1
 **********
 **********
 **   12 **MIGRAD        1625        0.01
 **********
 MACHINE ACCURACY LIMITS FURTHER IMPROVEMENT.
 MIGRAD MINIMIZATION HAS CONVERGED.
 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.
 EIGENVALUES OF SECOND-DERIVATIVE MATRIX:
        -9.6448e-02  5.4207e-02  3.9056e-01  1.7448e+00  2.9069e+00
 MINUIT WARNING IN MIGRAD  
 ============== MATRIX FORCED POS-DEF BY ADDING 0.099354 TO DIAGONAL.
 MIGRAD MINIMIZATION HAS CONVERGED.
 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.
 FCN=-1.96881e+06 FROM MIGRAD    STATUS=CONVERGED     432 CALLS         433 TOTAL
                     EDM=8.69716e-06    STRATEGY= 1      ERROR MATRIX ACCURATE 
  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME      VALUE            ERROR          SIZE      DERIVATIVE 
   1  frac0        1.42320e-01   1.21722e-02   2.18750e-03  -7.75189e-01
   2  frac1        1.97336e-01   1.52364e-02   2.30255e-03  -5.82786e-01
   3  frac2        5.11700e-01   2.61310e-02   1.63394e-03  -3.73342e-01
   4  frac3        7.89567e-02   1.98073e-02   3.75938e-03  -2.08662e-01
   5  frac4        6.96826e-02   5.84814e-03   2.79714e-03  -7.36727e-01
                               ERR DEF= 0.5
+------------------+----------+-----------+
|     Template     | Fraction | Error [%] |
+------------------+----------+-----------+
|     13512010     |  0.142   |    8.55   |
|     13512400     |  0.197   |    7.72   |
| 13774000_DsX_Tau |  0.511   |    5.1    |
|  13774000_Ds01   |  0.078   |   25.08   |
| Combinatorial_K  |  0.069   |    8.39   |
+------------------+----------+-----------+
Info in ROOT::Math::ParameterSettings>: lower/upper bounds outside current parameter value. The value will be set to (low+up)/2 
Info in ROOT::Math::ParameterSettings>: lower/upper bounds outside current parameter value. The value will be set to (low+up)/2 
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c1
Info in <TCanvas::Print>: pdf file ExampleFit_KMuNu_Run5_RF.pdf has been created

Perform $B_s \rightarrow k^- \mu^+ \nu_\mu$ fit using Run5 vertex resolution without RF foil


In [4]:
Fitter = FutureFitter("../output/Data_Histograms_Run5_NoRF_LHCb.root", "MCORR_Data_KMuNu",  "../output/Source_Histograms_KMu_Run5_NoRF_LHCb_Merged.root", True)
Fitter.Fit()

c1 = ROOT.TCanvas("c1", "c1", 900,900)

Fitter.Plot(c1)

c1.Draw()

c1.Print("ExampleFit_KMuNu_Run5_NoRF.pdf")
Yields += [Fitter.GetYield()["13512010"]]


 **********
 **   13 **SET PRINT           0
 **********
 **********
 **   14 **SET NOGRAD
 **********
 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 frac0        2.00000e-01  1.00000e-02    0.00000e+00  1.00000e+01
     2 frac1        2.00000e-01  1.00000e-02    0.00000e+00  1.00000e+01
     3 frac2        2.00000e-01  1.00000e-02    0.00000e+00  1.00000e+01
     4 frac3        1.00000e-01  1.00000e-02    0.00000e+00  1.00000e+01
     5 frac4        6.50000e-02  1.00000e-02    0.00000e+00  1.00000e+01
 **********
 **   15 **SET ERR         0.5
 **********
 **********
 **   16 **SET PRINT           0
 **********
 **********
 **   17 **SET STR           1
 **********
 **********
 **   18 **MIGRAD        1625        0.01
 **********
 MACHINE ACCURACY LIMITS FURTHER IMPROVEMENT.
 MIGRAD MINIMIZATION HAS CONVERGED.
 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.
 MACHINE ACCURACY LIMITS FURTHER IMPROVEMENT.
 MIGRAD MINIMIZATION HAS CONVERGED.
 FCN=-1.97769e+06 FROM MIGRAD    STATUS=CONVERGED     323 CALLS         324 TOTAL
                     EDM=2.7244e-05    STRATEGY= 1  ERROR MATRIX UNCERTAINTY   3.5 per cent
  EXT PARAMETER                                   STEP         FIRST   
  NO.   NAME      VALUE            ERROR          SIZE      DERIVATIVE 
   1  frac0        1.48619e-01   8.37760e-03   0.00000e+00  -8.81139e-02
   2  frac1        1.95233e-01   1.12692e-02  -0.00000e+00  -2.94455e-01
   3  frac2        5.04232e-01   1.94735e-02   0.00000e+00  -1.01212e-01
   4  frac3        8.62667e-02   1.49750e-02  -0.00000e+00   4.05375e-01
   5  frac4        6.56484e-02   4.18294e-03  -0.00000e+00   2.78315e-01
                               ERR DEF= 0.5
+------------------+----------+-----------+
|     Template     | Fraction | Error [%] |
+------------------+----------+-----------+
|     13512010     |  0.148   |    5.63   |
|     13512400     |  0.195   |    5.77   |
| 13774000_DsX_Tau |  0.504   |    3.86   |
|  13774000_Ds01   |  0.086   |   17.35   |
| Combinatorial_K  |  0.065   |    6.37   |
+------------------+----------+-----------+
Info in ROOT::Math::ParameterSettings>: lower/upper bounds outside current parameter value. The value will be set to (low+up)/2 
Info in ROOT::Math::ParameterSettings>: lower/upper bounds outside current parameter value. The value will be set to (low+up)/2 
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c1
Info in <TCanvas::Print>: pdf file ExampleFit_KMuNu_Run5_NoRF.pdf has been created

Perform $B_s \rightarrow D_s \mu^+ \nu_\mu$ fit using Run1 vertex resolution


In [5]:
Fitter = FutureFitter("../output/Data_Histograms_Run1_LHCb.root", "MCORR_Data_DsMuNu",  "../output/Source_Histograms_DsMu_Run1_LHCb_Merged.root", False)
Fitter.Fit()

c1 = ROOT.TCanvas("c1", "c1", 900,900)

Fitter.Plot(c1)

c1.Draw()

c1.Print("ExampleFit_DsMuNu_Run1.pdf")
Yields += [Fitter.GetYield()["13774000_Ds"]]


 **********
 **   19 **SET PRINT           0
 **********
 **********
 **   20 **SET NOGRAD
 **********
 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 frac0        3.50000e-02  1.00000e-02    0.00000e+00  1.00000e+01
     2 frac1        2.00000e-01  1.00000e-02    0.00000e+00  1.00000e+01
     3 frac2        7.00000e-01  1.00000e-02    0.00000e+00  1.00000e+01
     4 frac3        7.00000e-02  1.00000e-02    0.00000e+00  1.00000e+01
     5 frac4        2.00000e-01  1.00000e-02    0.00000e+00  1.00000e+01
 **********
 **   21 **SET ERR         0.5
 **********
 **********
 **   22 **SET PRINT           0
 **********
 **********
 **   23 **SET STR           1
 **********
 **********
 **   24 **MIGRAD        1625        0.01
 **********
 MACHINE ACCURACY LIMITS FURTHER IMPROVEMENT.
 MIGRAD MINIMIZATION HAS CONVERGED.
 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.
 MACHINE ACCURACY LIMITS FURTHER IMPROVEMENT.
 MIGRAD MINIMIZATION HAS CONVERGED.
 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.
 MIGRAD TERMINATED WITHOUT CONVERGENCE.
 FCN=-6.70163e+06 FROM MIGRAD    STATUS=FAILED        414 CALLS         415 TOTAL
                     EDM=0.00507008    STRATEGY= 1      ERR MATRIX APPROXIMATE
  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME      VALUE            ERROR          SIZE      DERIVATIVE 
   1  frac0        3.01855e-02   3.67827e-03   5.73549e-03   2.61154e+00
   2  frac1        4.38383e-02   2.40471e-03   5.04138e-03   1.88721e+00
   3  frac2        5.96469e-01   2.24296e-02   2.65585e-03   3.87131e+00
   4  frac3        5.04361e-02   1.60341e-02   7.92107e-03  -8.84233e-01
   5  frac4        2.79087e-01   1.32568e-02   3.72541e-03  -5.17077e-01
                               ERR DEF= 0.5
+------------------+----------+-----------+
|     Template     | Fraction | Error [%] |
+------------------+----------+-----------+
|   13774000_Tau   |   0.03   |   12.18   |
| Combinatorial_Ds |  0.043   |    5.48   |
| 13774000_Dsstar  |  0.596   |    3.76   |
|  13774000_Ds01   |   0.05   |   31.79   |
|   13774000_Ds    |  0.279   |    4.75   |
+------------------+----------+-----------+
Info in ROOT::Math::ParameterSettings>: lower/upper bounds outside current parameter value. The value will be set to (low+up)/2 
Info in ROOT::Math::ParameterSettings>: lower/upper bounds outside current parameter value. The value will be set to (low+up)/2 
Info in ROOT::Math::ParameterSettings>: lower/upper bounds outside current parameter value. The value will be set to (low+up)/2 
Warning in <TFractionFitter::Fit>: Abnormal termination of minimization.
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c1
Info in <TCanvas::Print>: pdf file ExampleFit_DsMuNu_Run1.pdf has been created

Perform $B_s \rightarrow D_s \mu^+ \nu_\mu$ fit using Run5 vertex resolution with RF foil


In [6]:
Fitter = FutureFitter("../output/Data_Histograms_Run5_RF_LHCb.root", "MCORR_Data_DsMuNu",  "../output/Source_Histograms_DsMu_Run5_RF_LHCb_Merged.root", False)
Fitter.Fit()

c1 = ROOT.TCanvas("c1", "c1", 900,900)

Fitter.Plot(c1)

c1.Draw()

c1.Print("ExampleFit_DsMuNu_Run5_RF.pdf")
Yields += [Fitter.GetYield()["13774000_Ds"]]


 **********
 **   25 **SET PRINT           0
 **********
 **********
 **   26 **SET NOGRAD
 **********
 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 frac0        3.50000e-02  1.00000e-02    0.00000e+00  1.00000e+01
     2 frac1        2.00000e-01  1.00000e-02    0.00000e+00  1.00000e+01
     3 frac2        7.00000e-01  1.00000e-02    0.00000e+00  1.00000e+01
     4 frac3        7.00000e-02  1.00000e-02    0.00000e+00  1.00000e+01
     5 frac4        2.00000e-01  1.00000e-02    0.00000e+00  1.00000e+01
 **********
 **   27 **SET ERR         0.5
 **********
 **********
 **   28 **SET PRINT           0
 **********
 **********
 **   29 **SET STR           1
 **********
 **********
 **   30 **MIGRAD        1625        0.01
 **********
 MACHINE ACCURACY LIMITS FURTHER IMPROVEMENT.
 MIGRAD MINIMIZATION HAS CONVERGED.
 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.
 MACHINE ACCURACY LIMITS FURTHER IMPROVEMENT.
 MIGRAD MINIMIZATION HAS CONVERGED.
 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.
 MIGRAD TERMINATED WITHOUT CONVERGENCE.
 FCN=-6.68911e+06 FROM MIGRAD    STATUS=FAILED        419 CALLS         420 TOTAL
                     EDM=0.00842814    STRATEGY= 1      ERR MATRIX APPROXIMATE
  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME      VALUE            ERROR          SIZE      DERIVATIVE 
   1  frac0        2.93256e-02   3.96354e-03   5.95874e-03  -3.45953e+00
   2  frac1        4.43065e-02   2.69365e-03   5.29263e-03   4.53178e-02
   3  frac2        5.98088e-01   2.36938e-02   2.65455e-03  -1.33498e+01
   4  frac3        5.00312e-02   1.76949e-02   8.02910e-03  -7.14500e+00
   5  frac4        2.78175e-01   1.44431e-02   3.75932e-03  -1.21084e+01
                               ERR DEF= 0.5
+------------------+----------+-----------+
|     Template     | Fraction | Error [%] |
+------------------+----------+-----------+
|   13774000_Tau   |  0.029   |   13.51   |
| Combinatorial_Ds |  0.044   |    6.07   |
| 13774000_Dsstar  |  0.598   |    3.96   |
|  13774000_Ds01   |   0.05   |   35.36   |
|   13774000_Ds    |  0.278   |    5.19   |
+------------------+----------+-----------+
Info in ROOT::Math::ParameterSettings>: lower/upper bounds outside current parameter value. The value will be set to (low+up)/2 
Info in ROOT::Math::ParameterSettings>: lower/upper bounds outside current parameter value. The value will be set to (low+up)/2 
Info in ROOT::Math::ParameterSettings>: lower/upper bounds outside current parameter value. The value will be set to (low+up)/2 
Warning in <TFractionFitter::Fit>: Abnormal termination of minimization.
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c1
Info in <TCanvas::Print>: pdf file ExampleFit_DsMuNu_Run5_RF.pdf has been created

Perform $B_s \rightarrow D_s \mu^+ \nu_\mu$ fit using Run5 vertex resolution without RF foil


In [7]:
Fitter = FutureFitter("../output/Data_Histograms_Run5_NoRF_LHCb.root", "MCORR_Data_DsMuNu",  "../output/Source_Histograms_DsMu_Run5_NoRF_LHCb_Merged.root", False)
Fitter.Fit()

c1 = ROOT.TCanvas("c1", "c1", 900,900)

Fitter.Plot(c1)

c1.Draw()

c1.Print("ExampleFit_DsMuNu_Run5_NoRF.pdf")
Yields += [Fitter.GetYield()["13774000_Ds"]]


 **********
 **   31 **SET PRINT           0
 **********
 **********
 **   32 **SET NOGRAD
 **********
 PARAMETER DEFINITIONS:
    NO.   NAME         VALUE      STEP SIZE      LIMITS
     1 frac0        3.50000e-02  1.00000e-02    0.00000e+00  1.00000e+01
     2 frac1        2.00000e-01  1.00000e-02    0.00000e+00  1.00000e+01
     3 frac2        7.00000e-01  1.00000e-02    0.00000e+00  1.00000e+01
     4 frac3        7.00000e-02  1.00000e-02    0.00000e+00  1.00000e+01
     5 frac4        2.00000e-01  1.00000e-02    0.00000e+00  1.00000e+01
 **********
 **   33 **SET ERR         0.5
 **********
 **********
 **   34 **SET PRINT           0
 **********
 **********
 **   35 **SET STR           1
 **********
 **********
 **   36 **MIGRAD        1625        0.01
 **********
 MACHINE ACCURACY LIMITS FURTHER IMPROVEMENT.
 MIGRAD MINIMIZATION HAS CONVERGED.
 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.
 MACHINE ACCURACY LIMITS FURTHER IMPROVEMENT.
 MIGRAD MINIMIZATION HAS CONVERGED.
 MIGRAD WILL VERIFY CONVERGENCE AND ERROR MATRIX.
 MIGRAD TERMINATED WITHOUT CONVERGENCE.
 FCN=-6.73058e+06 FROM MIGRAD    STATUS=FAILED        365 CALLS         366 TOTAL
                     EDM=0.0010292    STRATEGY= 1      ERR MATRIX APPROXIMATE
  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME      VALUE            ERROR          SIZE      DERIVATIVE 
   1  frac0        2.85884e-02   3.03967e-03   5.63799e-03  -2.30111e+00
   2  frac1        4.38412e-02   2.13178e-03   4.65517e-03  -2.53257e+00
   3  frac2        5.88149e-01   1.76666e-02   2.65991e-03  -8.71896e-01
   4  frac3        5.55130e-02   1.18855e-02   7.36407e-03  -2.32739e+00
   5  frac4        2.83900e-01   1.16362e-02   3.65300e-03  -2.41924e+00
                               ERR DEF= 0.5
+------------------+----------+-----------+
|     Template     | Fraction | Error [%] |
+------------------+----------+-----------+
|   13774000_Tau   |  0.028   |   10.63   |
| Combinatorial_Ds |  0.043   |    4.86   |
| 13774000_Dsstar  |  0.588   |    3.0    |
|  13774000_Ds01   |  0.055   |   21.41   |
|   13774000_Ds    |  0.283   |    4.09   |
+------------------+----------+-----------+
Info in ROOT::Math::ParameterSettings>: lower/upper bounds outside current parameter value. The value will be set to (low+up)/2 
Info in ROOT::Math::ParameterSettings>: lower/upper bounds outside current parameter value. The value will be set to (low+up)/2 
Info in ROOT::Math::ParameterSettings>: lower/upper bounds outside current parameter value. The value will be set to (low+up)/2 
Warning in <TFractionFitter::Fit>: Abnormal termination of minimization.
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TH1F::Sumw2>: Sum of squares of weights structure already created
Warning in <TCanvas::Constructor>: Deleting canvas with same name: c1
Info in <TCanvas::Print>: pdf file ExampleFit_DsMuNu_Run5_NoRF.pdf has been created

In [11]:
from prettytable import PrettyTable
PT = PrettyTable(("", "K Mu Nu", "Ds Mu Nu"))

PT.add_row( ["Run1", Yields[0][1] / Yields[0][0], Yields[3][1] / Yields[3][0]])
PT.add_row( ["Run5 RF Foil", Yields[1][1] / Yields[1][0], Yields[4][1] / Yields[4][0]])
PT.add_row( ["Run5 No RF Foil", Yields[2][1] / Yields[2][0], Yields[5][1] / Yields[5][0]])

print "Fitter uncertainties"
print PT


Fitter uncertainties
+-----------------+-----------------+-----------------+
|                 |     K Mu Nu     |     Ds Mu Nu    |
+-----------------+-----------------+-----------------+
|       Run1      | 0.0780352616516 | 0.0475006003285 |
|   Run5 RF Foil  | 0.0855268522215 | 0.0519210802459 |
| Run5 No RF Foil | 0.0563697661634 | 0.0409869613703 |
+-----------------+-----------------+-----------------+

In [ ]: