b Tag Analysis with a CMSSW EDAnalyzer in CMSSW 1.3

Most physics analyses will use this method. You should start by creating your own generic EDAnalyzer and .cfg files, as described here earlier in the Workbook.

To look at b tag information in each event, you can add to your EDAnalyzer::analyze() code like this. :

#include "DataFormats/BTauReco/interface/JetTag.h"

# Get b tag information
edm::Handle<reco::JetTagCollection> bTagHandle;
iEvent.getByLabel("trackCountingJetTags", bTagHandle);
const reco::JetTagCollection & bTags = *(bTagHandle.product());

# Loop over jets and study b tags.
for (int i = 0; i != bTags.size(); ++i) {
   cout<<" Jet "<< i 
         <<" has b tag discriminator = "<<bTags[i].discriminator()
         << " and jet Pt = "<<bTags[i].jet()->pt()<<endl;

If you have a Jet, rather than a JetTag, and wish to know if it is b-tagged, there are several ways of doing so. One which always works is to perform angular matching between the Jet and the JetTag::jet(). (The match should be perfect if your JetCollection was used to produce the JetTagCollection).

Should you wish to look at the information from which the b tag discriminator was calculated, do something like:

# Get TagInfo from the event for this b tag algorithm.
edm::Handle<reco::TrackCountingTagInfoCollection> bTagInfoHandle;
iEvent.getByLabel("trackCountingJetTags", bTagInfoHandle);
const reco::TrackCountingTagInfoCollection & bTagInfos = *(bTagInfoHandle.product());

# Loop over jets and study b tag info.
for (int i = 0; i != bTagInfos.size(); ++i) {

# Access 3D impact parameter significance of 2nd most significant track in jet.
  int 2D = 0;
  float sig3d = bTagInfos[i].significance(2, 2D); 
  cout<<" Jet "<< i << " : significance = " << sig3d <<endl;

# Get JetTag calculated from this TagInfo.
  const JetTagRef jet = bTagInfos[i].getJetTag(void);

-- IanTomalin - 30 Oct 2007

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2007-10-30 - 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