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)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 ~CAHitNtupletEDProducerT () override=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 25 of file CAHitNtupletEDProducerT.cc.

Constructor & Destructor Documentation

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

Definition at line 43 of file CAHitNtupletEDProducerT.cc.

43  :
44  doubletToken_(consumes<IntermediateHitDoublets>(iConfig.getParameter<edm::InputTag>("doublets"))),
45  generator_(iConfig, consumesCollector())
46 {
47  produces<RegionsSeedingHitSets>();
48 }
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 ( )
overridedefault

Member Function Documentation

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

Definition at line 51 of file CAHitNtupletEDProducerT.cc.

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

51  {
53 
54  desc.add<edm::InputTag>("doublets", edm::InputTag("hitPairEDProducer"));
55  T_Generator::fillDescriptions(desc);
56 
57  auto label = T_Generator::fillDescriptionsLabel() + std::string("EDProducer");
58  descriptions.add(label, desc);
59 }
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 
)
override

Definition at line 62 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().

62  {
64  iEvent.getByToken(doubletToken_, hdoublets);
65  const auto& regionDoublets = *hdoublets;
66 
67  const SeedingLayerSetsHits& seedingLayerHits = regionDoublets.seedingLayerHits();
68  if(seedingLayerHits.numberOfLayersInSet() < T_Generator::minLayers) {
69  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.";
70  }
71 
72  auto seedingHitSets = std::make_unique<RegionsSeedingHitSets>();
73  if(regionDoublets.empty()) {
74  iEvent.put(std::move(seedingHitSets));
75  return;
76  }
77  seedingHitSets->reserve(regionDoublets.regionSize(), localRA_.upper());
78  generator_.initEvent(iEvent, iSetup);
79 
80  LogDebug("CAHitNtupletEDProducer") << "Creating ntuplets for " << regionDoublets.regionSize() << " regions, and " << regionDoublets.layerPairsSize() << " layer pairs";
81  std::vector<OrderedHitSeeds> ntuplets;
82  ntuplets.resize(regionDoublets.regionSize());
83  for(auto& ntuplet : ntuplets) ntuplet.reserve(localRA_.upper());
84 
85  generator_.hitNtuplets(regionDoublets, ntuplets, iSetup, seedingLayerHits);
86  int index = 0;
87  for(const auto& regionLayerPairs: regionDoublets) {
88  const TrackingRegion& region = regionLayerPairs.region();
89  auto seedingHitSetsFiller = seedingHitSets->beginRegion(&region);
90 
91  fillNtuplets(seedingHitSetsFiller, ntuplets[index]);
92  ntuplets[index].clear();
93  index++;
94  }
96 
97  iEvent.put(std::move(seedingHitSets));
98 }
#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