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<>

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< IntermediateHitDoubletsdoubletToken_
 
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 27 of file CAHitNtupletEDProducerT.cc.

Constructor & Destructor Documentation

◆ CAHitNtupletEDProducerT()

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

Definition at line 45 of file CAHitNtupletEDProducerT.cc.

46  : doubletToken_(consumes<IntermediateHitDoublets>(iConfig.getParameter<edm::InputTag>("doublets"))),
47  generator_(iConfig, consumesCollector()) {
48  produces<RegionsSeedingHitSets>();
49 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< IntermediateHitDoublets > doubletToken_

◆ ~CAHitNtupletEDProducerT()

template<typename T_Generator >
CAHitNtupletEDProducerT< T_Generator >::~CAHitNtupletEDProducerT ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

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(), submitPVResolutionJobs::desc, fillDescriptions(), HLT_2022v15_cff::InputTag, label, and AlCaHLTBitMon_QueryRunRegistry::string.

52  {
54 
55  desc.add<edm::InputTag>("doublets", edm::InputTag("hitPairEDProducer"));
57 
58  auto label = T_Generator::fillDescriptionsLabel() + std::string("EDProducer");
59  descriptions.add(label, desc);
60 }
char const * label
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

template<typename T_Generator >
void CAHitNtupletEDProducerT< T_Generator >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 63 of file CAHitNtupletEDProducerT.cc.

References Exception, iEvent, LogDebug, beam_dqm_sourceclient-live_cfg::minLayers, eostools::move(), pixelTracksMonitoring_cff::ntuplet, SeedingLayerSetsHits::numberOfLayersInSet(), HLT_2022v15_cff::region, and HLT_2022v15_cff::seedingHitSets.

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")
71  << "CAHitNtupletEDProducer expects SeedingLayerSetsHits::numberOfLayersInSet() to be >= "
72  << T_Generator::minLayers << ", got " << seedingLayerHits.numberOfLayersInSet()
73  << ". This is likely caused by a configuration error of this module, HitPairEDProducer, or "
74  "SeedingLayersEDProducer.";
75  }
76 
77  auto seedingHitSets = std::make_unique<RegionsSeedingHitSets>();
78  if (regionDoublets.empty()) {
80  return;
81  }
82  seedingHitSets->reserve(regionDoublets.regionSize(), localRA_.upper());
83  generator_.initEvent(iEvent, iSetup);
84 
85  LogDebug("CAHitNtupletEDProducer") << "Creating ntuplets for " << regionDoublets.regionSize() << " regions, and "
86  << regionDoublets.layerPairsSize() << " layer pairs";
87  std::vector<OrderedHitSeeds> ntuplets;
88  ntuplets.resize(regionDoublets.regionSize());
89  for (auto& ntuplet : ntuplets)
90  ntuplet.reserve(localRA_.upper());
91 
92  generator_.hitNtuplets(regionDoublets, ntuplets, seedingLayerHits);
93  int index = 0;
94  for (const auto& regionLayerPairs : regionDoublets) {
95  const TrackingRegion& region = regionLayerPairs.region();
96  auto seedingHitSetsFiller = seedingHitSets->beginRegion(&region);
97 
98  fillNtuplets(seedingHitSetsFiller, ntuplets[index]);
99  ntuplets[index].clear();
100  index++;
101  }
102  localRA_.update(seedingHitSets->size());
103 
105 }
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< IntermediateHitDoublets > doubletToken_
unsigned short numberOfLayersInSet() const
Get number of layers in each SeedingLayerSets.
def move(src, dest)
Definition: eostools.py:511
void update(unsigned int q)
#define LogDebug(id)

Member Data Documentation

◆ doubletToken_

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

Definition at line 37 of file CAHitNtupletEDProducerT.cc.

◆ generator_

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

Definition at line 41 of file CAHitNtupletEDProducerT.cc.

◆ localRA_

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

Definition at line 39 of file CAHitNtupletEDProducerT.cc.