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::unique_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(std::move(newjets));
37 }
38 
39 
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
Jets made from CaloTowers.
Definition: CaloJet.h:29
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
int iEvent
Definition: GenABIO.cc:230
vector< PseudoJet > jets
def move
Definition: eostools.py:510
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:81
virtual void produce(edm::Event &, const edm::EventSetup &)
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects