CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
PFRecHitProducer Class Referencefinal
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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

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<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 16 of file PFRecHitProducer.cc.

Constructor & Destructor Documentation

◆ PFRecHitProducer()

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

Definition at line 42 of file PFRecHitProducer.cc.

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

42  {
43  produces<reco::PFRecHitCollection>();
44  produces<reco::PFRecHitCollection>("Cleaned");
45 
46  edm::ConsumesCollector cc = consumesCollector();
47 
48  std::vector<edm::ParameterSet> creators = iConfig.getParameter<std::vector<edm::ParameterSet> >("producers");
49  for (auto& creator : creators) {
50  std::string name = creator.getParameter<std::string>("name");
51  creators_.emplace_back(PFRecHitFactory::get()->create(name, creator, cc));
52  }
53 
54  edm::ParameterSet navSet = iConfig.getParameter<edm::ParameterSet>("navigator");
55  navigator_ = PFRecHitNavigationFactory::get()->create(navSet.getParameter<std::string>("name"), navSet, cc);
56 }
std::vector< std::unique_ptr< PFRecHitCreatorBase > > creators_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
def create(alignables, pedeDump, additionalData, outputFile, config)
#define get
std::unique_ptr< PFRecHitNavigatorBase > navigator_

◆ ~PFRecHitProducer()

PFRecHitProducer::~PFRecHitProducer ( )
overridedefault

Member Function Documentation

◆ beginLuminosityBlock()

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

Definition at line 64 of file PFRecHitProducer.cc.

References creators_, and navigator_.

64  {
65  for (const auto& creator : creators_) {
66  creator->init(iSetup);
67  }
68  navigator_->init(iSetup);
69 }
std::vector< std::unique_ptr< PFRecHitCreatorBase > > creators_
std::unique_ptr< PFRecHitNavigatorBase > navigator_

◆ endLuminosityBlock()

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

Definition at line 71 of file PFRecHitProducer.cc.

71 {}

◆ fillDescriptions()

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

Definition at line 105 of file PFRecHitProducer.cc.

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

105  {
106  //The following says we do not know what parameters are allowed so do no validation
107  // Please change this to state exactly what you do use, even if it is no parameters
109  desc.setUnknown();
110  descriptions.addDefault(desc);
111 }
void addDefault(ParameterSetDescription const &psetDescription)

◆ produce()

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

Definition at line 74 of file PFRecHitProducer.cc.

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

74  {
75  using namespace edm;
76  auto out = std::make_unique<reco::PFRecHitCollection>();
77  auto cleaned = std::make_unique<reco::PFRecHitCollection>();
78 
79  out->reserve(localRA1.upper());
80  cleaned->reserve(localRA2.upper());
81 
82  for (const auto& creator : creators_) {
83  creator->importRecHits(out, cleaned, iEvent, iSetup);
84  }
85 
86  if (out->capacity() > 2 * out->size())
87  out->shrink_to_fit();
88  if (cleaned->capacity() > 2 * cleaned->size())
89  cleaned->shrink_to_fit();
90  localRA1.update(out->size());
91  localRA2.update(cleaned->size());
92  std::sort(out->begin(), out->end(), sortByDetId);
93 
94  //create a refprod here
96 
97  for (auto& pfrechit : *out) {
98  navigator_->associateNeighbours(pfrechit, out, refProd);
99  }
100 
101  iEvent.put(std::move(out), "");
102  iEvent.put(std::move(cleaned), "Cleaned");
103 }
std::vector< std::unique_ptr< PFRecHitCreatorBase > > creators_
std::vector< PFRecHit > PFRecHitCollection
collection of PFRecHit objects
Definition: PFRecHitFwd.h:9
int iEvent
Definition: GenABIO.cc:224
HLT enums.
def move(src, dest)
Definition: eostools.py:511
std::unique_ptr< PFRecHitNavigatorBase > navigator_

Member Data Documentation

◆ creators_

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

Definition at line 27 of file PFRecHitProducer.cc.

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

◆ init_

bool PFRecHitProducer::init_
private

Definition at line 29 of file PFRecHitProducer.cc.

◆ navigator_

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

Definition at line 28 of file PFRecHitProducer.cc.

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