Translates a EcalGainRatio record to XML and vice versa
- Author
- Francesco RUBBO
- Version
- Id:
- EcalPedestalsXMLTranslator.h,v 0 2010/04/26 fay Exp
- Date
- 26 Apr 2010
Definition at line 20 of file EcalPedestalsXMLTranslator.h.
Definition at line 114 of file EcalPedestalsXMLTranslator.cc.
References EcalCondObjectContainer< T >::barrelItems(), hcal_timing_source_file_cfg::dump, EcalCondObjectContainer< T >::end(), EcalCondObjectContainer< T >::endcapItems(), EcalCondObjectContainer< T >::find(), xuti::fromNative(), EBDetId::kSizeForDenseIndexing, EEDetId::kSizeForDenseIndexing, xuti::mean12_tag(), xuti::mean1_tag(), xuti::mean6_tag(), cond::ecalped::mean_x12, cond::ecalped::mean_x6, EBDetId::MIN_HASH, xuti::Pedestals_tag(), xuti::rms12_tag(), xuti::rms1_tag(), xuti::rms6_tag(), dbtoconf::root, AlCaHLTBitMon_QueryRunRegistry::string, xuti::toNative(), EBDetId::unhashIndex(), EEDetId::unhashIndex(), EEDetId::validHashIndex(), xuti::writeCell(), xuti::writeHeader(), xuti::WriteNodeWithValue(), and cms::concurrency::xercesInitialize().
Referenced by cond::PayLoadInspector< DataT >::dump().
117 DOMImplementation* impl =
118 DOMImplementationRegistry::getDOMImplementation(
fromNative(
"LS").c_str());
120 DOMWriter* writer =
static_cast<DOMImplementationLS*
>(impl)->createDOMWriter( );
121 writer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint,
true);
123 DOMDocumentType* doctype = impl->createDocumentType(
fromNative(
"XML").c_str(), 0, 0 );
127 doc->setEncoding(
fromNative(
"UTF-8").c_str() );
128 doc->setStandalone(
true);
131 DOMElement*
root = doc->getDocumentElement();
140 if (record.
find(rawid) == record.
end())
continue;
141 if(!record[rawid].
mean_x12 && !record[rawid].rms_x12)
continue;
143 DOMElement* cellnode=
writeCell(root,rawid);
161 if (record.
find(rawid) == record.
end())
continue;
162 if(!record[rawid].
mean_x12 && !record[rawid].rms_x12)
continue;
164 DOMElement* cellnode=
writeCell(root,rawid);
const std::string mean12_tag("mean_x12")
const Items & barrelItems() const
static EEDetId unhashIndex(int hi)
const std::string mean1_tag("mean_x1")
void WriteNodeWithValue(xercesc::DOMNode *parentNode, const std::string &tag, const T &value)
write a node with
static bool validHashIndex(int i)
static const int MIN_HASH
const std::string Pedestals_tag("EcalPedestals")
void writeHeader(xercesc::DOMNode *parentNode, const EcalCondHeader &header)
write
const std::string mean6_tag("mean_x6")
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
const_iterator find(uint32_t rawId) const
XercesString fromNative(const char *str)
const std::string rms12_tag("rms_x12")
const std::string rms6_tag("rms_x6")
const_iterator end() const
xercesc::DOMElement * writeCell(xercesc::DOMNode *node, const DetId &detid)
Append a Cell node with attributes to.
const Items & endcapItems() const
const std::string rms1_tag("rms_x1")
std::string toNative(const XMLCh *str)
string root
initialization
Definition at line 23 of file EcalPedestalsXMLTranslator.cc.
References xuti::Cell_tag(), gather_cfg::cout, cond::rpcobgas::detid, xuti::getChildNode(), xuti::GetNodeData(), xuti::mean12_tag(), xuti::mean1_tag(), xuti::mean6_tag(), geometryXMLtoCSV::parser, xuti::readCellId(), xuti::readHeader(), xuti::rms12_tag(), xuti::rms1_tag(), xuti::rms6_tag(), cms::concurrency::xercesInitialize(), and cms::concurrency::xercesTerminate().
29 XercesDOMParser*
parser =
new XercesDOMParser;
30 parser->setValidationScheme( XercesDOMParser::Val_Never );
31 parser->setDoNamespaces(
false );
32 parser->setDoSchema(
false );
36 DOMDocument* xmlDoc = parser->getDocument();
38 std::cout <<
"EcalPedestalsXMLTranslator::Error parsing document" << std::endl;
42 DOMElement* elementRoot = xmlDoc->getDocumentElement();
85 record[
detid].mean_x12 = mean12;
86 record[
detid].mean_x6 = mean6;
87 record[
detid].mean_x1 = mean1;
88 record[
detid].rms_x12 = rms12;
89 record[
detid].rms_x6 = rms6;
90 record[
detid].rms_x1 = rms1;
92 cellnode = cellnode->getNextSibling();
94 while(cellnode && cellnode->getNodeType() != DOMNode::ELEMENT_NODE)
95 cellnode = cellnode->getNextSibling();
101 std::cout <<
" nb of channels found in xml file " << chan << std::endl;
const std::string mean12_tag("mean_x12")
const std::string mean1_tag("mean_x1")
void readHeader(xercesc::DOMNode *parentNode, EcalCondHeader &header)
read header from
const std::string Cell_tag("cell")
void GetNodeData(xercesc::DOMNode *node, T &value)
get the node data
xercesc::DOMNode * getChildNode(xercesc::DOMNode *node, const std::string &nodename)
get the child of
const std::string mean6_tag("mean_x6")
const std::string rms12_tag("rms_x12")
const std::string rms6_tag("rms_x6")
const std::string rms1_tag("rms_x1")
const DetId readCellId(xercesc::DOMElement *node)
Assuming.