Tasks in b tagging
@mmahdavi, here is the sequence of tasks related to b tagging:
- Class
BTagCalibrationStandalone
, whose code is taken from CMSSW, is an implementation detail and should not be exposed in interface of the analysis library. Move the corresponding source files tosrc/BTag
, similarly to what is done for jets. Add there a README with a description. - Update the code of
BTagCalibrationStandalone
to the latest version from CMSSW, as mentioned in #4 (closed). Use signed η here and make sure that the results don't change. - In class
Jet
, rename fieldbTagCsvV2
tobTag
. Almost certainly, we will only use a single b tagging algorithm in this analysis. InJetBuilder
read the name of the branch with values of the b tagger from the configuration file. - Add class
BTagger
that would evaluate whether a jet is b-tagged or not, with an interface likebool BTaggger::operator()(Jet const &jet) const;
IsTaggable
that would check if the jet is within the tracker coverage (|η| < 2.4 for this purpose) and has a high enough pT to be b-tagged (#3 (closed)). A jet that is not taggable automatically fails the b tagging selection regardless of the value of the discriminator. All thresholds used inBTagger
should be read from the configuration file. - Migrate all code to use the
BTagger
class. Drop not needed working points inLooperMain::FillBTagEfficiency
and adjust the corresponding files here and this script accordingly. - Vary b tagging scale factors separately for heavy-flavour and light-flavour jets in
BTagWeight
(#2 (closed)).
At each step you'll need to make sure that results don't change or, if they do, that the change is expected. Since here only the C++ part of the analysis is affected, it's enough to check histograms produced by the main program. You can produce the histograms by running something like
runHZZanalysis --catalog /pnfs/iihe/cms/store/group/HZZ2l2nu/Bonzais/Catalogs/September2018_newIDIso_v2/Bonzais-ZZTo2L2Nu_13TeV_powheg_pythia8-all-ZZ2l2vPruner-MC_DLep.txt \
--output hists.root --max-files 1 --all-control-plots --seed 1129
interactively. (Note the fixed random number seed.) I'm attaching a couple of scripts to compare files with histograms produced in different versions of the code:
-
compare.py
compares all histograms and prints a notification if the set of histograms or the content of any histogram have changed. -
compare_vis.py
plots mT distributions from the two versions in the same figure so that they can be compared.
Edited by Andrey Popov