CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DQM/HcalMonitorClient/interface/HcalDQMDbInterface.h

Go to the documentation of this file.
00001 #include <xercesc/util/XMLString.hpp>
00002 #include <xercesc/framework/LocalFileFormatTarget.hpp>
00003 #include <xercesc/dom/DOM.hpp>
00004 #include <xercesc/dom/DOMImplementationLS.hpp>
00005 #include <xercesc/dom/DOMWriter.hpp>
00006 
00007 #include "DQM/HcalMonitorClient/interface/HcalDQMChannelQuality.h"
00008 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
00009 #include "CalibFormats/HcalObjects/interface/HcalText2DetIdConverter.h"
00010 #include "DQM/HcalMonitorClient/interface/HcalHLXMask.h"
00011 //#include "CondTools/Hcal/include/HcalDbXml.h"
00012 
00013 #include "time.h"
00014 #include <fstream>
00015 #include <sstream>
00016 #include <iostream>
00017 #include <string>
00018 
00019 #if defined(XERCES_NEW_IOSTREAMS)
00020 #include <iostream>
00021 #else
00022 #include <iostream.h>
00023 #endif
00024 
00025 XERCES_CPP_NAMESPACE_USE
00026 #define XML(str) XMLString::transcode(str)
00027 
00028 
00029 class HcalDQMDbInterface{
00030 public:
00031   
00032   HcalDQMDbInterface(){};
00033 
00034   DOMDocument* createDocument();  
00035   void writeDocument(DOMDocument* doc, const char* xmlFile);
00036 
00037   DOMElement* createElement(DOMDocument* doc, DOMElement* parent, char* name);
00038   DOMElement* createElement(DOMDocument* doc, DOMElement* parent, char* name, char* value);
00039   DOMElement* createElement(DOMDocument* doc, DOMElement* parent, char* name, const char* value);
00040   DOMElement* createIOV(DOMDocument* doc, DOMElement*  parent,
00041                         unsigned long long fIovBegin, unsigned long long fIovEnd);
00042   DOMElement* createTag(DOMDocument* doc, DOMElement*  parent,
00043                         const char* fTagName, const char* fDetectorName, const char* fComment);
00044   DOMElement* makeMapTag(DOMDocument* doc, DOMElement* fMap);
00045   DOMElement* makeMapIOV(DOMDocument* doc, DOMElement* fTag);
00046   DOMElement* makeMapDataset(DOMDocument* doc, DOMElement* fIov);
00047   DOMElement* createFooter(DOMDocument* doc,
00048                            unsigned long long fIovBegin, unsigned long long fIovEnd,
00049                            const char* fTagName, const char* fDetectorName, const char* fComment);
00050   DOMElement* createChannel(DOMDocument* doc,DOMElement* parent, HcalDetId id);
00051 
00052   const char* itoa(int i){
00053     char temp[256];
00054     sprintf(temp,"%d",i);
00055     std::string outVal(temp);
00056     return outVal.c_str();
00057   }
00058 };
00059 
00060 
00061 class HcalHotCellDbInterface : public HcalDQMDbInterface {
00062  public:
00063   
00064   HcalHotCellDbInterface(){};
00065   
00066   DOMElement* createData(DOMDocument* doc,DOMElement* parent, HcalDQMChannelQuality::Item item);
00067   void createDataset(DOMDocument* doc, HcalDQMChannelQuality::Item item, const char* gmtime, const char* version);
00068   void createHeader(DOMDocument* doc, unsigned int runno, const char* startTime);
00069 
00070 };
00071 
00072 class HcalHLXMaskDbInterface : public HcalDQMDbInterface {
00073  public:
00074 
00075   HcalHLXMaskDbInterface(){};
00076 
00077   void createData(DOMDocument* doc,DOMElement* parent, HcalHLXMask mask);
00078   DOMElement* createDataset(DOMDocument* doc, const HcalHLXMask mask, const char* gmtime, const char* version, const char* subversion);
00079   void createHeader(DOMDocument* doc);
00080 };
00081 
00082 
00083 
00084 
00085 /*
00086 class HcalRunSummaryDbInterface : public HcalDQMDbInterface{
00087  public:
00088   
00089   HcalDQMDbInterface(){};
00090   
00091   DOMElement* createChannel(DOMDocument* doc,DOMElement* parent );
00092   DOMElement* createData(DOMDocument* doc,DOMElement* parent );
00093   void createDataset(DOMDocument* doc);
00094   
00095   
00096 };
00097 */