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

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
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

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
 

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 reco::get(), edm::ParameterSet::getParameter(), moduleName, eostools::move(), AlCaHLTBitMon_QueryRunRegistry::string, theGenerator, theRegionProducer, and theSilentOnClusterCheck.

27  : theRegionProducer(nullptr),
28  theClusterCheck(cfg.getParameter<edm::ParameterSet>("ClusterCheckPSet"),consumesCollector())
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 = std::unique_ptr<TrackingRegionProducer>{TrackingRegionProducerFactory::get()->create(regfactoryName,regfactoryPSet, consumesCollector())};
41 
42  edm::ConsumesCollector iC = consumesCollector();
43  edm::ParameterSet hitsfactoryPSet =
44  cfg.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
45  std::string hitsfactoryName = hitsfactoryPSet.getParameter<std::string>("ComponentName");
46 
47  edm::ParameterSet comparitorPSet =
48  cfg.getParameter<edm::ParameterSet>("SeedComparitorPSet");
49  std::string comparitorName = comparitorPSet.getParameter<std::string>("ComponentName");
50  std::unique_ptr<SeedComparitor> aComparitor;
51  if(comparitorName != "none") {
52  aComparitor = std::unique_ptr<SeedComparitor>{SeedComparitorFactory::get()->create( comparitorName, comparitorPSet, iC)};
53  }
54 
55  std::string creatorName = creatorPSet.getParameter<std::string>("ComponentName");
56 
57  theGenerator = std::make_unique<SeedGeneratorFromRegionHits>(OrderedHitsGeneratorFactory::get()->create( hitsfactoryName, hitsfactoryPSet, iC),
58  std::move(aComparitor),
59  SeedCreatorFactory::get()->create( creatorName, creatorPSet));
60 
61  produces<TrajectorySeedCollection>();
62 }
T getParameter(std::string const &) const
std::unique_ptr< TrackingRegionProducer > theRegionProducer
std::unique_ptr< SeedGeneratorFromRegionHits > theGenerator
def move(src, dest)
Definition: eostools.py:511
T get(const Candidate &c)
Definition: component.h:55
SeedGeneratorFromRegionHitsEDProducer::~SeedGeneratorFromRegionHitsEDProducer ( )
override

Definition at line 64 of file SeedGeneratorFromRegionHitsEDProducer.cc.

65 {
66 }

Member Function Documentation

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

Definition at line 68 of file SeedGeneratorFromRegionHitsEDProducer.cc.

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

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

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