CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

JetIDProducer Class Reference

#include <RecoJets/JetProducers/plugins/JetIDProducer.cc>

Inheritance diagram for JetIDProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 JetIDProducer (const edm::ParameterSet &)
 ~JetIDProducer ()

Private Member Functions

virtual void beginJob ()
virtual void endJob ()
virtual void produce (edm::Event &, const edm::EventSetup &)

Private Attributes

reco::helper::JetIDHelper helper_
reco::helper::JetMuonHitsIDHelper muHelper_
edm::InputTag src_

Detailed Description

Description: Produces a value map of jet---> jet Id

Implementation: There are two modes: AOD only, in which case only a subset of the info is written, and RECO, when all the info is written. The AOD-only case will be suitable for the "very loose" jet ID, whereas the RECO case will be globally suitable.

Definition at line 46 of file JetIDProducer.h.


Constructor & Destructor Documentation

JetIDProducer::JetIDProducer ( const edm::ParameterSet iConfig) [explicit]

Definition at line 18 of file JetIDProducer.cc.

                                                           :
  src_       ( iConfig.getParameter<edm::InputTag>("src") ),
  helper_    ( iConfig ),
  muHelper_  ( iConfig )
{
  produces< reco::JetIDValueMap >();
}
JetIDProducer::~JetIDProducer ( )

Definition at line 27 of file JetIDProducer.cc.

{
}

Member Function Documentation

void JetIDProducer::beginJob ( void  ) [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 106 of file JetIDProducer.cc.

{
}
void JetIDProducer::endJob ( void  ) [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 112 of file JetIDProducer.cc.

                      {
}
void JetIDProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
) [private, virtual]

Implements edm::EDProducer.

Definition at line 38 of file JetIDProducer.cc.

References reco::helper::JetIDHelper::approximatefHPD(), reco::helper::JetIDHelper::approximatefRBX(), reco::helper::JetIDHelper::calculate(), reco::helper::JetMuonHitsIDHelper::calculate(), reco::helper::JetIDHelper::fEB(), reco::helper::JetIDHelper::fEE(), reco::helper::JetIDHelper::fHB(), reco::helper::JetIDHelper::fHE(), reco::helper::JetIDHelper::fHFOOT(), reco::helper::JetIDHelper::fHO(), reco::helper::JetIDHelper::fHPD(), edm::helper::Filler< Map >::fill(), reco::helper::JetIDHelper::fLong(), reco::helper::JetIDHelper::fLSbad(), reco::helper::JetIDHelper::fRBX(), reco::helper::JetIDHelper::fShort(), reco::helper::JetIDHelper::fSubDetector1(), reco::helper::JetIDHelper::fSubDetector2(), reco::helper::JetIDHelper::fSubDetector3(), reco::helper::JetIDHelper::fSubDetector4(), edm::Event::getByLabel(), helper_, reco::helper::JetIDHelper::hitsInN90(), edm::helper::Filler< Map >::insert(), muHelper_, reco::helper::JetIDHelper::n90Hits(), reco::helper::JetIDHelper::nECALTowers(), reco::helper::JetIDHelper::nHCALTowers(), reco::helper::JetMuonHitsIDHelper::numberOfHits2RPC(), reco::helper::JetMuonHitsIDHelper::numberOfHits3RPC(), reco::helper::JetMuonHitsIDHelper::numberOfHitsRPC(), edm::Event::put(), reco::helper::JetIDHelper::restrictedEMF(), and src_.

{

  // get the input jets
  edm::Handle< edm::View<reco::CaloJet> > h_jets;
  iEvent.getByLabel( src_, h_jets );

  // allocate the jet--->jetid value map
  std::auto_ptr<reco::JetIDValueMap> jetIdValueMap( new reco::JetIDValueMap );
  // instantiate the filler with the map
  reco::JetIDValueMap::Filler filler(*jetIdValueMap);
  
  // allocate the vector of ids
  size_t njets = h_jets->size();
  std::vector<reco::JetID>  ids (njets);
   
  // loop over the jets
  for ( edm::View<reco::CaloJet>::const_iterator jetsBegin = h_jets->begin(),
          jetsEnd = h_jets->end(),
          ijet = jetsBegin;
        ijet != jetsEnd; ++ijet ) {

    // get the id from each jet
    helper_.calculate( iEvent, *ijet );

    muHelper_.calculate( iEvent, iSetup, *ijet );

    ids[ijet-jetsBegin].fHPD               =  helper_.fHPD();
    ids[ijet-jetsBegin].fRBX               =  helper_.fRBX();
    ids[ijet-jetsBegin].n90Hits            =  helper_.n90Hits();
    ids[ijet-jetsBegin].fSubDetector1      =  helper_.fSubDetector1();
    ids[ijet-jetsBegin].fSubDetector2      =  helper_.fSubDetector2();
    ids[ijet-jetsBegin].fSubDetector3      =  helper_.fSubDetector3();
    ids[ijet-jetsBegin].fSubDetector4      =  helper_.fSubDetector4();
    ids[ijet-jetsBegin].restrictedEMF      =  helper_.restrictedEMF();
    ids[ijet-jetsBegin].nHCALTowers        =  helper_.nHCALTowers();
    ids[ijet-jetsBegin].nECALTowers        =  helper_.nECALTowers();
    ids[ijet-jetsBegin].approximatefHPD    =  helper_.approximatefHPD();
    ids[ijet-jetsBegin].approximatefRBX    =  helper_.approximatefRBX();
    ids[ijet-jetsBegin].hitsInN90          =  helper_.hitsInN90();    

    ids[ijet-jetsBegin].numberOfHits2RPC   = muHelper_.numberOfHits2RPC();
    ids[ijet-jetsBegin].numberOfHits3RPC   = muHelper_.numberOfHits3RPC();
    ids[ijet-jetsBegin].numberOfHitsRPC    = muHelper_.numberOfHitsRPC();
    
    ids[ijet-jetsBegin].fEB     = helper_.fEB   ();
    ids[ijet-jetsBegin].fEE     = helper_.fEE   ();
    ids[ijet-jetsBegin].fHB     = helper_.fHB   (); 
    ids[ijet-jetsBegin].fHE     = helper_.fHE   (); 
    ids[ijet-jetsBegin].fHO     = helper_.fHO   (); 
    ids[ijet-jetsBegin].fLong   = helper_.fLong ();
    ids[ijet-jetsBegin].fShort  = helper_.fShort();
    ids[ijet-jetsBegin].fLS     = helper_.fLSbad   ();
    ids[ijet-jetsBegin].fHFOOT  = helper_.fHFOOT();
  }
  
  // set up the map
  filler.insert( h_jets, ids.begin(), ids.end() );
 
  // fill the vals
  filler.fill();

  // write map to the event
  iEvent.put( jetIdValueMap );
}

Member Data Documentation

Definition at line 59 of file JetIDProducer.h.

Referenced by produce().

Definition at line 60 of file JetIDProducer.h.

Referenced by produce().

Definition at line 58 of file JetIDProducer.h.

Referenced by produce().