24 std::string mthn =
"[PixelDelay25Calib::PixelDelay25Calib()]\t\t\t " ;
25 std::map<std::string , int > colM;
26 std::vector<std::string > colNames;
41 colNames.push_back(
"CONFIG_KEY" );
42 colNames.push_back(
"KEY_TYPE" );
43 colNames.push_back(
"KEY_ALIAS" );
44 colNames.push_back(
"VERSION" );
45 colNames.push_back(
"KIND_OF_COND" );
46 colNames.push_back(
"CALIB_TYPE" );
47 colNames.push_back(
"CALIB_OBJ_DATA_FILE");
48 colNames.push_back(
"CALIB_OBJ_DATA_CLOB");
50 for(
unsigned int c = 0 ;
c < tableMat[0].size() ;
c++)
52 for(
unsigned int n=0;
n<colNames.size();
n++)
54 if(tableMat[0][
c] == colNames[
n])
56 colM[colNames[
n]] =
c;
61 for(
unsigned int n=0;
n<colNames.size();
n++)
63 if(colM.find(colNames[
n]) == colM.end())
65 std::cerr <<
"[[PixelDelay25Calib::PixelDelay25Calib()]\tCouldn't find in the database the column with name " << colNames[
n] << std::endl;
71 std::istringstream
in ;
72 in.str(tableMat[1][colM[
"CALIB_OBJ_DATA_CLOB"]]) ;
92 allPortcards_ =
false;
94 while (tmp!=
"AllModules:")
96 portcardNames_.insert(tmp);
100 assert(tmp==
"AllModules:");
128 if(tmp==
"Commands:") {
135 gridSteps_ = range_/gridSize_;
138 calibFileContent_ = in.str() ;
149 std::string mthn =
"[PixelDelay25Calib::PixelDelay25Calib()]\t\t\t ";
151 std::ifstream
in(filename.c_str());
154 std::cout << __LINE__ <<
"]\t" << mthn <<
"Could not open: " << filename << std::endl;
158 std::cout << __LINE__ <<
"]\t" << mthn <<
"Opened: " << filename << std::endl;
175 assert(tmp==
"Portcards:");
183 while (tmp!=
"AllModules:")
189 assert(tmp==
"AllModules:");
217 if(tmp==
"Commands:") {
229 std::ifstream inTmp(filename.c_str());
234 getline (inTmp, tmpString);
235 calibFileContent_ += tmpString +
"\n";
246 if (path!=
"") path+=
"/";
247 graph_ = path+
"graph_"+portcardName+
"_"+moduleName+
".dat";
253 graphout_ <<
"Portcard: " << portcardName << endl;
254 graphout_ <<
"Module: " << moduleName << endl;
255 graphout_ <<
"SDaOrigin: " << origSDa_ << endl;
256 graphout_ <<
"RDaOrigin: " << origRDa_ << endl;
257 graphout_ <<
"SDaRange: " << range_ << endl;
258 graphout_ <<
"RDaRange: " << range_ << endl;
259 graphout_ <<
"GridSize: " << gridSize_ << endl;
260 graphout_ <<
"Tests: " << numTests_ << endl;
270 graphout_ << currentSDa <<
" " << currentRDa <<
" " << number << endl;
284 if (dir!=
"") dir+=
"/";
286 std::ofstream
out(filename.c_str());
288 out <<
"Mode: "<<mode_<<endl;
290 out <<
"Portcards:" <<endl;
298 out <<
"AllModules:" <<endl;
305 out <<
"OrigSDa:"<<endl;
306 out << origSDa_<<endl;
308 out <<
"OrigRDa:"<<endl;
309 out << origRDa_<<endl;
311 out <<
"Range:"<<endl;
314 out <<
"GridSize:"<<endl;
315 out << gridSize_<<endl;
317 out <<
"Tests:"<<endl;
318 out << numTests_<<endl;
320 out <<
"Commands:"<<endl;
330 std::ofstream *outstream,
331 std::ofstream *out1stream,
332 std::ofstream *out2stream)
const
334 std::string mthn =
"[PixelDelay25Calib::writeXMLHeader()]\t\t\t " ;
335 std::stringstream maskFullPath ;
340 std::cout << __LINE__ <<
"]\t" << mthn <<
"Writing to: " << maskFullPath.str() << std::endl ;
342 outstream->open(maskFullPath.str().c_str()) ;
344 *outstream <<
"<?xml version='1.0' encoding='UTF-8' standalone='yes'?>" << std::endl ;
345 *outstream <<
"<ROOT xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>" << std::endl ;
346 *outstream <<
"" << std::endl ;
347 *outstream <<
" <!-- " << mthn <<
"-->" << std::endl ;
348 *outstream <<
"" << std::endl ;
349 *outstream <<
" <HEADER>" << std::endl ;
350 *outstream <<
" <TYPE>" << std::endl ;
351 *outstream <<
" <EXTENSION_TABLE_NAME>PIXEL_CALIB_CLOB</EXTENSION_TABLE_NAME>" << std::endl ;
352 *outstream <<
" <NAME>Calibration Object Clob</NAME>" << std::endl ;
353 *outstream <<
" </TYPE>" << std::endl ;
354 *outstream <<
" <RUN>" << std::endl ;
355 *outstream <<
" <RUN_TYPE>delay25</RUN_TYPE>" << std::endl ;
356 *outstream <<
" <RUN_NUMBER>1</RUN_NUMBER>" << std::endl ;
358 *outstream <<
" <LOCATION>CERN P5</LOCATION>" << std::endl ;
359 *outstream <<
" </RUN>" << std::endl ;
360 *outstream <<
" </HEADER>" << std::endl ;
361 *outstream <<
"" << std::endl ;
362 *outstream <<
" <DATA_SET>" << std::endl ;
363 *outstream <<
"" << std::endl ;
364 *outstream <<
" <VERSION>" << version <<
"</VERSION>" << std::endl ;
365 *outstream <<
" <COMMENT_DESCRIPTION>" <<
getComment() <<
"</COMMENT_DESCRIPTION>" << std::endl ;
366 *outstream <<
" <CREATED_BY_USER>" <<
getAuthor() <<
"</CREATED_BY_USER>" << std::endl ;
367 *outstream <<
"" << std::endl ;
368 *outstream <<
" <PART>" << std::endl ;
369 *outstream <<
" <NAME_LABEL>CMS-PIXEL-ROOT</NAME_LABEL>" << std::endl ;
370 *outstream <<
" <KIND_OF_PART>Detector ROOT</KIND_OF_PART>" << std::endl ;
371 *outstream <<
" </PART>" << std::endl ;
377 std::ofstream *out1stream,
378 std::ofstream *out2stream)
const
380 std::string mthn =
"[PixelDelay25Calib::writeXML()]\t\t\t " ;
382 std::cout << __LINE__ <<
"]\t" << mthn <<
"Writing.." << std::endl ;
384 *outstream <<
" " << std::endl ;
385 *outstream <<
" <DATA>" << std::endl ;
386 *outstream <<
" <CALIB_OBJ_DATA_FILE>./delay25.dat</CALIB_OBJ_DATA_FILE>" << std::endl ;
387 *outstream <<
" <CALIB_TYPE>delay25</CALIB_TYPE>" << std::endl ;
388 *outstream <<
" </DATA>" << std::endl ;
389 *outstream <<
" " << std::endl ;
394 std::ofstream *out1stream,
395 std::ofstream *out2stream )
const
397 std::string mthn =
"[PixelDelay25Calib::writeXMLTrailer()]\t\t\t " ;
399 *outstream <<
" </DATA_SET>" << std::endl ;
400 *outstream <<
"</ROOT>" << std::endl ;
403 std::cout << __LINE__ <<
"]\t" << mthn <<
"Data written " << std::endl ;
std::string calibFileContent_
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 moduleName(Provenance const &provenance)
tuple path
else: Piece not in the list, fine.
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="")