CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
HitTripletEDProducerT< T_HitTripletGenerator > Class Template Reference

#include <HitTripletEDProducerT.h>

Inheritance diagram for HitTripletEDProducerT< T_HitTripletGenerator >:
edm::stream::EDProducer<>

Public Member Functions

 HitTripletEDProducerT (const edm::ParameterSet &iConfig)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 ~HitTripletEDProducerT () 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< IntermediateHitDoubletsdoubletToken_
 
std::unique_ptr< hitTripletEDProducerT::ImplBaseimpl_
 

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

template<typename T_HitTripletGenerator>
class HitTripletEDProducerT< T_HitTripletGenerator >

Definition at line 25 of file HitTripletEDProducerT.h.

Constructor & Destructor Documentation

template<typename T_HitTripletGenerator >
HitTripletEDProducerT< T_HitTripletGenerator >::HitTripletEDProducerT ( const edm::ParameterSet iConfig)

Definition at line 294 of file HitTripletEDProducerT.h.

References Exception, edm::ParameterSet::getParameter(), HitTripletEDProducerT< T_HitTripletGenerator >::impl_, HIPixel3PrimTracks_cfi::produceIntermediateHitTriplets, and hiDetachedTripletStep_cff::produceSeedingHitSets.

294  :
295  doubletToken_(consumes<IntermediateHitDoublets>(iConfig.getParameter<edm::InputTag>("doublets")))
296 {
297  const bool produceSeedingHitSets = iConfig.getParameter<bool>("produceSeedingHitSets");
298  const bool produceIntermediateHitTriplets = iConfig.getParameter<bool>("produceIntermediateHitTriplets");
299 
300  auto iC = consumesCollector();
301 
302  using namespace hitTripletEDProducerT;
303 
304  if(produceSeedingHitSets && produceIntermediateHitTriplets)
305  impl_ = std::make_unique<Impl<T_HitTripletGenerator, ImplSeedingHitSets, ImplIntermediateHitTriplets>>(iConfig, iC);
306  else if(produceSeedingHitSets)
307  impl_ = std::make_unique<Impl<T_HitTripletGenerator, ImplSeedingHitSets, DoNothing>>(iConfig, iC);
308  else if(produceIntermediateHitTriplets)
309  impl_ = std::make_unique<Impl<T_HitTripletGenerator, DoNothing, ImplIntermediateHitTriplets>>(iConfig, iC);
310  else
311  throw cms::Exception("Configuration") << "HitTripletEDProducerT requires either produceIntermediateHitTriplets or produceSeedingHitSets to be True. If neither are needed, just remove this module from your sequence/path as it doesn't do anything useful";
312 
313  impl_->produces(*this);
314 }
T getParameter(std::string const &) const
std::unique_ptr< hitTripletEDProducerT::ImplBase > impl_
edm::EDGetTokenT< IntermediateHitDoublets > doubletToken_
template<typename T_HitTripletGenerator >
HitTripletEDProducerT< T_HitTripletGenerator >::~HitTripletEDProducerT ( )
overridedefault

Member Function Documentation

template<typename T_HitTripletGenerator >
void HitTripletEDProducerT< T_HitTripletGenerator >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 317 of file HitTripletEDProducerT.h.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), fillDescriptions(), diffTwoXMLs::label, and AlCaHLTBitMon_QueryRunRegistry::string.

317  {
319 
320  desc.add<edm::InputTag>("doublets", edm::InputTag("hitPairEDProducer"));
321  desc.add<bool>("produceSeedingHitSets", false);
322  desc.add<bool>("produceIntermediateHitTriplets", false);
323 
325 
326  auto label = T_HitTripletGenerator::fillDescriptionsLabel() + std::string("EDProducerDefault");
327  descriptions.add(label, desc);
328 }
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
template<typename T_HitTripletGenerator >
void HitTripletEDProducerT< T_HitTripletGenerator >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 331 of file HitTripletEDProducerT.h.

References HitTripletEDProducerT< T_HitTripletGenerator >::doubletToken_, Exception, edm::Event::getByToken(), HitTripletEDProducerT< T_HitTripletGenerator >::impl_, and SeedingLayerSetsHits::numberOfLayersInSet().

331  {
333  iEvent.getByToken(doubletToken_, hdoublets);
334  const auto& regionDoublets = *hdoublets;
335 
336  const SeedingLayerSetsHits& seedingLayerHits = regionDoublets.seedingLayerHits();
337  if(seedingLayerHits.numberOfLayersInSet() < 3) {
338  throw cms::Exception("LogicError") << "HitTripletEDProducerT expects SeedingLayerSetsHits::numberOfLayersInSet() to be >= 3, got " << seedingLayerHits.numberOfLayersInSet() << ". This is likely caused by a configuration error of this module, HitPairEDProducer, or SeedingLayersEDProducer.";
339  }
340 
341  impl_->produce(regionDoublets, iEvent, iSetup);
342 }
unsigned short numberOfLayersInSet() const
Get number of layers in each SeedingLayerSets.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
std::unique_ptr< hitTripletEDProducerT::ImplBase > impl_
edm::EDGetTokenT< IntermediateHitDoublets > doubletToken_

Member Data Documentation

template<typename T_HitTripletGenerator >
edm::EDGetTokenT<IntermediateHitDoublets> HitTripletEDProducerT< T_HitTripletGenerator >::doubletToken_
private
template<typename T_HitTripletGenerator >
std::unique_ptr<hitTripletEDProducerT::ImplBase> HitTripletEDProducerT< T_HitTripletGenerator >::impl_
private