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

Private Attributes

const CaloTopologycaloTopology_
 
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 13 of file InterestingEcalDetIdProducer.h.

Constructor & Destructor Documentation

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

Definition at line 22 of file InterestingEcalDetIdProducer.cc.

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

22  {
23  inputCollection_ = iConfig.getParameter<edm::InputTag>("inputCollection");
24  produces<DetIdCollection>();
25  muonToken_ = consumes<reco::MuonCollection>(inputCollection_);
26 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::MuonCollection > muonToken_
InterestingEcalDetIdProducer::~InterestingEcalDetIdProducer ( )
override

Definition at line 28 of file InterestingEcalDetIdProducer.cc.

28 {}

Member Function Documentation

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

Definition at line 30 of file InterestingEcalDetIdProducer.cc.

References caloTopology_, and edm::EventSetup::get().

30  {
31  edm::ESHandle<CaloTopology> theCaloTopology;
32  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
33  caloTopology_ = &(*theCaloTopology);
34 }
T get() const
Definition: EventSetup.h:73
void InterestingEcalDetIdProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 36 of file InterestingEcalDetIdProducer.cc.

References caloTopology_, DetId::Ecal, spr::find(), edm::Event::getByToken(), CaloTopology::getSubdetectorTopology(), CaloSubdetectorTopology::getWindow(), triggerObjects_cff::id, photons_cff::ids, interestingDetIdCollectionProducer_cfi::interestingDetIdCollection, eostools::move(), HLT_2018_cff::muon, PDWG_BPHSkim_cff::muons, muonToken_, edm::Event::put(), and ecaldqm::topology().

36  {
38  iEvent.getByToken(muonToken_, muons);
39 
40  auto interestingDetIdCollection = std::make_unique<DetIdCollection>();
41 
42  for (reco::MuonCollection::const_iterator muon = muons->begin(); muon != muons->end(); ++muon) {
43  if (!muon->isEnergyValid())
44  continue;
45  if (muon->calEnergy().ecal_id.rawId() == 0)
46  continue;
48  caloTopology_->getSubdetectorTopology(DetId::Ecal, muon->calEnergy().ecal_id.subdetId());
49  const std::vector<DetId>& ids = topology->getWindow(muon->calEnergy().ecal_id, 5, 5);
50  for (std::vector<DetId>::const_iterator id = ids.begin(); id != ids.end(); ++id)
53  interestingDetIdCollection->push_back(*id);
54  }
56 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
CaloTopology const * topology(0)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
edm::EDGetTokenT< reco::MuonCollection > muonToken_
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:17
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

const CaloTopology* InterestingEcalDetIdProducer::caloTopology_
private

Definition at line 23 of file InterestingEcalDetIdProducer.h.

Referenced by beginRun(), and produce().

edm::InputTag InterestingEcalDetIdProducer::inputCollection_
private

Definition at line 21 of file InterestingEcalDetIdProducer.h.

Referenced by InterestingEcalDetIdProducer().

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

Definition at line 22 of file InterestingEcalDetIdProducer.h.

Referenced by InterestingEcalDetIdProducer(), and produce().