CMS 3D CMS Logo

PFJetToCaloProducer.cc
Go to the documentation of this file.
4 #include "Math/GenVector/VectorUtil.h"
5 //
6 // class decleration
7 //
8 
9 
11 {
12 
13  tauSrc_ = consumes<reco::PFJetCollection>(iConfig.getParameter<edm::InputTag>("Source"));
14  produces<reco::CaloJetCollection>();
15 }
16 
18 
20 {
21  using namespace reco;
22  using namespace edm;
23  using namespace std;
24 
25  std::unique_ptr<reco::CaloJetCollection> selectedTaus(new CaloJetCollection);
26 
28  iEvent.getByToken( tauSrc_, tauJets );
29 
30  CaloJet::Specific specific;
31  for (PFJetCollection::const_iterator i = tauJets->begin(); i != tauJets->end(); ++i ) {
32  CaloJet jet(i->p4(), i->vertex(), specific);
33  jet.setPdgId(15);
34  selectedTaus->push_back(jet);
35  }
36 
37  iEvent.put(std::move(selectedTaus));
38 }
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
Jets made from CaloTowers.
Definition: CaloJet.h:29
void produce(edm::Event &, const edm::EventSetup &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
PFJetToCaloProducer(const edm::ParameterSet &)
selectedTaus
====================================== Taus
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< reco::PFJetCollection > tauSrc_
fixed size matrix
HLT enums.
def move(src, dest)
Definition: eostools.py:511
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects