CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
BasicToPFJet Class Reference

#include <UserCode/BasicToPFJet/plugins/BasicToPFJet.cc>

Inheritance diagram for BasicToPFJet:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 BasicToPFJet (const edm::ParameterSet &PSet)
 
virtual void produce (edm::Event &event, const edm::EventSetup &EventSetup) override
 
virtual ~BasicToPFJet ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

const edm::EDGetTokenT< reco::BasicJetCollectioninputToken_
 
edm::InputTag src_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: converts reco::BasicJets to reco::PFJets and adds the new PFJetCollection to the event. Originally designed to be a work around for a way to store reco::BasicJets at HLT level

Implementation: [Notes on implementation]

Definition at line 12 of file BasicToPFJet.h.

Constructor & Destructor Documentation

BasicToPFJet::BasicToPFJet ( const edm::ParameterSet PSet)
explicit

Definition at line 34 of file BasicToPFJet.cc.

34  :
35  src_ (PSet.getParameter<edm::InputTag>("src")),
36  inputToken_ (consumes<reco::BasicJetCollection>(src_))
37 {
38  produces<reco::PFJetCollection>();
39 }
const edm::EDGetTokenT< reco::BasicJetCollection > inputToken_
Definition: BasicToPFJet.h:23
T getParameter(std::string const &) const
edm::InputTag src_
Definition: BasicToPFJet.h:22
BasicToPFJet::~BasicToPFJet ( )
virtual

Definition at line 41 of file BasicToPFJet.cc.

41 {}

Member Function Documentation

void BasicToPFJet::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 44 of file BasicToPFJet.cc.

References edm::ConfigurationDescriptions::add(), and edm::ParameterSetDescription::add().

44  {
46  desc.add<edm::InputTag>("src",edm::InputTag(""));
47  descriptions.add("BasicToPFJet",desc);
48 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void BasicToPFJet::produce ( edm::Event event,
const edm::EventSetup EventSetup 
)
overridevirtual

Definition at line 50 of file BasicToPFJet.cc.

References DEFINE_FWK_MODULE, edm::Event::getByToken(), mps_fire::i, inputToken_, eostools::move(), and edm::Event::put().

50  {
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 }
const edm::EDGetTokenT< reco::BasicJetCollection > inputToken_
Definition: BasicToPFJet.h:23
Jets made from PFObjects.
Definition: PFJet.h:21
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

const edm::EDGetTokenT<reco::BasicJetCollection> BasicToPFJet::inputToken_
private

Definition at line 23 of file BasicToPFJet.h.

Referenced by produce().

edm::InputTag BasicToPFJet::src_
private

Definition at line 22 of file BasicToPFJet.h.