CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
CAHitNtupletEDProducerT< T_Generator > Class Template Reference
Inheritance diagram for CAHitNtupletEDProducerT< T_Generator >:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CAHitNtupletEDProducerT (const edm::ParameterSet &iConfig)
 
virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 ~CAHitNtupletEDProducerT ()=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< IntermediateHitDoubletsdoubletToken_
 
T_Generator generator_
 
edm::RunningAverage localRA_
 

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_Generator>
class CAHitNtupletEDProducerT< T_Generator >

Definition at line 26 of file CAHitNtupletEDProducerT.cc.

Constructor & Destructor Documentation

template<typename T_Generator >
CAHitNtupletEDProducerT< T_Generator >::CAHitNtupletEDProducerT ( const edm::ParameterSet iConfig)

Definition at line 44 of file CAHitNtupletEDProducerT.cc.

44  :
45  doubletToken_(consumes<IntermediateHitDoublets>(iConfig.getParameter<edm::InputTag>("doublets"))),
46  generator_(iConfig, consumesCollector(), false)
47 {
48  produces<RegionsSeedingHitSets>();
49 }
T getParameter(std::string const &) const
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< IntermediateHitDoublets > doubletToken_
template<typename T_Generator >
CAHitNtupletEDProducerT< T_Generator >::~CAHitNtupletEDProducerT ( )
default

Member Function Documentation

template<typename T_Generator >
void CAHitNtupletEDProducerT< T_Generator >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 52 of file CAHitNtupletEDProducerT.cc.

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

52  {
54 
55  desc.add<edm::InputTag>("doublets", edm::InputTag("hitPairEDProducer"));
56  T_Generator::fillDescriptions(desc);
57 
58  auto label = T_Generator::fillDescriptionsLabel() + std::string("EDProducer");
59  descriptions.add(label, desc);
60 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
template<typename T_Generator >
void CAHitNtupletEDProducerT< T_Generator >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Definition at line 63 of file CAHitNtupletEDProducerT.cc.

References CAHitNtupletEDProducerT< T_Generator >::doubletToken_, Exception, CAHitNtupletEDProducerT< T_Generator >::generator_, edm::Event::getByToken(), diffTreeTool::index, CAHitNtupletEDProducerT< T_Generator >::localRA_, LogDebug, dt1dClusters_cfi::minLayers, eostools::move(), SeedingLayerSetsHits::numberOfLayersInSet(), edm::Event::put(), HiRegitMuonDetachedTripletStep_cff::seedingHitSets, edm::RunningAverage::update(), and edm::RunningAverage::upper().

63  {
65  iEvent.getByToken(doubletToken_, hdoublets);
66  const auto& regionDoublets = *hdoublets;
67 
68  const SeedingLayerSetsHits& seedingLayerHits = regionDoublets.seedingLayerHits();
69  if(seedingLayerHits.numberOfLayersInSet() < T_Generator::minLayers) {
70  throw cms::Exception("LogicError") << "CAHitNtupletEDProducer expects SeedingLayerSetsHits::numberOfLayersInSet() to be >= " << T_Generator::minLayers << ", got " << seedingLayerHits.numberOfLayersInSet() << ". This is likely caused by a configuration error of this module, HitPairEDProducer, or SeedingLayersEDProducer.";
71  }
72 
73  auto seedingHitSets = std::make_unique<RegionsSeedingHitSets>();
74  if(regionDoublets.empty()) {
75  iEvent.put(std::move(seedingHitSets));
76  return;
77  }
78  seedingHitSets->reserve(regionDoublets.regionSize(), localRA_.upper());
79  generator_.initEvent(iEvent, iSetup);
80 
81  LogDebug("CAHitNtupletEDProducer") << "Creating ntuplets for " << regionDoublets.regionSize() << " regions, and " << regionDoublets.layerPairsSize() << " layer pairs";
82  std::vector<typename T_Generator::ResultType> ntuplets;
83  ntuplets.resize(regionDoublets.regionSize());
84  for(auto& ntuplet : ntuplets) ntuplet.reserve(localRA_.upper());
85 
86  generator_.hitNtuplets(regionDoublets, ntuplets, iSetup, seedingLayerHits);
87  int index = 0;
88  for(const auto& regionLayerPairs: regionDoublets) {
89  const TrackingRegion& region = regionLayerPairs.region();
90  auto seedingHitSetsFiller = seedingHitSets->beginRegion(&region);
91 
92  fillNtuplets(seedingHitSetsFiller, ntuplets[index]);
93  ntuplets[index].clear();
94  index++;
95  }
97 
98  iEvent.put(std::move(seedingHitSets));
99 }
#define LogDebug(id)
unsigned short numberOfLayersInSet() const
Get number of layers in each SeedingLayerSets.
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
int upper() const
edm::EDGetTokenT< IntermediateHitDoublets > doubletToken_
def move(src, dest)
Definition: eostools.py:510
void update(unsigned int q)

Member Data Documentation

template<typename T_Generator >
edm::EDGetTokenT<IntermediateHitDoublets> CAHitNtupletEDProducerT< T_Generator >::doubletToken_
private
template<typename T_Generator >
T_Generator CAHitNtupletEDProducerT< T_Generator >::generator_
private
template<typename T_Generator >
edm::RunningAverage CAHitNtupletEDProducerT< T_Generator >::localRA_
private