CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
SeedCreatorFromRegionHitsEDProducerT< T_SeedCreator > Class Template Reference

#include <SeedCreatorFromRegionHitsEDProducerT.h>

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

Public Member Functions

virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 SeedCreatorFromRegionHitsEDProducerT (const edm::ParameterSet &iConfig)
 
 ~SeedCreatorFromRegionHitsEDProducerT ()=default
 
- 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 Attributes

std::unique_ptr< SeedComparitorcomparitor_
 
T_SeedCreator seedCreator_
 
edm::EDGetTokenT< RegionsSeedingHitSetsseedingHitSetsToken_
 

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

template<typename T_SeedCreator>
class SeedCreatorFromRegionHitsEDProducerT< T_SeedCreator >

Definition at line 20 of file SeedCreatorFromRegionHitsEDProducerT.h.

Constructor & Destructor Documentation

template<typename T_SeedCreator >
SeedCreatorFromRegionHitsEDProducerT< T_SeedCreator >::SeedCreatorFromRegionHitsEDProducerT ( const edm::ParameterSet iConfig)

Definition at line 37 of file SeedCreatorFromRegionHitsEDProducerT.h.

References SeedCreatorFromRegionHitsEDProducerT< T_SeedCreator >::comparitor_, edm::EDConsumerBase::consumesCollector(), beamerCreator::create(), reco::get(), edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

37  :
38  seedingHitSetsToken_(consumes<RegionsSeedingHitSets>(iConfig.getParameter<edm::InputTag>("seedingHitSets"))),
39  seedCreator_(iConfig)
40 {
42  edm::ParameterSet comparitorPSet = iConfig.getParameter<edm::ParameterSet>("SeedComparitorPSet");
43  std::string comparitorName = comparitorPSet.getParameter<std::string>("ComponentName");
44  comparitor_.reset((comparitorName == "none") ? nullptr : SeedComparitorFactory::get()->create(comparitorName, comparitorPSet, iC));
45 
46  produces<TrajectorySeedCollection>();
47 }
T getParameter(std::string const &) const
def create(alignables, pedeDump, additionalData, outputFile, config)
edm::EDGetTokenT< RegionsSeedingHitSets > seedingHitSetsToken_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
T get(const Candidate &c)
Definition: component.h:55
template<typename T_SeedCreator >
SeedCreatorFromRegionHitsEDProducerT< T_SeedCreator >::~SeedCreatorFromRegionHitsEDProducerT ( )
default

Member Function Documentation

template<typename T_SeedCreator >
void SeedCreatorFromRegionHitsEDProducerT< T_SeedCreator >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 50 of file SeedCreatorFromRegionHitsEDProducerT.h.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), diffTwoXMLs::label, edm::ParameterSetDescription::setAllowAnything(), and AlCaHLTBitMon_QueryRunRegistry::string.

50  {
52 
53  desc.add<edm::InputTag>("seedingHitSets", edm::InputTag("hitPairEDProducer"));
54  T_SeedCreator::fillDescriptions(desc);
55 
56  edm::ParameterSetDescription descComparitor;
57  descComparitor.add<std::string>("ComponentName", "none");
58  descComparitor.setAllowAnything(); // until we have moved SeedComparitor too to EDProducers
59  desc.add<edm::ParameterSetDescription>("SeedComparitorPSet", descComparitor);
60 
61  auto label = std::string("seedCreatorFromRegion") + T_SeedCreator::fillDescriptionsLabel() + "EDProducer";
62  descriptions.add(label, desc);
63 }
void setAllowAnything()
allow any parameter label/value pairs
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
template<typename T_SeedCreator >
void SeedCreatorFromRegionHitsEDProducerT< T_SeedCreator >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Definition at line 66 of file SeedCreatorFromRegionHitsEDProducerT.h.

References SeedCreatorFromRegionHitsEDProducerT< T_SeedCreator >::comparitor_, edm::Event::getByToken(), hfClusterShapes_cfi::hits, eostools::move(), edm::Event::put(), RegionsSeedingHitSets::reserve(), SeedCreatorFromRegionHitsEDProducerT< T_SeedCreator >::seedCreator_, HiRegitMuonDetachedTripletStep_cff::seedingHitSets, and SeedCreatorFromRegionHitsEDProducerT< T_SeedCreator >::seedingHitSetsToken_.

66  {
67  edm::Handle<RegionsSeedingHitSets> hseedingHitSets;
68  iEvent.getByToken(seedingHitSetsToken_, hseedingHitSets);
69  const auto& seedingHitSets = *hseedingHitSets;
70 
71  auto seeds = std::make_unique<TrajectorySeedCollection>();
72  seeds->reserve(seedingHitSets.size());
73 
74  if(comparitor_)
75  comparitor_->init(iEvent, iSetup);
76 
77  for(const auto& regionSeedingHitSets: seedingHitSets) {
78  const TrackingRegion& region = regionSeedingHitSets.region();
79  seedCreator_.init(region, iSetup, comparitor_.get());
80 
81  for(const SeedingHitSet& hits: regionSeedingHitSets) {
82  // TODO: do we really need a comparitor at this point? It is
83  // used in triplet and quadruplet generators, as well as inside
84  // seedCreator.
85  if(!comparitor_ || comparitor_->compatible(hits)) {
86  seedCreator_.makeSeed(*seeds, hits);
87  }
88  }
89  }
90 
91  seeds->shrink_to_fit();
92  iEvent.put(std::move(seeds));
93 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
edm::EDGetTokenT< RegionsSeedingHitSets > seedingHitSetsToken_
void reserve(size_t nregions, size_t nhitsets)
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

template<typename T_SeedCreator >
std::unique_ptr<SeedComparitor> SeedCreatorFromRegionHitsEDProducerT< T_SeedCreator >::comparitor_
private
template<typename T_SeedCreator >
T_SeedCreator SeedCreatorFromRegionHitsEDProducerT< T_SeedCreator >::seedCreator_
private
template<typename T_SeedCreator >
edm::EDGetTokenT<RegionsSeedingHitSets> SeedCreatorFromRegionHitsEDProducerT< T_SeedCreator >::seedingHitSetsToken_
private