24 std::string mthn =
"[PixelDelay25Calib::PixelDelay25Calib()]\t\t\t " ;
25 std::cout << __LINE__ <<
"]\t" << mthn << std::endl;
26 std::map<std::string , int > colM;
27 std::vector<std::string > colNames;
42 colNames.push_back(
"CONFIG_KEY" );
43 colNames.push_back(
"KEY_TYPE" );
44 colNames.push_back(
"KEY_ALIAS" );
45 colNames.push_back(
"VERSION" );
46 colNames.push_back(
"KIND_OF_COND" );
47 colNames.push_back(
"CALIB_TYPE" );
48 colNames.push_back(
"CALIB_OBJ_DATA_FILE");
49 colNames.push_back(
"CALIB_OBJ_DATA_CLOB");
51 for(
unsigned int c = 0 ;
c < tableMat[0].size() ;
c++)
53 for(
unsigned int n=0;
n<colNames.size();
n++)
55 if(tableMat[0][
c] == colNames[
n])
57 colM[colNames[
n]] =
c;
62 for(
unsigned int n=0;
n<colNames.size();
n++)
64 if(colM.find(colNames[
n]) == colM.end())
66 std::cerr <<
"[[PixelDelay25Calib::PixelDelay25Calib()]\tCouldn't find in the database the column with name " << colNames[
n] << std::endl;
72 std::istringstream
in ;
73 in.str(tableMat[1][colM[
"CALIB_OBJ_DATA_CLOB"]]) ;
87 assert(tmp==
"Portcards:");
93 allPortcards_ =
false;
95 while (tmp!=
"AllModules:")
97 portcardNames_.insert(tmp);
101 assert(tmp==
"AllModules:");
106 assert(tmp==
"OrigSDa:");
111 assert(tmp==
"OrigRDa:");
116 assert(tmp==
"Range:");
121 assert(tmp==
"GridSize:");
125 assert(tmp==
"Tests:");
129 if(tmp==
"Commands:") {
136 gridSteps_ = range_/gridSize_;
144 std::string mthn =
"[PixelDelay25Calib::PixelDelay25Calib()]\t\t\t ";
146 std::ifstream
in(filename.c_str());
149 std::cout << __LINE__ <<
"]\t" << mthn <<
"Could not open: " << filename << std::endl;
153 std::cout << __LINE__ <<
"]\t" << mthn <<
"Opened: " << filename << std::endl;
163 assert(tmp==
"Mode:");
170 assert(tmp==
"Portcards:");
178 while (tmp!=
"AllModules:")
184 assert(tmp==
"AllModules:");
189 assert(tmp==
"OrigSDa:");
194 assert(tmp==
"OrigRDa:");
199 assert(tmp==
"Range:");
204 assert(tmp==
"GridSize:");
208 assert(tmp==
"Tests:");
212 if(tmp==
"Commands:") {
229 if (path!=
"") path+=
"/";
230 graph_ = path+
"graph_"+portcardName+
"_"+moduleName+
".dat";
236 graphout_ <<
"Portcard: " << portcardName << endl;
237 graphout_ <<
"Module: " << moduleName << endl;
238 graphout_ <<
"SDaOrigin: " << origSDa_ << endl;
239 graphout_ <<
"RDaOrigin: " << origRDa_ << endl;
240 graphout_ <<
"SDaRange: " << range_ << endl;
241 graphout_ <<
"RDaRange: " << range_ << endl;
242 graphout_ <<
"GridSize: " << gridSize_ << endl;
243 graphout_ <<
"Tests: " << numTests_ << endl;
253 graphout_ << currentSDa <<
" " << currentRDa <<
" " << number << endl;
267 if (dir!=
"") dir+=
"/";
269 std::ofstream
out(filename.c_str());
271 out <<
"Mode: "<<mode_<<endl;
273 out <<
"Portcards:" <<endl;
281 out <<
"AllModules:" <<endl;
288 out <<
"OrigSDa:"<<endl;
289 out << origSDa_<<endl;
291 out <<
"OrigRDa:"<<endl;
292 out << origRDa_<<endl;
294 out <<
"Range:"<<endl;
297 out <<
"GridSize:"<<endl;
298 out << gridSize_<<endl;
300 out <<
"Tests:"<<endl;
301 out << numTests_<<endl;
303 out <<
"Commands:"<<endl;
313 std::ofstream *outstream,
314 std::ofstream *out1stream,
315 std::ofstream *out2stream)
const
317 std::string mthn =
"[PixelDelay25Calib::writeXMLHeader()]\t\t\t " ;
318 std::stringstream maskFullPath ;
323 std::cout << __LINE__ <<
"]\t" << mthn <<
"Writing to: " << maskFullPath.str() << std::endl ;
325 outstream->open(maskFullPath.str().c_str()) ;
327 *outstream <<
"<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" << std::endl ;
328 *outstream <<
"<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" << std::endl ;
329 *outstream <<
"" << std::endl ;
330 *outstream <<
" <!-- " << mthn <<
"-->" << std::endl ;
331 *outstream <<
"" << std::endl ;
332 *outstream <<
" <HEADER>" << std::endl ;
333 *outstream <<
" <TYPE>" << std::endl ;
334 *outstream <<
" <EXTENSION_TABLE_NAME>PIXEL_CALIB_CLOB</EXTENSION_TABLE_NAME>" << std::endl ;
335 *outstream <<
" <NAME>Calibration Object Clob</NAME>" << std::endl ;
336 *outstream <<
" </TYPE>" << std::endl ;
337 *outstream <<
" <RUN>" << std::endl ;
338 *outstream <<
" <RUN_TYPE>delay25</RUN_TYPE>" << std::endl ;
339 *outstream <<
" <RUN_NUMBER>1</RUN_NUMBER>" << std::endl ;
341 *outstream <<
" <LOCATION>CERN P5</LOCATION>" << std::endl ;
342 *outstream <<
" </RUN>" << std::endl ;
343 *outstream <<
" </HEADER>" << std::endl ;
344 *outstream <<
"" << std::endl ;
345 *outstream <<
" <DATA_SET>" << std::endl ;
346 *outstream <<
"" << std::endl ;
347 *outstream <<
" <VERSION>" << version <<
"</VERSION>" << std::endl ;
348 *outstream <<
" <COMMENT_DESCRIPTION>" <<
getComment() <<
"</COMMENT_DESCRIPTION>" << std::endl ;
349 *outstream <<
" <CREATED_BY_USER>" <<
getAuthor() <<
"</CREATED_BY_USER>" << std::endl ;
350 *outstream <<
"" << std::endl ;
351 *outstream <<
" <PART>" << std::endl ;
352 *outstream <<
" <NAME_LABEL>CMS-PIXEL-ROOT</NAME_LABEL>" << std::endl ;
353 *outstream <<
" <KIND_OF_PART>Detector ROOT</KIND_OF_PART>" << std::endl ;
354 *outstream <<
" </PART>" << std::endl ;
360 std::ofstream *out1stream,
361 std::ofstream *out2stream)
const
363 std::string mthn =
"[PixelDelay25Calib::writeXML()]\t\t\t " ;
366 *outstream <<
" " << std::endl ;
367 *outstream <<
" <DATA>" << std::endl ;
368 *outstream <<
" <CALIB_OBJ_DATA_FILE>./delay25.dat</CALIB_OBJ_DATA_FILE>" << std::endl ;
369 *outstream <<
" <CALIB_TYPE>delay25</CALIB_TYPE>" << std::endl ;
370 *outstream <<
" </DATA>" << std::endl ;
371 *outstream <<
" " << std::endl ;
376 std::ofstream *out1stream,
377 std::ofstream *out2stream )
const
379 std::string mthn =
"[PixelDelay25Calib::writeXMLTrailer()]\t\t\t " ;
381 *outstream <<
" </DATA_SET>" << std::endl ;
382 *outstream <<
"</ROOT>" << std::endl ;
385 std::cout << __LINE__ <<
"]\t" << mthn <<
"Data written " << std::endl ;
This file contains the base class for "pixel configuration data" management.
std::set< std::string > portcardNames_
virtual void writeXMLHeader(pos::PixelConfigKey key, int version, std::string path, std::ofstream *out, std::ofstream *out1=NULL, std::ofstream *out2=NULL) const
PixelDelay25Calib(std::string)
void writeXML(pos::PixelConfigKey key, int version, std::string path) const
std::string getComment() const
std::string getAuthor() const
void writeFiles(std::string tmp)
This class manages data and files used in the Delay25 calibration.
virtual void writeASCII(std::string dir="") const
std::vector< std::vector< double > > tmp
void writeSettings(std::string portcardName, std::string moduleName)
virtual void writeXMLTrailer(std::ofstream *out, std::ofstream *out1=NULL, std::ofstream *out2=NULL) const
void openFiles(std::string portcardName, std::string moduleName, std::string path="")