72 float theMagField = magfield.
product()->inTesla(center).mag();
74 edm::LogPrint(
"SiPixelTemplateDBObjectReader") <<
"\nTesting global tag at magfield = " << theMagField;
76 edm::LogPrint(
"SiPixelTemplateDBObjectReader") <<
"With record SiPixelTemplateDBObjectESProducerRcd";
81 edm::LogPrint(
"SiPixelTemplateDBObjectReader") <<
"\nLoading from file " << std::endl;
83 edm::LogPrint(
"SiPixelTemplateDBObjectReader") <<
"With record SiPixelTemplateDBObjectRcd";
90 std::vector<short> tempMapId;
93 edm::LogPrint(
"SiPixelTemplateDBObjectReader") <<
"Map info" << std::endl;
94 std::map<unsigned int, short> templMap = dbobject.
getTemplateIDs();
95 for (std::map<unsigned int, short>::const_iterator it = templMap.begin(); it != templMap.end(); ++it) {
96 if (tempMapId.empty())
97 tempMapId.push_back(it->second);
98 for (
unsigned int i = 0;
i < tempMapId.size(); ++
i) {
99 if (tempMapId[
i] == it->second)
101 else if (
i == tempMapId.size() - 1) {
102 tempMapId.push_back(it->second);
108 <<
"DetId: " << it->first <<
" TemplateID: " << it->second <<
"\n";
111 edm::LogPrint(
"SiPixelTemplateDBObjectReader") <<
"\nMap stores template Id(s): ";
112 for (
unsigned int vindex = 0; vindex < tempMapId.size(); ++vindex)
113 edm::LogPrint(
"SiPixelTemplateDBObjectReader") << tempMapId[vindex] <<
" ";
117 const char* tempfile;
120 float tempnum = 0,
diff = 0;
122 bool error =
false, givenErrorMsg =
false;
125 <<
"\nChecking Template DB object version " << dbobject.
version() <<
" containing " << numOfTempl
126 <<
" calibration(s) at " << dbobject.
sVector()[index + 22] <<
"T\n";
127 for (
int i = 0;
i < numOfTempl; ++
i) {
133 <<
"Calibration " <<
i + 1 <<
" of " << numOfTempl <<
", with Template ID " << dbobject.
sVector()[
index]
134 <<
"\tand Version " << dbobject.
sVector()[index + 1] <<
"\t-------- ";
137 std::ostringstream tout;
139 << std::right << dbobject.
sVector()[
index] <<
".out" << std::ends;
142 tempfile = (
file.fullPath()).c_str();
145 if (in_file.is_open()) {
151 while (!in_file.eof()) {
159 edm::LogPrint(
"SiPixelTemplateDBObjectReader") <<
"does NOT match\n";
162 givenErrorMsg =
true;
166 <<
"from file = " << tempnum <<
"\t from dbobject = " << dbobject.
sVector()[
index]
167 <<
"\tdiff = " <<
diff <<
"\t db index = " << index << std::endl;
176 edm::LogPrint(
"SiPixelTemplateDBObjectReader") <<
"MATCHES\n";
179 givenErrorMsg =
false;
184 <<
"\nThe were differences found between the files and the database.\n"
185 <<
"If you would like more detailed information please set\n"
186 <<
"wantDetailedOutput = True in the cfg file. If you would like a\n"
187 <<
"full output of the contents of the database file please set\n"
188 <<
"wantFullOutput = True. Make sure that you pipe the output to a\n"
189 <<
"log file. This could take a few minutes.\n\n";
192 edm::LogPrint(
"SiPixelTemplateDBObjectReader") << dbobject << std::endl;
bool theFullTemplateDBOutput
edm::ESGetToken< SiPixelTemplateDBObject, SiPixelTemplateDBObjectRcd > the1DTemplateToken_
bool getData(T &iHolder) const
edm::ESGetToken< SiPixelTemplateDBObject, SiPixelTemplateDBObjectESProducerRcd > the1DTemplateESProdToken_
const std::map< unsigned int, short > & getTemplateIDs() const
bool theDetailedTemplateDBErrorOutput
Abs< T >::type abs(const T &t)
edm::ESWatcher< SiPixelTemplateDBObjectRcd > SiPixTemplDBObjWatcher_
Log< level::Warning, true > LogPrint
T const * product() const
bool check(const edm::EventSetup &iSetup)
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magneticFieldToken_
std::string theTemplateCalibrationLocation
std::vector< float > const & sVector() const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const