Skip to content

Commit

Permalink
migration to esConsumes in CalibTracker/SiPixelGainCalibration
Browse files Browse the repository at this point in the history
  • Loading branch information
ferencek committed Nov 24, 2020
1 parent b409f0b commit 74a1a86
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ SiPixelCalibDigiProducer::SiPixelCalibDigiProducer(const edm::ParameterSet& iCon
produces<edm::DetSetVector<SiPixelCalibDigi>>();
if (includeErrors_)
produces<edm::DetSetVector<SiPixelCalibDigiError>>();

calibToken_ = esConsumes<SiPixelCalibConfiguration, SiPixelCalibConfigurationRcd>();
trackerGeomToken_ = esConsumes<TrackerGeometry, TrackerDigiGeometryRecord>();
cablingMapToken_ = esConsumes<SiPixelFedCablingMap, SiPixelFedCablingMapRcd>();
}

SiPixelCalibDigiProducer::~SiPixelCalibDigiProducer() {
Expand Down Expand Up @@ -249,9 +253,9 @@ void SiPixelCalibDigiProducer::setPattern() {
void SiPixelCalibDigiProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
// edm::LogInfo("SiPixelCalibDigiProducer") <<"in produce() " << std::endl;
using namespace edm;
iSetup.get<SiPixelCalibConfigurationRcd>().get(calib_);
iSetup.get<TrackerDigiGeometryRecord>().get(theGeometry_);
iSetup.get<SiPixelFedCablingMapRcd>().get(theCablingMap_);
calib_ = iSetup.getHandle(calibToken_);
theGeometry_ = iSetup.getHandle(trackerGeomToken_);
theCablingMap_ = iSetup.getHandle(cablingMapToken_);
pattern_repeat_ = calib_->getNTriggers() * calib_->nVCal();
if (use_realeventnumber_) {
iEventCounter_ = iEvent.id().event() - 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "FWCore/Framework/interface/EDProducer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/Framework/interface/ESHandle.h"

#include "FWCore/ServiceRegistry/interface/Service.h"

Expand Down Expand Up @@ -87,6 +86,10 @@ class SiPixelCalibDigiProducer : public edm::EDProducer {
edm::ESHandle<TrackerGeometry> theGeometry_; // the tracker geometry
edm::ESHandle<SiPixelFedCablingMap> theCablingMap_;

edm::ESGetToken<SiPixelCalibConfiguration, SiPixelCalibConfigurationRcd> calibToken_;
edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> trackerGeomToken_;
edm::ESGetToken<SiPixelFedCablingMap, SiPixelFedCablingMapRcd> cablingMapToken_;

// worker variables
std::map<pixelstruct, SiPixelCalibDigi>
intermediate_data_; // data container, copied over into the event every pattern_repeat_ events
Expand Down

0 comments on commit 74a1a86

Please sign in to comment.