CMS 3D CMS Logo

BasicToPFJet.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: BasicToPFJet
4 // Class: BasicToPFJet
5 //
14 //
15 // Original Author: clint richardson
16 // Created: Thu, 6 Mar 2014 12:00:00 GMT
17 //
18 //
19 // system include files
20 #include <memory>
21 #include <vector>
22 #include <sstream>
23 
24 // user include files
30 
31 //include header file
33 
35  : src_(PSet.getParameter<edm::InputTag>("src")), inputToken_(consumes<reco::BasicJetCollection>(src_)) {
36  produces<reco::PFJetCollection>();
37 }
38 
41  desc.add<edm::InputTag>("src", edm::InputTag(""));
42  descriptions.add("BasicToPFJet", desc);
43 }
44 
46  //first get the basic jet collection
48  Event.getByToken(inputToken_, BasicJetColl);
49 
50  //now make the new pf jet collection
51  auto PFJetColl = std::make_unique<reco::PFJetCollection>();
52  //reco::PFJetCollection* PFJetColl = new reco::PFJetCollection;
53  //make the 'specific'
55 
56  //now get iterator
57  reco::BasicJetCollection::const_iterator i = BasicJetColl->begin();
58 
59  //loop over basic jets and convert them to pfjets
60  for (; i != BasicJetColl->end(); i++) {
61  reco::PFJet pfjet(i->p4(), i->vertex(), specific);
62  PFJetColl->push_back(pfjet);
63  }
64 
65  //std::unique_ptr<reco::PFJetCollection> selectedPFJets(PFJetColl);
66  Event.put(std::move(PFJetColl));
67 }
68 
69 //define as plug-in for the framework
const edm::EDGetTokenT< reco::BasicJetCollection > inputToken_
Definition: BasicToPFJet.h:19
BasicToPFJet(const edm::ParameterSet &PSet)
Definition: BasicToPFJet.cc:34
Jets made from PFObjects.
Definition: PFJet.h:20
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: BasicToPFJet.cc:39
void produce(edm::StreamID, edm::Event &event, const edm::EventSetup &EventSetup) const override
Definition: BasicToPFJet.cc:45
void add(std::string const &label, ParameterSetDescription const &psetDescription)
fixed size matrix
HLT enums.
def move(src, dest)
Definition: eostools.py:511
std::vector< BasicJet > BasicJetCollection
collection of BasicJet objects