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<>

Public Member Functions

 PFRecHitProducer (const edm::ParameterSet &iConfig)
 
 ~PFRecHitProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::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
 

Detailed Description

Definition at line 21 of file PFRecHitProducer.h.

Constructor & Destructor Documentation

◆ PFRecHitProducer()

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

Definition at line 11 of file PFRecHitProducer.cc.

11  {
12  produces<reco::PFRecHitCollection>();
13  produces<reco::PFRecHitCollection>("Cleaned");
14 
15  edm::ConsumesCollector iC = consumesCollector();
16 
17  std::vector<edm::ParameterSet> creators = iConfig.getParameter<std::vector<edm::ParameterSet> >("producers");
18  for (auto& creator : creators) {
19  std::string name = creator.getParameter<std::string>("name");
20  creators_.emplace_back(PFRecHitFactory::get()->create(name, creator, iC));
21  }
22 
23  edm::ParameterSet navSet = iConfig.getParameter<edm::ParameterSet>("navigator");
24  navigator_ = PFRecHitNavigationFactory::get()->create(navSet.getParameter<std::string>("name"), navSet);
25 }

References beamerCreator::create(), creators_, get, edm::ParameterSet::getParameter(), Skims_PA_cff::name, navigator_, and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~PFRecHitProducer()

PFRecHitProducer::~PFRecHitProducer ( )
overridedefault

Member Function Documentation

◆ beginLuminosityBlock()

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

Definition at line 33 of file PFRecHitProducer.cc.

33  {
34  for (const auto& creator : creators_) {
35  creator->init(iSetup);
36  }
37  navigator_->init(iSetup);
38 }

References creators_, and navigator_.

◆ endLuminosityBlock()

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

Definition at line 40 of file PFRecHitProducer.cc.

40 {}

◆ fillDescriptions()

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

Definition at line 74 of file PFRecHitProducer.cc.

74  {
75  //The following says we do not know what parameters are allowed so do no validation
76  // Please change this to state exactly what you do use, even if it is no parameters
78  desc.setUnknown();
79  descriptions.addDefault(desc);
80 }

References edm::ConfigurationDescriptions::addDefault(), and submitPVResolutionJobs::desc.

◆ produce()

void PFRecHitProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 43 of file PFRecHitProducer.cc.

43  {
44  using namespace edm;
45  auto out = std::make_unique<reco::PFRecHitCollection>();
46  auto cleaned = std::make_unique<reco::PFRecHitCollection>();
47 
48  out->reserve(localRA1.upper());
49  cleaned->reserve(localRA2.upper());
50 
51  for (const auto& creator : creators_) {
52  creator->importRecHits(out, cleaned, iEvent, iSetup);
53  }
54 
55  if (out->capacity() > 2 * out->size())
56  out->shrink_to_fit();
57  if (cleaned->capacity() > 2 * cleaned->size())
58  cleaned->shrink_to_fit();
59  localRA1.update(out->size());
60  localRA2.update(cleaned->size());
61  std::sort(out->begin(), out->end(), sortByDetId);
62 
63  //create a refprod here
65 
66  for (auto& pfrechit : *out) {
67  navigator_->associateNeighbours(pfrechit, out, refProd);
68  }
69 
70  iEvent.put(std::move(out), "");
71  iEvent.put(std::move(cleaned), "Cleaned");
72 }

References creators_, iEvent, eostools::move(), navigator_, and MillePedeFileConverter_cfg::out.

Member Data Documentation

◆ creators_

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

Definition at line 32 of file PFRecHitProducer.h.

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

◆ init_

bool PFRecHitProducer::init_
private

Definition at line 34 of file PFRecHitProducer.h.

◆ navigator_

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

Definition at line 33 of file PFRecHitProducer.h.

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

edm::RefProd
Definition: EDProductfwd.h:25
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
beamerCreator.create
def create(alignables, pedeDump, additionalData, outputFile, config)
Definition: beamerCreator.py:44
reco::PFRecHitCollection
std::vector< PFRecHit > PFRecHitCollection
collection of PFRecHit objects
Definition: PFRecHitFwd.h:9
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
iEvent
int iEvent
Definition: GenABIO.cc:224
get
#define get
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
PFRecHitProducer::creators_
std::vector< std::unique_ptr< PFRecHitCreatorBase > > creators_
Definition: PFRecHitProducer.h:32
PFRecHitProducer::navigator_
std::unique_ptr< PFRecHitNavigatorBase > navigator_
Definition: PFRecHitProducer.h:33
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
edm::ConsumesCollector
Definition: ConsumesCollector.h:45