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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 22 of file HitPairEDProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 419 of file HitPairEDProducer.cc.

References clusterCheckToken_, Exception, edm::ParameterSet::getParameter(), impl_, edm::InputTag::label(), hiDetachedQuadStep_cff::produceIntermediateHitDoublets, and hiDetachedTripletStep_cff::produceSeedingHitSets.

419  {
420  auto layersTag = iConfig.getParameter<edm::InputTag>("seedingLayers");
421  auto regionTag = iConfig.getParameter<edm::InputTag>("trackingRegions");
422  auto regionLayerTag = iConfig.getParameter<edm::InputTag>("trackingRegionsSeedingLayers");
423  const bool useRegionLayers = !regionLayerTag.label().empty();
424  if(useRegionLayers) {
425  if(!regionTag.label().empty()) {
426  throw cms::Exception("Configuration") << "HitPairEDProducer requires either trackingRegions or trackingRegionsSeedingLayers to be set, now both are set to non-empty value. Set the unneeded parameter to empty value.";
427  }
428  if(!layersTag.label().empty()) {
429  throw cms::Exception("Configuration") << "With non-empty trackingRegionsSeedingLayers, please set also seedingLayers to empty value to reduce confusion, because the parameter is not used";
430  }
431  }
432  if(regionTag.label().empty() && regionLayerTag.label().empty()) {
433  throw cms::Exception("Configuration") << "HitPairEDProducer requires either trackingRegions or trackingRegionsSeedingLayers to be set, now both are set to empty value. Set the needed parameter to a non-empty value.";
434  }
435 
436  const bool produceSeedingHitSets = iConfig.getParameter<bool>("produceSeedingHitSets");
437  const bool produceIntermediateHitDoublets = iConfig.getParameter<bool>("produceIntermediateHitDoublets");
438 
439  if(produceSeedingHitSets && produceIntermediateHitDoublets) {
440  if(useRegionLayers) throw cms::Exception("Configuration") << "Mode 'trackingRegionsSeedingLayers' makes sense only with 'produceSeedingHitsSets', now also 'produceIntermediateHitDoublets is active";
441  impl_ = std::make_unique<::Impl<::ImplSeedingHitSets, ::ImplIntermediateHitDoublets, ::RegionsLayersSeparate>>(iConfig, layersTag, regionTag, consumesCollector());
442  }
443  else if(produceSeedingHitSets) {
444  if(useRegionLayers) {
445  impl_ = std::make_unique<::Impl<::ImplSeedingHitSets, ::DoNothing, ::RegionsLayersTogether>>(iConfig, regionLayerTag, consumesCollector());
446  }
447  else {
448  impl_ = std::make_unique<::Impl<::ImplSeedingHitSets, ::DoNothing, ::RegionsLayersSeparate>>(iConfig, layersTag, regionTag, consumesCollector());
449  }
450  }
451  else if(produceIntermediateHitDoublets) {
452  if(useRegionLayers) throw cms::Exception("Configuration") << "Mode 'trackingRegionsSeedingLayers' makes sense only with 'produceSeedingHitsSets', now 'produceIntermediateHitDoublets is active instead";
453  impl_ = std::make_unique<::Impl<::DoNothing, ::ImplIntermediateHitDoublets, ::RegionsLayersSeparate>>(iConfig, layersTag, regionTag, consumesCollector());
454  }
455  else
456  throw cms::Exception("Configuration") << "HitPairEDProducer requires either produceIntermediateHitDoublets or produceSeedingHitSets to be True. If neither are needed, just remove this module from your sequence/path as it doesn't do anything useful";
457 
458  auto clusterCheckTag = iConfig.getParameter<edm::InputTag>("clusterCheck");
459  if(!clusterCheckTag.label().empty())
460  clusterCheckToken_ = consumes<bool>(clusterCheckTag);
461 
462  impl_->produces(*this);
463 }
T getParameter(std::string const &) const
std::unique_ptr<::ImplBase > impl_
edm::EDGetTokenT< bool > clusterCheckToken_
std::string const & label() const
Definition: InputTag.h:36
HitPairEDProducer::~HitPairEDProducer ( )
overridedefault

Member Function Documentation

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

Definition at line 465 of file HitPairEDProducer.cc.

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

465  {
467 
468  desc.add<edm::InputTag>("seedingLayers", edm::InputTag("seedingLayersEDProducer"))->setComment("Set this empty if 'trackingRegionsSeedingLayers' is non-empty");
469  desc.add<edm::InputTag>("trackingRegions", edm::InputTag("globalTrackingRegionFromBeamSpot"))->setComment("Input tracking regions when using all layer sets in 'seedingLayers' (conflicts with 'trackingRegionsSeedingLayers', set this empty to use the other)");
470  desc.add<edm::InputTag>("trackingRegionsSeedingLayers", edm::InputTag(""))->setComment("Input tracking regions and corresponding layer sets in case of dynamically limiting the seeding layers (conflicts with 'trackingRegions', set this empty to use the other; if using this set also 'seedingLayers' to empty)");
471  desc.add<edm::InputTag>("clusterCheck", edm::InputTag("trackerClusterCheck"));
472  desc.add<bool>("produceSeedingHitSets", false);
473  desc.add<bool>("produceIntermediateHitDoublets", false);
474  desc.add<unsigned int>("maxElement", 1000000);
475  desc.add<unsigned int>("maxElementTotal", 50000000);
476  desc.add<std::vector<unsigned> >("layerPairs", std::vector<unsigned>{0})->setComment("Indices to the pairs of consecutive layers, i.e. 0 means (0,1), 1 (1,2) etc.");
477 
478  descriptions.add("hitPairEDProducerDefault", desc);
479 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void HitPairEDProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 481 of file HitPairEDProducer.cc.

References clusterCheckToken_, DEFINE_FWK_MODULE, edm::Event::getByToken(), impl_, and edm::EDGetTokenT< T >::isUninitialized().

481  {
482  bool clusterCheckOk = true;
484  edm::Handle<bool> hclusterCheck;
485  iEvent.getByToken(clusterCheckToken_, hclusterCheck);
486  clusterCheckOk = *hclusterCheck;
487  }
488 
489  impl_->produce(clusterCheckOk, iEvent, iSetup);
490 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
std::unique_ptr<::ImplBase > impl_
edm::EDGetTokenT< bool > clusterCheckToken_
bool isUninitialized() const
Definition: EDGetToken.h:70

Member Data Documentation

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

Definition at line 32 of file HitPairEDProducer.cc.

Referenced by HitPairEDProducer(), and produce().

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

Definition at line 34 of file HitPairEDProducer.cc.

Referenced by HitPairEDProducer(), and produce().