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 hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () 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 17 of file SeedGeneratorFromRegionHitsEDProducer.h.

Constructor & Destructor Documentation

◆ SeedGeneratorFromRegionHitsEDProducer()

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

Definition at line 24 of file SeedGeneratorFromRegionHitsEDProducer.cc.

25  : theRegionProducer(nullptr),
26  theClusterCheck(cfg.getParameter<edm::ParameterSet>("ClusterCheckPSet"), consumesCollector()) {
28  cfg.getParameter<edm::ParameterSet>("ClusterCheckPSet").getUntrackedParameter<bool>("silentClusterCheck", false);
29 
30  moduleName = cfg.getParameter<std::string>("@module_label");
31 
32  edm::ParameterSet creatorPSet = cfg.getParameter<edm::ParameterSet>("SeedCreatorPSet");
33 
34  edm::ParameterSet regfactoryPSet = cfg.getParameter<edm::ParameterSet>("RegionFactoryPSet");
35  std::string regfactoryName = regfactoryPSet.getParameter<std::string>("ComponentName");
36  theRegionProducer = TrackingRegionProducerFactory::get()->create(regfactoryName, regfactoryPSet, consumesCollector());
37 
38  edm::ConsumesCollector iC = consumesCollector();
39  edm::ParameterSet hitsfactoryPSet = cfg.getParameter<edm::ParameterSet>("OrderedHitsFactoryPSet");
40  std::string hitsfactoryName = hitsfactoryPSet.getParameter<std::string>("ComponentName");
41 
42  edm::ParameterSet comparitorPSet = cfg.getParameter<edm::ParameterSet>("SeedComparitorPSet");
43  std::string comparitorName = comparitorPSet.getParameter<std::string>("ComponentName");
44  std::unique_ptr<SeedComparitor> aComparitor;
45  if (comparitorName != "none") {
46  aComparitor = SeedComparitorFactory::get()->create(comparitorName, comparitorPSet, iC);
47  }
48 
49  std::string creatorName = creatorPSet.getParameter<std::string>("ComponentName");
50 
51  theGenerator = std::make_unique<SeedGeneratorFromRegionHits>(
52  OrderedHitsGeneratorFactory::get()->create(hitsfactoryName, hitsfactoryPSet, iC),
53  std::move(aComparitor),
54  SeedCreatorFactory::get()->create(creatorName, creatorPSet));
55 
56  produces<TrajectorySeedCollection>();
57 }

References looper::cfg, beamerCreator::create(), get, edm::ParameterSet::getParameter(), moduleName, eostools::move(), AlCaHLTBitMon_QueryRunRegistry::string, theGenerator, theRegionProducer, and theSilentOnClusterCheck.

◆ ~SeedGeneratorFromRegionHitsEDProducer()

SeedGeneratorFromRegionHitsEDProducer::~SeedGeneratorFromRegionHitsEDProducer ( )
override

Definition at line 59 of file SeedGeneratorFromRegionHitsEDProducer.cc.

59 {}

Member Function Documentation

◆ produce()

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

Definition at line 61 of file SeedGeneratorFromRegionHitsEDProducer.cc.

61  {
62  auto triplets = std::make_unique<TrajectorySeedCollection>();
63 
64  //protection for big ass events...
65  size_t clustsOrZero = theClusterCheck.tooManyClusters(ev);
66  if (clustsOrZero) {
68  edm::LogError("TooManyClusters") << "Found too many clusters (" << clustsOrZero << "), bailing out.\n";
69  ev.put(std::move(triplets));
70  return;
71  }
72 
73  typedef std::vector<std::unique_ptr<TrackingRegion> > Regions;
74  typedef Regions::const_iterator IR;
75  Regions regions = theRegionProducer->regions(ev, es);
76 
77  for (IR ir = regions.begin(), irEnd = regions.end(); ir < irEnd; ++ir) {
78  const TrackingRegion& region = **ir;
79 
80  // make job
81  theGenerator->run(*triplets, region, ev, es);
82  // std::cout << "created seeds for " << moduleName << " " << triplets->size() << std::endl;
83  }
84  triplets->shrink_to_fit();
85 
86  // put to event
87  ev.put(std::move(triplets));
88 }

References ev, eostools::move(), HLT_FULL_cff::region, SiPixelRawToDigiRegional_cfi::Regions, theClusterCheck, theGenerator, theRegionProducer, theSilentOnClusterCheck, and ClusterChecker::tooManyClusters().

Member Data Documentation

◆ moduleName

std::string SeedGeneratorFromRegionHitsEDProducer::moduleName
private

◆ theClusterCheck

ClusterChecker SeedGeneratorFromRegionHitsEDProducer::theClusterCheck
private

Definition at line 27 of file SeedGeneratorFromRegionHitsEDProducer.h.

Referenced by produce().

◆ theGenerator

std::unique_ptr<SeedGeneratorFromRegionHits> SeedGeneratorFromRegionHitsEDProducer::theGenerator
private

◆ theRegionProducer

std::unique_ptr<TrackingRegionProducer> SeedGeneratorFromRegionHitsEDProducer::theRegionProducer
private

◆ theSilentOnClusterCheck

bool SeedGeneratorFromRegionHitsEDProducer::theSilentOnClusterCheck
private
beamerCreator.create
def create(alignables, pedeDump, additionalData, outputFile, config)
Definition: beamerCreator.py:44
SeedGeneratorFromRegionHitsEDProducer::theClusterCheck
ClusterChecker theClusterCheck
Definition: SeedGeneratorFromRegionHitsEDProducer.h:27
SeedGeneratorFromRegionHitsEDProducer::theRegionProducer
std::unique_ptr< TrackingRegionProducer > theRegionProducer
Definition: SeedGeneratorFromRegionHitsEDProducer.h:26
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88271
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
get
#define get
looper.cfg
cfg
Definition: looper.py:297
eostools.move
def move(src, dest)
Definition: eostools.py:511
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SeedGeneratorFromRegionHitsEDProducer::moduleName
std::string moduleName
Definition: SeedGeneratorFromRegionHitsEDProducer.h:29
TrackingRegion
Definition: TrackingRegion.h:41
AlignmentPI::regions
regions
Definition: AlignmentPayloadInspectorHelper.h:76
SeedGeneratorFromRegionHitsEDProducer::theGenerator
std::unique_ptr< SeedGeneratorFromRegionHits > theGenerator
Definition: SeedGeneratorFromRegionHitsEDProducer.h:25
ClusterChecker::tooManyClusters
size_t tooManyClusters(const edm::Event &e) const
Definition: ClusterChecker.cc:44
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
SeedGeneratorFromRegionHitsEDProducer::theSilentOnClusterCheck
bool theSilentOnClusterCheck
Definition: SeedGeneratorFromRegionHitsEDProducer.h:31
SiPixelRawToDigiRegional_cfi.Regions
Regions
Definition: SiPixelRawToDigiRegional_cfi.py:7