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 hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () 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

◆ SeedCreatorFromRegionHitsEDProducerT()

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

Definition at line 37 of file SeedCreatorFromRegionHitsEDProducerT.h.

39  : seedingHitSetsToken_(consumes<RegionsSeedingHitSets>(iConfig.getParameter<edm::InputTag>("seedingHitSets"))),
40  seedCreator_(iConfig) {
41  edm::ConsumesCollector iC = consumesCollector();
42  edm::ParameterSet comparitorPSet = iConfig.getParameter<edm::ParameterSet>("SeedComparitorPSet");
43  std::string comparitorName = comparitorPSet.getParameter<std::string>("ComponentName");
44  if (comparitorName != "none") {
45  comparitor_ = SeedComparitorFactory::get()->create(comparitorName, comparitorPSet, iC);
46  }
47 
48  produces<TrajectorySeedCollection>();
49 }

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

◆ ~SeedCreatorFromRegionHitsEDProducerT()

template<typename T_SeedCreator >
SeedCreatorFromRegionHitsEDProducerT< T_SeedCreator >::~SeedCreatorFromRegionHitsEDProducerT ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 52 of file SeedCreatorFromRegionHitsEDProducerT.h.

53  {
55 
56  desc.add<edm::InputTag>("seedingHitSets", edm::InputTag("hitPairEDProducer"));
58 
59  edm::ParameterSetDescription descComparitor;
60  descComparitor.add<std::string>("ComponentName", "none");
61  descComparitor.setAllowAnything(); // until we have moved SeedComparitor too to EDProducers
62  desc.add<edm::ParameterSetDescription>("SeedComparitorPSet", descComparitor);
63 
64  auto label = std::string("seedCreatorFromRegion") + T_SeedCreator::fillDescriptionsLabel() + "EDProducer";
65  descriptions.add(label, desc);
66 }

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

◆ produce()

template<typename T_SeedCreator >
void SeedCreatorFromRegionHitsEDProducerT< T_SeedCreator >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 69 of file SeedCreatorFromRegionHitsEDProducerT.h.

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

References edm::EventSetup::get(), hfClusterShapes_cfi::hits, iEvent, eostools::move(), HLT_2018_cff::region, HLT_2018_cff::seedingHitSets, and InitialStep_cff::seeds.

Member Data Documentation

◆ comparitor_

template<typename T_SeedCreator >
std::unique_ptr<SeedComparitor> SeedCreatorFromRegionHitsEDProducerT< T_SeedCreator >::comparitor_
private

◆ seedCreator_

template<typename T_SeedCreator >
T_SeedCreator SeedCreatorFromRegionHitsEDProducerT< T_SeedCreator >::seedCreator_
private

Definition at line 32 of file SeedCreatorFromRegionHitsEDProducerT.h.

◆ seedingHitSetsToken_

template<typename T_SeedCreator >
edm::EDGetTokenT<RegionsSeedingHitSets> SeedCreatorFromRegionHitsEDProducerT< T_SeedCreator >::seedingHitSetsToken_
private

Definition at line 31 of file SeedCreatorFromRegionHitsEDProducerT.h.

SeedCreatorFromRegionHitsEDProducerT::seedingHitSetsToken_
edm::EDGetTokenT< RegionsSeedingHitSets > seedingHitSetsToken_
Definition: SeedCreatorFromRegionHitsEDProducerT.h:31
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
HLT_2018_cff.seedingHitSets
seedingHitSets
Definition: HLT_2018_cff.py:8785
SeedingHitSet
Definition: SeedingHitSet.h:6
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::Handle
Definition: AssociativeIterator.h:50
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SeedCreatorFromRegionHitsEDProducerT::seedCreator_
T_SeedCreator seedCreator_
Definition: SeedCreatorFromRegionHitsEDProducerT.h:32
InitialStep_cff.seeds
seeds
Definition: InitialStep_cff.py:232
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
SeedCreatorFromRegionHitsEDProducerT::comparitor_
std::unique_ptr< SeedComparitor > comparitor_
Definition: SeedCreatorFromRegionHitsEDProducerT.h:33
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::ParameterSetDescription::setAllowAnything
void setAllowAnything()
allow any parameter label/value pairs
Definition: ParameterSetDescription.cc:37
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
HLT_2018_cff.region
region
Definition: HLT_2018_cff.py:81479
TrackingRegion
Definition: TrackingRegion.h:40
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
label
const char * label
Definition: PFTauDecayModeTools.cc:11