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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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

Constructor & Destructor Documentation

◆ HitPairEDProducer()

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

Definition at line 427 of file HitPairEDProducer.cc.

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

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

◆ ~HitPairEDProducer()

HitPairEDProducer::~HitPairEDProducer ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 487 of file HitPairEDProducer.cc.

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

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and HLT_2018_cff::InputTag.

◆ produce()

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

Definition at line 512 of file HitPairEDProducer.cc.

512  {
513  bool clusterCheckOk = true;
515  edm::Handle<bool> hclusterCheck;
516  iEvent.getByToken(clusterCheckToken_, hclusterCheck);
517  clusterCheckOk = *hclusterCheck;
518  }
519 
520  impl_->produce(clusterCheckOk, iEvent, iSetup);
521 }

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

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().

edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HitPairEDProducer::impl_
std::unique_ptr<::ImplBase > impl_
Definition: HitPairEDProducer.cc:37
HLT_2018_cff.produceSeedingHitSets
produceSeedingHitSets
Definition: HLT_2018_cff.py:8529
edm::Handle
Definition: AssociativeIterator.h:50
edm::InputTag::label
std::string const & label() const
Definition: InputTag.h:36
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
ValL1Emulator_cff.regionTag
regionTag
Definition: ValL1Emulator_cff.py:63
edm::EDGetTokenT::isUninitialized
bool isUninitialized() const
Definition: EDGetToken.h:70
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
iEvent
int iEvent
Definition: GenABIO.cc:224
HitPairEDProducer::clusterCheckToken_
edm::EDGetTokenT< bool > clusterCheckToken_
Definition: HitPairEDProducer.cc:35
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
HLT_2018_cff.produceIntermediateHitDoublets
produceIntermediateHitDoublets
Definition: HLT_2018_cff.py:8530
Exception
Definition: hltDiff.cc:246
edm::InputTag
Definition: InputTag.h:15