CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
29 
30 //include header file
32 
34  src_ (PSet.getParameter<edm::InputTag>("src")),
35  inputToken_ (consumes<reco::BasicJetCollection>(src_))
36 {
37  produces<reco::PFJetCollection>();
38 }
39 
41 
42 
45  desc.add<edm::InputTag>("src",edm::InputTag(""));
46  descriptions.add("BasicToPFJet",desc);
47 }
48 
50 
51  //first get the basic jet collection
53  Event.getByToken(inputToken_, BasicJetColl);
54 
55  //now make the new pf jet collection
56  std::auto_ptr<reco::PFJetCollection> PFJetColl(new reco::PFJetCollection);
57  //reco::PFJetCollection* PFJetColl = new reco::PFJetCollection;
58  //make the 'specific'
60 
61  //now get iterator
62  reco::BasicJetCollection::const_iterator i = BasicJetColl->begin();
63 
64  //loop over basic jets and convert them to pfjets
65  for(; i!=BasicJetColl->end(); i++){
66  reco::PFJet pfjet(i->p4(),i->vertex(),specific);
67  PFJetColl->push_back(pfjet);
68  }
69 
70  //std::auto_ptr<reco::PFJetCollection> selectedPFJets(PFJetColl);
71  Event.put(PFJetColl);
72 }
73 
74 
75 //define as plug-in for the framework
const edm::EDGetTokenT< reco::BasicJetCollection > inputToken_
Definition: BasicToPFJet.h:23
int i
Definition: DBlmapReader.cc:9
dictionary specific
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
BasicToPFJet(const edm::ParameterSet &PSet)
Definition: BasicToPFJet.cc:33
Jets made from PFObjects.
Definition: PFJet.h:21
Definition: Event.h:16
virtual ~BasicToPFJet()
Definition: BasicToPFJet.cc:40
virtual void produce(edm::Event &event, const edm::EventSetup &EventSetup) override
Definition: BasicToPFJet.cc:49
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: BasicToPFJet.cc:43
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< PFJet > PFJetCollection
collection of PFJet objects
std::vector< BasicJet > BasicJetCollection
collection of BasicJet objects