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

Public Member Functions

 HitPairEDProducer (const edm::ParameterSet &iConfig)
 
virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 ~HitPairEDProducer ()=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
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 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 & itemsToGetFrom (BranchType iType) 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< bool > clusterCheckToken_
 
std::unique_ptr<::ImplBase > impl_
 
edm::EDGetTokenT< edm::OwnVector< TrackingRegion > > regionToken_
 
edm::EDGetTokenT< SeedingLayerSetsHitsseedingLayerToken_
 

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

Definition at line 20 of file HitPairEDProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 258 of file HitPairEDProducer.cc.

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

258  :
259  seedingLayerToken_(consumes<SeedingLayerSetsHits>(iConfig.getParameter<edm::InputTag>("seedingLayers"))),
261 {
262  const bool produceSeedingHitSets = iConfig.getParameter<bool>("produceSeedingHitSets");
263  const bool produceIntermediateHitDoublets = iConfig.getParameter<bool>("produceIntermediateHitDoublets");
264 
265  if(produceSeedingHitSets && produceIntermediateHitDoublets)
266  impl_ = std::make_unique<::Impl<::ImplSeedingHitSets, ::ImplIntermediateHitDoublets>>(iConfig);
267  else if(produceSeedingHitSets)
268  impl_ = std::make_unique<::Impl<::ImplSeedingHitSets, ::DoNothing>>(iConfig);
269  else if(produceIntermediateHitDoublets)
270  impl_ = std::make_unique<::Impl<::DoNothing, ::ImplIntermediateHitDoublets>>(iConfig);
271  else
272  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";
273 
274  auto clusterCheckTag = iConfig.getParameter<edm::InputTag>("clusterCheck");
275  if(clusterCheckTag.label() != "")
276  clusterCheckToken_ = consumes<bool>(clusterCheckTag);
277 
278  impl_->produces(*this);
279 }
T getParameter(std::string const &) const
std::unique_ptr<::ImplBase > impl_
edm::EDGetTokenT< edm::OwnVector< TrackingRegion > > regionToken_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< bool > clusterCheckToken_
edm::EDGetTokenT< SeedingLayerSetsHits > seedingLayerToken_
HitPairEDProducer::~HitPairEDProducer ( )
default

Member Function Documentation

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

Definition at line 281 of file HitPairEDProducer.cc.

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

281  {
283 
284  desc.add<edm::InputTag>("seedingLayers", edm::InputTag("seedingLayersEDProducer"));
285  desc.add<edm::InputTag>("trackingRegions", edm::InputTag("globalTrackingRegionFromBeamSpot"));
286  desc.add<edm::InputTag>("clusterCheck", edm::InputTag("trackerClusterCheck"));
287  desc.add<bool>("produceSeedingHitSets", false);
288  desc.add<bool>("produceIntermediateHitDoublets", false);
289  desc.add<unsigned int>("maxElement", 1000000);
290  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.");
291 
292  descriptions.add("hitPairEDProducerDefault", desc);
293 }
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 
)
overridevirtual

Definition at line 295 of file HitPairEDProducer.cc.

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

295  {
296  bool clusterCheckOk = true;
298  edm::Handle<bool> hclusterCheck;
299  iEvent.getByToken(clusterCheckToken_, hclusterCheck);
300  clusterCheckOk = *hclusterCheck;
301  }
302 
304  iEvent.getByToken(seedingLayerToken_, hlayers);
305  const auto& layers = *hlayers;
306  if(layers.numberOfLayersInSet() < 2)
307  throw cms::Exception("LogicError") << "HitPairEDProducer expects SeedingLayerSetsHits::numberOfLayersInSet() to be >= 2, got " << layers.numberOfLayersInSet() << ". This is likely caused by a configuration error of this module, or SeedingLayersEDProducer.";
308 
310  iEvent.getByToken(regionToken_, hregions);
311 
312  impl_->produce(layers, *hregions, clusterCheckOk, iEvent, iSetup);
313 }
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
std::unique_ptr<::ImplBase > impl_
edm::EDGetTokenT< edm::OwnVector< TrackingRegion > > regionToken_
edm::EDGetTokenT< bool > clusterCheckToken_
edm::EDGetTokenT< SeedingLayerSetsHits > seedingLayerToken_
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().

edm::EDGetTokenT<edm::OwnVector<TrackingRegion> > HitPairEDProducer::regionToken_
private

Definition at line 31 of file HitPairEDProducer.cc.

Referenced by produce().

edm::EDGetTokenT<SeedingLayerSetsHits> HitPairEDProducer::seedingLayerToken_
private

Definition at line 30 of file HitPairEDProducer.cc.

Referenced by produce().