Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run3-ft33 Use of ESGetToken in analyzer code of HFNose #34305

Merged
merged 2 commits into from Jul 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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
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