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

Public Member Functions

void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 SeedCreatorFromRegionHitsEDProducerT (const edm::ParameterSet &iConfig)
 
 ~SeedCreatorFromRegionHitsEDProducerT () override=default
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

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

Detailed Description

template<typename T_SeedCreator>
class SeedCreatorFromRegionHitsEDProducerT< T_SeedCreator >

Definition at line 21 of file SeedCreatorFromRegionHitsEDProducerT.h.

Constructor & Destructor Documentation

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

Definition at line 38 of file SeedCreatorFromRegionHitsEDProducerT.h.

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

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

Member Function Documentation

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

Definition at line 51 of file SeedCreatorFromRegionHitsEDProducerT.h.

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

51  {
53 
54  desc.add<edm::InputTag>("seedingHitSets", edm::InputTag("hitPairEDProducer"));
56 
57  edm::ParameterSetDescription descComparitor;
58  descComparitor.add<std::string>("ComponentName", "none");
59  descComparitor.setAllowAnything(); // until we have moved SeedComparitor too to EDProducers
60  desc.add<edm::ParameterSetDescription>("SeedComparitorPSet", descComparitor);
61 
62  auto label = std::string("seedCreatorFromRegion") + T_SeedCreator::fillDescriptionsLabel() + "EDProducer";
63  descriptions.add(label, desc);
64 }
void setAllowAnything()
allow any parameter label/value pairs
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
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 
)
override

Definition at line 67 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_.

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