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 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< 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 28 of file HitTripletEDProducerT.h.

Constructor & Destructor Documentation

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

Definition at line 293 of file HitTripletEDProducerT.h.

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

294  : doubletToken_(consumes<IntermediateHitDoublets>(iConfig.getParameter<edm::InputTag>("doublets"))) {
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")
310  << "HitTripletEDProducerT requires either produceIntermediateHitTriplets or produceSeedingHitSets to be True. "
311  "If neither are needed, just remove this module from your sequence/path as it doesn't do anything useful";
312 
313  impl_->produces(producesCollector());
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(), HLT_2018_cff::InputTag, 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 }
char const * label
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
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")
339  << "HitTripletEDProducerT expects SeedingLayerSetsHits::numberOfLayersInSet() to be >= 3, got "
340  << seedingLayerHits.numberOfLayersInSet()
341  << ". This is likely caused by a configuration error of this module, HitPairEDProducer, or "
342  "SeedingLayersEDProducer.";
343  }
344 
345  impl_->produce(regionDoublets, iEvent, iSetup);
346 }
unsigned short numberOfLayersInSet() const
Get number of layers in each SeedingLayerSets.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
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