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 beamerCreator::create(), reco::get(), edm::ParameterSet::getParameter(), moduleName, 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.reset(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  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
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(), mathSSE::return(), theClusterCheck, theGenerator, theRegionProducer, theSilentOnClusterCheck, and ClusterChecker::tooManyClusters().

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