b Tag Analysis with a CMSSW EDAnalyzer in CMSSW 1.6

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("trackCountingHighEffJetTags", bTagHandle);
const reco::JetTagCollection & bTags = *(bTagHandle.product());

# Loop over jets and study b tag info.
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 for this JetTag, and cast it to the specific type for this b tag algorithm.
const reco::TrackIPTagInfo * tagInfo 
    = dynamic_cast<const reco::TrackIPTagInfo *>(bTags[i].tagInfoRef().get());
# Access 3D impact parameters of tracks in jet.
vector<Measurement1D> ip3d = tagInfo->impactParameters(0); 

-- IanTomalin - 29 Oct 2007

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2007-10-30 - IanTomalin


ESSENTIALS

ADVANCED TOPICS


 
    • 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