b-jet energy regression at 13 TeV

This page has moved here. Please refer to the new page to make sure everything is UP-TO-DATE.


Introduction

b-jet have several properties different from light jets.

  • b-jets are generally broader than light jets and have larger mass
  • have long lifetime(cτ ≈ 450 µm) and thus have a displaces vertex
  • have semileptonic decays

These properties can be used to identify b-jets ( BtagPOG). However, semileptonic decays lead to mismeasured energy due to escaping neutrino worsening the b-jets resolution. Reconstruction of the X→ bb decay is fundamental for many Higgs or BSM analyses with b-jets, and thus it is important to improve b-jet energy scale and resolution.

The goal of b-jet energy regression is to correct b-jet energy scale using a multidimensional correction and information at generator level. This correction improves detector responce and corrects for semi leptonic b-decays.

Overview

The b-jet regression is trained using modern machine learning software. Deep Neural Network(DNN) is used and implemented in Keras wirh TensorFlow backend. Back-propagation using stochastic gradient descent with ADAM optimizer.

b-jet energy correction and resolution estimator are provided as an output of DNN.

Training is perfromed for 2016 and 2017 datasets.

More information

Analysis Note : AN-18-092

Talk at the HH-workshop 11-13 April 2018

Talk at the JEC and JER meeting

Reccomendation for 13 TeV data analysis

b-regression should be applied on jet with pT > 20 GeV. The expected improvement is for jets with pT up to ~ 400 GeV.

b-regression output will be soon provided in NanoAOD and flashgg frameworks for 2016 and 2017 datasets.

Current(and working) versions can be found here :

flashgg producer

nanoAOD producer

For groups using other frameworks on top of MINIAOD several examples of implementation are available. The examples of implementation in flashgg and NanoAOD are given. You can use these examples to write producers for your own framework. For example, NanoAOD uses a CMSSW producer that reads MINIAOD and produces a valuemap. For a quick study and/or to avoid any interaction with CMSSW a Python version is recommended, very easy to implement.

How to treat the training

The training model files and additional information needed are available here:

/afs/cern.ch/user/n/nchernya/public/breg_training/

Era JEC type Files Information
Spring16 to be used with 80X MC Summer16_23Sep2016V4 2016 V1 : /afs/cern.ch/user/n/nchernya/public/breg_training/2016_updated/ Updated 2016 traininng with more epochs wrt to v0, to be used
Spring16 to be used with 80X MC Summer16_23Sep2016V4 2016 V0: /afs/cern.ch/user/n/nchernya/public/breg_training/2016/ First 2016 training

Era JEC type Files Information
Fall17 to be used with Fall17 94X MC Fall17_17Nov2017_V6 2017 V1 : /afs/cern.ch/user/n/nchernya/public/breg_training/2017_updated_newJEC/ Updated 2017 traininng, to be used
Fall17 to be used with Fall17 94X MC Fall17_17Nov2017_V6 2017 V0: /afs/cern.ch/user/n/nchernya/public/breg_training/2017/ First 2017 training, NOT to be used
The training is done using TensorFlow. Model is available in '.hdf5' and as a const tensor flow graph in format '.pb'. NanoAOD and flashgg implementation is using graph format. One can use either one.

NN output is a tensor of dimension 3 :

  • [0] : regression correction

  • [1] : 25% quantile

  • [2] : 75% quantile

Then once applied correction and resolution estimator are the following :
  • correction = prediction[:,0]. To get corrected pT one should multiply jet pT by this correction. JEC correction should be applied on the jet pT as well.
  • resolution = 0.5*(prediction[:,2] - prediction[:,1]) . Resolution estimator is taken as half difference of 75% and 25% quantiles.
In the folders you will also find additional file needed :

config_2016.json - config file with information about the training. You will need 'features' to extract the correct order of the featured to be fed to NN. As well as y_std and y_mean. In the training the target is normalized to zero mean and unit variance, that's why after prediction we have to renormalize the target.


features = config['options']['features'].split(',')

X = data[features].values

###################

correction = prediction[:,0]

resolution = 0.5*(prediction[:,2] - prediction[:,1])

if config['options']['normalize_target']:

correction *= config['y_std']

correction += config['y_mean']

resolution *= config['y_std']

<br />

Input features

Implementation of the inputs variables :

Many variables like jet pT, mass, etc are most likely already present in your framework. To implement other variables you can consult the recipes below :

Flashgg : All the needed input variables that were not present in the flashgg::Jet were added in flashgg and are currently in the master code. The relevant producer for the variable production is the jet producer. The computation of additional variables needed by the regression can be switched on and off, using the bool "computeRegVars".

NanoAOD : in NanoAOD (list with links below).

Full feature list used for the training (43 features in total) :

rho : fixedGridRhoFastjetAll

Jet : pT, eta, mass, mT

Jet_ptD : jet energy variable, defined as % $\frac{\sqrt{\sum_i \p_{T,i}^2}}{\sum_i \p_{T,i}}$ % with the sum over all particle flow candidates implementation

Jet_leadTrackPt : leading track pT

Jet_leptonPtRel, Jet_leptonPtRelInv : lepton pT relative to jet axis and jet pT relative to lepton axis implementation, implementation part 2

Jet_leptonDeltaR : delta R between jet and soft lepton inside jet when present, if no lepton present 0 implementation

Jet_vtxMass, Jet_vtxPt : secondary vertex mass and pT implementation

Jet_vtx3dL : secondary vertex 3D distance implementation

Jet_vtx3deL : secondary vertex 3D error (for 2017 MC), significance(for 2016 MC) implementation !!! Improrant, different variables were used for the training with 2016/2017 error vs significance. significance = 3D distance/ error

Jet_vtxNtrk : secondary vertex number of tracks implementation

Jet_neHEF,Jet_neEmEF : Jet inclusive neutral energy fractions implementation

Jet_chHEF,Jet_chEmEF : Jet inclusive charged energy fractions implementation

isEle,isMu,isOther : whether lepton inside jet is electron : isEle=1, is muon : isMu=1, not present : isOther=1 . Based on PdgId. implementation

Jet_numDaughters_pt03 : multiplicity of jet daughters with pT > 0.3 GeV implementation

Jet energy rings : jet energy fraction split by constituents and in rings of dR. implementation

dR0 = 0.00-0 .05, dR1 = 0.05-0.1, dR2 = 0.1-0.2, dR3 = 0.2-0.3, dR4 = 0.3-0.4

Jet_energyRing_dR*_em_Jet_rawEnergy - electomagnatic energy fraction

Jet_energyRing_dR*_neut_Jet_rawEnergy - neutral

Jet_energyRing_dR*_ch_Jet_rawEnergy - charged

Jet_energyRing_dR*_mu_Jet_rawEnergy - muon

All features have to be calculated from raw energy! (No JEC or JER)

Affected variables : Jet pT,mass,mT, Jet_leptonPtRelInv. All energy rings have to be calculated wrt to raw energy!

Python implementation

Simple python implementation keras and pandas :

python with keras

Read the config file and the model.hdf5 :

https://github.com/michelif/HHbbgg_ETH/blob/master/bregression/notebooks/predict_fit_ffwd.py#L37-L53

Get the correction and resolution estimator and renormalize them :

https://github.com/michelif/HHbbgg_ETH/blob/master/bregression/notebooks/predict_fit_ffwd.py#L63-L74

DNN producer implementation as in flashgg

Implementation of the producer in flashgg

A producer has been written to evaluate the b-regression on jet and add two userFloats (correction and resolution) to the jet collection. Two different implementations are present, depending if you are using 80X or 94X release, since TensorFlow is implemented only in 94X.

Producer for 80X

A branch with all the needed code for flashgg is present at this repository.

A setup of the interface between CMSSW and TensorFlow is needed. The code for 80X is here https://gitlab.cern.ch/mrieger/CMSSW-DNN/. Do the setup steps written in the README after the setup of flashgg. Be sure you follow the recipe for 80X. These two lines have been added to the buildfile to include the DNN Libraries.

An example producer for 80X is this, while here you can find the corresponding cfi. The input model to be applied is here.

An example ntuplizer using the flashgg producer can be found in this private branch for the code of double Higgs analysis (bbggTools). This is the py to run following the instructions described in the README of the package.

Producer for 94X

A branch with all the needed code for flashgg is present at this repository.

A setup of the interface between CMSSW and TensorFlow is needed. The code for 94X is lighter wrt 80X version since TensorFlow is integrated in the release https://gitlab.cern.ch/mrieger/CMSSW-DNN. Do the setup steps written in the README after the setup of flashgg. Be sure you follow the recipe for 94X.

On the producer side for flashgg the only thing that changed wrt to 80X implementation is the reading of the model file (since TensorFlow is in the release) and a better handling of libraries. The example producer for 94X is this, while here you can find the corresponding cfi. The input model to be applied is here.

As an example ntuplizer, the 80X version has been tested also in 94X. Please note that the 94X version of flashgg currently updates daily, and moreover a validation is ongoing on 2017 data. So this 94X version in flashgg should be considered as a work in progress.

DNN producer implementation as in NanoAOD

Implementation of the producer in NanoAOD

NanoAOD implementation [CMSSW_9_4_X]

You can ignore this part with tmva

tmva part to be ignored

because you need the TF (TensorFlow) part only.

NanoAOD implementation .cc

Energy rings variables are added in a separate producer :

energy rings producer

EDProducer:

https://github.com/arizzi/cmssw/blob/tfValuemap/PhysicsTools/NanoAOD/python/jets_cff.py#L322-L364

Saving correction and resolution:

https://github.com/arizzi/cmssw/blob/tfValuemap/PhysicsTools/NanoAOD/python/jets_cff.py#L181-L182

Do not forget to renormalize the output back to y_mean and y_std from the config file:

https://github.com/arizzi/cmssw/blob/tfValuemap/PhysicsTools/NanoAOD/python/jets_cff.py#L361

-- NadezdaChernyavskaya - 2018-04-13

Edit | Attach | Watch | Print version | History: r18 < r17 < r16 < r15 < r14 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r18 - 2018-11-17 - NadyaChernyavskaya
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright &© 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback