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 ()
 
- 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 & itemsToGetFromEvent () 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

virtual void beginLuminosityBlock (edm::LuminosityBlock const &, const edm::EventSetup &) override
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, const edm::EventSetup &) override
 
virtual 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(), mps_fire::i, dataset::name, navigator_, and AlCaHLTBitMon_QueryRunRegistry::string.

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 (unsigned int i=0;i<creators.size();++i) {
24  std::string name = creators.at(i).getParameter<std::string>("name");
25  creators_.emplace_back(PFRecHitFactory::get()->create(name,creators.at(i),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 ( )

Definition at line 36 of file PFRecHitProducer.cc.

37 {
38  }

Member Function Documentation

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

Definition at line 46 of file PFRecHitProducer.cc.

References creators_.

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

Definition at line 53 of file PFRecHitProducer.cc.

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

Definition at line 92 of file PFRecHitProducer.cc.

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

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

Definition at line 57 of file PFRecHitProducer.cc.

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

58 {
59  using namespace edm;
60  auto out = std::make_unique<reco::PFRecHitCollection>();
61  auto cleaned = std::make_unique<reco::PFRecHitCollection>();
62 
63  navigator_->beginEvent(iSetup);
64 
65  out->reserve(localRA1.upper());
66  cleaned->reserve(localRA2.upper());
67 
68  for( const auto& creator : creators_ ) {
69  creator->importRecHits(out,cleaned,iEvent,iSetup);
70  }
71 
72  if (out->capacity()>2*out->size()) out->shrink_to_fit();
73  if (cleaned->capacity()>2*cleaned->size()) cleaned->shrink_to_fit();
74  localRA1.update(out->size());
75  localRA2.update(cleaned->size());
76  std::sort(out->begin(),out->end(),sortByDetId);
77 
78  //create a refprod here
81 
82  for( auto& pfrechit : *out ) {
83  navigator_->associateNeighbours(pfrechit,out,refProd);
84  }
85 
86  iEvent.put(std::move(out),"");
87  iEvent.put(std::move(cleaned),"Cleaned");
88 
89 }
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().