Skip to content

Commit

Permalink
Merge pull request #34058 from archiron/DQMOffline_EGamma_esConsumes_1
Browse files Browse the repository at this point in the history
DQMOffline EGamma esConsumes modifications
  • Loading branch information
cmsbuild committed Jun 9, 2021
2 parents 643b4c9 + 402b43d commit ddcf743
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
13 changes: 8 additions & 5 deletions DQMOffline/EGamma/plugins/PiZeroAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@

using namespace std;

PiZeroAnalyzer::PiZeroAnalyzer(const edm::ParameterSet& pset) {
PiZeroAnalyzer::PiZeroAnalyzer(const edm::ParameterSet& pset)
: caloGeometryToken_{esConsumes()}, caloTopologyToken_{esConsumes()} {
fName_ = pset.getUntrackedParameter<std::string>("Name");
prescaleFactor_ = pset.getUntrackedParameter<int>("prescaleFactor", 1);

Expand Down Expand Up @@ -113,11 +114,13 @@ void PiZeroAnalyzer::makePizero(const edm::EventSetup& es,
const edm::Handle<EcalRecHitCollection> rhEE) {
const EcalRecHitCollection* hitCollection_p = rhEB.product();

edm::ESHandle<CaloGeometry> geoHandle;
es.get<CaloGeometryRecord>().get(geoHandle);
//edm::ESHandle<CaloGeometry> geoHandle;
//es.get<CaloGeometryRecord>().get(geoHandle);
auto geoHandle = es.getHandle(caloGeometryToken_);

edm::ESHandle<CaloTopology> theCaloTopology;
es.get<CaloTopologyRecord>().get(theCaloTopology);
//edm::ESHandle<CaloTopology> theCaloTopology;
//es.get<CaloTopologyRecord>().get(theCaloTopology);
auto theCaloTopology = es.getHandle(caloTopologyToken_);

const CaloSubdetectorTopology* topology_p;
const CaloSubdetectorGeometry* geometry_p = geoHandle->getSubdetectorGeometry(DetId::Ecal, EcalBarrel);
Expand Down
4 changes: 4 additions & 0 deletions DQMOffline/EGamma/plugins/PiZeroAnalyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ class PiZeroAnalyzer : public DQMEDAnalyzer {

edm::EDGetTokenT<edm::SortedCollection<EcalRecHit, edm::StrictWeakOrdering<EcalRecHit> > > barrelEcalHits_token_;
edm::EDGetTokenT<edm::SortedCollection<EcalRecHit, edm::StrictWeakOrdering<EcalRecHit> > > endcapEcalHits_token_;

const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> caloGeometryToken_;
const edm::ESGetToken<CaloTopology, CaloTopologyRecord> caloTopologyToken_;

double minPhoEtCut_;

double cutStep_;
Expand Down

0 comments on commit ddcf743

Please sign in to comment.