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 () noexcept(false) 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
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::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 11 of file BasicToPFJet.h.

Constructor & Destructor Documentation

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

Definition at line 34 of file BasicToPFJet.cc.

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

Definition at line 39 of file BasicToPFJet.cc.

39 {}

Member Function Documentation

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

Definition at line 41 of file BasicToPFJet.cc.

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

41  {
43  desc.add<edm::InputTag>("src", edm::InputTag(""));
44  descriptions.add("BasicToPFJet", desc);
45 }
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 47 of file BasicToPFJet.cc.

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

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

Member Data Documentation

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

Definition at line 20 of file BasicToPFJet.h.

Referenced by produce().

edm::InputTag BasicToPFJet::src_
private

Definition at line 19 of file BasicToPFJet.h.