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
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

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

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 }
T getParameter(std::string const &) const
edm::EDGetTokenT< l1t::HGCalMulticlusterBxCollection > src_
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 DEFINE_FWK_MODULE, boostedElectronIsolation_cff::deltaR, dR_, GenHFHadronMatcher_cfi::genParticles, genParticleSrc_, edm::Event::getByToken(), eostools::move(), MillePedeFileConverter_cfg::out, edm::Event::put(), and src_.

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:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
edm::EDGetTokenT< l1t::HGCalMulticlusterBxCollection > src_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

double l1t::HGC3DClusterGenMatchSelector::dR_
private

Definition at line 20 of file HGC3DClusterGenMatchSelector.cc.

Referenced by produce().

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

Definition at line 19 of file HGC3DClusterGenMatchSelector.cc.

Referenced by produce().

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

Definition at line 18 of file HGC3DClusterGenMatchSelector.cc.

Referenced by produce().