CMS 3D CMS Logo

Public Member Functions | Private Attributes

AnyJetToCaloJetProducer Class Reference

#include <AnyJetToCaloJetProducer.h>

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

List of all members.

Public Member Functions

 AnyJetToCaloJetProducer (const edm::ParameterSet &)
virtual void produce (edm::Event &, const edm::EventSetup &)
 ~AnyJetToCaloJetProducer ()

Private Attributes

edm::InputTag jetSrc_

Detailed Description

Definition at line 13 of file AnyJetToCaloJetProducer.h.


Constructor & Destructor Documentation

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

Definition at line 6 of file AnyJetToCaloJetProducer.cc.

References edm::ParameterSet::getParameter(), and jetSrc_.

{
  jetSrc_ = iConfig.getParameter<edm::InputTag>("Source");
  produces<reco::CaloJetCollection>();
}
AnyJetToCaloJetProducer::~AnyJetToCaloJetProducer ( )

Definition at line 12 of file AnyJetToCaloJetProducer.cc.

{ }

Member Function Documentation

void AnyJetToCaloJetProducer::produce ( edm::Event iEvent,
const edm::EventSetup iES 
) [virtual]

Implements edm::EDProducer.

Definition at line 14 of file AnyJetToCaloJetProducer.cc.

References edm::Event::getByLabel(), i, metsig::jet, fwrapper::jets, jetSrc_, and edm::Event::put().

{
  std::auto_ptr<reco::CaloJetCollection> newjets(new reco::CaloJetCollection());
  
  edm::Handle<edm::View<reco::Jet> > jets;
  if (iEvent.getByLabel( jetSrc_, jets )) {
    for(edm::View<reco::Jet>::const_iterator i = jets->begin(); i != jets->end(); i++ ) {
      reco::CaloJet jet(i->p4(), i->vertex(), reco::CaloJet::Specific());
      newjets->push_back(jet);
    }
  }
  
  iEvent.put(newjets);
}

Member Data Documentation

Definition at line 24 of file AnyJetToCaloJetProducer.h.

Referenced by AnyJetToCaloJetProducer(), and produce().