CMS 3D CMS Logo

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
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
Jets made from CaloTowers.
Definition: CaloJet.h:29
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
int iEvent
Definition: GenABIO.cc:230
~AnyJetToCaloJetProducer() override
void produce(edm::Event &, const edm::EventSetup &) override
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:86
def move(src, dest)
Definition: eostools.py:510
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects