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 Member Functions | Private Attributes
PFRecHitProducer Class Reference

#include <PFRecHitProducer.h>

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

Public Member Functions

 PFRecHitProducer (const edm::ParameterSet &iConfig)
 
 ~PFRecHitProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 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
 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 (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) 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 Member Functions

virtual void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

std::vector< std::unique_ptr
< PFRecHitCreatorBase > > 
creators_
 
std::unique_ptr
< PFRecHitNavigatorBase
navigator_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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

Definition at line 21 of file PFRecHitProducer.h.

Constructor & Destructor Documentation

PFRecHitProducer::PFRecHitProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 10 of file PFRecHitProducer.cc.

References edm::EDConsumerBase::consumesCollector(), SurfaceDeformationFactory::create(), creators_, reco::get(), edm::ParameterSet::getParameter(), i, mergeVDriftHistosByStation::name, navigator_, and AlCaHLTBitMon_QueryRunRegistry::string.

11 {
12 
13  produces<reco::PFRecHitCollection>();
14  produces<reco::PFRecHitCollection>("Cleaned");
15 
17 
18  std::vector<edm::ParameterSet> creators = iConfig.getParameter<std::vector<edm::ParameterSet> >("producers");
19  for (unsigned int i=0;i<creators.size();++i) {
20  std::string name = creators.at(i).getParameter<std::string>("name");
21  creators_.emplace_back(PFRecHitFactory::get()->create(name,creators.at(i),iC));
22  }
23 
24 
25  edm::ParameterSet navSet = iConfig.getParameter<edm::ParameterSet>("navigator");
26 
28 
29 }
T getParameter(std::string const &) const
std::vector< std::unique_ptr< PFRecHitCreatorBase > > creators_
int i
Definition: DBlmapReader.cc:9
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
SurfaceDeformation * create(int type, const std::vector< double > &params)
T get(const Candidate &c)
Definition: component.h:55
std::unique_ptr< PFRecHitNavigatorBase > navigator_
PFRecHitProducer::~PFRecHitProducer ( )

Definition at line 32 of file PFRecHitProducer.cc.

33 {
34  }

Member Function Documentation

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

Definition at line 71 of file PFRecHitProducer.cc.

References edm::ConfigurationDescriptions::addDefault(), and edm::ParameterSetDescription::setUnknown().

71  {
72  //The following says we do not know what parameters are allowed so do no validation
73  // Please change this to state exactly what you do use, even if it is no parameters
75  desc.setUnknown();
76  descriptions.addDefault(desc);
77 }
void addDefault(ParameterSetDescription const &psetDescription)
void PFRecHitProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 43 of file PFRecHitProducer.cc.

References creators_, edm::Event::getRefBeforePut(), navigator_, dbtoconf::out, edm::Event::put(), and python.multivaluedict::sort().

44 {
45  using namespace edm;
46  std::auto_ptr<reco::PFRecHitCollection> out(new reco::PFRecHitCollection );
47  std::auto_ptr<reco::PFRecHitCollection> cleaned(new reco::PFRecHitCollection );
48 
49  navigator_->beginEvent(iSetup);
50 
51  for( const auto& creator : creators_ ) {
52  creator->importRecHits(out,cleaned,iEvent,iSetup);
53  }
54 
55  std::sort(out->begin(),out->end(),sortByDetId);
56 
57  //create a refprod here
60 
61  for( auto& pfrechit : *out ) {
62  navigator_->associateNeighbours(pfrechit,out,refProd);
63  }
64 
65  iEvent.put(out,"");
66  iEvent.put(cleaned,"Cleaned");
67 
68 }
std::vector< std::unique_ptr< PFRecHitCreatorBase > > creators_
std::vector< PFRecHit > PFRecHitCollection
collection of PFRecHit objects
Definition: PFRecHitFwd.h:9
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
RefProd< PROD > getRefBeforePut()
Definition: Event.h:128
tuple out
Definition: dbtoconf.py:99
std::unique_ptr< PFRecHitNavigatorBase > navigator_

Member Data Documentation

std::vector<std::unique_ptr<PFRecHitCreatorBase> > PFRecHitProducer::creators_
private

Definition at line 30 of file PFRecHitProducer.h.

Referenced by PFRecHitProducer(), and produce().

std::unique_ptr<PFRecHitNavigatorBase> PFRecHitProducer::navigator_
private

Definition at line 31 of file PFRecHitProducer.h.

Referenced by PFRecHitProducer(), and produce().