How to determine the True Flavour of a Jet in CMSSW 1.6

Two packages exist to identify the flavour of the parton responsable for producing a given reconstructed jet. The new (and so recommended one is CMS.PhysicsTools/JetMCAlgos/, whilst the older one is RecoBTag/MCTools package. They should give identical results, but the latter may not work on AOD, since it accesses the MC truth using HepMCProduct rather than genParticles. Jet-parton matching is an essential tool for b tag performance studies. Details of both packages can be found here in the CMSSW Offline Guide. However, for a simple example of how to use RecoBTag/MCTools/ in your EDAnalyzer:

  1. Create a CMSSW 1.6.7 (or later) project area and go to its src/ directory.
  2. cvs co -r CMSSW_yourVersion RecoBTag/MCTools/test/ (If you are using 1.6.7, please check out instead V01-00-12)
  3. scram b
  4. cd RecoBTag/MCTools/test/
  5. cmsRun BtagMCTest.cfg

Take a look at to see how it works. Key ingredients are:

#include "RecoBTag/MCTools/interface/JetFlavourIdentifier.h"

# Initialize the tool for identifying the true jet flavour, 
# using configuration parameters read from the .cfg file. (Done once).
JetFlavourIdentifier jfi = 

# Give the tool the entire event to work with.

# Get the true jet flavour (where 1,2,3,4,5,21 = d,u,s,c,b,g) of the b tag jet found in the 
# earlier EDAnalyzer example.
JetFlavour jetFlavour = jfi.identifyBasedOnPartons(* bTags[i].jet());
int flavour = jetFlavour.flavour();

-- IanTomalin - 30 Oct 2007

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r4 - 2007-11-27 - IanTomalin



    • 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