CMS 3D CMS Logo

InterestingEcalDetIdProducer.cc
Go to the documentation of this file.
2 
8 
10 
13 
17 
19 
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 }
26 
28 
30  edm::ESHandle<CaloTopology> theCaloTopology = iSetup.getHandle(caloTopoToken_);
31  caloTopology_ = &(*theCaloTopology);
32 }
33 
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 }
PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
InterestingEcalDetIdProducer::InterestingEcalDetIdProducer
InterestingEcalDetIdProducer(const edm::ParameterSet &)
Definition: InterestingEcalDetIdProducer.cc:20
MessageLogger.h
ESHandle.h
InterestingEcalDetIdProducer::caloTopoToken_
edm::ESGetToken< CaloTopology, CaloTopologyRecord > caloTopoToken_
Definition: InterestingEcalDetIdProducer.h:26
muon
Definition: MuonCocktails.h:17
InterestingEcalDetIdProducer::beginRun
void beginRun(const edm::Run &, const edm::EventSetup &) override
Definition: InterestingEcalDetIdProducer.cc:29
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
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:34
InterestingEcalDetIdProducer::caloTopology_
const CaloTopology * caloTopology_
Definition: InterestingEcalDetIdProducer.h:27
BasicClusterFwd.h
ecaldqm::topology
const CaloTopology * topology(nullptr)
HLT_FULL_cff.muon
muon
Definition: HLT_FULL_cff.py:11710
edm::ESHandle< CaloTopology >
InterestingEcalDetIdProducer::~InterestingEcalDetIdProducer
~InterestingEcalDetIdProducer() override
Definition: InterestingEcalDetIdProducer.cc:27
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
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
edm::EventSetup
Definition: EventSetup.h:57
CaloSubdetectorTopology
Definition: CaloSubdetectorTopology.h:17
DetId::Ecal
Definition: DetId.h:27
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
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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:24