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 
40 
43  desc.add<edm::InputTag>("src", edm::InputTag(""));
44  descriptions.add("BasicToPFJet", desc);
45 }
46 
48  //first get the basic jet collection
50  Event.getByToken(inputToken_, BasicJetColl);
51 
52  //now make the new pf jet collection
53  auto PFJetColl = std::make_unique<reco::PFJetCollection>();
54  //reco::PFJetCollection* PFJetColl = new reco::PFJetCollection;
55  //make the 'specific'
57 
58  //now get iterator
59  reco::BasicJetCollection::const_iterator i = BasicJetColl->begin();
60 
61  //loop over basic jets and convert them to pfjets
62  for (; i != BasicJetColl->end(); i++) {
63  reco::PFJet pfjet(i->p4(), i->vertex(), specific);
64  PFJetColl->push_back(pfjet);
65  }
66 
67  //std::unique_ptr<reco::PFJetCollection> selectedPFJets(PFJetColl);
68  Event.put(std::move(PFJetColl));
69 }
70 
71 //define as plug-in for the framework
const edm::EDGetTokenT< reco::BasicJetCollection > inputToken_
Definition: BasicToPFJet.h:20
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
BasicToPFJet(const edm::ParameterSet &PSet)
Definition: BasicToPFJet.cc:34
~BasicToPFJet() override
Definition: BasicToPFJet.cc:39
Jets made from PFObjects.
Definition: PFJet.h:20
void produce(edm::Event &event, const edm::EventSetup &EventSetup) override
Definition: BasicToPFJet.cc:47
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: BasicToPFJet.cc:41
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