28 std::string mthn =
"[PixelMaskAllPixels::PixelMaskAllPixels()]\t\t ";
31 std::vector<std::string>
ins = tableMat[0];
32 std::map<std::string, int> colM;
33 std::vector<std::string> colNames;
46 colNames.push_back(
"CONFIG_KEY");
47 colNames.push_back(
"KEY_TYPE");
48 colNames.push_back(
"KEY_ALIAS");
49 colNames.push_back(
"VERSION");
50 colNames.push_back(
"KIND_OF_COND");
51 colNames.push_back(
"ROC_NAME");
52 colNames.push_back(
"KILL_MASK");
54 for (
unsigned int c = 0;
c <
ins.size();
c++) {
55 for (
unsigned int n = 0;
n < colNames.size();
n++) {
56 if (tableMat[0][
c] == colNames[
n]) {
57 colM[colNames[
n]] =
c;
62 for (
unsigned int n = 0;
n < colNames.size();
n++) {
63 if (colM.find(colNames[
n]) == colM.end()) {
64 std::cerr << mthn <<
"Couldn't find in the database the column with name " << colNames[
n] << std::endl;
69 for (
unsigned int r = 1;
r < tableMat.size();
r++) {
70 std::string currentRocName = tableMat[
r][colM[
"ROC_NAME"]];
88 std::string mthn =
"[PixelMaskAllPixels::PixelMaskAllPixels()]\t\t ";
94 std::cout << __LINE__ <<
"]\t" << mthn <<
"Could not open: " <<
filename << std::endl;
95 throw std::runtime_error(
"Failed to open file " +
filename);
118 std::ifstream
in(
filename.c_str(), std::ios::binary);
129 for (
int i = 0;
i < nchar;
i++) {
148 tmp.readBinary(rocid,
in);
162 for (
int i = 0;
i < nchar;
i++) {
192 std::ofstream
out(
filename.c_str(), std::ios::binary);
217 std::ofstream *outstream,
218 std::ofstream *out1stream,
219 std::ofstream *out2stream)
const {
220 std::string mthn =
"[PixelMaskAllPixels::writeXMLHeader()]\t\t\t ";
221 std::stringstream maskFullPath;
224 std::cout << __LINE__ <<
"]\t" << mthn <<
"Writing to: " << maskFullPath.str() << std::endl;
226 outstream->open(maskFullPath.str().c_str());
228 *outstream <<
"<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" << std::endl;
229 *outstream <<
"<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" << std::endl;
230 *outstream <<
"" << std::endl;
231 *outstream <<
" <HEADER>" << std::endl;
232 *outstream <<
" <TYPE>" << std::endl;
233 *outstream <<
" <EXTENSION_TABLE_NAME>ROC_MASKS</EXTENSION_TABLE_NAME>" << std::endl;
234 *outstream <<
" <NAME>ROC Mask Bits</NAME>" << std::endl;
235 *outstream <<
" </TYPE>" << std::endl;
236 *outstream <<
" <RUN>" << std::endl;
237 *outstream <<
" <RUN_TYPE>ROC Mask Bits</RUN_TYPE>" << std::endl;
238 *outstream <<
" <RUN_NUMBER>1</RUN_NUMBER>" << std::endl;
240 *outstream <<
" <LOCATION>CERN P5</LOCATION>" << std::endl;
241 *outstream <<
" </RUN>" << std::endl;
242 *outstream <<
" </HEADER>" << std::endl;
243 *outstream <<
"" << std::endl;
244 *outstream <<
" <DATA_SET>" << std::endl;
245 *outstream <<
"" << std::endl;
246 *outstream <<
" <VERSION>" <<
version <<
"</VERSION>" << std::endl;
247 *outstream <<
" <COMMENT_DESCRIPTION>" <<
getComment() <<
"</COMMENT_DESCRIPTION>" << std::endl;
248 *outstream <<
" <CREATED_BY_USER>" <<
getAuthor() <<
"</CREATED_BY_USER>" << std::endl;
249 *outstream <<
"" << std::endl;
250 *outstream <<
" <PART>" << std::endl;
251 *outstream <<
" <NAME_LABEL>CMS-PIXEL-ROOT</NAME_LABEL>" << std::endl;
252 *outstream <<
" <KIND_OF_PART>Detector ROOT</KIND_OF_PART>" << std::endl;
253 *outstream <<
" </PART>" << std::endl;
254 *outstream <<
" " << std::endl;
258 std::ofstream *out1stream,
259 std::ofstream *out2stream)
const {
260 std::string mthn =
"[PixelMaskAllPixels::writeXML()]\t\t\t ";
268 std::ofstream *out1stream,
269 std::ofstream *out2stream)
const {
270 std::string mthn =
"[PixelMaskAllPixels::writeXMLTrailer()]\t\t\t ";
272 *outstream <<
" " << std::endl;
273 *outstream <<
" </DATA_SET>" << std::endl;
274 *outstream <<
"</ROOT>" << std::endl;
277 std::cout << __LINE__ <<
"]\t" << mthn <<
"Data written " << std::endl;