00001 #ifndef EcalPedOffset_H 00002 #define EcalPedOffset_H 00003 00014 #include <map> 00015 #include <string> 00016 00017 #include "FWCore/Framework/interface/Event.h" 00018 #include "FWCore/Framework/interface/EventSetup.h" 00019 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00020 #include "FWCore/Framework/interface/EDAnalyzer.h" 00021 00022 #include "CalibCalorimetry/EcalPedestalOffsets/interface/TPedValues.h" 00023 #include "CalibCalorimetry/EcalPedestalOffsets/interface/TPedResult.h" 00024 00025 class EBDigiCollection; 00026 class EEDigiCollection; 00027 00028 class EcalElectronicsMapping; 00029 00030 class EcalPedOffset: public edm::EDAnalyzer 00031 { 00032 00033 public: 00034 00036 EcalPedOffset(const edm::ParameterSet& ps); 00037 00039 virtual ~EcalPedOffset(); 00040 00042 void analyze(edm::Event const& event, edm::EventSetup const& eventSetup); 00043 00045 void beginRun(edm::Run const &, edm::EventSetup const& eventSetup); 00046 00048 void endJob(void); 00049 00051 void writeXMLFiles(std::string fileName); 00052 00054 void writeDb(); 00055 00057 void makePlots(); 00058 00059 00060 private: 00061 00062 const EcalElectronicsMapping* ecalElectronicsMap_; 00063 00064 std::string intToString(int num); 00065 void readDACs(edm::Handle<EBDigiCollection> pDigis, std::map<int,int> DACvalues); 00066 void readDACs(edm::Handle<EEDigiCollection> pDigis, std::map<int,int> DACvalues); 00067 00068 edm::InputTag m_barrelDigiCollection; 00069 edm::InputTag m_endcapDigiCollection; 00070 edm::InputTag m_headerCollection; 00071 00072 std::string m_xmlFile; 00073 00074 std::map<int,TPedValues*> m_pedValues; 00075 std::map<int,TPedResult*> m_pedResult; 00076 00077 int m_DACmin; 00078 int m_DACmax; 00079 double m_RMSmax; 00080 int m_bestPed; 00081 00083 std::string m_dbHostName; 00085 std::string m_dbName; 00087 std::string m_dbUserName; 00089 std::string m_dbPassword; 00091 int m_dbHostPort; 00094 bool m_create_moniov; 00095 // used to retrieve the run_iov 00096 std::string m_location; 00098 int m_run; 00099 00101 std::string m_plotting; 00103 double m_maxSlopeAllowed_; 00105 double m_minSlopeAllowed_; 00107 double m_maxChi2OverNDFAllowed_; 00108 00109 } ; 00110 00111 #endif