22 std::string mthn =
"[PixelDelay25Calib::PixelDelay25Calib()]\t\t\t ";
23 std::map<std::string, int> colM;
24 std::vector<std::string> colNames;
39 colNames.push_back(
"CONFIG_KEY");
40 colNames.push_back(
"KEY_TYPE");
41 colNames.push_back(
"KEY_ALIAS");
42 colNames.push_back(
"VERSION");
43 colNames.push_back(
"KIND_OF_COND");
44 colNames.push_back(
"CALIB_TYPE");
45 colNames.push_back(
"CALIB_OBJ_DATA_FILE");
46 colNames.push_back(
"CALIB_OBJ_DATA_CLOB");
48 for (
unsigned int c = 0;
c < tableMat[0].size();
c++) {
49 for (
unsigned int n = 0;
n < colNames.size();
n++) {
50 if (tableMat[0][
c] == colNames[
n]) {
51 colM[colNames[
n]] =
c;
56 for (
unsigned int n = 0;
n < colNames.size();
n++) {
57 if (colM.find(colNames[
n]) == colM.end()) {
58 std::cerr <<
"[[PixelDelay25Calib::PixelDelay25Calib()]\tCouldn't find in the database the column with name " 59 << colNames[
n] << std::endl;
64 std::istringstream
in;
65 in.str(tableMat[1][colM[
"CALIB_OBJ_DATA_CLOB"]]);
84 allPortcards_ =
false;
86 while (
tmp !=
"AllModules:") {
87 portcardNames_.insert(
tmp);
119 if (
tmp ==
"Commands:") {
126 gridSteps_ = range_ / gridSize_;
129 calibFileContent_ =
in.str();
135 std::string mthn =
"[PixelDelay25Calib::PixelDelay25Calib()]\t\t\t ";
140 std::cout << __LINE__ <<
"]\t" << mthn <<
"Could not open: " <<
filename << std::endl;
163 allPortcards_ =
true;
165 allPortcards_ =
false;
167 while (
tmp !=
"AllModules:") {
168 portcardNames_.insert(
tmp);
200 if (
tmp ==
"Commands:") {
209 gridSteps_ = range_ / gridSize_;
212 std::ifstream inTmp(
filename.c_str());
213 calibFileContent_ =
"";
214 while (!inTmp.eof()) {
216 getline(inTmp, tmpString);
217 calibFileContent_ += tmpString +
"\n";
224 PixelDelay25Calib::~PixelDelay25Calib() {}
235 graphout_ <<
"Portcard: " << portcardName << endl;
271 out <<
"Portcards:" << endl;
279 out <<
"AllModules:" << endl;
286 out <<
"OrigSDa:" << endl;
289 out <<
"OrigRDa:" << endl;
292 out <<
"Range:" << endl;
295 out <<
"GridSize:" << endl;
298 out <<
"Tests:" << endl;
301 out <<
"Commands:" << endl;
311 std::ofstream *outstream,
312 std::ofstream *out1stream,
313 std::ofstream *out2stream)
const {
314 std::string mthn =
"[PixelDelay25Calib::writeXMLHeader()]\t\t\t ";
315 std::stringstream maskFullPath;
320 std::cout << __LINE__ <<
"]\t" << mthn <<
"Writing to: " << maskFullPath.str() << std::endl;
322 outstream->open(maskFullPath.str().c_str());
324 *outstream <<
"<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" << std::endl;
325 *outstream <<
"<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" << std::endl;
326 *outstream <<
"" << std::endl;
327 *outstream <<
" <!-- " << mthn <<
"-->" << std::endl;
328 *outstream <<
"" << std::endl;
329 *outstream <<
" <HEADER>" << std::endl;
330 *outstream <<
" <TYPE>" << std::endl;
331 *outstream <<
" <EXTENSION_TABLE_NAME>PIXEL_CALIB_CLOB</EXTENSION_TABLE_NAME>" << std::endl;
332 *outstream <<
" <NAME>Calibration Object Clob</NAME>" << std::endl;
333 *outstream <<
" </TYPE>" << std::endl;
334 *outstream <<
" <RUN>" << std::endl;
335 *outstream <<
" <RUN_TYPE>delay25</RUN_TYPE>" << std::endl;
336 *outstream <<
" <RUN_NUMBER>1</RUN_NUMBER>" << std::endl;
338 *outstream <<
" <LOCATION>CERN P5</LOCATION>" << std::endl;
339 *outstream <<
" </RUN>" << std::endl;
340 *outstream <<
" </HEADER>" << std::endl;
341 *outstream <<
"" << std::endl;
342 *outstream <<
" <DATA_SET>" << std::endl;
343 *outstream <<
"" << std::endl;
344 *outstream <<
" <VERSION>" <<
version <<
"</VERSION>" << std::endl;
345 *outstream <<
" <COMMENT_DESCRIPTION>" <<
getComment() <<
"</COMMENT_DESCRIPTION>" << std::endl;
346 *outstream <<
" <CREATED_BY_USER>" <<
getAuthor() <<
"</CREATED_BY_USER>" << std::endl;
347 *outstream <<
"" << std::endl;
348 *outstream <<
" <PART>" << std::endl;
349 *outstream <<
" <NAME_LABEL>CMS-PIXEL-ROOT</NAME_LABEL>" << std::endl;
350 *outstream <<
" <KIND_OF_PART>Detector ROOT</KIND_OF_PART>" << std::endl;
351 *outstream <<
" </PART>" << std::endl;
356 std::string mthn =
"[PixelDelay25Calib::writeXML()]\t\t\t ";
358 std::cout << __LINE__ <<
"]\t" << mthn <<
"Writing.." << std::endl;
360 *outstream <<
" " << std::endl;
361 *outstream <<
" <DATA>" << std::endl;
362 *outstream <<
" <CALIB_OBJ_DATA_FILE>./delay25.dat</CALIB_OBJ_DATA_FILE>" << std::endl;
363 *outstream <<
" <CALIB_TYPE>delay25</CALIB_TYPE>" << std::endl;
364 *outstream <<
" </DATA>" << std::endl;
365 *outstream <<
" " << std::endl;
370 std::ofstream *out1stream,
371 std::ofstream *out2stream)
const {
372 std::string mthn =
"[PixelDelay25Calib::writeXMLTrailer()]\t\t\t ";
374 *outstream <<
" </DATA_SET>" << std::endl;
375 *outstream <<
"</ROOT>" << std::endl;
378 std::cout << __LINE__ <<
"]\t" << mthn <<
"Data written " << std::endl;
This file contains the base class for "pixel configuration data" management.
void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
std::set< std::string > portcardNames_
void writeSettings(std::string portcardName, std::string moduleName)
std::string getComment() const
void writeFiles(std::string tmp)
PixelDelay25Calib(std::string)
void writeXMLTrailer(std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
void openFiles(std::string portcardName, std::string moduleName, std::string path="")
This class manages data and files used in the Delay25 calibration.
void writeASCII(std::string dir="") const override
std::string getAuthor() const
void writeXML(pos::PixelConfigKey key, int version, std::string path) const override