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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

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<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::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.

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

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, consumesCollector()));
55 
56  produces<TrajectorySeedCollection>();
57 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::unique_ptr< TrackingRegionProducer > theRegionProducer
#define get
std::unique_ptr< SeedGeneratorFromRegionHits > theGenerator
def move(src, dest)
Definition: eostools.py:511

◆ ~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.

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

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 }
size_t tooManyClusters(const edm::Event &e) const
Log< level::Error, false > LogError
std::unique_ptr< TrackingRegionProducer > theRegionProducer
std::unique_ptr< SeedGeneratorFromRegionHits > theGenerator
def move(src, dest)
Definition: eostools.py:511

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