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

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

428  {
429  auto layersTag = iConfig.getParameter<edm::InputTag>("seedingLayers");
430  auto regionTag = iConfig.getParameter<edm::InputTag>("trackingRegions");
431  auto regionLayerTag = iConfig.getParameter<edm::InputTag>("trackingRegionsSeedingLayers");
432  const bool useRegionLayers = !regionLayerTag.label().empty();
433  if (useRegionLayers) {
434  if (!regionTag.label().empty()) {
435  throw cms::Exception("Configuration")
436  << "HitPairEDProducer requires either trackingRegions or trackingRegionsSeedingLayers to be set, now both "
437  "are set to non-empty value. Set the unneeded parameter to empty value.";
438  }
439  if (!layersTag.label().empty()) {
440  throw cms::Exception("Configuration")
441  << "With non-empty trackingRegionsSeedingLayers, please set also seedingLayers to empty value to reduce "
442  "confusion, because the parameter is not used";
443  }
444  }
445  if (regionTag.label().empty() && regionLayerTag.label().empty()) {
446  throw cms::Exception("Configuration")
447  << "HitPairEDProducer requires either trackingRegions or trackingRegionsSeedingLayers to be set, now both are "
448  "set to empty value. Set the needed parameter to a non-empty value.";
449  }
450 
451  const bool produceSeedingHitSets = iConfig.getParameter<bool>("produceSeedingHitSets");
452  const bool produceIntermediateHitDoublets = iConfig.getParameter<bool>("produceIntermediateHitDoublets");
453 
455  if (useRegionLayers)
456  throw cms::Exception("Configuration")
457  << "Mode 'trackingRegionsSeedingLayers' makes sense only with 'produceSeedingHitsSets', now also "
458  "'produceIntermediateHitDoublets is active";
459  impl_ = std::make_unique<::Impl<::ImplSeedingHitSets, ::ImplIntermediateHitDoublets, ::RegionsLayersSeparate>>(
460  iConfig, consumesCollector(), layersTag, regionTag);
461  } else if (produceSeedingHitSets) {
462  if (useRegionLayers) {
463  impl_ = std::make_unique<::Impl<::ImplSeedingHitSets, ::DoNothing, ::RegionsLayersTogether>>(
464  iConfig, consumesCollector(), regionLayerTag);
465  } else {
466  impl_ = std::make_unique<::Impl<::ImplSeedingHitSets, ::DoNothing, ::RegionsLayersSeparate>>(
467  iConfig, consumesCollector(), layersTag, regionTag);
468  }
469  } else if (produceIntermediateHitDoublets) {
470  if (useRegionLayers)
471  throw cms::Exception("Configuration")
472  << "Mode 'trackingRegionsSeedingLayers' makes sense only with 'produceSeedingHitsSets', now "
473  "'produceIntermediateHitDoublets is active instead";
474  impl_ = std::make_unique<::Impl<::DoNothing, ::ImplIntermediateHitDoublets, ::RegionsLayersSeparate>>(
475  iConfig, consumesCollector(), layersTag, regionTag);
476  } else
477  throw cms::Exception("Configuration")
478  << "HitPairEDProducer requires either produceIntermediateHitDoublets or produceSeedingHitSets to be True. If "
479  "neither are needed, just remove this module from your sequence/path as it doesn't do anything useful";
480 
481  auto clusterCheckTag = iConfig.getParameter<edm::InputTag>("clusterCheck");
482  if (!clusterCheckTag.label().empty())
483  clusterCheckToken_ = consumes<bool>(clusterCheckTag);
484 
485  impl_->produces(producesCollector());
486 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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 488 of file HitPairEDProducer.cc.

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

488  {
490 
491  desc.add<edm::InputTag>("seedingLayers", edm::InputTag("seedingLayersEDProducer"))
492  ->setComment("Set this empty if 'trackingRegionsSeedingLayers' is non-empty");
493  desc.add<edm::InputTag>("trackingRegions", edm::InputTag("globalTrackingRegionFromBeamSpot"))
494  ->setComment(
495  "Input tracking regions when using all layer sets in 'seedingLayers' (conflicts with "
496  "'trackingRegionsSeedingLayers', set this empty to use the other)");
497  desc.add<edm::InputTag>("trackingRegionsSeedingLayers", edm::InputTag(""))
498  ->setComment(
499  "Input tracking regions and corresponding layer sets in case of dynamically limiting the seeding layers "
500  "(conflicts with 'trackingRegions', set this empty to use the other; if using this set also 'seedingLayers' "
501  "to empty)");
502  desc.add<edm::InputTag>("clusterCheck", edm::InputTag("trackerClusterCheck"));
503  desc.add<bool>("produceSeedingHitSets", false);
504  desc.add<bool>("produceIntermediateHitDoublets", false);
505  desc.add<unsigned int>("maxElement", 1000000);
506  desc.add<unsigned int>("maxElementTotal", 50000000);
507  desc.add<std::vector<unsigned>>("layerPairs", std::vector<unsigned>{0})
508  ->setComment("Indices to the pairs of consecutive layers, i.e. 0 means (0,1), 1 (1,2) etc.");
509 
510  descriptions.add("hitPairEDProducerDefault", desc);
511 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Definition at line 513 of file HitPairEDProducer.cc.

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

513  {
514  bool clusterCheckOk = true;
516  edm::Handle<bool> hclusterCheck;
517  iEvent.getByToken(clusterCheckToken_, hclusterCheck);
518  clusterCheckOk = *hclusterCheck;
519  }
520 
521  impl_->produce(clusterCheckOk, iEvent, iSetup);
522 }
std::unique_ptr<::ImplBase > impl_
constexpr bool isUninitialized() const noexcept
Definition: EDGetToken.h:99
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().