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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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 selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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 wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
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
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

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::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
Definition: ParameterSet.h:303
edm::InputTag src_
Definition: BasicToPFJet.h:19

◆ ~BasicToPFJet()

BasicToPFJet::~BasicToPFJet ( )
override

Definition at line 39 of file BasicToPFJet.cc.

39 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 41 of file BasicToPFJet.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and HLT_2022v12_cff::InputTag.

41  {
43  desc.add<edm::InputTag>("src", edm::InputTag(""));
44  descriptions.add("BasicToPFJet", desc);
45 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void BasicToPFJet::produce ( edm::Event event,
const edm::EventSetup EventSetup 
)
overridevirtual

Implements edm::EDProducer.

Definition at line 47 of file BasicToPFJet.cc.

References mps_fire::i, inputToken_, eostools::move(), 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

◆ inputToken_

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

Definition at line 20 of file BasicToPFJet.h.

Referenced by produce().

◆ src_

edm::InputTag BasicToPFJet::src_
private

Definition at line 19 of file BasicToPFJet.h.