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 Referencefinal

#include <PFRecHitProducer.h>

Inheritance diagram for PFRecHitProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 PFRecHitProducer (const edm::ParameterSet &iConfig)
 
 ~PFRecHitProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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::stream::EDProducerBase
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::stream::EDProducer<>
typedef CacheContexts< T...> CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T...> HasAbility
 
typedef
CacheTypes::LuminosityBlockCache 
LuminosityBlockCache
 
typedef
LuminosityBlockContextT
< LuminosityBlockCache,
RunCache, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase 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

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::stream::EDProducerBase.

Definition at line 43 of file PFRecHitProducer.cc.

References creators_, edm::Event::getRefBeforePut(), navigator_, GenerateHcalLaserBadRunList::out, and edm::Event::put().

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:121
RefProd< PROD > getRefBeforePut()
Definition: Event.h:141
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().