Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:31

0001 #ifndef DumpFileToDB_H
0002 #define DumpFileToDB_H
0003 
0004 /** \class DumpFileToDB
0005  *  Dump the content of a txt file with the format
0006  *  of ORCA MuBarDigiParameters (see DTCalibrationMap for details)
0007  *  into a DB. At the moment only the ttrig info is handled.
0008  *
0009  *  \author G. Cerminara - INFN Torino
0010  */
0011 
0012 #include "FWCore/Framework/interface/Frameworkfwd.h"
0013 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0014 #include "CondFormats/DataRecord/interface/DTTtrigRcd.h"
0015 
0016 #include <string>
0017 #include <fstream>
0018 #include <vector>
0019 
0020 class DTCalibrationMap;
0021 class DTTtrig;
0022 
0023 class DumpFileToDB : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
0024 public:
0025   /// Constructor
0026   DumpFileToDB(const edm::ParameterSet& pset);
0027 
0028   /// Destructor
0029   ~DumpFileToDB() override;
0030 
0031   // Operations
0032   void beginRun(const edm::Run& run, const edm::EventSetup& setup) override;
0033 
0034   void endRun(const edm::Run& run, const edm::EventSetup& setup) override {}
0035 
0036   void analyze(const edm::Event& event, const edm::EventSetup& setup) override {}
0037 
0038   void endJob() override;
0039 
0040 protected:
0041 private:
0042   std::vector<int> readChannelsMap(std::stringstream& linestr);
0043 
0044   const DTCalibrationMap* theCalibFile;
0045   std::string mapFileName;
0046 
0047   std::string dbToDump;
0048   std::string format;
0049 
0050   // sum the correction in the txt file (for the mean value) to what is input DB
0051   bool diffMode;
0052   const DTTtrig* tTrigMapOrig;
0053 
0054   edm::ESGetToken<DTTtrig, DTTtrigRcd> ttrigToken_;
0055 };
0056 #endif