28 comment = hcal_ass.getRandomQuote();
44 static const char * _str =
"\
48 <EXTENSION_TABLE_NAME>HCAL_CHANNEL_QUALITY_V1</EXTENSION_TABLE_NAME>\n\
49 <NAME>HCAL Channel Quality [V1]</NAME>\n\
52 <RUN_NUMBER>1</RUN_NUMBER>\n\
54 <HINTS channelmap='HCAL_CHANNELS'/>\n\
57 <DATA_SET id='-1'/>\n\
59 <INTERVAL_OF_VALIDITY_BEGIN>1</INTERVAL_OF_VALIDITY_BEGIN>\n\
60 <INTERVAL_OF_VALIDITY_END>-1</INTERVAL_OF_VALIDITY_END>\n\
62 <TAG id='2' mode='auto'>\n\
63 <TAG_NAME>test-channel-status-01jul2009-v4</TAG_NAME>\n\
64 <DETECTOR_NAME>HCAL</DETECTOR_NAME>\n\
65 <COMMENT_DESCRIPTION>testing channel status recording</COMMENT_DESCRIPTION>\n\
71 <DATA_SET idref='-1'/>\n\
77 const XMLByte * _template = (
const XMLByte *)_str;
78 _root =
new MemBufInputSource( _template, strlen( (
const char *)_template ),
"_root",
false );
83 set_header_table_name(extension_table_name);
84 set_header_type(type_name);
85 set_header_run_number(run_number);
86 set_header_channel_map(channel_map);
87 set_elements_dataset_id(data_set_id);
88 set_elements_iov_id(iov_id);
89 set_elements_iov_begin(iov_begin);
90 set_elements_iov_end(iov_end);
91 set_elements_tag_id(tag_id);
92 set_elements_tag_mode(tag_mode);
93 set_elements_tag_name(tag_name);
94 set_elements_detector_name(detector_name);
96 set_maps_tag_idref(tag_idref);
97 set_maps_iov_idref(iov_idref);
98 set_maps_dataset_idref(data_set_idref);
100 static const char * _str2 =
"\
102 <COMMENT_DESCRIPTION>test-channel-status-26jun2009-v1</COMMENT_DESCRIPTION>\n\
103 <CREATE_TIMESTAMP>2009-04-06 17:36:40.0</CREATE_TIMESTAMP>\n\
104 <CREATED_BY_USER>user</CREATED_BY_USER>\n\
105 <VERSION>test-channel-status-26jun2009-v1</VERSION>\n\
106 <SUBVERSION>1</SUBVERSION>\n\
108 <EXTENSION_TABLE_NAME>HCAL_CHANNELS</EXTENSION_TABLE_NAME>\n\
114 const XMLByte * _template2 = (
const XMLByte *)_str2;
115 _dataset =
new MemBufInputSource( _template2, strlen( (
const char *)_template2 ),
"_dataset",
false );
120 dataset_comment = hcal_ass.getRandomQuote();
127 DOMElement * _channel = get_channel_element(_dataset);
135 return (DOMNode *)_channel;
141 DOMDocument * dataset_doc = dataset_block . getDocument();
142 DOMElement * root_elem = (DOMElement *)(document -> getElementsByTagName(
XMLProcessor::_toXMLCh(
"ROOT" ) ) -> item(0));
143 DOMNode * dataset_node = document -> importNode( dataset_doc -> getDocumentElement(),
true );
144 root_elem -> appendChild( dataset_node );
153 time_t _offset = global_timestamp;
154 sprintf( _buf,
"%d", (uint32_t)_offset );
155 std::string _version;
157 _version.append(tag_name);
158 _version.append(
".");
159 _version.append(_buf);
161 DOMElement * dataset_elem = (DOMElement *)dataset_node;
162 setTagValue(dataset_elem,
"COMMENT_DESCRIPTION", dataset_comment);
163 setTagValue(dataset_elem,
"CREATE_TIMESTAMP", getTimestamp(
time(0)));
164 setTagValue(dataset_elem,
"CREATED_BY_USER",
username);
165 setTagValue(dataset_elem,
"VERSION", _version);
166 setTagValue(dataset_elem,
"SUBVERSION", dataset_count);
170 setTagValue(dataset_elem,
"EXTENSION_TABLE_NAME", channel_map);
172 if (dataset_node) ++dataset_count;
178 DOMElement * _element = 0;
180 _element = (DOMElement *)(((DOMElement *)_dataset) -> getElementsByTagName(
XMLProcessor::_toXMLCh(
"DATA"))->item( 0 ));
187 DOMElement * _element = 0;
189 _element = (DOMElement *)(((DOMElement *)_dataset) -> getElementsByTagName(
XMLProcessor::_toXMLCh(
"CHANNEL"))->item( 0 ));
196 extension_table_name =
name;
197 DOMElement * _header = (DOMElement *)(document -> getElementsByTagName( XMLString::transcode(
"HEADER") ) -> item(0));
198 return setTagValue(_header,
"EXTENSION_TABLE_NAME", extension_table_name);
204 DOMElement * _header = (DOMElement *)(document -> getElementsByTagName( XMLString::transcode(
"HEADER") ) -> item(0));
205 return setTagValue(_header,
"NAME", type_name);
211 DOMElement * _header = (DOMElement *)(document -> getElementsByTagName( XMLString::transcode(
"HEADER") ) -> item(0));
212 return setTagValue(_header,
"RUN_NUMBER", run_number);
218 DOMElement * _header = (DOMElement *)(document -> getElementsByTagName( XMLString::transcode(
"HEADER") ) -> item(0));
219 return setTagAttribute(_header,
"HINTS",
"channelmap", channel_map);
225 DOMElement * _elements = (DOMElement *)(document -> getElementsByTagName( XMLString::transcode(
"ELEMENTS") ) -> item(0));
226 return setTagAttribute(_elements,
"DATA_SET",
"id", data_set_id);
232 DOMElement * _elements = (DOMElement *)(document -> getElementsByTagName( XMLString::transcode(
"ELEMENTS") ) -> item(0));
233 return setTagAttribute(_elements,
"IOV",
"id", iov_id);
239 DOMElement * _elements = (DOMElement *)(document -> getElementsByTagName( XMLString::transcode(
"ELEMENTS") ) -> item(0));
240 return setTagValue(_elements,
"INTERVAL_OF_VALIDITY_BEGIN", iov_begin);
246 DOMElement * _elements = (DOMElement *)(document -> getElementsByTagName( XMLString::transcode(
"ELEMENTS") ) -> item(0));
247 return setTagValue(_elements,
"INTERVAL_OF_VALIDITY_END", iov_end);
253 DOMElement * _elements = (DOMElement *)(document -> getElementsByTagName( XMLString::transcode(
"ELEMENTS") ) -> item(0));
254 return setTagAttribute(_elements,
"TAG",
"id", tag_id);
260 DOMElement * _elements = (DOMElement *)(document -> getElementsByTagName( XMLString::transcode(
"ELEMENTS") ) -> item(0));
261 return setTagAttribute(_elements,
"TAG",
"mode", tag_mode);
267 DOMElement * _elements = (DOMElement *)(document -> getElementsByTagName( XMLString::transcode(
"ELEMENTS") ) -> item(0));
268 return setTagValue(_elements,
"TAG_NAME", tag_name);
273 detector_name =
value;
274 DOMElement * _elements = (DOMElement *)(document -> getElementsByTagName( XMLString::transcode(
"ELEMENTS") ) -> item(0));
275 return setTagValue(_elements,
"DETECTOR_NAME", detector_name);
281 DOMElement * _elements = (DOMElement *)(document -> getElementsByTagName( XMLString::transcode(
"ELEMENTS") ) -> item(0));
282 return setTagValue(_elements,
"COMMENT_DESCRIPTION",
comment);
288 DOMElement * _maps = (DOMElement *)(document -> getElementsByTagName( XMLString::transcode(
"MAPS") ) -> item(0));
289 return setTagAttribute(_maps,
"TAG",
"idref", tag_idref);
295 DOMElement * _maps = (DOMElement *)(document -> getElementsByTagName( XMLString::transcode(
"MAPS") ) -> item(0));
296 return setTagAttribute(_maps,
"IOV",
"idref", iov_idref);
301 data_set_idref =
value;
302 DOMElement * _maps = (DOMElement *)(document -> getElementsByTagName( XMLString::transcode(
"MAPS") ) -> item(0));
303 return setTagAttribute(_maps,
"DATA_SET",
"idref", data_set_idref);
DOMNode * set_header_channel_map(std::string name)
DOMElement * get_channel_element(DOMNode *_dataset)
DOMNode * set_elements_detector_name(std::string value)
DOMNode * set_header_run_number(int run)
Evaluator * parse(const T &text)
DOMNode * add_dataset(void)
DOMNode * set_maps_iov_idref(int value)
DOMNode * set_elements_iov_begin(int value)
DOMNode * set_header_table_name(std::string name)
DOMElement * get_data_element(DOMNode *_dataset)
DOMNode * set_maps_dataset_idref(int value)
DOMNode * set_header_type(std::string type)
DOMNode * set_maps_tag_idref(int value)
DOMNode * set_elements_comment(std::string value)
virtual ~HcalChannelDataXml()
DOMNode * set_elements_dataset_id(int id)
DOMNode * set_elements_iov_id(int id)
static XMLCh * _toXMLCh(std::string temp)
DOMNode * set_elements_tag_id(int value)
DOMNode * set_elements_tag_mode(std::string value)
DOMNode * add_hcal_channel(DOMNode *_dataset, int ieta, int iphi, int depth, std::string subdetector)
DOMNode * set_elements_iov_end(int value)
DOMNode * set_elements_tag_name(std::string value)