CMS 3D CMS Logo

Classes | Functions
HcalDbXml.cc File Reference
#include <vector>
#include <string>
#include <fstream>
#include <sstream>
#include "CalibFormats/HcalObjects/interface/HcalText2DetIdConverter.h"
#include "CondFormats/HcalObjects/interface/AllObjects.h"
#include <xercesc/util/XMLString.hpp>
#include <xercesc/dom/DOMElement.hpp>
#include <xercesc/dom/DOMText.hpp>
#include <xercesc/dom/DOMImplementation.hpp>
#include <xercesc/dom/DOMImplementationRegistry.hpp>
#include <xercesc/dom/DOMConfiguration.hpp>
#include <xercesc/dom/DOMDocument.hpp>
#include <xercesc/dom/DOMLSOutput.hpp>
#include <xercesc/dom/DOMLSSerializer.hpp>
#include "Utilities/Xerces/interface/Xerces.h"
#include "CondTools/Hcal/interface/StreamOutFormatTarget.h"
#include "CondTools/Hcal/interface/HcalDbXml.h"

Go to the source code of this file.

Classes

class  XMLDocument
 

Functions

template<class T1 , class T2 >
bool dumpObject_ (std::ostream &fOutput, unsigned fRun, unsigned long fGMTIOVBegin, unsigned long fGMTIOVEnd, const std::string &fTag, const T1 *fObject1, const T2 *fObject2=0)
 

Function Documentation

◆ dumpObject_()

template<class T1 , class T2 >
bool dumpObject_ ( std::ostream &  fOutput,
unsigned  fRun,
unsigned long  fGMTIOVBegin,
unsigned long  fGMTIOVEnd,
const std::string &  fTag,
const T1 *  fObject1,
const T2 *  fObject2 = 0 
)

Definition at line 334 of file HcalDbXml.cc.

340  {
341  if (!fObject1)
342  return false;
343  const std::string KIND = kind(*fObject1);
344 
346  DOMElement* root = doc.root();
347  doc.makeHeader(root, KIND, fRun);
348 
349  DOMElement* elements = doc.makeElement(root);
350  doc.makeElementIOV(elements, fGMTIOVBegin, fGMTIOVEnd);
351  doc.makeElementTag(elements, fTag, "HCAL");
352 
353  DOMElement* iovmap = doc.makeMapIOV(doc.makeMapTag(doc.makeMaps(root)));
354 
355  std::vector<DetId> detids = fObject1->getAllChannels();
356  for (unsigned iCh = 0; iCh < detids.size(); iCh++) {
357  DetId id = detids[iCh];
358  ostringstream version;
359  version << fTag << '_' << fGMTIOVBegin; // CONVENTION: version == tag + iov for initial setting
360  DOMElement* dataset = doc.makeDataset(root, version.str());
361  doc.makeChId(dataset, id);
362  DOMElement* data = doc.makeData(dataset);
363  doc.addData(data, *(fObject1->getValues(id)));
364  try {
365  if (fObject2)
366  doc.addData(data, *(fObject2->getValues(id)));
367  } catch (...) {
368  std::cout << "dumpObject_-> ERROR: width is not available for cell # " << id.rawId() << std::endl;
369  }
370  doc.makeElementDataset(elements, iCh, id, version.str(), KIND, fRun);
371  doc.makeMapDataset(iovmap, iCh);
372  }
373  doc.streamOut(fOutput);
374  return true;
375 }

References gather_cfg::cout, data, boostedTaus_cff::doc, bookConverter::elements, CalibrationSummaryClient_cfi::kind, AlCaHLTBitMon_QueryRunRegistry::string, and BeamSplash_cfg::version.

Referenced by HcalDbXml::dumpObject().

boostedTaus_cff.doc
doc
Definition: boostedTaus_cff.py:20
gather_cfg.cout
cout
Definition: gather_cfg.py:144
DetId
Definition: DetId.h:17
XMLDocument
Definition: HcalDbXml.cc:60
root
Definition: RooFitFunction.h:10
CalibrationSummaryClient_cfi.kind
kind
Definition: CalibrationSummaryClient_cfi.py:37
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
bookConverter.elements
elements
Definition: bookConverter.py:147
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
dataset
Definition: dataset.py:1
BeamSplash_cfg.version
version
Definition: BeamSplash_cfg.py:45