test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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::BasicJetCollection
inputToken_
 
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 33 of file BasicToPFJet.cc.

33  :
34  src_ (PSet.getParameter<edm::InputTag>("src")),
35  inputToken_ (consumes<reco::BasicJetCollection>(src_))
36 {
37  produces<reco::PFJetCollection>();
38 }
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 40 of file BasicToPFJet.cc.

40 {}

Member Function Documentation

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

Definition at line 43 of file BasicToPFJet.cc.

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

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

Implements edm::EDProducer.

Definition at line 49 of file BasicToPFJet.cc.

References edm::Event::getByToken(), i, inputToken_, edm::Event::put(), and timingPdfMaker::specific.

49  {
50 
51  //first get the basic jet collection
53  Event.getByToken(inputToken_, BasicJetColl);
54 
55  //now make the new pf jet collection
56  std::auto_ptr<reco::PFJetCollection> PFJetColl(new reco::PFJetCollection);
57  //reco::PFJetCollection* PFJetColl = new reco::PFJetCollection;
58  //make the 'specific'
60 
61  //now get iterator
62  reco::BasicJetCollection::const_iterator i = BasicJetColl->begin();
63 
64  //loop over basic jets and convert them to pfjets
65  for(; i!=BasicJetColl->end(); i++){
66  reco::PFJet pfjet(i->p4(),i->vertex(),specific);
67  PFJetColl->push_back(pfjet);
68  }
69 
70  //std::auto_ptr<reco::PFJetCollection> selectedPFJets(PFJetColl);
71  Event.put(PFJetColl);
72 }
const edm::EDGetTokenT< reco::BasicJetCollection > inputToken_
Definition: BasicToPFJet.h:23
int i
Definition: DBlmapReader.cc:9
dictionary specific
Jets made from PFObjects.
Definition: PFJet.h:21
Definition: Event.h:16
std::vector< PFJet > PFJetCollection
collection of PFJet objects

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.