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

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

406  {
407  auto layersTag = iConfig.getParameter<edm::InputTag>("seedingLayers");
408  auto regionTag = iConfig.getParameter<edm::InputTag>("trackingRegions");
409  auto regionLayerTag = iConfig.getParameter<edm::InputTag>("trackingRegionsSeedingLayers");
410  const bool useRegionLayers = regionLayerTag.label() != "";
411  if(useRegionLayers) {
412  if(regionTag.label() != "") {
413  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.";
414  }
415  if(layersTag.label() != "") {
416  throw cms::Exception("Configuration") << "With non-empty trackingRegionsSeedingLayers, please set also seedingLayers to empty value to reduce confusion, because the parameter is not used";
417  }
418  }
419  if(regionTag.label() == "" && regionLayerTag.label() == "") {
420  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.";
421  }
422 
423  const bool produceSeedingHitSets = iConfig.getParameter<bool>("produceSeedingHitSets");
424  const bool produceIntermediateHitDoublets = iConfig.getParameter<bool>("produceIntermediateHitDoublets");
425 
426  if(produceSeedingHitSets && produceIntermediateHitDoublets) {
427  if(useRegionLayers) throw cms::Exception("Configuration") << "Mode 'trackingRegionsSeedingLayers' makes sense only with 'produceSeedingHitsSets', now also 'produceIntermediateHitDoublets is active";
428  impl_ = std::make_unique<::Impl<::ImplSeedingHitSets, ::ImplIntermediateHitDoublets, ::RegionsLayersSeparate>>(iConfig, layersTag, regionTag, consumesCollector());
429  }
430  else if(produceSeedingHitSets) {
431  if(useRegionLayers) {
432  impl_ = std::make_unique<::Impl<::ImplSeedingHitSets, ::DoNothing, ::RegionsLayersTogether>>(iConfig, regionLayerTag, consumesCollector());
433  }
434  else {
435  impl_ = std::make_unique<::Impl<::ImplSeedingHitSets, ::DoNothing, ::RegionsLayersSeparate>>(iConfig, layersTag, regionTag, consumesCollector());
436  }
437  }
438  else if(produceIntermediateHitDoublets) {
439  if(useRegionLayers) throw cms::Exception("Configuration") << "Mode 'trackingRegionsSeedingLayers' makes sense only with 'produceSeedingHitsSets', now 'produceIntermediateHitDoublets is active instead";
440  impl_ = std::make_unique<::Impl<::DoNothing, ::ImplIntermediateHitDoublets, ::RegionsLayersSeparate>>(iConfig, layersTag, regionTag, consumesCollector());
441  }
442  else
443  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";
444 
445  auto clusterCheckTag = iConfig.getParameter<edm::InputTag>("clusterCheck");
446  if(clusterCheckTag.label() != "")
447  clusterCheckToken_ = consumes<bool>(clusterCheckTag);
448 
449  impl_->produces(*this);
450 }
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 452 of file HitPairEDProducer.cc.

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

452  {
454 
455  desc.add<edm::InputTag>("seedingLayers", edm::InputTag("seedingLayersEDProducer"))->setComment("Set this empty if 'trackingRegionsSeedingLayers' is non-empty");
456  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)");
457  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)");
458  desc.add<edm::InputTag>("clusterCheck", edm::InputTag("trackerClusterCheck"));
459  desc.add<bool>("produceSeedingHitSets", false);
460  desc.add<bool>("produceIntermediateHitDoublets", false);
461  desc.add<unsigned int>("maxElement", 1000000);
462  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.");
463 
464  descriptions.add("hitPairEDProducerDefault", desc);
465 }
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 467 of file HitPairEDProducer.cc.

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

467  {
468  bool clusterCheckOk = true;
470  edm::Handle<bool> hclusterCheck;
471  iEvent.getByToken(clusterCheckToken_, hclusterCheck);
472  clusterCheckOk = *hclusterCheck;
473  }
474 
475  impl_->produce(clusterCheckOk, iEvent, iSetup);
476 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
std::unique_ptr<::ImplBase > impl_
edm::EDGetTokenT< bool > clusterCheckToken_
bool isUninitialized() const
Definition: EDGetToken.h:73

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