Translates a EcalGainRatio record to XML and vice versa
- Author
- Francesco RUBBO
- Version
- Id
- EcalPulseSymmCovariancesXMLTranslator.h,v 0 2010/04/26 fay Exp
- Date
- 26 Apr 2010
Definition at line 15 of file EcalPulseSymmCovariancesXMLTranslator.h.
Definition at line 105 of file EcalPulseSymmCovariancesXMLTranslator.cc.
References EcalCondObjectContainer< T >::barrelItems(), common_cff::doc, FrontierConditions_GlobalTag_cff::dump, EcalCondObjectContainer< T >::end(), EcalCondObjectContainer< T >::endcapItems(), EcalCondObjectContainer< T >::find(), mps_fire::i, dqmiolumiharvest::j, dqmdumpme::k, EBDetId::kSizeForDenseIndexing, EEDetId::kSizeForDenseIndexing, EBDetId::MIN_HASH, funct::pow(), xuti::PulseSymmCovariances_tag(), AlCaHLTBitMon_QueryRunRegistry::string, EcalPulseShape::TEMPLATESAMPLES, cms::xerces::toString(), EBDetId::unhashIndex(), EEDetId::unhashIndex(), cms::xerces::uStr(), EEDetId::validHashIndex(), xuti::writeCell(), xuti::writeHeader(), xuti::WriteNodeWithValue(), and cscNeutronWriter_cfi::writer.
107 unique_ptr<DOMImplementation>
impl(DOMImplementationRegistry::getDOMImplementation(
cms::xerces::uStr(
"LS").ptr()));
109 DOMLSSerializer*
writer =
impl->createLSSerializer();
110 if (writer->getDomConfig()->canSetParameter(XMLUni::fgDOMWRTFormatPrettyPrint,
true))
111 writer->getDomConfig()->setParameter(XMLUni::fgDOMWRTFormatPrettyPrint,
true);
113 DOMDocumentType* doctype =
impl->createDocumentType(
cms::xerces::uStr(
"XML").ptr(),
nullptr,
nullptr);
116 DOMElement*
root = doc->getDocumentElement();
127 pulsecov_tag[linK] = Form(
"samplecov_%d_%d", i, j);
136 if (record.
find(rawid) == record.
end())
139 DOMElement* cellnode =
writeCell(root, rawid);
153 if (record.
find(rawid) == record.
end())
156 DOMElement* cellnode =
writeCell(root, rawid);
const Items & barrelItems() const
static const int TEMPLATESAMPLES
static EEDetId unhashIndex(int hi)
void WriteNodeWithValue(xercesc::DOMNode *parentNode, const std::string &tag, const T &value)
write a node with
static bool validHashIndex(int i)
std::string toString(XMLCh const *toTranscode)
static const int MIN_HASH
void writeHeader(xercesc::DOMNode *parentNode, const EcalCondHeader &header)
write
ZStr< XMLCh > uStr(char const *str)
const std::string PulseSymmCovariances_tag("EcalPulseSymmCovariances")
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
const_iterator find(uint32_t rawId) const
const_iterator end() const
xercesc::DOMElement * writeCell(xercesc::DOMNode *node, const DetId &detid)
Append a Cell node with attributes to.
const Items & endcapItems() const
Power< A, B >::type pow(const A &a, const B &b)
Definition at line 24 of file EcalPulseSymmCovariancesXMLTranslator.cc.
References xuti::Cell_tag(), officialStyle::chan, gather_cfg::cout, xuti::getChildNode(), xuti::GetNodeData(), mps_fire::i, createfilelist::int, dqmiolumiharvest::j, dqmdumpme::k, writedatasetfile::parser, xuti::readCellId(), xuti::readHeader(), EcalPulseShape::TEMPLATESAMPLES, 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 <<
"EcalPulseSymmCovariancesXMLTranslator::Error parsing document" << std::endl;
42 DOMElement* elementRoot = xmlDoc->getDocumentElement();
56 std::vector<std::string> pulsecov_tag(
62 k =
j + (EcalPulseShape::TEMPLATESAMPLES - 1) *
i;
64 k =
i + (EcalPulseShape::TEMPLATESAMPLES - 1) *
j;
65 pulsecov_tag[
k] = Form(
"samplecov_%d_%d",
i,
j);
70 new DOMNode*[
int(EcalPulseShape::TEMPLATESAMPLES * (EcalPulseShape::TEMPLATESAMPLES + 1) / 2)];
71 for (
int k = 0;
k < EcalPulseShape::TEMPLATESAMPLES * (EcalPulseShape::TEMPLATESAMPLES + 1) / 2; ++
k) {
76 for (
int k = 0;
k < EcalPulseShape::TEMPLATESAMPLES * (EcalPulseShape::TEMPLATESAMPLES + 1) / 2; ++
k)
77 record[detid].covval[
k] = covs[
k];
79 cellnode = cellnode->getNextSibling();
81 while (cellnode && cellnode->getNodeType() != DOMNode::ELEMENT_NODE)
82 cellnode = cellnode->getNextSibling();
88 std::cout <<
" nb of channels found in xml file " << chan << std::endl;
static const int TEMPLATESAMPLES
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
chan
lumi = TPaveText(lowX+0.38, lowY+0.061, lowX+0.45, lowY+0.161, "NDC") lumi.SetBorderSize( 0 ) lumi...
const DetId readCellId(xercesc::DOMElement *node)
Assuming.