35 name =
"HCAL RBX configuration [PEDESTAL]";
60 setTagValue(
"EXTENSION_TABLE_NAME", config -> extention_table_name );
65 setTagValue(
"INTERVAL_OF_VALIDITY_BEGIN", config -> iov_begin );
66 setTagValue(
"INTERVAL_OF_VALIDITY_END", config -> iov_end );
70 setTagValue(
"DETECTOR_NAME", config -> detector_name );
71 setTagValue(
"COMMENT_DESCRIPTION", config -> elements_comment_description );
94 strftime( timebuf, 50,
"%Y-%m-%d %H:%M:%S.0", gmtime( &(config -> create_timestamp) ) );
95 setTagValue(
"CREATE_TIMESTAMP", timebuf , 0, dataSet );
96 setTagValue(
"CREATED_BY_USER", config -> created_by_user, 0, dataSet );
98 setTagValue(
"SUBVERSION", config -> subversion, 0, dataSet );
99 setTagValue(
"COMMENT_DESCRIPTION", config -> comment_description, 0, dataSet );
100 setTagValue(
"NAME_LABEL", config -> name_label, 0, dataSet );
101 setTagValue(
"KIND_OF_PART", config -> kind_of_part, 0, dataSet );
106 DOMDocument * rbxBrick = rbxBrickDoc .
getDocument();
107 if ( rbx_config_type ==
"pedestals" || rbx_config_type ==
"delays" || rbx_config_type ==
"gols" ){
108 for (
unsigned int _item = 0; _item < rbxBrick -> getElementsByTagName(
XMLProcessor::_toXMLCh(
"Data" ) ) -> getLength(); _item++ ){
109 DOMElement * dataset_root = dataSet -> getDocumentElement();
116 MemBufInputSource * _data;
117 if ( rbx_config_type ==
"pedestals" || rbx_config_type ==
"delays" ){
123 else if ( rbx_config_type ==
"gols" ){
134 std::cout <<
"XMLRBXPedestalsLoader::addRBXSlot(): Unknown config type... exiting" << std::endl;
140 if ( rbx_config_type ==
"pedestals" || rbx_config_type ==
"delays" ){
145 else if ( rbx_config_type ==
"gols" ){
150 else if ( rbx_config_type ==
"gols" ){
155 else if ( rbx_config_type ==
"leds" ){
161 std::cout <<
"XMLRBXPedestalsLoader::addRBXSlot(): Unknown config type... exiting" << std::endl;
165 DOMNode * cloneData = dataSet -> importNode( data -> getDocumentElement(),
true );
166 dataset_root -> appendChild( cloneData );
169 else if ( rbx_config_type ==
"leds" ){
170 DOMElement * dataset_root = dataSet -> getDocumentElement();
174 MemBufInputSource * _data;
184 _value = rbxBrickDoc .
getTagValue(
"Data", _item );
185 setTagValue(
"LED1_ON_IS_CHECKED", _value, 0, data );
186 setTagValue(
"SET_LEDS_IS_CHECKED", _value, 0, data );
189 _value = rbxBrickDoc .
getTagValue(
"Data", _item );
190 setTagValue(
"LED2_ON_IS_CHECKED", _value, 0, data );
191 if (_value.find(
"0")==std::string::npos){
192 setTagValue(
"SET_LEDS_IS_CHECKED", _value, 0, data );
196 _value = rbxBrickDoc .
getTagValue(
"Data", _item );
200 _value = rbxBrickDoc .
getTagValue(
"Data", _item );
203 DOMNode * cloneData = dataSet -> importNode( data -> getDocumentElement(),
true );
204 dataset_root -> appendChild( cloneData );
208 DOMNode * cloneDataSet =
document -> importNode( dataSet -> getDocumentElement(),
true );
209 root -> appendChild( cloneDataSet );
213 int parameter_iter = -1;
217 _name = rbxBrickDoc .
getTagAttribute(
"Parameter",
"name", parameter_iter );
219 }
while( _name !=
"CREATIONTAG" );
228 _name = rbxBrickDoc .
getTagAttribute(
"Parameter",
"name", parameter_iter );
230 }
while( _name !=
"RBX" );
239 if (_rbx.find(
"ZDC01")!=std::string::npos){
241 std::cout <<
" --> ZDC RBX!" << std::endl;
250 if ( _fourth ==
"HBM0" || _fourth ==
"HBP0" || _fourth ==
"HEP0" || _fourth ==
"HFP0" || _fourth ==
"HOP0" || _fourth ==
"HOM0" ) rbx . erase( 3, 1 );
252 if ( rbx ==
"HO0M02" ) rbx =
"HO0M2";
253 if ( rbx ==
"HO0M04" ) rbx =
"HO0M4";
254 if ( rbx ==
"HO0M06" ) rbx =
"HO0M6";
255 if ( rbx ==
"HO0M08" ) rbx =
"HO0M8";
256 if ( rbx ==
"HO0M10" ) rbx =
"HO0M10";
257 if ( rbx ==
"HO0M12" ) rbx =
"HO0M12";
258 if ( rbx ==
"HO0P02" ) rbx =
"HO0P2";
259 if ( rbx ==
"HO0P04" ) rbx =
"HO0P4";
260 if ( rbx ==
"HO0P06" ) rbx =
"HO0P6";
261 if ( rbx ==
"HO0P08" ) rbx =
"HO0P8";
262 if ( rbx ==
"HO0P10" ) rbx =
"HO0P10";
263 if ( rbx ==
"HO0P12" ) rbx =
"HO0P12";
271 static const char * _str =
"\
273 <MODULE_POSITION>2</MODULE_POSITION>\n\
274 <QIE_CARD_POSITION>1</QIE_CARD_POSITION>\n\
275 <QIE_ADC_NUMBER>0</QIE_ADC_NUMBER>\n\
276 <INTEGER_VALUE>4</INTEGER_VALUE>\n\
279 const XMLByte * _template = (
const XMLByte *)_str;
280 _data_ped_delay =
new MemBufInputSource( _template, strlen( (
const char *)_template ),
"_data_ped_delay",
false );
283 static const char * _str2 =
"\
285 <MODULE_POSITION>2</MODULE_POSITION>\n\
286 <QIE_CARD_POSITION>1</QIE_CARD_POSITION>\n\
287 <FIBER_NUMBER>0</FIBER_NUMBER>\n\
288 <INTEGER_VALUE>4</INTEGER_VALUE>\n\
291 const XMLByte * _template2 = (
const XMLByte *)_str2;
292 _data_gol =
new MemBufInputSource( _template2, strlen( (
const char *)_template2 ),
"_data_gol",
false );
295 static const char * _str3 =
"\
297 <RM1_IS_CHECKED>1</RM1_IS_CHECKED>\n\
298 <RM2_IS_CHECKED>1</RM2_IS_CHECKED>\n\
299 <RM3_IS_CHECKED>1</RM3_IS_CHECKED>\n\
300 <RM4_IS_CHECKED>1</RM4_IS_CHECKED>\n\
301 <CALIB_IS_CHECKED>1</CALIB_IS_CHECKED>\n\
302 <RESET1_IS_CHECKED>1</RESET1_IS_CHECKED>\n\
303 <RESET1_VALUE>40</RESET1_VALUE>\n\
304 <RESET1_WAIT_CYCLES>3</RESET1_WAIT_CYCLES>\n\
305 <RESET2_IS_CHECKED>1</RESET2_IS_CHECKED>\n\
306 <RESET2_VALUE>40</RESET2_VALUE>\n\
307 <RESET2_WAIT_CYCLES>3</RESET2_WAIT_CYCLES>\n\
308 <SET_LEDS_IS_CHECKED>0</SET_LEDS_IS_CHECKED>\n\
309 <LED1_ON_IS_CHECKED>0</LED1_ON_IS_CHECKED>\n\
310 <LED2_ON_IS_CHECKED>0</LED2_ON_IS_CHECKED>\n\
311 <LED_AMPLITUDE>128</LED_AMPLITUDE>\n\
312 <LED_DELAY>1000</LED_DELAY>\n\
313 <TTCRX_PHASE>100</TTCRX_PHASE>\n\
314 <BROADCAST_SETTINGS>1</BROADCAST_SETTINGS>\n\
315 <QIE_RESET_DELAY>5</QIE_RESET_DELAY>\n\
316 <BUNCH_NUMBER>2000</BUNCH_NUMBER>\n\
319 const XMLByte * _template3 = (
const XMLByte *)_str3;
320 _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)
char data[epos_bytes_allocation]
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)