Apply sPlot to obtain sWeight ~ P(B)
In [2]:
from IPython.display import Image
import pandas
https://github.com/tata-antares/tagging_LHCb/blob/master/old-tagging.ipynb
We first tested the current algorithm (OS taggers: muon, electron, kaon, vertex). TMVA original method was compared with XGBoost.
In [3]:
pandas.set_option('display.precision', 4)
pandas.read_csv('img/old-tagging-parts.csv').drop(['AUC, with untag', '$\Delta$ AUC, with untag'], axis=1)
Out[3]:
In [4]:
pandas.set_option('display.precision', 4)
pandas.read_csv('img/old-tagging-parts-MC.csv').drop(['AUC, with untag', '$\Delta$ AUC, with untag'], axis=1)
Out[4]:
In [5]:
pandas.set_option('display.precision', 4)
pandas.read_csv('img/old-tagging.csv').drop(['$\Delta$ AUC, with untag'], axis=1)
Out[5]:
In [6]:
pandas.set_option('display.precision', 4)
pandas.read_csv('img/old-tagging-MC.csv').drop(['$\Delta$ AUC, with untag'], axis=1)
Out[6]:
Details see in the previous presentation: https://indico.cern.ch/event/369520/contribution/3/attachments/1178333/1704665/15.10.28.Tagging.pdf
where $sw_i$ - sPLot weight
$$\epsilon_{tag} = \frac{N (\text{passed selection})} {N (\text{all events})}$$$$\Delta\epsilon_{tag} = \frac{\sqrt{N (\text{passed selection})}} {N (\text{all events})}$$cos_diff_phi
= $\cos(\phi^{sig} - \phi^{\rm part})$diff_pt
= $\max(p_T^{part}) - p_T^{part}$partPt
= $p_T^{part}$max_PID_e_mu
= $\max(PIDNN(e), PIDNN(\mu))^{part}$partP
= $p^{part}$nnkrec
= Number of reconstructed verticesdiff_eta
= $(\eta^{sig} - \eta^{\rm part})$EOverP
= E/P (from CALO)sum_PID_k_mu
= $\sum\limits_{i\in part}(PIDNN(K)+PIDNN(\mu))$ptB
= $p_T^{sig}$sum_PID_e_mu
= $\sum\limits_{i\in part}(PIDNN(e)+PIDNN(\mu))$sum_PID_k_e
= $\sum\limits_{i\in part}(PIDNN(K)+PIDNN(e))$proj
= $(\vec{p}^{sig},\vec{p}^{part})$PIDNNe
= $PIDNN(e)$PIDNNk
= $PIDNN(K)$PIDNNm
= $PIDNN(\mu)$phi
= $\phi^{part}$IP
= number of IPs in the eventmax_PID_k_mu
= $max(PIDNN(K)+PIDNN(\mu))$IPerr
= error of IPIPs
= IP/IPerrveloch
= dE/dx track charge from the VELO systemmax_PID_k_e
= $max(PIDNN(K)+PIDNN(e))$diff_phi
= $(\phi^{sig} - \phi^{\rm part})$ghostProb
= ghost probability IPPU
= impact parameter with respect to any other reconstructed primary vertex.eta
= pseudorapity of track particlepartlcs
= chi2PerDoF for a track mult
= multiplicity in the eventnnkrec
= number of reconstructed vertices ptB
= signal B transverse momentum vflag
= number of tracks in the vertexipsmean
= mean of tracks IPsptmean
= mean pt of the tracksvcharge
= charge of the vertex weigthed by ptsvm
= mass of the vertex svp
= momentum of the vertexBDphiDir
= angle betwen B and vertexsvtau
= lifetime of the vertexdocamax
= mean DOCA of the tracksTry to define B sign using track/vertex sign (to define they have the same signs or opposite).
target
= signB
* signTrack/signVertex
> 0
Compute $p(B^+)$ using this probabilistic model representation (similar to the previous tagging combination):
$$ \frac{P(B^+)}{P(B^-)} = \prod_{track, vertex} \frac{P(\text{track/vertex}|B^+)} {P(\text{track/vertex} |B^-)} = \alpha \qquad $$$$\Rightarrow\qquad P(B^+) = \frac {\alpha}{1+\alpha}, \qquad \qquad [1] $$where
$$ \frac{P(B^+)}{P(B^-)} = \prod_{track, vertex} \begin{cases} \frac{P(\text{track/vertex same sign as } B| B)}{P(\text{track/vertex opposite sign as } B| B)}, \text{if track/vertex}^+ \\ \\ \frac{P(\text{track/vertex opposite sign as } B| B)}{P(\text{track/vertex same sign as } B| B)}, \text{if track/vertex}^- \end{cases} $$$$p_{mistag} = min(p(B^+), p(B^-))$$Do calibration of $p(B^+)$ and compute $ < D^2 > $ :
$ < D^2 > $ formula for sample: $$ < D^2 > = \frac{\sum_i[2(p^{mistag}_i - 0.5)]^2 * sw_i}{\sum_i sw_i} = $$ $$ = \frac{\sum_i[2(p_i(B^+) - 0.5)]^2 * sw_i}{\sum_i sw_i}$$
Formula is symmetric and it is not necessary to compute mistag probability
This procedure is repeated (from the scratch) for 30 different random states and then we compute mean and std for these 30 values of $ < D^2 > $.
https://github.com/tata-antares/tagging_LHCb/blob/master/track-based-tagging-OS.ipynb
Take all possible tracks for all B-events.
Apply:
https://github.com/tata-antares/tagging_LHCb/blob/master/combined-tagging-OS.ipynb
In [4]:
pandas.set_option('display.precision', 5)
pandas.read_csv('img/eff_OS.csv').drop(['$\Delta$ AUC, with untag'], axis=1)
Out[4]:
https://github.com/tata-antares/tagging_LHCb/blob/master/track-based-tagging-SS.ipynb
Take all possible tracks for all B-events.
Apply:
https://github.com/tata-antares/tagging_LHCb/blob/master/combined-tagging-SS.ipynb
In [5]:
pandas.set_option('display.precision', 5)
pandas.read_csv('img/eff_tracking_SS.csv').drop(['$\Delta$ AUC, with untag'], axis=1)
Out[5]:
https://github.com/tata-antares/tagging_LHCb/blob/master/track-based-tagging-PID-less.ipynb
Take all possible tracks for all B-events.
Apply:
(PIDNNp < 0.6) & (PIDNNpi < 0.6) & (ghostProb < 0.4)
( (PIDNNk > 0.7) | (PIDNNm > 0.4) | (PIDNNe > 0.6) )
In [6]:
pandas.set_option('display.precision', 5)
pandas.read_csv('img/new-tagging.csv').drop(['$\Delta$ AUC, with untag'], axis=1)
Out[6]:
(PIDNNp < 0.6) & (PIDNNpi < 0.6) & (ghostProb < 0.4)
( (PIDNNk > 0.1) | (PIDNNm > 0.1) | (PIDNNe > 0.1) )
In [7]:
pandas.set_option('display.precision', 5)
pandas.read_csv('img/new-tagging_relax1.csv')
Out[7]:
(PIDNNpi < 0.6) & (ghostProb < 0.4)
( (PIDNNk > 0.) | (PIDNNm > 0.) | (PIDNNe > 0.) )
In [8]:
pandas.set_option('display.precision', 5)
pandas.read_csv('img/new-tagging_relax2.csv')
Out[8]:
https://github.com/tata-antares/tagging_LHCb/blob/master/combined-tagging-PID-less.ipynb
In [9]:
pandas.set_option('display.precision', 5)
pandas.read_csv('img/new-tagging-PID-less.csv').drop(['$\Delta$ AUC, with untag'], axis=1)
Out[9]:
https://github.com/tata-antares/tagging_LHCb/blob/master/track-based-tagging-PID-less.ipynb
In [10]:
pandas.set_option('display.precision', 5)
pandas.read_csv('img/new-tagging_full_tracks.csv')
Out[10]:
mask_signal = ((Bmass > 5.27) & (Bmass < 5.3))
mask_bck = ((Bmass < 5.25) | (Bmass > 5.32))
Procedure:
Let's see on the following characteristic of the event:
$$ -\sum_{track} charge_{track}$$It seems, that for $B^+$ event it should be around +1 + constant (because we exclude signal part)
Regions:
In [11]:
pandas.set_option('display.precision', 5)
pandas.read_csv('img/track_signs_assymetry_means.csv', index_col='name')
Out[11]:
This ROC AUC score is similar to the current tagging implementation
In [12]:
pandas.set_option('display.precision', 5)
pandas.concat([pandas.read_csv('img/track_signs_assymetry_means.csv', index_col='name'),
pandas.read_csv('img/track_signs_assymetry_means_mc.csv', index_col='name')])
Out[12]:
The asymmery plays a discriminative role even if we choose the random track in the event!
Random is not random!
normalize number of positive and negative tracks for $B^+$ and $B^-$ separately to avoid track charges asymmetry, the quality drops:
use track sign as feature during training (bad quality):
* ROC AUC for all regions ("OS", "SS", full sample) < 0.5006
* doesn't discriminate