Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:51:50

0001 #ifndef ECAL_DCS_HANDLER_H
0002 #define ECAL_DCS_HANDLER_H
0003 
0004 #include <vector>
0005 #include <typeinfo>
0006 #include <string>
0007 #include <map>
0008 #include <iostream>
0009 #include <ctime>
0010 
0011 #include "CondCore/PopCon/interface/PopConSourceHandler.h"
0012 #include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
0013 
0014 #include "FWCore/ServiceRegistry/interface/Service.h"
0015 #include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
0016 #include "FWCore/Framework/interface/ESHandle.h"
0017 #include "FWCore/Framework/interface/Event.h"
0018 #include "FWCore/Framework/interface/MakerMacros.h"
0019 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0021 #include "DataFormats/Common/interface/Handle.h"
0022 #include "FWCore/Framework/interface/EventSetup.h"
0023 #include "FWCore/Framework/interface/EventSetupRecordKey.h"
0024 
0025 #include "OnlineDB/EcalCondDB/interface/RunDCSHVDat.h"
0026 #include "OnlineDB/EcalCondDB/interface/RunDCSLVDat.h"
0027 #include "CondFormats/EcalObjects/interface/EcalDCSTowerStatus.h"
0028 #include "CondFormats/DataRecord/interface/EcalDCSTowerStatusRcd.h"
0029 
0030 #include "OnlineDB/EcalCondDB/interface/all_monitoring_types.h"
0031 #include "OnlineDB/Oracle/interface/Oracle.h"
0032 #include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h"
0033 
0034 #include "DataFormats/EcalDetId/interface/EEDetId.h"
0035 #include "DataFormats/EcalDetId/interface/EBDetId.h"
0036 #include "DataFormats/EcalDetId/interface/EcalTrigTowerDetId.h"
0037 #include "DataFormats/EcalDetId/interface/EcalScDetId.h"
0038 #include "DataFormats/Provenance/interface/Timestamp.h"
0039 
0040 namespace edm {
0041   class ParameterSet;
0042   class Event;
0043   class EventSetup;
0044 }  // namespace edm
0045 
0046 namespace popcon {
0047 
0048   class EcalDCSHandler : public popcon::PopConSourceHandler<EcalDCSTowerStatus> {
0049   public:
0050     EcalDCSHandler(edm::ParameterSet const&);
0051     ~EcalDCSHandler() override;
0052     void printHVDataSet(const std::map<EcalLogicID, RunDCSHVDat>* dataset, int) const;
0053     void printLVDataSet(const std::map<EcalLogicID, RunDCSLVDat>* dataset, int) const;
0054     uint16_t updateHV(RunDCSHVDat* hv, uint16_t dbStatus, int modo = 0) const;
0055     uint16_t updateLV(RunDCSLVDat* lv, uint16_t dbStatus) const;
0056     bool insertHVDataSetToOffline(const std::map<EcalLogicID, RunDCSHVDat>* dataset,
0057                                   EcalDCSTowerStatus* dcs_temp) const;
0058     bool insertLVDataSetToOffline(const std::map<EcalLogicID, RunDCSLVDat>* dataset,
0059                                   EcalDCSTowerStatus* dcs_temp,
0060                                   const std::vector<EcalLogicID>&) const;
0061 
0062     void getNewObjects() override;
0063     std::string id() const override { return m_name; }
0064     EcalCondDBInterface* econn;
0065 
0066     int* HVLogicIDToDetID(int, int) const;
0067     int* HVEELogicIDToDetID(int, int) const;
0068     int* LVLogicIDToDetID(int, int) const;
0069 
0070     int detIDToLogicID(int, int, int);
0071     uint16_t OffDBStatus(uint16_t dbStatus, int pos);
0072 
0073   private:
0074     unsigned long m_firstRun;
0075     unsigned long m_lastRun;
0076 
0077     std::string m_sid;
0078     std::string m_user;
0079     std::string m_pass;
0080     std::string m_name;
0081   };
0082 }  // namespace popcon
0083 #endif