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 | Private Member Functions | Private Attributes
l1t::HGC3DClusterGenMatchSelector Class Reference
Inheritance diagram for l1t::HGC3DClusterGenMatchSelector:
edm::stream::EDProducer<>

Public Member Functions

 HGC3DClusterGenMatchSelector (const edm::ParameterSet &)
 
 ~HGC3DClusterGenMatchSelector () override
 
- 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
 

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

double dR_
 
edm::EDGetToken genParticleSrc_
 
edm::EDGetTokenT
< l1t::HGCalMulticlusterBxCollection
src_
 

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

Definition at line 12 of file HGC3DClusterGenMatchSelector.cc.

Constructor & Destructor Documentation

l1t::HGC3DClusterGenMatchSelector::HGC3DClusterGenMatchSelector ( const edm::ParameterSet iConfig)
explicit

Definition at line 26 of file HGC3DClusterGenMatchSelector.cc.

27  : src_(consumes<l1t::HGCalMulticlusterBxCollection>(iConfig.getParameter<edm::InputTag>("src"))),
28  genParticleSrc_(consumes<reco::GenParticleCollection>(iConfig.getParameter<edm::InputTag>("genSrc"))),
29  dR_(iConfig.getParameter<double>("dR")) {
30  produces<l1t::HGCalMulticlusterBxCollection>();
31 }
edm::EDGetTokenT< l1t::HGCalMulticlusterBxCollection > src_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
l1t::HGC3DClusterGenMatchSelector::~HGC3DClusterGenMatchSelector ( )
inlineoverride

Definition at line 15 of file HGC3DClusterGenMatchSelector.cc.

15 {}

Member Function Documentation

void l1t::HGC3DClusterGenMatchSelector::produce ( edm::Event iEvent,
const edm::EventSetup  
)
overrideprivate

Definition at line 33 of file HGC3DClusterGenMatchSelector.cc.

References makePileupJSON::bx, HLT_FULL_cff::deltaR, genParticleCandidates2GenParticles_cfi::genParticles, edm::Event::getByToken(), eostools::move(), submitPVResolutionJobs::out, and edm::Event::put().

33  {
34  auto out = std::make_unique<l1t::HGCalMulticlusterBxCollection>();
35 
37  iEvent.getByToken(src_, multiclusters);
38 
40  iEvent.getByToken(genParticleSrc_, genParticles);
41 
42  for (int bx = multiclusters->getFirstBX(); bx <= multiclusters->getLastBX(); ++bx) {
43  for (auto it = multiclusters->begin(bx), ed = multiclusters->end(bx); it != ed; ++it) {
44  const auto &multicluster = *it;
45  for (const auto &particle : *genParticles) {
46  if (particle.status() != 1)
47  continue;
48  if (deltaR(multicluster, particle) < dR_) {
49  out->push_back(bx, multicluster);
50  break; // don't save duplicate multiclusters!
51  }
52  }
53  }
54  }
55 
56  iEvent.put(std::move(out));
57 }
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
def move
Definition: eostools.py:511
edm::EDGetTokenT< l1t::HGCalMulticlusterBxCollection > src_

Member Data Documentation

double l1t::HGC3DClusterGenMatchSelector::dR_
private

Definition at line 20 of file HGC3DClusterGenMatchSelector.cc.

edm::EDGetToken l1t::HGC3DClusterGenMatchSelector::genParticleSrc_
private

Definition at line 19 of file HGC3DClusterGenMatchSelector.cc.

edm::EDGetTokenT<l1t::HGCalMulticlusterBxCollection> l1t::HGC3DClusterGenMatchSelector::src_
private

Definition at line 18 of file HGC3DClusterGenMatchSelector.cc.