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"]]);
79 assert(tmp ==
"Portcards:");
84 allPortcards_ =
false;
86 while (tmp !=
"AllModules:") {
87 portcardNames_.insert(tmp);
91 assert(tmp ==
"AllModules:");
101 assert(tmp ==
"OrigRDa:");
111 assert(tmp ==
"GridSize:");
119 if (tmp ==
"Commands:") {
126 gridSteps_ = range_ / gridSize_;
129 calibFileContent_ = in.str();
135 std::string mthn =
"[PixelDelay25Calib::PixelDelay25Calib()]\t\t\t ";
137 std::ifstream
in(filename.c_str());
140 std::cout << __LINE__ <<
"]\t" << mthn <<
"Could not open: " << filename << std::endl;
143 std::cout << __LINE__ <<
"]\t" << mthn <<
"Opened: " << filename << std::endl;
160 assert(tmp ==
"Portcards:");
167 while (tmp !=
"AllModules:") {
172 assert(tmp ==
"AllModules:");
177 assert(tmp ==
"OrigSDa:");
182 assert(tmp ==
"OrigRDa:");
192 assert(tmp ==
"GridSize:");
200 if (tmp ==
"Commands:") {
212 std::ifstream inTmp(filename.c_str());
214 while (!inTmp.eof()) {
216 getline(inTmp, tmpString);
217 calibFileContent_ += tmpString +
"\n";
229 graph_ = path +
"graph_" + portcardName +
"_" + moduleName +
".dat";
235 graphout_ <<
"Portcard: " << portcardName << endl;
236 graphout_ <<
"Module: " << moduleName << endl;
237 graphout_ <<
"SDaOrigin: " << origSDa_ << endl;
238 graphout_ <<
"RDaOrigin: " << origRDa_ << endl;
239 graphout_ <<
"SDaRange: " << range_ << endl;
240 graphout_ <<
"RDaRange: " << range_ << endl;
241 graphout_ <<
"GridSize: " << gridSize_ << endl;
242 graphout_ <<
"Tests: " << numTests_ << endl;
252 graphout_ << currentSDa <<
" " << currentRDa <<
" " << number << endl;
267 std::ofstream
out(filename.c_str());
269 out <<
"Mode: " << mode_ << endl;
271 out <<
"Portcards:" << endl;
279 out <<
"AllModules:" << endl;
286 out <<
"OrigSDa:" << endl;
287 out << origSDa_ << endl;
289 out <<
"OrigRDa:" << endl;
290 out << origRDa_ << endl;
292 out <<
"Range:" << endl;
293 out << range_ << endl;
295 out <<
"GridSize:" << endl;
296 out << gridSize_ << endl;
298 out <<
"Tests:" << endl;
299 out << numTests_ << 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;
std::string calibFileContent_
void writeXMLTrailer(std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
This file contains the base class for "pixel configuration data" management.
const edm::EventSetup & c
std::set< std::string > portcardNames_
PixelDelay25Calib(std::string)
~PixelDelay25Calib() override
std::string getComment() const
tuple key
prepare the HTCondor submission files and eventually submit them
std::string getAuthor() const
void writeFiles(std::string tmp)
This class manages data and files used in the Delay25 calibration.
void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=nullptr, std::ofstream *out2=nullptr) const override
void writeASCII(std::string dir="") const override
void writeSettings(std::string portcardName, std::string moduleName)
void writeXML(pos::PixelConfigKey key, int version, std::string path) const override
void openFiles(std::string portcardName, std::string moduleName, std::string path="")