Newer
Older
Rphipi_new / fitAndSplotPhipiee.ipynb
@Davide Lancierini Davide Lancierini on 28 May 2019 4 KB first commit
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/home/hep/davide/miniconda3/envs/root_env/lib/ROOT.py:301: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility\n",
      "  return _orig_ihook( name, *args, **kwds )\n"
     ]
    }
   ],
   "source": [
    "from tools.fitAndSplotPhipill import *"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "fit= fitAndSplotphipill(trigCat=1, l_index=0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "fit.set_paths()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Preparing MC Dplus_phipi_e workspace\n",
      "Done!\n",
      "Preparing MC Ds_phipi_e workspace\n",
      "Done!\n",
      "Fitting MC Dplus_phipi_e\n",
      "Done!\n",
      "Fitting MC Ds_phipi_e\n",
      "Done!\n",
      "Preparing data workspace\n",
      "Overwriting pickle file at/disk/lhcb_data/davide/Rphipi_new/data/e_tuples/BDT_selected/trigCats/1/Ds_phipi_ee_BDT_selection_temp.pickle\n",
      "Done!\n"
     ]
    }
   ],
   "source": [
    "fit.prepare_MC_workspaces(mother_index=0, mis_id_bkg=False)\n",
    "fit.prepare_MC_workspaces(mother_index=1, mis_id_bkg=False)\n",
    "\n",
    "fit.fit_MC(mother_index=0, mis_id_bkg=False)\n",
    "fit.fit_MC(mother_index=1, mis_id_bkg=False)\n",
    "\n",
    "fit.prepare_data_workspace(BDT_CUT=0.1)\n",
    "#"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Plotting MC Dplus_phipi_e\n",
      "Done!\n",
      "Plotting MC Ds_phipi_e\n",
      "Done!\n"
     ]
    }
   ],
   "source": [
    "fit.plot_MC(mother_index=0, mis_id_bkg=False)\n",
    "fit.plot_MC(mother_index=1, mis_id_bkg=False)\n",
    "#"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Fitting data D(s)_phipi_ee\n",
      "(<ROOT.RooAddPdf object (\"fit_model\") at 0x55cda0ce5040>, <ROOT.RooDataSet object (\"data_Ds_ConsD_M\") at 0x55cd9f1fe894>, <ROOT.RooRealVar object (\"data_Ds_m\") at 0x55cda05e6990>)\n",
      "Done!\n"
     ]
    }
   ],
   "source": [
    "fit.fit_data()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "TCanvas::Constructor:0: RuntimeWarning: Deleting canvas with same name: Fit\n"
     ]
    }
   ],
   "source": [
    "fit.plot_data(wantThesisStyle=True)\n",
    "fit.plot_data(wantThesisStyle=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Done!\n",
      "1791\n",
      "Overwriting pickle file at/disk/lhcb_data/davide/Rphipi_new/data/e_tuples/BDT_selected/trigCats/1/Ds_phipi_ee_2016_sWeighted.pickle\n",
      "Overwriting root file at/disk/lhcb_data/davide/Rphipi_new/data/e_tuples/BDT_selected/trigCats/1/Ds_phipi_ee_2016_sWeighted.root\n"
     ]
    }
   ],
   "source": [
    "fit.splot(plot=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.15"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}