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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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 ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 13 of file InterestingEcalDetIdProducer.h.

Constructor & Destructor Documentation

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

Definition at line 23 of file InterestingEcalDetIdProducer.cc.

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

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

Definition at line 31 of file InterestingEcalDetIdProducer.cc.

32 {}

Member Function Documentation

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

Definition at line 34 of file InterestingEcalDetIdProducer.cc.

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

35 {
36  edm::ESHandle<CaloTopology> theCaloTopology;
37  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
38  caloTopology_ = &(*theCaloTopology);
39 }
const T & get() const
Definition: EventSetup.h:55
void InterestingEcalDetIdProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 42 of file InterestingEcalDetIdProducer.cc.

References caloTopology_, DetId::Ecal, spr::find(), edm::Event::getByToken(), CaloTopology::getSubdetectorTopology(), CaloSubdetectorTopology::getWindow(), hcalTTPDigis_cfi::id, interestingDetIdCollectionProducer_cfi::interestingDetIdCollection, eostools::move(), metsig::muon, electronCleaner_cfi::muons, muonToken_, edm::Event::put(), and ecaldqm::topology().

44 {
46  iEvent.getByToken(muonToken_,muons);
47 
48  auto interestingDetIdCollection = std::make_unique<DetIdCollection>();
49 
50  for(reco::MuonCollection::const_iterator muon = muons->begin(); muon != muons->end(); ++muon){
51  if (! muon->isEnergyValid() ) continue;
52  if ( muon->calEnergy().ecal_id.rawId()==0 ) continue;
53  const CaloSubdetectorTopology* topology = caloTopology_->getSubdetectorTopology(DetId::Ecal,muon->calEnergy().ecal_id.subdetId());
54  const std::vector<DetId>& ids = topology->getWindow(muon->calEnergy().ecal_id, 5, 5);
55  for ( std::vector<DetId>::const_iterator id = ids.begin(); id != ids.end(); ++id )
57  == interestingDetIdCollection->end())
58  interestingDetIdCollection->push_back(*id);
59  }
61 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
CaloTopology const * topology(0)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
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:25
def move(src, dest)
Definition: eostools.py:510

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().