CMS 3D CMS Logo

Public Member Functions

HcalDQMDbInterface Class Reference

#include <HcalDQMDbInterface.h>

Inheritance diagram for HcalDQMDbInterface:
HcalHLXMaskDbInterface HcalHotCellDbInterface

List of all members.

Public Member Functions

DOMElement * createChannel (DOMDocument *doc, DOMElement *parent, HcalDetId id)
DOMDocument * createDocument ()
DOMElement * createElement (DOMDocument *doc, DOMElement *parent, const char *name)
DOMElement * createElement (DOMDocument *doc, DOMElement *parent, const char *name, const char *value)
DOMElement * createFooter (DOMDocument *doc, unsigned long long fIovBegin, unsigned long long fIovEnd, const char *fTagName, const char *fDetectorName, const char *fComment)
DOMElement * createIOV (DOMDocument *doc, DOMElement *parent, unsigned long long fIovBegin, unsigned long long fIovEnd)
DOMElement * createTag (DOMDocument *doc, DOMElement *parent, const char *fTagName, const char *fDetectorName, const char *fComment)
 HcalDQMDbInterface ()
const char * itoa (int i)
DOMElement * makeMapDataset (DOMDocument *doc, DOMElement *fIov)
DOMElement * makeMapIOV (DOMDocument *doc, DOMElement *fTag)
DOMElement * makeMapTag (DOMDocument *doc, DOMElement *fMap)
void writeDocument (DOMDocument *doc, const char *xmlFile)

Detailed Description

Definition at line 29 of file HcalDQMDbInterface.h.


Constructor & Destructor Documentation

HcalDQMDbInterface::HcalDQMDbInterface ( ) [inline]

Definition at line 32 of file HcalDQMDbInterface.h.

{};

Member Function Documentation

DOMElement * HcalDQMDbInterface::createChannel ( DOMDocument *  doc,
DOMElement *  parent,
HcalDetId  id 
)

Definition at line 117 of file HcalDQMDbInterface.cc.

References createElement(), HcalText2DetIdConverter::getFlavor(), and itoa().

Referenced by HcalHotCellDbInterface::createDataset().

                                                                                              {
  HcalText2DetIdConverter converter(id);
  DOMElement*  chanElem = createElement(doc,parent,"CHANNEL");
  createElement(doc,chanElem,"EXTENSION_TABLE_NAME","HCAL_CHANNELS");
  createElement(doc,chanElem,"ETA",itoa(id.ietaAbs()));
  createElement(doc,chanElem,"PHI",itoa(id.iphi()));
  createElement(doc,chanElem,"DEPTH",itoa(id.depth()));
  createElement(doc,chanElem,"Z",itoa(id.zside()));
  createElement(doc,chanElem,"DETECTOR_NAME",converter.getFlavor().c_str());
  createElement(doc,chanElem,"HCAL_CHANNEL_ID",itoa(id.rawId()));
  return chanElem;
}
DOMDocument * HcalDQMDbInterface::createDocument ( )

Definition at line 23 of file HcalDQMDbInterface.cc.

References XML.

                                               {
  DOMImplementation* impl =  DOMImplementationRegistry::getDOMImplementation(XML("Core"));
  return impl->createDocument(0,XML("ROOT"),0);
}
DOMElement * HcalDQMDbInterface::createElement ( DOMDocument *  doc,
DOMElement *  parent,
const char *  name,
const char *  value 
)

Definition at line 17 of file HcalDQMDbInterface.cc.

References createElement(), HTMLExport::elem(), and XML.

                                                                                                                      {
  DOMElement*  elem = createElement(doc,parent,name);
  elem->appendChild(doc->createTextNode(XML(value)));
  return elem;
}
DOMElement * HcalDQMDbInterface::createElement ( DOMDocument *  doc,
DOMElement *  parent,
const char *  name 
)
DOMElement * HcalDQMDbInterface::createFooter ( DOMDocument *  doc,
unsigned long long  fIovBegin,
unsigned long long  fIovEnd,
const char *  fTagName,
const char *  fDetectorName,
const char *  fComment 
)

Definition at line 41 of file HcalDQMDbInterface.cc.

References createElement(), createIOV(), createTag(), dtDQMMerge_cfg::dataset, makeMapDataset(), makeMapIOV(), makeMapTag(), and dbtoconf::parent.

                                                                                                                   {
  
  DOMElement* parent = doc->getDocumentElement();
  DOMElement* elems = createElement(doc,parent,"ELEMENTS");
  DOMElement* dataset = createElement(doc, elems, "DATA_SET");
  dataset->setAttribute(transcode("id"), transcode("-1"));
  createIOV(doc,elems,fIovBegin,fIovEnd);
  createTag(doc,elems,fTagName,fDetectorName,fComment);

  DOMElement* maps = createElement(doc,parent, "MAPS");
  DOMElement* mapTag = makeMapTag(doc,maps);
  DOMElement* mapIov = makeMapIOV(doc,mapTag);
  makeMapDataset(doc,mapIov);

  return elems;
}
DOMElement * HcalDQMDbInterface::createIOV ( DOMDocument *  doc,
DOMElement *  parent,
unsigned long long  fIovBegin,
unsigned long long  fIovEnd 
)

Definition at line 78 of file HcalDQMDbInterface.cc.

References createElement(), o2o::iov, and itoa().

Referenced by createFooter().

                                                                                                    {
  DOMElement* iov = createElement(doc,parent,"IOV");
  iov->setAttribute(transcode("id"), transcode("IOV_ID"));
  
  createElement(doc,iov,"INTERVAL_OF_VALIDITY_BEGIN", itoa(fIovBegin));
  if(fIovEnd) {
    createElement(doc,iov,"INTERVAL_OF_VALIDITY_END", itoa(fIovEnd));
  }
  return iov;
}
DOMElement * HcalDQMDbInterface::createTag ( DOMDocument *  doc,
DOMElement *  parent,
const char *  fTagName,
const char *  fDetectorName,
const char *  fComment 
)

Definition at line 90 of file HcalDQMDbInterface.cc.

References createElement(), and GlobalPosition_Frontier_DevDB_cff::tag.

Referenced by createFooter().

                                                                                                                  {
  DOMElement* tag = createElement(doc,parent,"TAG");
  tag->setAttribute(transcode("id"), transcode ("TAG_ID"));
  tag->setAttribute(transcode("mode"), transcode ("auto"));

  createElement(doc,tag,"TAG_NAME", fTagName);
  createElement(doc,tag,"DETECTOR_NAME", fDetectorName);
  createElement(doc,tag,"COMMENT_DESCRIPTION", fComment);

  return tag;
}
const char* HcalDQMDbInterface::itoa ( int  i) [inline]
DOMElement * HcalDQMDbInterface::makeMapDataset ( DOMDocument *  doc,
DOMElement *  fIov 
)

Definition at line 72 of file HcalDQMDbInterface.cc.

References createElement().

Referenced by createFooter().

                                                                                {
  DOMElement* element = createElement(doc,fIov, "DATA_SET");
  element->setAttribute(transcode("idref"), transcode("-1"));
  return element;
}
DOMElement * HcalDQMDbInterface::makeMapIOV ( DOMDocument *  doc,
DOMElement *  fTag 
)

Definition at line 66 of file HcalDQMDbInterface.cc.

References createElement(), and o2o::iov.

Referenced by createFooter().

                                                                            {
  DOMElement* iov = createElement(doc,fTag, "IOV");
  iov->setAttribute(transcode("idref"), transcode("IOV_ID"));
  return iov;
}
DOMElement * HcalDQMDbInterface::makeMapTag ( DOMDocument *  doc,
DOMElement *  fMap 
)

Definition at line 60 of file HcalDQMDbInterface.cc.

References createElement(), and GlobalPosition_Frontier_DevDB_cff::tag.

Referenced by createFooter().

                                                                            {
  DOMElement* tag = createElement(doc, fMap, "TAG");
  tag->setAttribute(transcode("idref"), transcode("TAG_ID"));
  return tag;
}
void HcalDQMDbInterface::writeDocument ( DOMDocument *  doc,
const char *  xmlFile 
)

Definition at line 28 of file HcalDQMDbInterface.cc.

References XML.

                                                                           {
  DOMImplementation* impl =  DOMImplementationRegistry::getDOMImplementation(XML("Core"));
  DOMWriter *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter();
  if (theSerializer->canSetFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true))
    theSerializer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true);
  if (theSerializer->canSetFeature(XMLUni::fgDOMWRTBOM, true))
    theSerializer->setFeature(XMLUni::fgDOMWRTBOM, true);
  XMLFormatTarget *myFormTarget = new LocalFileFormatTarget(xmlFile);
  theSerializer->writeNode(myFormTarget, *doc);
  delete theSerializer;
  delete myFormTarget;
}