CMS 3D CMS Logo

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 () override
 
- 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)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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

void beginLuminosityBlock (edm::LuminosityBlock const &, const edm::EventSetup &) override
 
void endLuminosityBlock (edm::LuminosityBlock const &, const edm::EventSetup &) override
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

std::vector< std::unique_ptr< PFRecHitCreatorBase > > creators_
 
bool init_
 
std::unique_ptr< PFRecHitNavigatorBasenavigator_
 

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, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
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 14 of file PFRecHitProducer.cc.

References edm::EDConsumerBase::consumesCollector(), beamerCreator::create(), creators_, reco::get(), edm::ParameterSet::getParameter(), dataset::name, navigator_, AlCaHLTBitMon_QueryRunRegistry::string, and ~PFRecHitProducer().

15 {
16 
17  produces<reco::PFRecHitCollection>();
18  produces<reco::PFRecHitCollection>("Cleaned");
19 
21 
22  std::vector<edm::ParameterSet> creators = iConfig.getParameter<std::vector<edm::ParameterSet> >("producers");
23  for (auto & creator : creators) {
24  std::string name = creator.getParameter<std::string>("name");
25  creators_.emplace_back(PFRecHitFactory::get()->create(name,creator,iC));
26  }
27 
28 
29  edm::ParameterSet navSet = iConfig.getParameter<edm::ParameterSet>("navigator");
30 
32 
33 }
T getParameter(std::string const &) const
std::vector< std::unique_ptr< PFRecHitCreatorBase > > creators_
def create(alignables, pedeDump, additionalData, outputFile, config)
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
T get(const Candidate &c)
Definition: component.h:55
std::unique_ptr< PFRecHitNavigatorBase > navigator_
PFRecHitProducer::~PFRecHitProducer ( )
overridedefault

Referenced by PFRecHitProducer().

Member Function Documentation

void PFRecHitProducer::beginLuminosityBlock ( edm::LuminosityBlock const &  iLumi,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 44 of file PFRecHitProducer.cc.

References creators_.

44  {
45  for( const auto& creator : creators_ ) {
46  creator->init(iSetup);
47  }
48 }
std::vector< std::unique_ptr< PFRecHitCreatorBase > > creators_
void PFRecHitProducer::endLuminosityBlock ( edm::LuminosityBlock const &  iLumi,
const edm::EventSetup  
)
overrideprivate

Definition at line 51 of file PFRecHitProducer.cc.

51 { }
void PFRecHitProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 90 of file PFRecHitProducer.cc.

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

90  {
91  //The following says we do not know what parameters are allowed so do no validation
92  // Please change this to state exactly what you do use, even if it is no parameters
94  desc.setUnknown();
95  descriptions.addDefault(desc);
96 }
void addDefault(ParameterSetDescription const &psetDescription)
void PFRecHitProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 55 of file PFRecHitProducer.cc.

References creators_, edm::Event::getRefBeforePut(), eostools::move(), navigator_, MillePedeFileConverter_cfg::out, and edm::Event::put().

56 {
57  using namespace edm;
58  auto out = std::make_unique<reco::PFRecHitCollection>();
59  auto cleaned = std::make_unique<reco::PFRecHitCollection>();
60 
61  navigator_->beginEvent(iSetup);
62 
63  out->reserve(localRA1.upper());
64  cleaned->reserve(localRA2.upper());
65 
66  for( const auto& creator : creators_ ) {
67  creator->importRecHits(out,cleaned,iEvent,iSetup);
68  }
69 
70  if (out->capacity()>2*out->size()) out->shrink_to_fit();
71  if (cleaned->capacity()>2*cleaned->size()) cleaned->shrink_to_fit();
72  localRA1.update(out->size());
73  localRA2.update(cleaned->size());
74  std::sort(out->begin(),out->end(),sortByDetId);
75 
76  //create a refprod here
79 
80  for( auto& pfrechit : *out ) {
81  navigator_->associateNeighbours(pfrechit,out,refProd);
82  }
83 
84  iEvent.put(std::move(out),"");
85  iEvent.put(std::move(cleaned),"Cleaned");
86 
87 }
std::vector< std::unique_ptr< PFRecHitCreatorBase > > creators_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
std::vector< PFRecHit > PFRecHitCollection
collection of PFRecHit objects
Definition: PFRecHitFwd.h:9
RefProd< PROD > getRefBeforePut()
Definition: Event.h:134
HLT enums.
def move(src, dest)
Definition: eostools.py:510
std::unique_ptr< PFRecHitNavigatorBase > navigator_

Member Data Documentation

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

Definition at line 32 of file PFRecHitProducer.h.

Referenced by beginLuminosityBlock(), PFRecHitProducer(), and produce().

bool PFRecHitProducer::init_
private

Definition at line 34 of file PFRecHitProducer.h.

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

Definition at line 33 of file PFRecHitProducer.h.

Referenced by PFRecHitProducer(), and produce().