00001 #ifndef ECAL_LASER_HANDLER_H 00002 #define ECAL_LASER_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 00028 #include "CondFormats/EcalObjects/interface/EcalPedestals.h" 00029 #include "CondFormats/DataRecord/interface/EcalPedestalsRcd.h" 00030 #include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatios.h" 00031 #include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRcd.h" 00032 #include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatiosRef.h" 00033 #include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRefRcd.h" 00034 #include "CondFormats/EcalObjects/interface/EcalLaserAlphas.h" 00035 #include "CondFormats/DataRecord/interface/EcalLaserAlphasRcd.h" 00036 00037 #include "OnlineDB/EcalCondDB/interface/all_monitoring_types.h" 00038 #include "OnlineDB/EcalCondDB/interface/all_lmf_types.h" 00039 00040 #include "OnlineDB/Oracle/interface/Oracle.h" 00041 #include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h" 00042 00043 #include "DataFormats/EcalDetId/interface/EEDetId.h" 00044 #include "DataFormats/EcalDetId/interface/EBDetId.h" 00045 #include "DataFormats/Provenance/interface/Timestamp.h" 00046 00047 namespace edm { 00048 class ParameterSet; 00049 class Event; 00050 class EventSetup; 00051 } 00052 00053 namespace popcon 00054 { 00055 class EcalLaserHandler : public popcon::PopConSourceHandler<EcalLaserAPDPNRatios> 00056 { 00057 00058 public: 00059 void getNewObjects(); 00060 double diff(float x, float old_x); 00061 ~EcalLaserHandler(); 00062 EcalLaserHandler(edm::ParameterSet const & ); 00063 00064 EcalCondDBInterface* econn; 00065 std::string id() const { return m_name;} 00066 void notifyProblems(const EcalLaserAPDPNRatios::EcalLaserAPDPNpair &old, 00067 const EcalLaserAPDPNRatios::EcalLaserAPDPNpair ¤t, 00068 int hashedIndex, const std::string &reason); 00069 bool checkAPDPN(const EcalLaserAPDPNRatios::EcalLaserAPDPNpair &old, 00070 const EcalLaserAPDPNRatios::EcalLaserAPDPNpair ¤t, 00071 int hashedIndex); 00072 bool checkAPDPNs(const EcalLaserAPDPNRatios::EcalLaserAPDPNRatiosMap &laserMap, 00073 const EcalLaserAPDPNRatios::EcalLaserAPDPNRatiosMap &apdpns_popcon); 00074 00075 void dumpBarrelPayload(EcalLaserAPDPNRatios::EcalLaserAPDPNRatiosMap const &laserMap); 00076 void dumpEndcapPayload(EcalLaserAPDPNRatios::EcalLaserAPDPNRatiosMap const &laserMap); 00077 00078 private: 00079 const EcalLaserAPDPNRatios * myapdpns; 00080 unsigned long m_sequences; 00081 std::string m_sid; 00082 std::string m_user; 00083 std::string m_pass; 00084 std::string m_name; 00085 std::string m_maxtime; 00086 bool m_debug; 00087 bool m_fake; 00088 }; 00089 } 00090 #endif