20 XERCES_CPP_NAMESPACE_USE
27 comment = hcal_ass.getRandomQuote();
30 global_timestamp = time(
NULL);
43 static const char * _str =
"\
47 <EXTENSION_TABLE_NAME>HCAL_CHANNEL_QUALITY_V1</EXTENSION_TABLE_NAME>\n\
48 <NAME>HCAL Channel Quality [V1]</NAME>\n\
51 <RUN_NUMBER>1</RUN_NUMBER>\n\
53 <HINTS channelmap='HCAL_CHANNELS'/>\n\
56 <DATA_SET id='-1'/>\n\
58 <INTERVAL_OF_VALIDITY_BEGIN>1</INTERVAL_OF_VALIDITY_BEGIN>\n\
59 <INTERVAL_OF_VALIDITY_END>-1</INTERVAL_OF_VALIDITY_END>\n\
61 <TAG id='2' mode='auto'>\n\
62 <TAG_NAME>test-channel-status-01jul2009-v4</TAG_NAME>\n\
63 <DETECTOR_NAME>HCAL</DETECTOR_NAME>\n\
64 <COMMENT_DESCRIPTION>testing channel status recording</COMMENT_DESCRIPTION>\n\
70 <DATA_SET idref='-1'/>\n\
76 const XMLByte * _template = (
const XMLByte *)_str;
77 _root =
new MemBufInputSource( _template, strlen( (
const char *)_template ),
"_root",
false );
82 set_header_table_name(extension_table_name);
83 set_header_type(type_name);
85 set_header_channel_map(channel_map);
86 set_elements_dataset_id(data_set_id);
87 set_elements_iov_id(iov_id);
88 set_elements_iov_begin(iov_begin);
89 set_elements_iov_end(iov_end);
90 set_elements_tag_id(tag_id);
91 set_elements_tag_mode(tag_mode);
92 set_elements_tag_name(tag_name);
93 set_elements_detector_name(detector_name);
95 set_maps_tag_idref(tag_idref);
96 set_maps_iov_idref(iov_idref);
97 set_maps_dataset_idref(data_set_idref);
99 static const char * _str2 =
"\
101 <COMMENT_DESCRIPTION>test-channel-status-26jun2009-v1</COMMENT_DESCRIPTION>\n\
102 <CREATE_TIMESTAMP>2009-04-06 17:36:40.0</CREATE_TIMESTAMP>\n\
103 <CREATED_BY_USER>user</CREATED_BY_USER>\n\
104 <VERSION>test-channel-status-26jun2009-v1</VERSION>\n\
105 <SUBVERSION>1</SUBVERSION>\n\
107 <EXTENSION_TABLE_NAME>HCAL_CHANNELS</EXTENSION_TABLE_NAME>\n\
113 const XMLByte * _template2 = (
const XMLByte *)_str2;
114 _dataset =
new MemBufInputSource( _template2, strlen( (
const char *)_template2 ),
"_dataset",
false );
119 dataset_comment = hcal_ass.getRandomQuote();
126 DOMElement * _channel = get_channel_element(_dataset);
134 return (DOMNode *)_channel;
140 DOMDocument * dataset_doc = dataset_block . getDocument();
141 DOMElement * root_elem = (DOMElement *)(document -> getElementsByTagName(
XMLProcessor::_toXMLCh(
"ROOT" ) ) -> item(0));
142 DOMNode * dataset_node = document -> importNode( dataset_doc -> getDocumentElement(),
true );
143 root_elem -> appendChild( dataset_node );
152 time_t _offset = global_timestamp;
153 sprintf( _buf,
"%d", (uint32_t)_offset );
156 _version.append(tag_name);
157 _version.append(
".");
158 _version.append(_buf);
160 DOMElement * dataset_elem = (DOMElement *)dataset_node;
161 setTagValue(dataset_elem,
"COMMENT_DESCRIPTION", dataset_comment);
162 setTagValue(dataset_elem,
"CREATE_TIMESTAMP", getTimestamp(time(0)));
163 setTagValue(dataset_elem,
"CREATED_BY_USER",
username);
164 setTagValue(dataset_elem,
"VERSION", _version);
165 setTagValue(dataset_elem,
"SUBVERSION", dataset_count);
169 setTagValue(dataset_elem,
"EXTENSION_TABLE_NAME", channel_map);
171 if (dataset_node) ++dataset_count;
177 DOMElement * _element = 0;
179 _element = (DOMElement *)(((DOMElement *)_dataset) -> getElementsByTagName(
XMLProcessor::_toXMLCh(
"DATA"))->item( 0 ));
186 DOMElement * _element = 0;
188 _element = (DOMElement *)(((DOMElement *)_dataset) -> getElementsByTagName(
XMLProcessor::_toXMLCh(
"CHANNEL"))->item( 0 ));
195 extension_table_name =
name;
196 DOMElement * _header = (DOMElement *)(document -> getElementsByTagName(
XMLString::transcode(
"HEADER") ) -> item(0));
197 return setTagValue(_header,
"EXTENSION_TABLE_NAME", extension_table_name);
203 DOMElement * _header = (DOMElement *)(document -> getElementsByTagName(
XMLString::transcode(
"HEADER") ) -> item(0));
204 return setTagValue(_header,
"NAME", type_name);
210 DOMElement * _header = (DOMElement *)(document -> getElementsByTagName(
XMLString::transcode(
"HEADER") ) -> item(0));
211 return setTagValue(_header,
"RUN_NUMBER",
run_number);
217 DOMElement * _header = (DOMElement *)(document -> getElementsByTagName(
XMLString::transcode(
"HEADER") ) -> item(0));
218 return setTagAttribute(_header,
"HINTS",
"channelmap", channel_map);
224 DOMElement * _elements = (DOMElement *)(document -> getElementsByTagName(
XMLString::transcode(
"ELEMENTS") ) -> item(0));
225 return setTagAttribute(_elements,
"DATA_SET",
"id", data_set_id);
231 DOMElement * _elements = (DOMElement *)(document -> getElementsByTagName(
XMLString::transcode(
"ELEMENTS") ) -> item(0));
232 return setTagAttribute(_elements,
"IOV",
"id", iov_id);
238 DOMElement * _elements = (DOMElement *)(document -> getElementsByTagName(
XMLString::transcode(
"ELEMENTS") ) -> item(0));
239 return setTagValue(_elements,
"INTERVAL_OF_VALIDITY_BEGIN", iov_begin);
245 DOMElement * _elements = (DOMElement *)(document -> getElementsByTagName(
XMLString::transcode(
"ELEMENTS") ) -> item(0));
246 return setTagValue(_elements,
"INTERVAL_OF_VALIDITY_END", iov_end);
252 DOMElement * _elements = (DOMElement *)(document -> getElementsByTagName(
XMLString::transcode(
"ELEMENTS") ) -> item(0));
253 return setTagAttribute(_elements,
"TAG",
"id", tag_id);
259 DOMElement * _elements = (DOMElement *)(document -> getElementsByTagName(
XMLString::transcode(
"ELEMENTS") ) -> item(0));
260 return setTagAttribute(_elements,
"TAG",
"mode", tag_mode);
266 DOMElement * _elements = (DOMElement *)(document -> getElementsByTagName(
XMLString::transcode(
"ELEMENTS") ) -> item(0));
267 return setTagValue(_elements,
"TAG_NAME", tag_name);
272 detector_name =
value;
273 DOMElement * _elements = (DOMElement *)(document -> getElementsByTagName(
XMLString::transcode(
"ELEMENTS") ) -> item(0));
274 return setTagValue(_elements,
"DETECTOR_NAME", detector_name);
280 DOMElement * _elements = (DOMElement *)(document -> getElementsByTagName(
XMLString::transcode(
"ELEMENTS") ) -> item(0));
281 return setTagValue(_elements,
"COMMENT_DESCRIPTION",
comment);
287 DOMElement * _maps = (DOMElement *)(document -> getElementsByTagName(
XMLString::transcode(
"MAPS") ) -> item(0));
288 return setTagAttribute(_maps,
"TAG",
"idref", tag_idref);
294 DOMElement * _maps = (DOMElement *)(document -> getElementsByTagName(
XMLString::transcode(
"MAPS") ) -> item(0));
295 return setTagAttribute(_maps,
"IOV",
"idref", iov_idref);
300 data_set_idref =
value;
301 DOMElement * _maps = (DOMElement *)(document -> getElementsByTagName(
XMLString::transcode(
"MAPS") ) -> item(0));
302 return setTagAttribute(_maps,
"DATA_SET",
"idref", data_set_idref);
XERCES_CPP_NAMESPACE::DOMNode * set_header_channel_map(std::string name)
XERCES_CPP_NAMESPACE::DOMNode * set_elements_detector_name(std::string value)
XERCES_CPP_NAMESPACE::DOMNode * add_hcal_channel(XERCES_CPP_NAMESPACE::DOMNode *_dataset, int ieta, int iphi, int depth, std::string subdetector)
XERCES_CPP_NAMESPACE::DOMNode * set_header_run_number(int run)
XERCES_CPP_NAMESPACE::DOMElement * get_data_element(XERCES_CPP_NAMESPACE::DOMNode *_dataset)
Evaluator * parse(const T &text)
XERCES_CPP_NAMESPACE::DOMNode * add_dataset(void)
XERCES_CPP_NAMESPACE::DOMNode * set_maps_iov_idref(int value)
XERCES_CPP_NAMESPACE::DOMNode * set_elements_iov_begin(int value)
XERCES_CPP_NAMESPACE::DOMNode * set_header_table_name(std::string name)
XERCES_CPP_NAMESPACE::DOMNode * set_maps_dataset_idref(int value)
XERCES_CPP_NAMESPACE::DOMNode * set_header_type(std::string type)
XERCES_CPP_NAMESPACE::DOMNode * set_maps_tag_idref(int value)
XMLCh * transcode(const T &fInput)
XERCES_CPP_NAMESPACE::DOMNode * set_elements_comment(std::string value)
virtual ~HcalChannelDataXml()
XERCES_CPP_NAMESPACE::DOMElement * get_channel_element(XERCES_CPP_NAMESPACE::DOMNode *_dataset)
XERCES_CPP_NAMESPACE::DOMNode * set_elements_dataset_id(int id)
XERCES_CPP_NAMESPACE::DOMNode * set_elements_iov_id(int id)
static XMLCh * _toXMLCh(std::string temp)
XERCES_CPP_NAMESPACE::DOMNode * set_elements_tag_id(int value)
XERCES_CPP_NAMESPACE::DOMNode * set_elements_tag_mode(std::string value)
XERCES_CPP_NAMESPACE::DOMNode * set_elements_iov_end(int value)
XERCES_CPP_NAMESPACE::DOMNode * set_elements_tag_name(std::string value)