Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:59:33

0001 #include "CalibTracker/SiPixelESProducers/interface/SiPixelGainCalibrationForHLTGPU.h"
0002 #include "CalibTracker/Records/interface/SiPixelGainCalibrationForHLTGPURcd.h"
0003 #include "CondFormats/SiPixelObjects/interface/SiPixelGainCalibrationForHLT.h"
0004 #include "CondFormats/DataRecord/interface/SiPixelGainCalibrationForHLTRcd.h"
0005 #include "FWCore/Framework/interface/ESProducer.h"
0006 #include "FWCore/Framework/interface/EventSetup.h"
0007 #include "FWCore/Framework/interface/ESHandle.h"
0008 #include "FWCore/Framework/interface/ModuleFactory.h"
0009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0010 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0011 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0012 
0013 #include <memory>
0014 
0015 class SiPixelGainCalibrationForHLTGPUESProducer : public edm::ESProducer {
0016 public:
0017   explicit SiPixelGainCalibrationForHLTGPUESProducer(const edm::ParameterSet& iConfig);
0018   std::unique_ptr<SiPixelGainCalibrationForHLTGPU> produce(const SiPixelGainCalibrationForHLTGPURcd& iRecord);
0019 
0020   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0021 
0022 private:
0023   edm::ESGetToken<SiPixelGainCalibrationForHLT, SiPixelGainCalibrationForHLTRcd> gainsToken_;
0024   edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> geometryToken_;
0025 };
0026 
0027 SiPixelGainCalibrationForHLTGPUESProducer::SiPixelGainCalibrationForHLTGPUESProducer(const edm::ParameterSet& iConfig) {
0028   auto cc = setWhatProduced(this);
0029   gainsToken_ = cc.consumes();
0030   geometryToken_ = cc.consumes();
0031 }
0032 
0033 void SiPixelGainCalibrationForHLTGPUESProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0034   edm::ParameterSetDescription desc;
0035   descriptions.add("siPixelGainCalibrationForHLTGPU", desc);
0036 }
0037 
0038 std::unique_ptr<SiPixelGainCalibrationForHLTGPU> SiPixelGainCalibrationForHLTGPUESProducer::produce(
0039     const SiPixelGainCalibrationForHLTGPURcd& iRecord) {
0040   auto gains = iRecord.getHandle(gainsToken_);
0041   auto geom = iRecord.getHandle(geometryToken_);
0042   return std::make_unique<SiPixelGainCalibrationForHLTGPU>(*gains, *geom);
0043 }
0044 
0045 #include "FWCore/Framework/interface/MakerMacros.h"
0046 #include "FWCore/Utilities/interface/typelookup.h"
0047 #include "FWCore/Framework/interface/eventsetuprecord_registration_macro.h"
0048 
0049 DEFINE_FWK_EVENTSETUP_MODULE(SiPixelGainCalibrationForHLTGPUESProducer);