CMS 3D CMS Logo

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

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

◆ HGC3DClusterGenMatchSelector()

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 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetTokenT< l1t::HGCalMulticlusterBxCollection > src_

◆ ~HGC3DClusterGenMatchSelector()

l1t::HGC3DClusterGenMatchSelector::~HGC3DClusterGenMatchSelector ( )
inlineoverride

Definition at line 15 of file HGC3DClusterGenMatchSelector.cc.

15 {}

Member Function Documentation

◆ produce()

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

Definition at line 33 of file HGC3DClusterGenMatchSelector.cc.

References nano_mu_digi_cff::bx, eleIsoSequence_cff::deltaR, AJJGenJetFilter_cfi::genParticles, iEvent, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, eostools::move(), and MillePedeFileConverter_cfg::out.

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 }
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< l1t::HGCalMulticlusterBxCollection > src_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ dR_

double l1t::HGC3DClusterGenMatchSelector::dR_
private

Definition at line 20 of file HGC3DClusterGenMatchSelector.cc.

◆ genParticleSrc_

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

Definition at line 19 of file HGC3DClusterGenMatchSelector.cc.

◆ src_

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

Definition at line 18 of file HGC3DClusterGenMatchSelector.cc.