59 edm::LogPrint(
"SiPixelGenErrorDBObjectReader") <<
"\nLoading ... " << std::endl;
66 <<
" DBObject version " << dbobject.
version() <<
" index " << dbobject.
index() <<
" max " << dbobject.
maxIndex()
67 <<
" fail " << dbobject.
fail() <<
" numOfTeml " << dbobject.
numOfTempl() << std::endl;
70 edm::LogPrint(
"SiPixelGenErrorDBObjectReader") <<
"Map info" << std::endl;
71 std::vector<short> tempMapId;
72 std::map<unsigned int, short> templMap = dbobject.
getGenErrorIDs();
73 for (std::map<unsigned int, short>::const_iterator it = templMap.begin(); it != templMap.end(); ++it) {
74 if (tempMapId.empty())
75 tempMapId.push_back(it->second);
76 for (
unsigned int i = 0;
i < tempMapId.size(); ++
i) {
77 if (tempMapId[
i] == it->second)
79 else if (
i == tempMapId.size() - 1) {
80 tempMapId.push_back(it->second);
85 edm::LogPrint(
"SiPixelGenErrorDBObjectReader") <<
"DetId: " << it->first <<
" GenErrorID: " << it->second <<
"\n";
88 edm::LogPrint(
"SiPixelGenErrorDBObjectReader") <<
"\nMap stores GenError Id(s): ";
89 for (
unsigned int vindex = 0; vindex < tempMapId.size(); ++vindex)
90 edm::LogPrint(
"SiPixelGenErrorDBObjectReader") << tempMapId[vindex] <<
" ";
97 <<
" no file for camparison defined, comparison will be skipped " << std::endl;
104 float tempnum = 0,
diff = 0;
106 bool givenErrorMsg =
false;
109 <<
"\nChecking GenError DB object version " << dbobject.
version() <<
" containing " << numOfTempl
110 <<
" calibration(s) at " << dbobject.
sVector()[
index + 22] <<
"T\n";
112 for (
int i = 0;
i < numOfTempl; ++
i) {
119 <<
"Calibration " <<
i + 1 <<
" of " << numOfTempl <<
", with GenError ID " << dbobject.
sVector()[
index]
120 <<
"\tand Version " << dbobject.
sVector()[
index + 1] <<
"\t-------- " << std::endl;
123 std::ostringstream tout;
125 << std::right << dbobject.
sVector()[
index] <<
".out" << std::ends;
131 <<
" open file " << tout.str() <<
" " <<
in_file.is_open() << std::endl;
147 edm::LogPrint(
"SiPixelGenErrorDBObjectReader") <<
"does NOT match\n";
150 givenErrorMsg =
true;
154 <<
"from file = " << tempnum <<
"\t from dbobject = " << dbobject.
sVector()[
index]
155 <<
"\tdiff = " <<
diff <<
"\t db index = " <<
index << std::endl;
164 edm::LogPrint(
"SiPixelGenErrorDBObjectReader") <<
"MATCHES\n";
167 <<
" ERROR: cannot open file, comparison will be stopped" << std::endl;
171 givenErrorMsg =
false;
177 <<
"\nThe were differences found between the files and the database.\n" 178 <<
"If you would like more detailed information please set\n" 179 <<
"wantDetailedOutput = True in the cfg file. If you would like a\n" 180 <<
"full output of the contents of the database file please set\n" 181 <<
"wantFullOutput = True. Make sure that you pipe the output to a\n" 182 <<
"log file. This could take a few minutes.\n\n";
187 std::vector<SiPixelGenErrorStore> thePixelGenError;
190 <<
" status = " <<
status <<
" size = " << thePixelGenError.size() << std::endl;
195 <<
" some values " << genError.lorxwidth() <<
" " << genError.lorywidth() <<
" " << std::endl;
199 edm::LogPrint(
"SiPixelGenErrorDBObjectReader") << dbobject << std::endl;
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
static bool pushfile(int filenum, std::vector< SiPixelGenErrorStore > &pixelTemp, std::string dir="")
edm::ESGetToken< SiPixelGenErrorDBObject, SiPixelGenErrorDBObjectRcd > genErrToken_
Abs< T >::type abs(const T &t)
Log< level::Warning, true > LogPrint
std::vector< float > sVector() const
bool theDetailedGenErrorDBErrorOutput
std::string theGenErrorCalibrationLocation
const std::map< unsigned int, short > & getGenErrorIDs() const
bool theFullGenErrorDBOutput