#include <EcalFloatCondObjectContainerXMLTranslator.h>
Static Public Member Functions | |
static std::vector< float > | barrelfromXML (const std::string &filename) |
static std::string | dumpXML (const EcalCondHeader &header, const EcalFloatCondObjectContainer &record) |
static std::vector< float > | endcapfromXML (const std::string &filename) |
static int | readXML (const std::string &filename, EcalCondHeader &header, EcalFloatCondObjectContainer &record) |
static int | writeXML (const std::string &filename, const EcalCondHeader &header, const EcalFloatCondObjectContainer &record) |
Translates a EcalFloatCondObjectContainer record to XML and vice versa
Definition at line 21 of file EcalFloatCondObjectContainerXMLTranslator.h.
std::vector< float > EcalFloatCondObjectContainerXMLTranslator::barrelfromXML | ( | const std::string & | filename | ) | [static] |
Definition at line 86 of file EcalFloatCondObjectContainerXMLTranslator.cc.
References EcalCondObjectContainer< T >::barrelItems(), MultipleCompare::header, insertMaterial::readXML(), and record.
Referenced by BOOST_PYTHON_MODULE().
{ EcalCondHeader header; EcalFloatCondObjectContainer record; readXML(filename,header,record); return record.barrelItems(); }
std::string EcalFloatCondObjectContainerXMLTranslator::dumpXML | ( | const EcalCondHeader & | header, |
const EcalFloatCondObjectContainer & | record | ||
) | [static] |
Definition at line 108 of file EcalFloatCondObjectContainerXMLTranslator.cc.
References asciidump::doc, hcal_timing_source_file_cfg::dump, xuti::EcalFloatCondObjectContainer_tag(), EcalCondObjectContainer< T >::end(), EcalCondObjectContainer< T >::find(), xuti::fromNative(), EBDetId::kSizeForDenseIndexing, EEDetId::kSizeForDenseIndexing, EBDetId::MIN_HASH, dbtoconf::root, xuti::toNative(), EBDetId::unhashIndex(), EEDetId::unhashIndex(), EEDetId::validHashIndex(), xuti::Value_tag(), xuti::writeCell(), xuti::writeHeader(), and xuti::WriteNodeWithValue().
{ XMLPlatformUtils::Initialize(); DOMImplementation* impl = DOMImplementationRegistry::getDOMImplementation(fromNative("LS").c_str()); DOMWriter* writer = static_cast<DOMImplementationLS*>(impl)->createDOMWriter( ); writer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint, true); DOMDocumentType* doctype = impl->createDocumentType( fromNative("XML").c_str(), 0, 0 ); DOMDocument * doc = impl->createDocument( 0, fromNative(EcalFloatCondObjectContainer_tag).c_str(), doctype ); doc->setEncoding(fromNative("UTF-8").c_str() ); doc->setStandalone(true); doc->setVersion(fromNative("1.0").c_str() ); DOMElement* root = doc->getDocumentElement(); xuti::writeHeader(root, header); for (int cellid = EBDetId::MIN_HASH; cellid < EBDetId::kSizeForDenseIndexing; ++cellid){// loop on EB cells uint32_t rawid= EBDetId::unhashIndex(cellid); EcalFloatCondObjectContainer::const_iterator value_ptr= record.find(rawid); if (value_ptr==record.end()) continue; // cell absent from original record DOMElement* cellnode=writeCell(root,rawid); WriteNodeWithValue(cellnode,Value_tag,*value_ptr); } // loop on EB cells for (int cellid = 0; cellid < EEDetId::kSizeForDenseIndexing; ++cellid){// loop on EE cells if (!EEDetId::validHashIndex(cellid)) continue; uint32_t rawid= EEDetId::unhashIndex(cellid); EcalFloatCondObjectContainer::const_iterator value_ptr= record.find(rawid); if (value_ptr==record.end()) continue; // cell absent from original record DOMElement* cellnode= writeCell(root,rawid); WriteNodeWithValue(cellnode,Value_tag,*value_ptr); } // loop on EE cells std::string dump= toNative(writer->writeToString(*root)); doc->release(); return dump; }
std::vector< float > EcalFloatCondObjectContainerXMLTranslator::endcapfromXML | ( | const std::string & | filename | ) | [static] |
Definition at line 97 of file EcalFloatCondObjectContainerXMLTranslator.cc.
References EcalCondObjectContainer< T >::endcapItems(), MultipleCompare::header, insertMaterial::readXML(), and record.
Referenced by BOOST_PYTHON_MODULE().
{ EcalCondHeader header; EcalFloatCondObjectContainer record; readXML(filename,header,record); return record.endcapItems(); }
static int EcalFloatCondObjectContainerXMLTranslator::readXML | ( | const std::string & | filename, |
EcalCondHeader & | header, | ||
EcalFloatCondObjectContainer & | record | ||
) | [static] |
int EcalFloatCondObjectContainerXMLTranslator::writeXML | ( | const std::string & | filename, |
const EcalCondHeader & | header, | ||
const EcalFloatCondObjectContainer & | record | ||
) | [static] |
Definition at line 183 of file EcalFloatCondObjectContainerXMLTranslator.cc.
References EcalCondTools::dumpXML(), and dbtoconf::out.
Referenced by PhiSymmetryCalibration_step2_SM::endJob(), PhiSymmetryCalibration_step2::endJob(), and main().