CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AnyJetToCaloJetProducer.cc
Go to the documentation of this file.
3 
7 
9 {
10  jetSrc_ = iConfig.getParameter<edm::InputTag>("Source");
11  m_theGenericJetToken = consumes<edm::View<reco::Jet>>(jetSrc_);
12  produces<reco::CaloJetCollection>();
13 }
14 
16 
17 void
20  desc.add<edm::InputTag>("Source",edm::InputTag(""));
21  descriptions.add("AnyJetToCaloJetProducer",desc);
22 }
23 
25 {
26  std::auto_ptr<reco::CaloJetCollection> newjets(new reco::CaloJetCollection());
27 
29  if(iEvent.getByToken(m_theGenericJetToken,jets)) {
30  for(edm::View<reco::Jet>::const_iterator i = jets->begin(); i != jets->end(); i++ ) {
31  reco::CaloJet jet(i->p4(), i->vertex(), reco::CaloJet::Specific());
32  newjets->push_back(jet);
33  }
34  }
35 
36  iEvent.put(newjets);
37 }
38 
39 
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
Jets made from CaloTowers.
Definition: CaloJet.h:29
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
int iEvent
Definition: GenABIO.cc:230
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
vector< PseudoJet > jets
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::EDGetTokenT< edm::View< reco::Jet > > m_theGenericJetToken
void add(std::string const &label, ParameterSetDescription const &psetDescription)
AnyJetToCaloJetProducer(const edm::ParameterSet &)
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:85
virtual void produce(edm::Event &, const edm::EventSetup &)
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects