Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:37:43

0001 #ifndef ECAL_LASER_HANDLER_H
0002 #define ECAL_LASER_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 "CondFormats/EcalObjects/interface/EcalPedestals.h"
0026 #include "CondFormats/DataRecord/interface/EcalPedestalsRcd.h"
0027 #include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatios.h"
0028 #include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRcd.h"
0029 #include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatiosRef.h"
0030 #include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRefRcd.h"
0031 #include "CondFormats/EcalObjects/interface/EcalLaserAlphas.h"
0032 #include "CondFormats/DataRecord/interface/EcalLaserAlphasRcd.h"
0033 
0034 #include "OnlineDB/EcalCondDB/interface/all_monitoring_types.h"
0035 #include "OnlineDB/EcalCondDB/interface/all_lmf_types.h"
0036 
0037 #include "OnlineDB/Oracle/interface/Oracle.h"
0038 #include "OnlineDB/EcalCondDB/interface/EcalCondDBInterface.h"
0039 
0040 #include "DataFormats/EcalDetId/interface/EEDetId.h"
0041 #include "DataFormats/EcalDetId/interface/EBDetId.h"
0042 #include "DataFormats/Provenance/interface/Timestamp.h"
0043 
0044 namespace edm {
0045   class ParameterSet;
0046   class Event;
0047   class EventSetup;
0048 }  // namespace edm
0049 
0050 namespace popcon {
0051   class EcalLaserHandler : public popcon::PopConSourceHandler<EcalLaserAPDPNRatios> {
0052   public:
0053     void getNewObjects() override;
0054     double diff(float x, float old_x);
0055     ~EcalLaserHandler() override;
0056     EcalLaserHandler(edm::ParameterSet const &);
0057 
0058     EcalCondDBInterface *econn;
0059     std::string id() const override { return m_name; }
0060     void notifyProblems(const EcalLaserAPDPNRatios::EcalLaserAPDPNpair &old,
0061                         const EcalLaserAPDPNRatios::EcalLaserAPDPNpair &current,
0062                         int hashedIndex,
0063                         const std::string &reason);
0064     bool checkAPDPN(const EcalLaserAPDPNRatios::EcalLaserAPDPNpair &old,
0065                     const EcalLaserAPDPNRatios::EcalLaserAPDPNpair &current,
0066                     int hashedIndex);
0067     bool checkAPDPNs(const EcalLaserAPDPNRatios::EcalLaserAPDPNRatiosMap &laserMap,
0068                      const EcalLaserAPDPNRatios::EcalLaserAPDPNRatiosMap &apdpns_popcon);
0069 
0070     void dumpBarrelPayload(EcalLaserAPDPNRatios::EcalLaserAPDPNRatiosMap const &laserMap);
0071     void dumpEndcapPayload(EcalLaserAPDPNRatios::EcalLaserAPDPNRatiosMap const &laserMap);
0072 
0073   private:
0074     const EcalLaserAPDPNRatios *myapdpns;
0075     unsigned long m_sequences;
0076     std::string m_sid;
0077     std::string m_user;
0078     std::string m_pass;
0079     std::string m_name;
0080     std::string m_maxtime;
0081     bool m_debug;
0082     bool m_fake;
0083   };
0084 }  // namespace popcon
0085 #endif