CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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<>

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
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDGetTokenT
< IntermediateHitDoublets
doubletToken_
 
T_Generator generator_
 
edm::RunningAverage localRA_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

template<typename T_Generator>
class CAHitNtupletEDProducerT< T_Generator >

Definition at line 24 of file CAHitNtupletEDProducerT.cc.

Constructor & Destructor Documentation

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

Definition at line 42 of file CAHitNtupletEDProducerT.cc.

43  : doubletToken_(consumes<IntermediateHitDoublets>(iConfig.getParameter<edm::InputTag>("doublets"))),
44  generator_(iConfig, consumesCollector()) {
45  produces<RegionsSeedingHitSets>();
46 }
edm::EDGetTokenT< IntermediateHitDoublets > doubletToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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 49 of file CAHitNtupletEDProducerT.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, fillDescriptions(), HLT_FULL_cff::InputTag, label, and AlCaHLTBitMon_QueryRunRegistry::string.

49  {
51 
52  desc.add<edm::InputTag>("doublets", edm::InputTag("hitPairEDProducer"));
54 
55  auto label = T_Generator::fillDescriptionsLabel() + std::string("EDProducer");
56  descriptions.add(label, desc);
57 }
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_Generator >
void CAHitNtupletEDProducerT< T_Generator >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 60 of file CAHitNtupletEDProducerT.cc.

References Exception, edm::Event::getByToken(), LogDebug, eostools::move(), pixelTracksMonitoring_cff::ntuplet, SeedingLayerSetsHits::numberOfLayersInSet(), edm::Event::put(), HLT_FULL_cff::region, and HLT_FULL_cff::seedingHitSets.

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

Member Data Documentation

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

Definition at line 34 of file CAHitNtupletEDProducerT.cc.

template<typename T_Generator >
T_Generator CAHitNtupletEDProducerT< T_Generator >::generator_
private

Definition at line 38 of file CAHitNtupletEDProducerT.cc.

template<typename T_Generator >
edm::RunningAverage CAHitNtupletEDProducerT< T_Generator >::localRA_
private

Definition at line 36 of file CAHitNtupletEDProducerT.cc.