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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HitTripletEDProducerT (const edm::ParameterSet &iConfig)
 
virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 ~HitTripletEDProducerT ()=default
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

template<typename T_HitTripletGenerator>
class HitTripletEDProducerT< T_HitTripletGenerator >

Definition at line 23 of file HitTripletEDProducerT.h.

Constructor & Destructor Documentation

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

Definition at line 292 of file HitTripletEDProducerT.h.

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

292  :
293  doubletToken_(consumes<IntermediateHitDoublets>(iConfig.getParameter<edm::InputTag>("doublets")))
294 {
295  const bool produceSeedingHitSets = iConfig.getParameter<bool>("produceSeedingHitSets");
296  const bool produceIntermediateHitTriplets = iConfig.getParameter<bool>("produceIntermediateHitTriplets");
297 
298  auto iC = consumesCollector();
299 
300  using namespace hitTripletEDProducerT;
301 
302  if(produceSeedingHitSets && produceIntermediateHitTriplets)
303  impl_ = std::make_unique<Impl<T_HitTripletGenerator, ImplSeedingHitSets, ImplIntermediateHitTriplets>>(iConfig, iC);
304  else if(produceSeedingHitSets)
305  impl_ = std::make_unique<Impl<T_HitTripletGenerator, ImplSeedingHitSets, DoNothing>>(iConfig, iC);
306  else if(produceIntermediateHitTriplets)
307  impl_ = std::make_unique<Impl<T_HitTripletGenerator, DoNothing, ImplIntermediateHitTriplets>>(iConfig, iC);
308  else
309  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";
310 
311  impl_->produces(*this);
312 }
T getParameter(std::string const &) const
std::unique_ptr< hitTripletEDProducerT::ImplBase > impl_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< IntermediateHitDoublets > doubletToken_
template<typename T_HitTripletGenerator >
HitTripletEDProducerT< T_HitTripletGenerator >::~HitTripletEDProducerT ( )
default

Member Function Documentation

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

Definition at line 315 of file HitTripletEDProducerT.h.

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

315  {
317 
318  desc.add<edm::InputTag>("doublets", edm::InputTag("hitPairEDProducer"));
319  desc.add<bool>("produceSeedingHitSets", false);
320  desc.add<bool>("produceIntermediateHitTriplets", false);
321 
322  T_HitTripletGenerator::fillDescriptions(desc);
323 
324  auto label = T_HitTripletGenerator::fillDescriptionsLabel() + std::string("EDProducerDefault");
325  descriptions.add(label, desc);
326 }
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 
)
overridevirtual

Definition at line 329 of file HitTripletEDProducerT.h.

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

329  {
331  iEvent.getByToken(doubletToken_, hdoublets);
332  const auto& regionDoublets = *hdoublets;
333 
334  const SeedingLayerSetsHits& seedingLayerHits = regionDoublets.seedingLayerHits();
335  if(seedingLayerHits.numberOfLayersInSet() < 3) {
336  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.";
337  }
338 
339  impl_->produce(regionDoublets, iEvent, iSetup);
340 }
unsigned short numberOfLayersInSet() const
Get number of layers in each SeedingLayerSets.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
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