Skip to content

Commit

Permalink
Merge pull request #34305 from bsunanda/Run3-ft33
Browse files Browse the repository at this point in the history
Run3-ft33 Use of ESGetToken in analyzer code of HFNose
  • Loading branch information
cmsbuild authored Jul 7, 2021
2 parents a50a483 + 9e19906 commit d6c8a11
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// user include files
#include "FWCore/Framework/interface/ModuleFactory.h"
#include "FWCore/Framework/interface/ESProducer.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "Geometry/Records/interface/CastorGeometryRecord.h"
#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
#include "Geometry/ForwardGeometry/interface/CastorHardcodeGeometryLoader.h"
Expand Down
1 change: 0 additions & 1 deletion Geometry/ForwardGeometry/plugins/ZdcHardcodeGeometryEP.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
// user include files
#include "FWCore/Framework/interface/ModuleFactory.h"
#include "FWCore/Framework/interface/ESProducer.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "Geometry/Records/interface/ZDCGeometryRecord.h"
#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
#include "Geometry/ForwardGeometry/interface/ZdcHardcodeGeometryLoader.h"
Expand Down
13 changes: 5 additions & 8 deletions Geometry/ForwardGeometry/test/HFNoseGeometryTester.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/ESTransientHandle.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/MakerMacros.h"

#include "Geometry/Records/interface/IdealGeometryRecord.h"
Expand All @@ -31,18 +30,16 @@ class HFNoseGeometryTester : public edm::one::EDAnalyzer<> {
void doTestWafer(const HGCalGeometry* geom);

const std::string name_;
const edm::ESGetToken<HGCalGeometry, IdealGeometryRecord> tokGeom_;
};

HFNoseGeometryTester::HFNoseGeometryTester(const edm::ParameterSet& iC)
: name_(iC.getParameter<std::string>("Detector")) {}
: name_(iC.getParameter<std::string>("Detector")),
tokGeom_(esConsumes<HGCalGeometry, IdealGeometryRecord>(edm::ESInputTag{"", name_})) {}

void HFNoseGeometryTester::analyze(const edm::Event&, const edm::EventSetup& iSetup) {
edm::ESHandle<HGCalGeometry> geomH;
iSetup.get<IdealGeometryRecord>().get(name_, geomH);
const HGCalGeometry* geom = (geomH.product());
if (!geomH.isValid()) {
std::cout << "Cannot get valid HGCalGeometry Object for " << name_ << std::endl;
} else if (geom->topology().isHFNose()) {
const HGCalGeometry* geom = &iSetup.getData(tokGeom_);
if (geom->topology().isHFNose()) {
doTestWafer(geom);
} else {
std::cout << name_ << " is not a valid name for HFNose Detecor" << std::endl;
Expand Down

0 comments on commit d6c8a11

Please sign in to comment.