CMS 3D CMS Logo

SeedGeneratorFromRegionHitsEDProducer.cc
Go to the documentation of this file.
2 
6 
8 
12 
15 
18 
21 
23 
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 }
58 
60 
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 }
SeedCreatorFactory.h
SeedGeneratorFromRegionHits.h
edm
HLT enums.
Definition: AlignableModifier.h:19
SeedGeneratorFromRegionHitsEDProducer.h
beamerCreator.create
def create(alignables, pedeDump, additionalData, outputFile, config)
Definition: beamerCreator.py:44
SeedGeneratorFromRegionHitsEDProducer::theClusterCheck
ClusterChecker theClusterCheck
Definition: SeedGeneratorFromRegionHitsEDProducer.h:27
TrackingRegionProducer.h
TrackingRegionProducerFactory.h
SeedGeneratorFromRegionHitsEDProducer::theRegionProducer
std::unique_ptr< TrackingRegionProducer > theRegionProducer
Definition: SeedGeneratorFromRegionHitsEDProducer.h:26
SeedGeneratorFromRegionHitsEDProducer::~SeedGeneratorFromRegionHitsEDProducer
~SeedGeneratorFromRegionHitsEDProducer() override
Definition: SeedGeneratorFromRegionHitsEDProducer.cc:59
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
SeedComparitorFactory.h
Event.h
ParameterSet
Definition: Functions.h:16
OrderedHitsGeneratorFactory.h
edm::EventSetup
Definition: EventSetup.h:57
get
#define get
TrajectorySeedCollection.h
looper.cfg
cfg
Definition: looper.py:297
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
SeedComparitor.h
eostools.move
def move(src, dest)
Definition: eostools.py:511
SeedCreator.h
ev
bool ev
Definition: Hydjet2Hadronizer.cc:95
SeedGeneratorFromRegionHitsEDProducer::SeedGeneratorFromRegionHitsEDProducer
SeedGeneratorFromRegionHitsEDProducer(const edm::ParameterSet &cfg)
Definition: SeedGeneratorFromRegionHitsEDProducer.cc:24
HLT_2018_cff.region
region
Definition: HLT_2018_cff.py:81479
EventSetup.h
SeedGeneratorFromRegionHitsEDProducer::moduleName
std::string moduleName
Definition: SeedGeneratorFromRegionHitsEDProducer.h:29
TrackingRegion
Definition: TrackingRegion.h:38
AlignmentPI::regions
regions
Definition: AlignmentPayloadInspectorHelper.h:76
ConsumesCollector.h
TrackingRegion.h
SeedGeneratorFromRegionHitsEDProducer::produce
void produce(edm::Event &ev, const edm::EventSetup &es) override
Definition: SeedGeneratorFromRegionHitsEDProducer.cc:61
SeedGeneratorFromRegionHitsEDProducer::theGenerator
std::unique_ptr< SeedGeneratorFromRegionHits > theGenerator
Definition: SeedGeneratorFromRegionHitsEDProducer.h:25
edm::Event
Definition: Event.h:73
ClusterChecker::tooManyClusters
size_t tooManyClusters(const edm::Event &e) const
Definition: ClusterChecker.cc:44
edm::ConsumesCollector
Definition: ConsumesCollector.h:39
SeedGeneratorFromRegionHitsEDProducer::theSilentOnClusterCheck
bool theSilentOnClusterCheck
Definition: SeedGeneratorFromRegionHitsEDProducer.h:31
SiPixelRawToDigiRegional_cfi.Regions
Regions
Definition: SiPixelRawToDigiRegional_cfi.py:7
OrderedHitsGenerator.h