CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
InterestingEcalDetIdProducer Class Reference

#include <InterestingEcalDetIdProducer.h>

Inheritance diagram for InterestingEcalDetIdProducer:
edm::stream::EDProducer<>

Public Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
 InterestingEcalDetIdProducer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~InterestingEcalDetIdProducer () 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 Attributes

const CaloTopologycaloTopology_
 
edm::ESGetToken< CaloTopology, CaloTopologyRecordcaloTopoToken_
 
edm::InputTag inputCollection_
 
edm::EDGetTokenT< reco::MuonCollectionmuonToken_
 

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 16 of file InterestingEcalDetIdProducer.h.

Constructor & Destructor Documentation

◆ InterestingEcalDetIdProducer()

InterestingEcalDetIdProducer::InterestingEcalDetIdProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 20 of file InterestingEcalDetIdProducer.cc.

20  {
21  inputCollection_ = iConfig.getParameter<edm::InputTag>("inputCollection");
22  produces<DetIdCollection>();
23  muonToken_ = consumes<reco::MuonCollection>(inputCollection_);
24  caloTopoToken_ = esConsumes<CaloTopology, CaloTopologyRecord, edm::Transition::BeginRun>();
25 }

References caloTopoToken_, edm::ParameterSet::getParameter(), inputCollection_, and muonToken_.

◆ ~InterestingEcalDetIdProducer()

InterestingEcalDetIdProducer::~InterestingEcalDetIdProducer ( )
override

Definition at line 27 of file InterestingEcalDetIdProducer.cc.

27 {}

Member Function Documentation

◆ beginRun()

void InterestingEcalDetIdProducer::beginRun ( const edm::Run run,
const edm::EventSetup iSetup 
)
override

Definition at line 29 of file InterestingEcalDetIdProducer.cc.

29  {
30  edm::ESHandle<CaloTopology> theCaloTopology = iSetup.getHandle(caloTopoToken_);
31  caloTopology_ = &(*theCaloTopology);
32 }

References caloTopology_, caloTopoToken_, and edm::EventSetup::getHandle().

◆ produce()

void InterestingEcalDetIdProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 34 of file InterestingEcalDetIdProducer.cc.

34  {
36  iEvent.getByToken(muonToken_, muons);
37 
38  auto interestingDetIdCollection = std::make_unique<DetIdCollection>();
39 
40  for (reco::MuonCollection::const_iterator muon = muons->begin(); muon != muons->end(); ++muon) {
41  if (!muon->isEnergyValid())
42  continue;
43  if (muon->calEnergy().ecal_id.rawId() == 0)
44  continue;
46  caloTopology_->getSubdetectorTopology(DetId::Ecal, muon->calEnergy().ecal_id.subdetId());
47  const std::vector<DetId>& ids = topology->getWindow(muon->calEnergy().ecal_id, 5, 5);
48  for (std::vector<DetId>::const_iterator id = ids.begin(); id != ids.end(); ++id)
51  interestingDetIdCollection->push_back(*id);
52  }
54 }

References caloTopology_, DetId::Ecal, spr::find(), CaloTopology::getSubdetectorTopology(), CaloTopology::getWindow(), triggerObjects_cff::id, iEvent, interestingDetIdCollectionProducer_cfi::interestingDetIdCollection, eostools::move(), HLT_FULL_cff::muon, PDWG_BPHSkim_cff::muons, muonToken_, and ecaldqm::topology().

Member Data Documentation

◆ caloTopology_

const CaloTopology* InterestingEcalDetIdProducer::caloTopology_
private

Definition at line 27 of file InterestingEcalDetIdProducer.h.

Referenced by beginRun(), and produce().

◆ caloTopoToken_

edm::ESGetToken<CaloTopology, CaloTopologyRecord> InterestingEcalDetIdProducer::caloTopoToken_
private

Definition at line 26 of file InterestingEcalDetIdProducer.h.

Referenced by beginRun(), and InterestingEcalDetIdProducer().

◆ inputCollection_

edm::InputTag InterestingEcalDetIdProducer::inputCollection_
private

Definition at line 24 of file InterestingEcalDetIdProducer.h.

Referenced by InterestingEcalDetIdProducer().

◆ muonToken_

edm::EDGetTokenT<reco::MuonCollection> InterestingEcalDetIdProducer::muonToken_
private

Definition at line 25 of file InterestingEcalDetIdProducer.h.

Referenced by InterestingEcalDetIdProducer(), and produce().

PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
InterestingEcalDetIdProducer::caloTopoToken_
edm::ESGetToken< CaloTopology, CaloTopologyRecord > caloTopoToken_
Definition: InterestingEcalDetIdProducer.h:26
muon
Definition: MuonCocktails.h:17
CaloTopology::getWindow
std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
Get the neighbors of the given cell in a window of given size.
Definition: CaloTopology.cc:64
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
edm::Handle< reco::MuonCollection >
InterestingEcalDetIdProducer::caloTopology_
const CaloTopology * caloTopology_
Definition: InterestingEcalDetIdProducer.h:27
ecaldqm::topology
const CaloTopology * topology(nullptr)
HLT_FULL_cff.muon
muon
Definition: HLT_FULL_cff.py:11710
edm::ESHandle< CaloTopology >
InterestingEcalDetIdProducer::muonToken_
edm::EDGetTokenT< reco::MuonCollection > muonToken_
Definition: InterestingEcalDetIdProducer.h:25
CaloTopology::getSubdetectorTopology
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:17
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:148
CaloSubdetectorTopology
Definition: CaloSubdetectorTopology.h:17
DetId::Ecal
Definition: DetId.h:27
eostools.move
def move(src, dest)
Definition: eostools.py:511
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
interestingDetIdCollectionProducer_cfi.interestingDetIdCollection
interestingDetIdCollection
Definition: interestingDetIdCollectionProducer_cfi.py:11
edm::InputTag
Definition: InputTag.h:15
InterestingEcalDetIdProducer::inputCollection_
edm::InputTag inputCollection_
Definition: InterestingEcalDetIdProducer.h:24