EcalTPGPedestalsHandler

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84
#ifndef ECAL_TPG_PEDESTALS_HANDLER_H
#define ECAL_TPG_PEDESTALS_HANDLER_H

#include <vector>
#include <typeinfo>
#include <string>
#include <map>
#include <iostream>
#include <ctime>

#include "CondCore/PopCon/interface/PopConSourceHandler.h"
#include "FWCore/ParameterSet/interface/ParameterSetfwd.h"

#include "FWCore/ServiceRegistry/interface/Service.h"
#include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "DataFormats/Common/interface/Handle.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/EventSetupRecordKey.h"

#include "CondFormats/EcalObjects/interface/EcalTPGPedestals.h"
#include "CondFormats/DataRecord/interface/EcalTPGPedestalsRcd.h"

#include "OnlineDB/EcalCondDB/interface/all_monitoring_types.h"
#include "OnlineDB/Oracle/interface/Oracle.h"
#include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h"

#include "DataFormats/EcalDetId/interface/EEDetId.h"
#include "DataFormats/EcalDetId/interface/EBDetId.h"
#include "DataFormats/Provenance/interface/Timestamp.h"

namespace edm {
  class ParameterSet;
  class Event;
  class EventSetup;
}  // namespace edm

namespace popcon {

  class EcalTPGPedestalsHandler : public popcon::PopConSourceHandler<EcalTPGPedestals> {
    std::string to_string(char value[]) {
      std::ostringstream streamOut;
      streamOut << value;
      return streamOut.str();
    }

  public:
    EcalTPGPedestalsHandler(edm::ParameterSet const&);
    ~EcalTPGPedestalsHandler() override;
    void getNewObjects() override;

    std::string id() const override { return m_name; }

    void readFromFile(const char* inputFile);
    void writeFile(const char* inputFile);

    EcalCondDBInterface* econn;

  private:
    const EcalTPGPedestals* mypedestals;

    unsigned int m_firstRun;
    unsigned int m_lastRun;

    std::string m_location;
    std::string m_gentag;
    std::string m_sid;
    std::string m_user;
    std::string m_pass;
    std::string m_locationsource;
    std::string m_name;
    unsigned int m_runnr;
    std::string m_runtype;
    std::string m_i_tag;
    int m_i_version;
    unsigned int m_i_run_number;
    int m_i_ped;
  };
}  // namespace popcon
#endif