CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SeedGeneratorFromRegionHitsEDProducer Class Reference

#include <SeedGeneratorFromRegionHitsEDProducer.h>

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

Public Member Functions

void produce (edm::Event &ev, const edm::EventSetup &es) override
 
 SeedGeneratorFromRegionHitsEDProducer (const edm::ParameterSet &cfg)
 
 ~SeedGeneratorFromRegionHitsEDProducer () override
 
- 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
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 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)
 

Private Attributes

std::string moduleName
 
ClusterChecker theClusterCheck
 
std::unique_ptr< SeedGeneratorFromRegionHitstheGenerator
 
std::unique_ptr< TrackingRegionProducertheRegionProducer
 
bool theSilentOnClusterCheck
 

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
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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

Definition at line 13 of file SeedGeneratorFromRegionHitsEDProducer.h.

Constructor & Destructor Documentation

SeedGeneratorFromRegionHitsEDProducer::SeedGeneratorFromRegionHitsEDProducer ( const edm::ParameterSet cfg)

Definition at line 25 of file SeedGeneratorFromRegionHitsEDProducer.cc.

References edm::EDConsumerBase::consumesCollector(), beamerCreator::create(), reco::get(), edm::ParameterSet::getParameter(), moduleName, AlCaHLTBitMon_QueryRunRegistry::string, theGenerator, theRegionProducer, and theSilentOnClusterCheck.

27  : theRegionProducer(nullptr),
29 {
30  theSilentOnClusterCheck = cfg.getParameter<edm::ParameterSet>("ClusterCheckPSet").getUntrackedParameter<bool>("silentClusterCheck",false);
31 
32  moduleName = cfg.getParameter<std::string>("@module_label");
33 
34  edm::ParameterSet creatorPSet =
35  cfg.getParameter<edm::ParameterSet>("SeedCreatorPSet");
36 
37  edm::ParameterSet regfactoryPSet =
38  cfg.getParameter<edm::ParameterSet>("RegionFactoryPSet");
39  std::string regfactoryName = regfactoryPSet.getParameter<std::string>("ComponentName");
40  theRegionProducer.reset(TrackingRegionProducerFactory::get()->create(regfactoryName,regfactoryPSet, consumesCollector()));
41 
43  edm::ParameterSet hitsfactoryPSet =
44  cfg.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
45  std::string hitsfactoryName = hitsfactoryPSet.getParameter<std::string>("ComponentName");
46  OrderedHitsGenerator* hitsGenerator =
47  OrderedHitsGeneratorFactory::get()->create( hitsfactoryName, hitsfactoryPSet, iC);
48 
49  edm::ParameterSet comparitorPSet =
50  cfg.getParameter<edm::ParameterSet>("SeedComparitorPSet");
51  std::string comparitorName = comparitorPSet.getParameter<std::string>("ComponentName");
52  SeedComparitor * aComparitor = (comparitorName == "none") ?
53  nullptr : SeedComparitorFactory::get()->create( comparitorName, comparitorPSet, iC);
54 
55  std::string creatorName = creatorPSet.getParameter<std::string>("ComponentName");
56  SeedCreator * aCreator = SeedCreatorFactory::get()->create( creatorName, creatorPSet);
57 
58  theGenerator.reset(new SeedGeneratorFromRegionHits(hitsGenerator, aComparitor, aCreator));
59 
60  produces<TrajectorySeedCollection>();
61 }
T getParameter(std::string const &) const
def create(alignables, pedeDump, additionalData, outputFile, config)
std::unique_ptr< TrackingRegionProducer > theRegionProducer
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::unique_ptr< SeedGeneratorFromRegionHits > theGenerator
T get(const Candidate &c)
Definition: component.h:55
SeedGeneratorFromRegionHitsEDProducer::~SeedGeneratorFromRegionHitsEDProducer ( )
override

Definition at line 63 of file SeedGeneratorFromRegionHitsEDProducer.cc.

64 {
65 }

Member Function Documentation

void SeedGeneratorFromRegionHitsEDProducer::produce ( edm::Event ev,
const edm::EventSetup es 
)
override

Definition at line 67 of file SeedGeneratorFromRegionHitsEDProducer.cc.

References eostools::move(), edm::Event::put(), reco::return(), theClusterCheck, theGenerator, theRegionProducer, theSilentOnClusterCheck, ClusterChecker::tooManyClusters(), and DetachedQuadStep_cff::triplets.

68 {
69  auto triplets = std::make_unique<TrajectorySeedCollection>();
70 
71  //protection for big ass events...
72  size_t clustsOrZero = theClusterCheck.tooManyClusters(ev);
73  if (clustsOrZero){
75  edm::LogError("TooManyClusters") << "Found too many clusters (" << clustsOrZero << "), bailing out.\n";
76  ev.put(std::move(triplets));
77  return ;
78  }
79 
80  typedef std::vector<std::unique_ptr<TrackingRegion> > Regions;
81  typedef Regions::const_iterator IR;
82  Regions regions = theRegionProducer->regions(ev,es);
83 
84  for (IR ir=regions.begin(), irEnd=regions.end(); ir < irEnd; ++ir) {
85  const TrackingRegion & region = **ir;
86 
87  // make job
88  theGenerator->run(*triplets, region, ev,es);
89  // std::cout << "created seeds for " << moduleName << " " << triplets->size() << std::endl;
90  }
91  triplets->shrink_to_fit();
92 
93  // put to event
94  ev.put(std::move(triplets));
95 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
std::unique_ptr< TrackingRegionProducer > theRegionProducer
size_t tooManyClusters(const edm::Event &e) const
return(e1-e2)*(e1-e2)+dp *dp
std::unique_ptr< SeedGeneratorFromRegionHits > theGenerator
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

std::string SeedGeneratorFromRegionHitsEDProducer::moduleName
private
ClusterChecker SeedGeneratorFromRegionHitsEDProducer::theClusterCheck
private

Definition at line 24 of file SeedGeneratorFromRegionHitsEDProducer.h.

Referenced by produce().

std::unique_ptr<SeedGeneratorFromRegionHits> SeedGeneratorFromRegionHitsEDProducer::theGenerator
private
std::unique_ptr<TrackingRegionProducer> SeedGeneratorFromRegionHitsEDProducer::theRegionProducer
private
bool SeedGeneratorFromRegionHitsEDProducer::theSilentOnClusterCheck
private