Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-11-13 03:30:46

0001 #ifndef CondTools_Ecal_StoreESCondition_h
0002 #define CondTools_Ecal_StoreESCondition_h
0003 
0004 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0005 
0006 #include <string>
0007 #include <map>
0008 #include <memory>
0009 #include <fstream>
0010 #include <cstdio>
0011 #include <typeinfo>
0012 #include <sstream>
0013 
0014 #include "CondFormats/ESObjects/interface/ESTimeSampleWeights.h"
0015 #include "CondFormats/ESObjects/interface/ESChannelStatus.h"
0016 #include "CondFormats/ESObjects/interface/ESGain.h"
0017 #include "CondFormats/ESObjects/interface/ESThresholds.h"
0018 #include "CondFormats/ESObjects/interface/ESPedestals.h"
0019 #include "CondFormats/ESObjects/interface/ESRecHitRatioCuts.h"
0020 #include "CondFormats/ESObjects/interface/ESIntercalibConstants.h"
0021 #include "CondFormats/ESObjects/interface/ESMissingEnergyCalibration.h"
0022 #include "CondFormats/ESObjects/interface/ESEEIntercalibConstants.h"
0023 #include "DataFormats/EcalDetId/interface/ESDetId.h"
0024 
0025 namespace edm {
0026   class ParameterSet;
0027   class Event;
0028   class EventSetup;
0029 }  // namespace edm
0030 
0031 class StoreESCondition : public edm::one::EDAnalyzer<> {
0032 public:
0033   std::shared_ptr<ESThresholds> readESThresholdsFromFile(const char*);
0034   std::shared_ptr<ESPedestals> readESPedestalsFromFile(const char*);
0035   std::shared_ptr<ESRecHitRatioCuts> readESRecHitRatioCutsFromFile(const char*);
0036   std::shared_ptr<ESGain> readESGainFromFile(const char*);
0037   std::shared_ptr<ESTimeSampleWeights> readESTimeSampleWeightsFromFile(const char*);
0038   std::shared_ptr<ESChannelStatus> readESChannelStatusFromFile(const char*);
0039   std::shared_ptr<ESIntercalibConstants> readESIntercalibConstantsFromFile(const char*);
0040   std::shared_ptr<ESMissingEnergyCalibration> readESMissingEnergyFromFile(const char*);
0041   std::shared_ptr<ESEEIntercalibConstants> readESEEIntercalibConstantsFromFile(const char*);
0042   void writeToLogFile(std::string, std::string, unsigned long long);
0043   void writeToLogFileResults(char*);
0044 
0045   explicit StoreESCondition(const edm::ParameterSet& iConfig);
0046   ~StoreESCondition() override;
0047 
0048   void analyze(const edm::Event& evt, const edm::EventSetup& evtSetup) override;
0049   void endJob() override;
0050 
0051 private:
0052   void fillHeader(char*);
0053 
0054   std::vector<std::string> objectName_;
0055   std::vector<std::string> inpFileName_;
0056   std::vector<std::string> inpFileNameEE_;
0057   std::string prog_name_;
0058   std::vector<unsigned long long> since_;  // beginning IOV for objects
0059   std::string logfile_;
0060 
0061   unsigned int esgain_;
0062 
0063   std::string to_string(char value[]) {
0064     std::ostringstream streamOut;
0065     streamOut << value;
0066     return streamOut.str();
0067   }
0068 };
0069 
0070 #endif