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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

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

Detailed Description

template<typename T_Generator>
class CAHitNtupletEDProducerT< T_Generator >

Definition at line 24 of file CAHitNtupletEDProducerT.cc.

Constructor & Destructor Documentation

◆ CAHitNtupletEDProducerT()

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 }

◆ ~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 49 of file CAHitNtupletEDProducerT.cc.

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 }

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

◆ produce()

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.

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()) {
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, iSetup, 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 
102 }

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

Member Data Documentation

◆ doubletToken_

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

Definition at line 34 of file CAHitNtupletEDProducerT.cc.

◆ generator_

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

Definition at line 38 of file CAHitNtupletEDProducerT.cc.

◆ localRA_

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

Definition at line 36 of file CAHitNtupletEDProducerT.cc.

edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
beam_dqm_sourceclient-live_cfg.minLayers
minLayers
Definition: beam_dqm_sourceclient-live_cfg.py:141
HLT_2018_cff.seedingHitSets
seedingHitSets
Definition: HLT_2018_cff.py:8785
CAHitNtupletEDProducerT::generator_
T_Generator generator_
Definition: CAHitNtupletEDProducerT.cc:38
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
SeedingLayerSetsHits
Definition: SeedingLayerSetsHits.h:18
edm::Handle
Definition: AssociativeIterator.h:50
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::RunningAverage::update
void update(unsigned int q)
Definition: RunningAverage.h:35
SeedingLayerSetsHits::numberOfLayersInSet
unsigned short numberOfLayersInSet() const
Get number of layers in each SeedingLayerSets.
Definition: SeedingLayerSetsHits.h:197
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
CAHitNtupletEDProducerT::doubletToken_
edm::EDGetTokenT< IntermediateHitDoublets > doubletToken_
Definition: CAHitNtupletEDProducerT.cc:34
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::RunningAverage::upper
int upper() const
Definition: RunningAverage.h:30
Exception
Definition: hltDiff.cc:246
HLT_2018_cff.region
region
Definition: HLT_2018_cff.py:81479
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
TrackingRegion
Definition: TrackingRegion.h:40
CAHitNtupletEDProducerT::localRA_
edm::RunningAverage localRA_
Definition: CAHitNtupletEDProducerT.cc:36
edm::InputTag
Definition: InputTag.h:15
label
const char * label
Definition: PFTauDecayModeTools.cc:11