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)
 
void produce (edm::Event &event, const edm::EventSetup &EventSetup) override
 
 ~BasicToPFJet () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- 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 ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
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, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) 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)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

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
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
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 ( )
override

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 
)
override

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.