CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/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, const char* name);
00038   DOMElement* createElement(DOMDocument* doc, DOMElement* parent, const char* name, const char* value);
00039   DOMElement* createIOV(DOMDocument* doc, DOMElement*  parent,
00040                         unsigned long long fIovBegin, unsigned long long fIovEnd);
00041   DOMElement* createTag(DOMDocument* doc, DOMElement*  parent,
00042                         const char* fTagName, const char* fDetectorName, const char* fComment);
00043   DOMElement* makeMapTag(DOMDocument* doc, DOMElement* fMap);
00044   DOMElement* makeMapIOV(DOMDocument* doc, DOMElement* fTag);
00045   DOMElement* makeMapDataset(DOMDocument* doc, DOMElement* fIov);
00046   DOMElement* createFooter(DOMDocument* doc,
00047                            unsigned long long fIovBegin, unsigned long long fIovEnd,
00048                            const char* fTagName, const char* fDetectorName, const char* fComment);
00049   DOMElement* createChannel(DOMDocument* doc,DOMElement* parent, HcalDetId id);
00050 
00051   const char* itoa(int i){
00052     char temp[256];
00053     sprintf(temp,"%d",i);
00054     std::string outVal(temp);
00055     return outVal.c_str();
00056   }
00057 };
00058 
00059 
00060 class HcalHotCellDbInterface : public HcalDQMDbInterface {
00061  public:
00062   
00063   HcalHotCellDbInterface(){};
00064   
00065   DOMElement* createData(DOMDocument* doc,DOMElement* parent, HcalDQMChannelQuality::Item item);
00066   void createDataset(DOMDocument* doc, HcalDQMChannelQuality::Item item, const char* gmtime, const char* version);
00067   void createHeader(DOMDocument* doc, unsigned int runno, const char* startTime);
00068 
00069 };
00070 
00071 class HcalHLXMaskDbInterface : public HcalDQMDbInterface {
00072  public:
00073 
00074   HcalHLXMaskDbInterface(){};
00075 
00076   void createData(DOMDocument* doc,DOMElement* parent, HcalHLXMask mask);
00077   DOMElement* createDataset(DOMDocument* doc, const HcalHLXMask mask, const char* gmtime, const char* version, const char* subversion);
00078   void createHeader(DOMDocument* doc);
00079 };
00080 
00081 
00082 
00083 
00084 /*
00085 class HcalRunSummaryDbInterface : public HcalDQMDbInterface{
00086  public:
00087   
00088   HcalDQMDbInterface(){};
00089   
00090   DOMElement* createChannel(DOMDocument* doc,DOMElement* parent );
00091   DOMElement* createData(DOMDocument* doc,DOMElement* parent );
00092   void createDataset(DOMDocument* doc);
00093   
00094   
00095 };
00096 */