Electron isolation with PAT in 2_2_X

note: You should always use 2.2.X for the PAT, even to run on 2.1.X samples. You can get the updated prescriptions to run PAT from the SWGuidePATRecipes twikipage. Please avoid the 2.2.0 release because it has some known problems related to electron cluster shapes and isolation that have been fixed in 2.2.1-

You should also check out and compile PhysicsTools/PatAlgos V04-14-15 unless it's already included in the release you're working with (it's not in 2.2.1, it should be in 2.2.2). You can check which tag is included in your release using addpkg -q PhysicsTools/PatAlgos.

Access Track isolation from your PAT sample:

//First get a hand on the PAT electrons:
Handle<vector<pat::Electron> > pelecs;
event.getByLabel("selectedLayer1Electrons", "", pelecs);
const vector<pat::Electron>* elecs = pelecs.product();

//Loop over pat electrons and access track isolation:
for(vector<pat::Electron>::const_iterator ipatelec = elecs->begin(); ipatelec != elecs->end(); ipatelec++) {
  //First and simplest way: Use default isolation
  float defaultPatTrackIso = ipatelec->trackIso();
  //If you want to tune it, use isodeposits. Here is a dummy example:
  const pat::IsoDeposit * trkisodepo = ipatelec->trackerIsoDeposit();
  float customtrackiso=0.;
  for (pat::IsoDeposit::const_iterator im = trkisodepo->begin(); im != trkisodepo->end(); ++im) {
    if (im->dR() >  0.015 && im->dR() < 0.3 && im->value()>1.)  customtrackiso+=im->value();

Access ECAL isolation from your PAT sample:

Do the same as for track isolation described above, replacing trackIso() by ecalIso() and trackerIsoDeposit() by ecalIsoDeposit().

-- MatthewLeBourgeois - 14 Jul 2009

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2009-07-14 - MatthewLeBourgeois
    • 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