CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/src/CondTools/Ecal/interface/EcalDCSHandler.h

Go to the documentation of this file.
00001 #ifndef ECAL_DCS_HANDLER_H
00002 #define ECAL_DCS_HANDLER_H
00003 
00004 #include <vector>
00005 #include <typeinfo>
00006 #include <string>
00007 #include <map>
00008 #include <iostream>
00009 #include <time.h>
00010 
00011 #include "CondCore/PopCon/interface/PopConSourceHandler.h"
00012 #include "FWCore/ParameterSet/interface/ParameterSetfwd.h"
00013 
00014 
00015 #include "FWCore/ServiceRegistry/interface/Service.h"
00016 #include "CondCore/DBOutputService/interface/PoolDBOutputService.h"
00017 #include "FWCore/Framework/interface/ESHandle.h"
00018 #include "FWCore/Framework/interface/Event.h"
00019 #include "FWCore/Framework/interface/MakerMacros.h"
00020 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00021 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00022 #include "DataFormats/Common/interface/Handle.h"
00023 #include "FWCore/Framework/interface/EventSetup.h"
00024 #include "FWCore/Framework/interface/EventSetupRecordKey.h"
00025 
00026 
00027 #include "OnlineDB/EcalCondDB/interface/RunDCSHVDat.h"
00028 #include "OnlineDB/EcalCondDB/interface/RunDCSLVDat.h"
00029 #include "CondFormats/EcalObjects/interface/EcalDCSTowerStatus.h"
00030 #include "CondFormats/DataRecord/interface/EcalDCSTowerStatusRcd.h"
00031 
00032 #include "OnlineDB/EcalCondDB/interface/all_monitoring_types.h"
00033 #include "OnlineDB/Oracle/interface/Oracle.h"
00034 #include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h"
00035 
00036 #include "DataFormats/EcalDetId/interface/EEDetId.h"
00037 #include "DataFormats/EcalDetId/interface/EBDetId.h"
00038 #include "DataFormats/EcalDetId/interface/EcalTrigTowerDetId.h"
00039 #include "DataFormats/EcalDetId/interface/EcalScDetId.h"
00040 #include "DataFormats/Provenance/interface/Timestamp.h"
00041 
00042 namespace edm {
00043   class ParameterSet;
00044   class Event;
00045   class EventSetup;
00046 }
00047 
00048 namespace popcon
00049 {
00050 
00051 
00052         class EcalDCSHandler : public popcon::PopConSourceHandler<EcalDCSTowerStatus>
00053         {
00054 
00055                 public:
00056                         EcalDCSHandler(edm::ParameterSet const & );
00057                         ~EcalDCSHandler(); 
00058                         void printHVDataSet( const std::map<EcalLogicID, RunDCSHVDat>* dataset,int ) const;
00059                         void printLVDataSet( const std::map<EcalLogicID, RunDCSLVDat>* dataset,int ) const ;
00060                         uint16_t  updateHV( RunDCSHVDat* hv, uint16_t dbStatus, int modo=0) const ; 
00061                         uint16_t  updateLV( RunDCSLVDat* lv, uint16_t dbStatus) const ; 
00062                         bool  insertHVDataSetToOffline( const std::map<EcalLogicID, RunDCSHVDat>* dataset, EcalDCSTowerStatus* dcs_temp ) const;
00063                         bool  insertLVDataSetToOffline( const std::map<EcalLogicID, RunDCSLVDat>* dataset, EcalDCSTowerStatus* dcs_temp, std::vector<EcalLogicID> ) const;
00064 
00065                         void getNewObjects();
00066                         std::string id() const { return m_name;}
00067                         EcalCondDBInterface* econn;
00068 
00069                         int * HVLogicIDToDetID(int, int) const;
00070                         int * HVEELogicIDToDetID(int, int) const;
00071                         int * LVLogicIDToDetID(int, int) const;
00072 
00073                         int detIDToLogicID(int, int, int);
00074                         uint16_t OffDBStatus( uint16_t dbStatus , int pos ) ;
00075 
00076                 private:
00077 
00078                         unsigned long m_firstRun ;
00079                         unsigned long m_lastRun ;
00080                         
00081                         std::string m_sid;
00082                         std::string m_user;
00083                         std::string m_pass;
00084                         std::string m_name;
00085                         
00086         };
00087 }
00088 #endif
00089