#include <CaloOnlineTools/HcalOnlineDb/interface/XMLHTRPatternLoader.h>
Public Types | |
typedef XMLHTRPatternLoader::_checksumsDBConfig | checksumsDBConfig |
typedef XMLHTRPatternLoader::_datasetDBConfig | datasetDBConfig |
typedef XMLHTRPatternLoader::_loaderBaseConfig | loaderBaseConfig |
Public Member Functions | |
int | addChecksums (checksumsDBConfig *config, string templateFileName="HCAL_HTR_DATA_PATTERNS.checksums.template") |
int | addPattern (datasetDBConfig *config, string templateFileName="HCAL_HTR_DATA_PATTERNS.dataset.template") |
int | createLoader (vector< int > crate_number, vector< string > file_name) |
XMLHTRPatternLoader (XMLProcessor::loaderBaseConfig *config, string templateBase="HCAL_HTR_DATA_PATTERNS.XMLloader.template") | |
XMLHTRPatternLoader () | |
virtual | ~XMLHTRPatternLoader () |
Private Member Functions | |
const XMLHTRPatternLoader & | operator= (const XMLHTRPatternLoader &) |
XMLHTRPatternLoader (const XMLHTRPatternLoader &) | |
Classes | |
struct | _checksumsDBConfig |
struct | _datasetDBConfig |
struct | _loaderBaseConfig |
Usage: <usage>
Definition at line 30 of file XMLHTRPatternLoader.h.
XMLHTRPatternLoader::XMLHTRPatternLoader | ( | ) |
XMLHTRPatternLoader::XMLHTRPatternLoader | ( | XMLProcessor::loaderBaseConfig * | config, | |
string | templateBase = "HCAL_HTR_DATA_PATTERNS.XMLloader.template" | |||
) |
Definition at line 68 of file XMLHTRPatternLoader.cc.
References name, XMLDOMBlock::setTagAttribute(), and XMLDOMBlock::setTagValue().
00068 : XMLDOMBlock( templateBase ) 00069 { 00070 setTagValue( "EXTENSION_TABLE_NAME", config -> extention_table_name ); 00071 setTagValue( "NAME", config -> name ); 00072 setTagAttribute( "RUN", "mode", config -> run_mode ); 00073 setTagAttribute( "DATA_SET", "id", config -> data_set_id ); 00074 setTagAttribute( "IOV", "id", config -> iov_id ); 00075 setTagValue( "INTERVAL_OF_VALIDITY_BEGIN", config -> iov_begin ); 00076 setTagValue( "INTERVAL_OF_VALIDITY_END", config -> iov_end ); 00077 setTagAttribute( "TAG", "id", config -> tag_id ); 00078 setTagAttribute( "TAG", "mode", config -> tag_mode ); 00079 setTagValue( "TAG_NAME", config -> tag_name ); 00080 setTagValue( "DETECTOR_NAME", config -> detector_name ); 00081 setTagValue( "COMMENT_DESCRIPTION", config -> comment_description ); 00082 00083 setTagAttribute( "TAG", "idref", config -> tag_id, 1 ); 00084 setTagAttribute( "IOV", "idref", config -> iov_id, 1 ); 00085 setTagAttribute( "DATA_SET", "idref", config -> data_set_id, 1 ); 00086 }
XMLHTRPatternLoader::~XMLHTRPatternLoader | ( | ) | [virtual] |
XMLHTRPatternLoader::XMLHTRPatternLoader | ( | const XMLHTRPatternLoader & | ) | [private] |
int XMLHTRPatternLoader::addChecksums | ( | checksumsDBConfig * | config, | |
string | templateFileName = "HCAL_HTR_DATA_PATTERNS.checksums.template" | |||
) |
Definition at line 139 of file XMLHTRPatternLoader.cc.
References XMLDOMBlock::document, XMLDOMBlock::getDocument(), pydbsAccessor::root, XMLDOMBlock::setTagValue(), and version().
00140 { 00141 DOMElement * root = document -> getDocumentElement(); 00142 00143 XMLDOMBlock dataSetDoc( templateFileName ); 00144 DOMDocument * dataSet = dataSetDoc . getDocument(); 00145 00146 // changes to the Checksums <data_set> node 00147 setTagValue( "VERSION", config -> version, 0, dataSet ); 00148 setTagValue( "SUBVERSION", config -> subversion, 0, dataSet ); 00149 char timebuf[50]; 00150 //strftime( timebuf, 50, "%c", gmtime( &(config -> create_timestamp) ) ); 00151 strftime( timebuf, 50, "%Y-%m-%d %H:%M:%S.0", gmtime( &(config -> create_timestamp) ) ); 00152 setTagValue( "CREATE_TIMESTAMP", timebuf , 0, dataSet ); 00153 setTagValue( "CREATED_BY_USER", config -> created_by_user, 0, dataSet ); 00154 setTagValue( "COMMENT_DESCRIPTION", config -> comment_description, 0, dataSet ); 00155 setTagValue( "NAME_LABEL", config -> name_label, 0, dataSet ); 00156 setTagValue( "HTR_DATA_PATTERNS_DATA_FILE", config -> htr_data_patterns_data_file, 0, dataSet ); 00157 setTagValue( "CRATE", config -> crate, 0, dataSet ); 00158 00159 // copy the <data_set> node into the final XML 00160 DOMNode * cloneDataSet = document -> importNode( dataSet -> getDocumentElement(), true ); 00161 root -> appendChild( cloneDataSet ); 00162 00163 return 0; 00164 }
int XMLHTRPatternLoader::addPattern | ( | datasetDBConfig * | config, | |
string | templateFileName = "HCAL_HTR_DATA_PATTERNS.dataset.template" | |||
) |
Definition at line 112 of file XMLHTRPatternLoader.cc.
References XMLDOMBlock::document, XMLDOMBlock::getDocument(), pydbsAccessor::root, XMLDOMBlock::setTagValue(), and version().
Referenced by createLoader().
00113 { 00114 DOMElement * root = document -> getDocumentElement(); 00115 00116 XMLDOMBlock dataSetDoc( templateFileName ); 00117 DOMDocument * dataSet = dataSetDoc . getDocument(); 00118 00119 // changes to the HTRPATTERN <data_set> node 00120 setTagValue( "VERSION", config -> version, 0, dataSet ); 00121 setTagValue( "SUBVERSION", config -> subversion, 0, dataSet ); 00122 char timebuf[50]; 00123 //strftime( timebuf, 50, "%c", gmtime( &(config -> create_timestamp) ) ); 00124 strftime( timebuf, 50, "%Y-%m-%d %H:%M:%S.0", gmtime( &(config -> create_timestamp) ) ); 00125 setTagValue( "CREATE_TIMESTAMP", timebuf , 0, dataSet ); 00126 setTagValue( "CREATED_BY_USER", config -> created_by_user, 0, dataSet ); 00127 setTagValue( "KIND_OF_PART", config -> kind_of_part, 0, dataSet ); 00128 setTagValue( "NAME_LABEL", config -> name_label, 0, dataSet ); 00129 setTagValue( "HTR_DATA_PATTERNS_DATA_FILE", config -> htr_data_patterns_data_file, 0, dataSet ); 00130 setTagValue( "CRATE", config -> crate, 0, dataSet ); 00131 00132 // copy the <data_set> node into the final XML 00133 DOMNode * cloneDataSet = document -> importNode( dataSet -> getDocumentElement(), true ); 00134 root -> appendChild( cloneDataSet ); 00135 00136 return 0; 00137 }
Definition at line 166 of file XMLHTRPatternLoader.cc.
References addPattern(), bitset_utilities::append(), begin, dbtoconf::conf, end, and XMLDOMBlock::write().
00167 { 00168 XMLHTRPatternLoader::datasetDBConfig conf; 00169 00170 for ( vector<string>::const_iterator _file = file_name . begin(); _file != file_name . end(); _file++ ) 00171 { 00172 conf . htr_data_patterns_data_file = *_file; 00173 conf . htr_data_patterns_data_file += ".dat"; 00174 conf . crate = crate_number[ _file - file_name . begin() ]; 00175 00176 char _buf[128]; 00177 sprintf( _buf, "CRATE%.2d", conf . crate ); 00178 string _namelabel; 00179 _namelabel . append( _buf ); 00180 conf . name_label = _namelabel; 00181 addPattern( &conf ); 00182 } 00183 00184 write( "HTRPatternLoader.xml" ); 00185 00186 return 0; 00187 }
const XMLHTRPatternLoader& XMLHTRPatternLoader::operator= | ( | const XMLHTRPatternLoader & | ) | [private] |