36 name =
"HCAL RBX configuration [PEDESTAL]";
61 setTagValue(
"EXTENSION_TABLE_NAME", config -> extention_table_name );
66 setTagValue(
"INTERVAL_OF_VALIDITY_BEGIN", config -> iov_begin );
67 setTagValue(
"INTERVAL_OF_VALIDITY_END", config -> iov_end );
71 setTagValue(
"DETECTOR_NAME", config -> detector_name );
72 setTagValue(
"COMMENT_DESCRIPTION", config -> elements_comment_description );
95 strftime( timebuf, 50,
"%Y-%m-%d %H:%M:%S.0", gmtime( &(config -> create_timestamp) ) );
96 setTagValue(
"CREATE_TIMESTAMP", timebuf , 0, dataSet );
97 setTagValue(
"CREATED_BY_USER", config -> created_by_user, 0, dataSet );
99 setTagValue(
"SUBVERSION", config -> subversion, 0, dataSet );
100 setTagValue(
"COMMENT_DESCRIPTION", config -> comment_description, 0, dataSet );
101 setTagValue(
"NAME_LABEL", config -> name_label, 0, dataSet );
102 setTagValue(
"KIND_OF_PART", config -> kind_of_part, 0, dataSet );
107 DOMDocument * rbxBrick = rbxBrickDoc .
getDocument();
108 if ( rbx_config_type ==
"pedestals" || rbx_config_type ==
"delays" || rbx_config_type ==
"gols" ){
109 for (
unsigned int _item = 0; _item < rbxBrick -> getElementsByTagName(
XMLProcessor::_toXMLCh(
"Data" ) ) -> getLength(); _item++ ){
110 DOMElement * dataset_root = dataSet -> getDocumentElement();
117 MemBufInputSource * _data;
118 if ( rbx_config_type ==
"pedestals" || rbx_config_type ==
"delays" ){
124 else if ( rbx_config_type ==
"gols" ){
135 std::cout <<
"XMLRBXPedestalsLoader::addRBXSlot(): Unknown config type... exiting" << std::endl;
140 std::string _value = rbxBrickDoc .
getTagValue(
"Data", _item );
141 if ( rbx_config_type ==
"pedestals" || rbx_config_type ==
"delays" ){
146 else if ( rbx_config_type ==
"gols" ){
151 else if ( rbx_config_type ==
"gols" ){
156 else if ( rbx_config_type ==
"leds" ){
162 std::cout <<
"XMLRBXPedestalsLoader::addRBXSlot(): Unknown config type... exiting" << std::endl;
166 DOMNode * cloneData = dataSet -> importNode( data -> getDocumentElement(),
true );
167 dataset_root -> appendChild( cloneData );
170 else if ( rbx_config_type ==
"leds" ){
171 DOMElement * dataset_root = dataSet -> getDocumentElement();
173 std::string _led_item;
175 MemBufInputSource * _data;
185 _value = rbxBrickDoc .
getTagValue(
"Data", _item );
186 setTagValue(
"LED1_ON_IS_CHECKED", _value, 0, data );
187 setTagValue(
"SET_LEDS_IS_CHECKED", _value, 0, data );
190 _value = rbxBrickDoc .
getTagValue(
"Data", _item );
191 setTagValue(
"LED2_ON_IS_CHECKED", _value, 0, data );
192 if (_value.find(
"0")==std::string::npos){
193 setTagValue(
"SET_LEDS_IS_CHECKED", _value, 0, data );
197 _value = rbxBrickDoc .
getTagValue(
"Data", _item );
201 _value = rbxBrickDoc .
getTagValue(
"Data", _item );
204 DOMNode * cloneData = dataSet -> importNode( data -> getDocumentElement(),
true );
205 dataset_root -> appendChild( cloneData );
209 DOMNode * cloneDataSet =
document -> importNode( dataSet -> getDocumentElement(),
true );
210 root -> appendChild( cloneDataSet );
214 int parameter_iter = -1;
218 _name = rbxBrickDoc .
getTagAttribute(
"Parameter",
"name", parameter_iter );
220 }
while( _name !=
"CREATIONTAG" );
221 std::string _creationtag = rbxBrickDoc .
getTagValue(
"Parameter", parameter_iter );
229 _name = rbxBrickDoc .
getTagAttribute(
"Parameter",
"name", parameter_iter );
231 }
while( _name !=
"RBX" );
232 std::string _rbx = rbxBrickDoc .
getTagValue(
"Parameter", parameter_iter );
240 if (_rbx.find(
"ZDC01")!=std::string::npos){
242 std::cout <<
" --> ZDC RBX!" << std::endl;
250 std::string _fourth = rbx . substr(0,4);
251 if ( _fourth ==
"HBM0" || _fourth ==
"HBP0" || _fourth ==
"HEP0" || _fourth ==
"HFP0" || _fourth ==
"HOP0" || _fourth ==
"HOM0" ) rbx . erase( 3, 1 );
253 if ( rbx ==
"HO0M02" ) rbx =
"HO0M2";
254 if ( rbx ==
"HO0M04" ) rbx =
"HO0M4";
255 if ( rbx ==
"HO0M06" ) rbx =
"HO0M6";
256 if ( rbx ==
"HO0M08" ) rbx =
"HO0M8";
257 if ( rbx ==
"HO0M10" ) rbx =
"HO0M10";
258 if ( rbx ==
"HO0M12" ) rbx =
"HO0M12";
259 if ( rbx ==
"HO0P02" ) rbx =
"HO0P2";
260 if ( rbx ==
"HO0P04" ) rbx =
"HO0P4";
261 if ( rbx ==
"HO0P06" ) rbx =
"HO0P6";
262 if ( rbx ==
"HO0P08" ) rbx =
"HO0P8";
263 if ( rbx ==
"HO0P10" ) rbx =
"HO0P10";
264 if ( rbx ==
"HO0P12" ) rbx =
"HO0P12";
272 static const char * _str =
"\
274 <MODULE_POSITION>2</MODULE_POSITION>\n\
275 <QIE_CARD_POSITION>1</QIE_CARD_POSITION>\n\
276 <QIE_ADC_NUMBER>0</QIE_ADC_NUMBER>\n\
277 <INTEGER_VALUE>4</INTEGER_VALUE>\n\
280 const XMLByte * _template = (
const XMLByte *)_str;
281 _data_ped_delay =
new MemBufInputSource( _template, strlen( (
const char *)_template ),
"_data_ped_delay",
false );
284 static const char * _str2 =
"\
286 <MODULE_POSITION>2</MODULE_POSITION>\n\
287 <QIE_CARD_POSITION>1</QIE_CARD_POSITION>\n\
288 <FIBER_NUMBER>0</FIBER_NUMBER>\n\
289 <INTEGER_VALUE>4</INTEGER_VALUE>\n\
292 const XMLByte * _template2 = (
const XMLByte *)_str2;
293 _data_gol =
new MemBufInputSource( _template2, strlen( (
const char *)_template2 ),
"_data_gol",
false );
296 static const char * _str3 =
"\
298 <RM1_IS_CHECKED>1</RM1_IS_CHECKED>\n\
299 <RM2_IS_CHECKED>1</RM2_IS_CHECKED>\n\
300 <RM3_IS_CHECKED>1</RM3_IS_CHECKED>\n\
301 <RM4_IS_CHECKED>1</RM4_IS_CHECKED>\n\
302 <CALIB_IS_CHECKED>1</CALIB_IS_CHECKED>\n\
303 <RESET1_IS_CHECKED>1</RESET1_IS_CHECKED>\n\
304 <RESET1_VALUE>40</RESET1_VALUE>\n\
305 <RESET1_WAIT_CYCLES>3</RESET1_WAIT_CYCLES>\n\
306 <RESET2_IS_CHECKED>1</RESET2_IS_CHECKED>\n\
307 <RESET2_VALUE>40</RESET2_VALUE>\n\
308 <RESET2_WAIT_CYCLES>3</RESET2_WAIT_CYCLES>\n\
309 <SET_LEDS_IS_CHECKED>0</SET_LEDS_IS_CHECKED>\n\
310 <LED1_ON_IS_CHECKED>0</LED1_ON_IS_CHECKED>\n\
311 <LED2_ON_IS_CHECKED>0</LED2_ON_IS_CHECKED>\n\
312 <LED_AMPLITUDE>128</LED_AMPLITUDE>\n\
313 <LED_DELAY>1000</LED_DELAY>\n\
314 <TTCRX_PHASE>100</TTCRX_PHASE>\n\
315 <BROADCAST_SETTINGS>1</BROADCAST_SETTINGS>\n\
316 <QIE_RESET_DELAY>5</QIE_RESET_DELAY>\n\
317 <BUNCH_NUMBER>2000</BUNCH_NUMBER>\n\
320 const XMLByte * _template3 = (
const XMLByte *)_str3;
321 _data_led =
new MemBufInputSource( _template3, strlen( (
const char *)_template3 ),
"_data_led",
false );
MemBufInputSource * _data_led
virtual ~XMLRBXPedestalsLoader()
std::string extention_table_name
XMLRBXPedestalsLoader(loaderBaseConfig *config, std::string templateBase="HCAL_RBX_PEDESTALS_TYPE01.XMLloader.template")
DOMDocument * getDocument(void)
int fixRbxName(std::string &)
std::string elements_comment_description
static XMLCh * _toXMLCh(std::string temp)
MemBufInputSource * _data_ped_delay
const char * getTagValue(const std::string &tagName, int _item=0, DOMDocument *_document=NULL)
std::string comment_description
MemBufInputSource * _data_gol
std::string detector_name
int addRBXSlot(datasetDBConfig *config, std::string brickFileName, std::string rbx_config_type="pedestals", std::string templateFileName="HCAL_RBX_PEDESTALS_TYPE01.dataset.template")
DOMNode * setTagValue(const std::string &tagName, const std::string &tagValue, int _item=0, DOMDocument *_document=NULL)
DOMNode * setTagAttribute(const std::string &tagName, const std::string &attrName, const std::string &attrValue, int _item=0)
string root
initialization
const char * getTagAttribute(const std::string &tagName, const std::string &attrName, int _item=0)