Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-12-16 00:32:46

0001 #ifndef CalibMuon_DTCalibration_DTVDriftWriter_h
0002 #define CalibMuon_DTCalibration_DTVDriftWriter_h
0003 
0004 /*  \class DTVDriftWriter
0005  *  Instantiates configurable algo plugin to
0006  *  compute and write vDrift DB.
0007  * 
0008  *  Author of original version: M. Giunta
0009  *  \author A. Vilela Pereira 
0010  */
0011 
0012 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0013 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0014 #include "FWCore/Framework/interface/ESHandle.h"
0015 #include "CondFormats/DataRecord/interface/DTMtimeRcd.h"
0016 #include "CondFormats/DataRecord/interface/DTRecoConditionsVdriftRcd.h"
0017 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0018 #include "FWCore/Framework/interface/ConsumesCollector.h"
0019 
0020 #include <string>
0021 
0022 class DTMtime;
0023 class DTRecoConditions;
0024 class DTGeometry;
0025 namespace dtCalibration {
0026   class DTVDriftBaseAlgo;
0027 }
0028 
0029 class DTVDriftWriter : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
0030 public:
0031   DTVDriftWriter(const edm::ParameterSet& pset);
0032   ~DTVDriftWriter() override;
0033 
0034   // Operations
0035   void beginRun(const edm::Run& run, const edm::EventSetup& setup) override;
0036   void analyze(const edm::Event& event, const edm::EventSetup& eventSetup) override {}
0037   void endRun(const edm::Run& run, const edm::EventSetup& setup) override{};
0038   void endJob() override;
0039 
0040 private:
0041   const edm::ESGetToken<DTMtime, DTMtimeRcd> mTimeMapToken_;
0042   const edm::ESGetToken<DTRecoConditions, DTRecoConditionsVdriftRcd> vDriftMapToken_;
0043   const edm::ESGetToken<DTGeometry, MuonGeometryRecord> dtGeomToken_;
0044   std::string granularity_;            // enforced by SL
0045   const DTMtime* mTimeMap_;            // legacy DB object
0046   const DTRecoConditions* vDriftMap_;  // DB object in new format
0047   bool readLegacyVDriftDB;             // which format to use to read old values
0048   bool writeLegacyVDriftDB;            // which format to be created
0049 
0050   edm::ESHandle<DTGeometry> dtGeom_;
0051 
0052   std::unique_ptr<dtCalibration::DTVDriftBaseAlgo> vDriftAlgo_;
0053 };
0054 #endif