17 std::map<std::string, int> colM;
18 std::vector<std::string> colNames;
31 colNames.push_back(
"CONFIG_KEY");
32 colNames.push_back(
"KEY_TYPE");
33 colNames.push_back(
"KEY_ALIAS");
34 colNames.push_back(
"VERSION");
35 colNames.push_back(
"KIND_OF_COND");
36 colNames.push_back(
"TTC_OBJ_DATA_FILE");
37 colNames.push_back(
"TTC_OBJ_DATA_CLOB");
39 for (
unsigned int c = 0;
c < tableMat[0].size();
c++) {
40 for (
unsigned int n = 0;
n < colNames.size();
n++) {
41 if (tableMat[0][
c] == colNames[
n]) {
42 colM[colNames[
n]] =
c;
47 for (
unsigned int n = 0;
n < colNames.size();
n++) {
48 if (colM.find(colNames[
n]) == colM.end()) {
49 std::cerr <<
"[PixelTTCciConfig::PixelTTCciConfig()]\tCouldn't find in the database the column with name " 50 << colNames[
n] << std::endl;
54 ttcConfigStream_ << tableMat[1][colM[
"TTC_OBJ_DATA_CLOB"]];
59 std::string mthn =
"]\t[PixelTKFECConfig::PixelTKFECConfig()]\t\t\t ";
64 throw std::runtime_error(
"Failed to open file " +
filename);
88 out << configstr << endl;
97 std::ofstream *outstream,
98 std::ofstream *out1stream,
99 std::ofstream *out2stream)
const {
100 std::string mthn =
"[PixelTTCciConfig::writeXMLHeader()]\t\t\t ";
101 std::stringstream maskFullPath;
106 std::cout << mthn <<
"Writing to: " << maskFullPath.str() << std::endl;
108 outstream->open(maskFullPath.str().c_str());
110 *outstream <<
"<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" << std::endl;
111 *outstream <<
"<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" << std::endl;
112 *outstream <<
"" << std::endl;
113 *outstream <<
" <HEADER>" << std::endl;
114 *outstream <<
" <TYPE>" << std::endl;
115 *outstream <<
" <EXTENSION_TABLE_NAME>PIXEL_TTC_PARAMETERS</EXTENSION_TABLE_NAME>" << std::endl;
116 *outstream <<
" <NAME>TTC Configuration Parameters</NAME>" << std::endl;
117 *outstream <<
" </TYPE>" << std::endl;
118 *outstream <<
" <RUN>" << std::endl;
119 *outstream <<
" <RUN_TYPE>TTC Configuration Parameters</RUN_TYPE>" << std::endl;
120 *outstream <<
" <RUN_NUMBER>1</RUN_NUMBER>" << std::endl;
122 *outstream <<
" <LOCATION>CERN P5</LOCATION>" << std::endl;
123 *outstream <<
" </RUN>" << std::endl;
124 *outstream <<
" </HEADER>" << std::endl;
125 *outstream <<
"" << std::endl;
126 *outstream <<
" <DATA_SET>" << std::endl;
127 *outstream <<
"" << std::endl;
128 *outstream <<
" <VERSION>" <<
version <<
"</VERSION>" << std::endl;
129 *outstream <<
" <COMMENT_DESCRIPTION>" <<
getComment() <<
"</COMMENT_DESCRIPTION>" << std::endl;
130 *outstream <<
" <CREATED_BY_USER>" <<
getAuthor() <<
"</CREATED_BY_USER>" << std::endl;
131 *outstream <<
"" << std::endl;
132 *outstream <<
" <PART>" << std::endl;
133 *outstream <<
" <NAME_LABEL>CMS-PIXEL-ROOT</NAME_LABEL>" << std::endl;
134 *outstream <<
" <KIND_OF_PART>Detector ROOT</KIND_OF_PART>" << std::endl;
135 *outstream <<
" </PART>" << std::endl;
140 std::string mthn =
"[PixelTTCciConfig::writeXML()]\t\t\t ";
142 *outstream <<
" " << std::endl;
143 *outstream <<
" <DATA>" << std::endl;
144 *outstream <<
" <TTC_OBJ_DATA_FILE>TTCciConfiguration.txt</TTC_OBJ_DATA_FILE>" << std::endl;
145 *outstream <<
" </DATA>" << std::endl;
146 *outstream <<
" " << std::endl;
151 std::ofstream *out1stream,
152 std::ofstream *out2stream)
const {
153 std::string mthn =
"[PixelTTCciConfig::writeXMLTrailer()]\t\t\t ";
155 *outstream <<
" " << std::endl;
156 *outstream <<
" </DATA_SET>" << std::endl;
157 *outstream <<
"</ROOT>" << std::endl;
160 std::cout << mthn <<
"Data written " << std::endl;
void writeASCII(std::string dir) const override
This file contains the base class for "pixel configuration data" management.
std::string getComment() const
std::stringstream ttcConfigStream_
void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
key
prepare the HTCondor submission files and eventually submit them
void writeXMLTrailer(std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
PixelTTCciConfig(std::string filename)
void writeXML(pos::PixelConfigKey key, int version, std::string path) const override
std::string getAuthor() const