CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

CastorJetIDProducer Class Reference

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

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

List of all members.

Public Member Functions

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

Private Member Functions

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

Private Attributes

reco::helper::CastorJetIDHelper helper_
edm::InputTag src_

Detailed Description

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

Definition at line 42 of file CastorJetIDProducer.h.


Constructor & Destructor Documentation

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

Definition at line 18 of file CastorJetIDProducer.cc.

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

Definition at line 26 of file CastorJetIDProducer.cc.

{
}

Member Function Documentation

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

Reimplemented from edm::EDProducer.

Definition at line 86 of file CastorJetIDProducer.cc.

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

Reimplemented from edm::EDProducer.

Definition at line 92 of file CastorJetIDProducer.cc.

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

Implements edm::EDProducer.

Definition at line 37 of file CastorJetIDProducer.cc.

References reco::helper::CastorJetIDHelper::calculate(), reco::helper::CastorJetIDHelper::depth(), reco::helper::CastorJetIDHelper::emEnergy(), reco::helper::CastorJetIDHelper::fem(), reco::helper::CastorJetIDHelper::fhot(), edm::helper::Filler< Map >::fill(), edm::Event::getByLabel(), reco::helper::CastorJetIDHelper::hadEnergy(), helper_, edm::helper::Filler< Map >::insert(), reco::helper::CastorJetIDHelper::nTowers(), edm::Event::put(), reco::helper::CastorJetIDHelper::sigmaz(), src_, and reco::helper::CastorJetIDHelper::width().

{

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

  // allocate the jet--->jetid value map
  std::auto_ptr<reco::CastorJetIDValueMap> castorjetIdValueMap( new reco::CastorJetIDValueMap );
  // instantiate the filler with the map
  reco::CastorJetIDValueMap::Filler filler(*castorjetIdValueMap);
  
  // allocate the vector of ids
  size_t njets = h_jets->size();
  std::vector<reco::CastorJetID>  ids (njets);
   
  // loop over the jets
  for ( edm::View<reco::BasicJet>::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 );

    ids[ijet-jetsBegin].emEnergy               =  helper_.emEnergy();
    ids[ijet-jetsBegin].hadEnergy               =  helper_.hadEnergy();
    ids[ijet-jetsBegin].fem            =  helper_.fem();
    ids[ijet-jetsBegin].depth      =  helper_.depth();
    ids[ijet-jetsBegin].width      =  helper_.width();
    ids[ijet-jetsBegin].fhot      =  helper_.fhot();
    ids[ijet-jetsBegin].sigmaz      =  helper_.sigmaz();
    ids[ijet-jetsBegin].nTowers      =  helper_.nTowers(); 


  }
  
  // set up the map
  filler.insert( h_jets, ids.begin(), ids.end() );
 
  // fill the vals
  filler.fill();

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

Member Data Documentation

Definition at line 55 of file CastorJetIDProducer.h.

Referenced by produce().

Definition at line 54 of file CastorJetIDProducer.h.

Referenced by produce().