CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
HitPairEDProducer Class Reference
Inheritance diagram for HitPairEDProducer:
edm::stream::EDProducer<>

Public Member Functions

 HitPairEDProducer (const edm::ParameterSet &iConfig)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 ~HitPairEDProducer () override=default
 
- 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
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDGetTokenT< bool > clusterCheckToken_
 
std::unique_ptr<::ImplBase > impl_
 

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 25 of file HitPairEDProducer.cc.

Constructor & Destructor Documentation

◆ HitPairEDProducer()

HitPairEDProducer::HitPairEDProducer ( const edm::ParameterSet iConfig)

Definition at line 443 of file HitPairEDProducer.cc.

References clusterCheckToken_, Exception, edm::ParameterSet::getParameter(), impl_, edm::InputTag::label(), HLT_2023v12_cff::produceIntermediateHitDoublets, HLT_2023v12_cff::produceSeedingHitSets, and ValL1Emulator_cff::regionTag.

443  {
444  auto layersTag = iConfig.getParameter<edm::InputTag>("seedingLayers");
445  auto regionTag = iConfig.getParameter<edm::InputTag>("trackingRegions");
446  auto regionLayerTag = iConfig.getParameter<edm::InputTag>("trackingRegionsSeedingLayers");
447  const bool useRegionLayers = !regionLayerTag.label().empty();
448  if (useRegionLayers) {
449  if (!regionTag.label().empty()) {
450  throw cms::Exception("Configuration")
451  << "HitPairEDProducer requires either trackingRegions or trackingRegionsSeedingLayers to be set, now both "
452  "are set to non-empty value. Set the unneeded parameter to empty value.";
453  }
454  if (!layersTag.label().empty()) {
455  throw cms::Exception("Configuration")
456  << "With non-empty trackingRegionsSeedingLayers, please set also seedingLayers to empty value to reduce "
457  "confusion, because the parameter is not used";
458  }
459  }
460  if (regionTag.label().empty() && regionLayerTag.label().empty()) {
461  throw cms::Exception("Configuration")
462  << "HitPairEDProducer requires either trackingRegions or trackingRegionsSeedingLayers to be set, now both are "
463  "set to empty value. Set the needed parameter to a non-empty value.";
464  }
465 
466  const bool produceSeedingHitSets = iConfig.getParameter<bool>("produceSeedingHitSets");
467  const bool produceIntermediateHitDoublets = iConfig.getParameter<bool>("produceIntermediateHitDoublets");
468 
470  if (useRegionLayers)
471  throw cms::Exception("Configuration")
472  << "Mode 'trackingRegionsSeedingLayers' makes sense only with 'produceSeedingHitsSets', now also "
473  "'produceIntermediateHitDoublets is active";
474  impl_ = std::make_unique<::Impl<::ImplSeedingHitSets, ::ImplIntermediateHitDoublets, ::RegionsLayersSeparate>>(
475  iConfig, consumesCollector(), layersTag, regionTag);
476  } else if (produceSeedingHitSets) {
477  if (useRegionLayers) {
478  impl_ = std::make_unique<::Impl<::ImplSeedingHitSets, ::DoNothing, ::RegionsLayersTogether>>(
479  iConfig, consumesCollector(), regionLayerTag);
480  } else {
481  impl_ = std::make_unique<::Impl<::ImplSeedingHitSets, ::DoNothing, ::RegionsLayersSeparate>>(
482  iConfig, consumesCollector(), layersTag, regionTag);
483  }
484  } else if (produceIntermediateHitDoublets) {
485  if (useRegionLayers)
486  throw cms::Exception("Configuration")
487  << "Mode 'trackingRegionsSeedingLayers' makes sense only with 'produceSeedingHitsSets', now "
488  "'produceIntermediateHitDoublets is active instead";
489  impl_ = std::make_unique<::Impl<::DoNothing, ::ImplIntermediateHitDoublets, ::RegionsLayersSeparate>>(
490  iConfig, consumesCollector(), layersTag, regionTag);
491  } else
492  throw cms::Exception("Configuration")
493  << "HitPairEDProducer requires either produceIntermediateHitDoublets or produceSeedingHitSets to be True. If "
494  "neither are needed, just remove this module from your sequence/path as it doesn't do anything useful";
495 
496  auto clusterCheckTag = iConfig.getParameter<edm::InputTag>("clusterCheck");
497  if (!clusterCheckTag.label().empty())
498  clusterCheckToken_ = consumes<bool>(clusterCheckTag);
499 
500  impl_->produces(producesCollector());
501 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
std::unique_ptr<::ImplBase > impl_
std::string const & label() const
Definition: InputTag.h:36
edm::EDGetTokenT< bool > clusterCheckToken_

◆ ~HitPairEDProducer()

HitPairEDProducer::~HitPairEDProducer ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

void HitPairEDProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 503 of file HitPairEDProducer.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and ProducerED_cfi::InputTag.

503  {
505 
506  desc.add<edm::InputTag>("seedingLayers", edm::InputTag("seedingLayersEDProducer"))
507  ->setComment("Set this empty if 'trackingRegionsSeedingLayers' is non-empty");
508  desc.add<edm::InputTag>("trackingRegions", edm::InputTag("globalTrackingRegionFromBeamSpot"))
509  ->setComment(
510  "Input tracking regions when using all layer sets in 'seedingLayers' (conflicts with "
511  "'trackingRegionsSeedingLayers', set this empty to use the other)");
512  desc.add<edm::InputTag>("trackingRegionsSeedingLayers", edm::InputTag(""))
513  ->setComment(
514  "Input tracking regions and corresponding layer sets in case of dynamically limiting the seeding layers "
515  "(conflicts with 'trackingRegions', set this empty to use the other; if using this set also 'seedingLayers' "
516  "to empty)");
517  desc.add<edm::InputTag>("clusterCheck", edm::InputTag("trackerClusterCheck"));
518  desc.add<bool>("produceSeedingHitSets", false);
519  desc.add<bool>("produceIntermediateHitDoublets", false);
520  desc.add<unsigned int>("maxElement", 1000000);
521  desc.add<unsigned int>("maxElementTotal", 50000000);
522  desc.add<bool>("putEmptyIfMaxElementReached", false)
523  ->setComment(
524  "If set to true (default is 'false'), abort processing and put empty data products also if any layer pair "
525  "yields at least maxElement doublets, in addition to aborting processing if the sum of doublets from all "
526  "layer pairs reaches maxElementTotal.");
527  desc.add<std::vector<unsigned>>("layerPairs", std::vector<unsigned>{0})
528  ->setComment("Indices to the pairs of consecutive layers, i.e. 0 means (0,1), 1 (1,2) etc.");
529 
530  descriptions.add("hitPairEDProducerDefault", desc);
531 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void HitPairEDProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 533 of file HitPairEDProducer.cc.

References clusterCheckToken_, iEvent, impl_, and edm::EDGetTokenT< T >::isUninitialized().

533  {
534  bool clusterCheckOk = true;
536  edm::Handle<bool> hclusterCheck;
537  iEvent.getByToken(clusterCheckToken_, hclusterCheck);
538  clusterCheckOk = *hclusterCheck;
539  }
540 
541  impl_->produce(clusterCheckOk, iEvent, iSetup);
542 }
std::unique_ptr<::ImplBase > impl_
constexpr bool isUninitialized() const noexcept
Definition: EDGetToken.h:104
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< bool > clusterCheckToken_

Member Data Documentation

◆ clusterCheckToken_

edm::EDGetTokenT<bool> HitPairEDProducer::clusterCheckToken_
private

Definition at line 35 of file HitPairEDProducer.cc.

Referenced by HitPairEDProducer(), and produce().

◆ impl_

std::unique_ptr<::ImplBase> HitPairEDProducer::impl_
private

Definition at line 37 of file HitPairEDProducer.cc.

Referenced by HitPairEDProducer(), and produce().