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")),
36  inputToken_ (consumes<reco::BasicJetCollection>(src_))
37 {
38  produces<reco::PFJetCollection>();
39 }
40 
42 
43 
46  desc.add<edm::InputTag>("src",edm::InputTag(""));
47  descriptions.add("BasicToPFJet",desc);
48 }
49 
51 
52  //first get the basic jet collection
54  Event.getByToken(inputToken_, BasicJetColl);
55 
56  //now make the new pf jet collection
57  auto PFJetColl = std::make_unique<reco::PFJetCollection>();
58  //reco::PFJetCollection* PFJetColl = new reco::PFJetCollection;
59  //make the 'specific'
60  reco::PFJet::Specific specific;
61 
62  //now get iterator
63  reco::BasicJetCollection::const_iterator i = BasicJetColl->begin();
64 
65  //loop over basic jets and convert them to pfjets
66  for(; i!=BasicJetColl->end(); i++){
67  reco::PFJet pfjet(i->p4(),i->vertex(),specific);
68  PFJetColl->push_back(pfjet);
69  }
70 
71  //std::auto_ptr<reco::PFJetCollection> selectedPFJets(PFJetColl);
72  Event.put(std::move(PFJetColl));
73 }
74 
75 
76 //define as plug-in for the framework
const edm::EDGetTokenT< reco::BasicJetCollection > inputToken_
Definition: BasicToPFJet.h:23
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
BasicToPFJet(const edm::ParameterSet &PSet)
Definition: BasicToPFJet.cc:34
Jets made from PFObjects.
Definition: PFJet.h:21
virtual ~BasicToPFJet()
Definition: BasicToPFJet.cc:41
virtual void produce(edm::Event &event, const edm::EventSetup &EventSetup) override
Definition: BasicToPFJet.cc:50
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: BasicToPFJet.cc:44
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
fixed size matrix
HLT enums.
def move(src, dest)
Definition: eostools.py:510
std::vector< BasicJet > BasicJetCollection
collection of BasicJet objects