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

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

◆ ~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.

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 }

References BXVector< T >::begin(), l1GtPatternGenerator_cfi::bx, PbPb_ZMuSkimMuonDPG_cff::deltaR, BXVector< T >::end(), genParticles2HepMC_cfi::genParticles, BXVector< T >::getFirstBX(), BXVector< T >::getLastBX(), iEvent, eostools::move(), and MillePedeFileConverter_cfg::out.

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.

genParticles2HepMC_cfi.genParticles
genParticles
Definition: genParticles2HepMC_cfi.py:4
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
edm::Handle
Definition: AssociativeIterator.h:50
BXVector::getFirstBX
int getFirstBX() const
l1t::HGC3DClusterGenMatchSelector::genParticleSrc_
edm::EDGetToken genParticleSrc_
Definition: HGC3DClusterGenMatchSelector.cc:19
BXVector::begin
const_iterator begin(int bx) const
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
BXVector::end
const_iterator end(int bx) const
l1t::HGC3DClusterGenMatchSelector::src_
edm::EDGetTokenT< l1t::HGCalMulticlusterBxCollection > src_
Definition: HGC3DClusterGenMatchSelector.cc:18
iEvent
int iEvent
Definition: GenABIO.cc:224
eostools.move
def move(src, dest)
Definition: eostools.py:511
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
BXVector::getLastBX
int getLastBX() const
l1t::HGC3DClusterGenMatchSelector::dR_
double dR_
Definition: HGC3DClusterGenMatchSelector.cc:20
edm::InputTag
Definition: InputTag.h:15