Translates a EcalTPGLinearizationConst record to XML
- Version
- Id:
- EcalTPGLinearizationConstXMLTranslator.h,v 1.0 2012/05/01 13:48:05 Exp
- Date
- 01 May 2012
Definition at line 24 of file EcalTPGLinearizationConstXMLTranslator.h.
Definition at line 23 of file EcalTPGLinearizationConstXMLTranslator.cc.
References asciidump::doc, hcal_timing_source_file_cfg::dump, groupFilesInBlocks::fout, xuti::fromNative(), EBDetId::kSizeForDenseIndexing, EEDetId::kSizeForDenseIndexing, xuti::Linearization_m12_tag(), xuti::Linearization_m1_tag(), xuti::Linearization_m6_tag(), xuti::Linearization_s12_tag(), xuti::Linearization_s1_tag(), xuti::Linearization_s6_tag(), xuti::Linearization_tag(), EBDetId::MIN_HASH, record, 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().
28 DOMImplementation* impl =
29 DOMImplementationRegistry::getDOMImplementation(
fromNative(
"LS").c_str());
31 DOMWriter* writer =
static_cast<DOMImplementationLS*
>(impl)->createDOMWriter( );
32 writer->setFeature(XMLUni::fgDOMWRTFormatPrettyPrint,
true);
34 DOMDocumentType* doctype = impl->createDocumentType(
fromNative(
"XML").c_str(), 0, 0 );
39 doc->setEncoding(
fromNative(
"UTF-8").c_str() );
40 doc->setStandalone(
true);
43 DOMElement*
root = doc->getDocumentElement();
49 fout.open(
"Linearization.txt");
57 DOMElement* cellnode=
writeCell(root,rawid);
59 float m12=(
record)[rawid].mult_x12;
60 float s12=(
record)[rawid].shift_x12;
61 float m6 =(
record)[rawid].mult_x6;
62 float s6 =(
record)[rawid].shift_x6;
63 float m1 =(
record)[rawid].mult_x1;
64 float s1 =(
record)[rawid].shift_x1;
72 fout << rawid <<
" " << m12 <<
" " << m6 <<
" " << m1 <<
" " << s12 <<
" " << s6 <<
" " << s1 <<
"\n";
82 DOMElement* cellnode=
writeCell(root,rawid);
84 float m12=(
record)[rawid].mult_x12;
85 float s12=(
record)[rawid].shift_x12;
86 float m6 =(
record)[rawid].mult_x6;
87 float s6 =(
record)[rawid].shift_x6;
88 float m1 =(
record)[rawid].mult_x1;
89 float s1 =(
record)[rawid].shift_x1;
97 fout << rawid <<
" " << m12 <<
" " << m6 <<
" " << m1 <<
" " << s12 <<
" " << s6 <<
" " << s1 <<
"\n";
const std::string Linearization_m1_tag("mult1")
const std::string Linearization_s12_tag("shift12")
static EEDetId unhashIndex(int hi)
const std::string Linearization_m12_tag("mult12")
void WriteNodeWithValue(xercesc::DOMNode *parentNode, const std::string &tag, const T &value)
write a node with
static bool validHashIndex(int i)
const std::string Linearization_m6_tag("mult6")
const std::string Linearization_s6_tag("shift6")
static const int MIN_HASH
void writeHeader(xercesc::DOMNode *parentNode, const EcalCondHeader &header)
write
const std::string Linearization_s1_tag("shift1")
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
XercesString fromNative(const char *str)
const std::string Linearization_tag("EcalTPGLinearizationConts")
xercesc::DOMElement * writeCell(xercesc::DOMNode *node, const DetId &detid)
Append a Cell node with attributes to.
std::string toNative(const XMLCh *str)
string root
initialization