b-tagging tutorial

Complete: 5

Btagging example

Let's create a working are based on CMSSW 1.1.1, add the latest b tagging software packages, and run the TrackCounting and SoftLepton algorithms on some b and c jets:
scramv1 project -n Tutorial20061116 CMSSW CMSSW_1_1_1
cd Tutorial20061116/src/
project CMSSW
cvs co -r Tutorial20061116 DataFormats/BTauReco
cvs co -r Tutorial20061116 RecoBTau
cvs co -r Tutorial20061116 RecoBTag
scramv1 b -r
eval `scramv1 runtime -sh`
cd ..

Two sample config files are test_b.cfg and test_c.cfg.

mkdir analysis
cd analysis
wget https://twiki.cern.ch/twiki/pub/CMS/BTagTutorialFnal/test_b.cfg
cmsRun test_b.cfg
and
wget https://twiki.cern.ch/twiki/pub/CMS/BTagTutorialFnal/test_c.cfg
cmsRun test_c.cfg

We can look at the output with ROOT and fwLite:

gSystem->Load("libFWCoreFWLite.so");
AutoLibraryLoader::enable();
TFile* file = new TFile("test_b.root");
new TBrowser;

Events->SetAlias("tkCountBase", "recoJetTags_trackCountingJetTags__bTag.obj");
Events->SetAlias("tkCountExt",  "recoTrackCountingTagInfos_trackCountingJetTags__bTag.obj");
Events->SetAlias("leptonBase",  "recoJetTags_softLeptonJetTags_softLepton_bTag.obj");
Events->SetAlias("leptonExt",   "recoSoftLeptonTagInfos_softLeptonJetTags__bTag.obj");

c1 = new TCanvas();
c1->Divide(2,2);
c1->cd(1);
Events->Draw("tkCountBase.discriminator()", "tkCountBase.jet().pt() > 20");
c1->cd(2);
Events->Draw("tkCountBase.jet().pt()");
c1->cd(3);
Events->Draw("tkCountExt.discriminator(3,1)", "tkCountBase.jet().pt() > 20");
c1->cd(4);
Events->Draw("tkCountExt.discriminator(3,0)", "tkCountBase.jet().pt() > 20");

c2 = new TCanvas();
c2->Divide(2,2);
c2->cd(1);
Events->Draw("leptonExt.discriminator()", "(leptonExt.jet().pt() > 20) && (leptonExt.leptons() > 0)");
c2->cd(2);
Events->Draw("leptonExt.jet().pt()");
c2->cd(3);
Events->Draw("leptonExt.properties(0).sip3d", "(leptonExt.jet().pt() > 20) && (leptonExt.leptons() > 0)");
c2->cd(4);
Events->Draw("leptonExt.properties(0).ptRel", "(leptonExt.jet().pt() > 20) && (leptonExt.leptons() > 0)");

Analysis

For this tutorial, check out the head of RecoBTag/Analysis and RecoBTag/MCTools, and compile the two packages.

The full explanation of the Analysis package is given in this page.

Exercise:

  replace bTagTrackCountingAnalysis.rootfile = "plots_b.root"
  • Run on your sample of c jets, calling the ouptut file plots_c.root
  • You now have two root files. Merge the files obtained using the root executable hadd (you should have this in your path, in $ROOTSYS/bin):
 hadd plots_add.root    plots_b.root    plots_c.root

  • Run the cfg file nicePlots.cfg to produce the final performance plots and produce a root file (test_final.root) and eps and ps files of the merged plots (= cmsRun nicePlots.cfg=). Notice in nicePlots.cfg the replace statements, to replace the parameters of the default configuration. In case you have used different eta and pt bins, put in the correct bins through two other replace statements. For example:
  replace bTagTrackCountingAnalysis.etaRanges = { 0.0,  2.4 }
  replace bTagTrackCountingAnalysis.ptRanges = { 30.0, 400.0 }

Look at the plots produced, either in the root file, the ps or the eps file.

MC tools

An example of the usage of the Jet flavour identification tools is given in the EDAnalyzer RecoBTag/MCTools/test/BtagMCTest.cc. It is explained in the SWGuideBTagMCTools page. A sample configuration file to run it is provided in the same directory (test.cfg).

Review Status

Editor/Reviewer and date Comments
Andrea Bocci, Thomas Speer - 15 Nov 2006 page authors
JennyWilliams - 30 Mar 2007

Responsible: Main.speer
Last reviewed by: Reviewer

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatcfg nicePlots.cfg r2 r1 manage 0.6 K 2006-11-16 - 15:10 AndreaBocci draw final plots
Unknown file formatcfg plot_b.cfg r2 r1 manage 0.5 K 2006-11-16 - 15:01 AndreaBocci plot b jets stuff
Unknown file formatcfg plot_c.cfg r2 r1 manage 0.5 K 2006-11-16 - 15:01 AndreaBocci plot c jets stuff
Unknown file formatcfg test_b.cfg r1 manage 2.5 K 2006-11-16 - 10:29 AndreaBocci sample .cfg file running b tag algorithms on RelVal 1.1.1 b jets
Unknown file formatcfg test_c.cfg r1 manage 2.8 K 2006-11-16 - 10:30 AndreaBocci sample .cfg file running b tag algorithms on RelVal 1.1.1 c jets
Edit | Attach | Watch | Print version | History: r10 < r9 < r8 < r7 < r6 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r10 - 2007-06-29 - JennyWilliams



 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CMSPublic All webs login

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