CMS 3D CMS Logo

InterestingEcalDetIdProducer.cc
Go to the documentation of this file.
2 
8 
10 
13 
17 
21 
23  inputCollection_ = iConfig.getParameter<edm::InputTag>("inputCollection");
24  produces<DetIdCollection>();
25  muonToken_ = consumes<reco::MuonCollection>(inputCollection_);
26 }
27 
29 
31  edm::ESHandle<CaloTopology> theCaloTopology;
32  iSetup.get<CaloTopologyRecord>().get(theCaloTopology);
33  caloTopology_ = &(*theCaloTopology);
34 }
35 
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 }
PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
InterestingEcalDetIdProducer::InterestingEcalDetIdProducer
InterestingEcalDetIdProducer(const edm::ParameterSet &)
Definition: InterestingEcalDetIdProducer.cc:22
MessageLogger.h
ESHandle.h
muon
Definition: MuonCocktails.h:17
InterestingEcalDetIdProducer::beginRun
void beginRun(const edm::Run &, const edm::EventSetup &) override
Definition: InterestingEcalDetIdProducer.cc:30
edm::Run
Definition: Run.h:45
BasicCluster.h
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
EBDetId.h
EEDetId.h
CaloTopologyRecord
Definition: CaloTopologyRecord.h:10
HLT_2018_cff.muon
muon
Definition: HLT_2018_cff.py:10349
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 >
EcalRecHitCollections.h
InterestingEcalDetIdProducer::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: InterestingEcalDetIdProducer.cc:36
InterestingEcalDetIdProducer::caloTopology_
const CaloTopology * caloTopology_
Definition: InterestingEcalDetIdProducer.h:23
BasicClusterFwd.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
ecaldqm::topology
const CaloTopology * topology(nullptr)
edm::ESHandle< CaloTopology >
InterestingEcalDetIdProducer::~InterestingEcalDetIdProducer
~InterestingEcalDetIdProducer() override
Definition: InterestingEcalDetIdProducer.cc:28
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
InterestingEcalDetIdProducer::muonToken_
edm::EDGetTokenT< reco::MuonCollection > muonToken_
Definition: InterestingEcalDetIdProducer.h:22
CaloTopology::getSubdetectorTopology
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
Definition: CaloTopology.cc:17
CaloTopologyRecord.h
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:57
CaloSubdetectorTopology
Definition: CaloSubdetectorTopology.h:17
DetId::Ecal
Definition: DetId.h:27
get
#define get
CaloTopology.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
CaloSubdetectorTopology.h
eostools.move
def move(src, dest)
Definition: eostools.py:511
writedatasetfile.run
run
Definition: writedatasetfile.py:27
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
EventSetup.h
InterestingEcalDetIdProducer.h
ParameterSet.h
edm::Event
Definition: Event.h:73
interestingDetIdCollectionProducer_cfi.interestingDetIdCollection
interestingDetIdCollection
Definition: interestingDetIdCollectionProducer_cfi.py:11
edm::InputTag
Definition: InputTag.h:15
DetIdCollection.h
InterestingEcalDetIdProducer::inputCollection_
edm::InputTag inputCollection_
Definition: InterestingEcalDetIdProducer.h:21