49 : hasTriggeredWatcher(
false),
50 theTemplateCalibrationLocation(iConfig.getParameter<
std::
string>(
"siPixelTemplateCalibrationLocation")),
51 theDetailedTemplateDBErrorOutput(iConfig.getParameter<
bool>(
"wantDetailedTemplateDBErrorOutput")),
52 theFullTemplateDBOutput(iConfig.getParameter<
bool>(
"wantFullTemplateDBOutput")),
53 testGlobalTag(iConfig.getParameter<
bool>(
"TestGlobalTag")),
65 float theMagField =
magfield.product()->inTesla(center).mag();
67 edm::LogPrint(
"SiPixelTemplateDBObjectReader") <<
"\nTesting global tag at magfield = " << theMagField;
69 edm::LogPrint(
"SiPixelTemplateDBObjectReader") <<
"With record SiPixelTemplateDBObjectESProducerRcd";
74 edm::LogPrint(
"SiPixelTemplateDBObjectReader") <<
"\nLoading from file " << std::endl;
76 edm::LogPrint(
"SiPixelTemplateDBObjectReader") <<
"With record SiPixelTemplateDBObjectRcd";
83 std::vector<short> tempMapId;
86 edm::LogPrint(
"SiPixelTemplateDBObjectReader") <<
"Map info" << std::endl;
87 std::map<unsigned int, short> templMap = dbobject.
getTemplateIDs();
88 for (std::map<unsigned int, short>::const_iterator
it = templMap.begin();
it != templMap.end(); ++
it) {
89 if (tempMapId.empty())
90 tempMapId.push_back(
it->second);
91 for (
unsigned int i = 0;
i < tempMapId.size(); ++
i) {
92 if (tempMapId[
i] ==
it->second)
94 else if (
i == tempMapId.size() - 1) {
95 tempMapId.push_back(
it->second);
101 <<
"DetId: " <<
it->first <<
" TemplateID: " <<
it->second <<
"\n";
104 edm::LogPrint(
"SiPixelTemplateDBObjectReader") <<
"\nMap stores template Id(s): ";
105 for (
unsigned int vindex = 0; vindex < tempMapId.size(); ++vindex)
106 edm::LogPrint(
"SiPixelTemplateDBObjectReader") << tempMapId[vindex] <<
" ";
112 float tempnum = 0,
diff = 0;
114 bool error =
false, givenErrorMsg =
false;
117 <<
"\nChecking Template DB object version " << dbobject.
version() <<
" containing " << numOfTempl
118 <<
" calibration(s) at " << dbobject.
sVector()[
index + 22] <<
"T\n";
126 for (
int i = 0;
i < numOfTempl; ++
i) {
132 <<
"Calibration " <<
i + 1 <<
" of " << numOfTempl <<
", with Template ID " << dbobject.
sVector()[
index]
133 <<
"\tand Version " << dbobject.
sVector()[
index + 1] <<
"\t-------- ";
136 std::ostringstream tout;
138 << std::right << dbobject.
sVector()[
index] <<
".out" << std::ends;
160 edm::LogPrint(
"SiPixelTemplateDBObjectReader") <<
"does NOT match\n";
163 givenErrorMsg =
true;
167 <<
"from file = " << tempnum <<
"\t from dbobject = " << dbobject.
sVector()[
index]
168 <<
"\tdiff = " <<
diff <<
"\t db index = " <<
index << std::endl;
177 edm::LogPrint(
"SiPixelTemplateDBObjectReader") <<
"MATCHES\n";
180 givenErrorMsg =
false;
185 <<
"\nThe were differences found between the files and the database.\n" 186 <<
"If you would like more detailed information please set\n" 187 <<
"wantDetailedOutput = True in the cfg file. If you would like a\n" 188 <<
"full output of the contents of the database file please set\n" 189 <<
"wantFullOutput = True. Make sure that you pipe the output to a\n" 190 <<
"log file. This could take a few minutes.\n\n";
193 edm::LogPrint(
"SiPixelTemplateDBObjectReader") << dbobject << std::endl;
201 int txsize[4] = {7, 13, 0, 0};
202 int tysize[4] = {21, 21, 0, 0};
204 int entries[4] = {0};
206 int i,
j,
k,
l,
m,
n, entry_it;
208 int sizeSetter = 0, templateVersion = 0;
210 edm::LogPrint(
"SiPixelTemplateDBObjectReader") <<
"\n\nDBobject version: " << dbobject.
version() << std::endl;
215 if (templateVersion <= 10) {
217 <<
"*****WARNING***** This code will not format this template version properly *****WARNING*****\n";
219 }
else if (templateVersion <= 16)
223 <<
"*****WARNING***** This code has not been tested at formatting this version *****WARNING*****\n";
226 <<
"\n\n*********************************************************************************************" 229 <<
"*************** Reading Template ID " << dbobject.
sVector_[
index + 20] <<
"\t(" <<
m + 1
230 <<
"/" << dbobject.
numOfTempl_ <<
") ***************" << std::endl;
232 <<
"*********************************************************************************************\n\n" 237 for (
n = 0;
n < 20; ++
n) {
257 for (entry_it = 0; entry_it < 4; ++entry_it) {
259 for (
i = 0;
i < entries[entry_it]; ++
i) {
272 for (
j = 0;
j < 2; ++
j) {
273 for (
k = 0;
k < 5; ++
k) {
280 for (
j = 0;
j < 9; ++
j) {
281 for (
k = 0;
k < tysize[sizeSetter]; ++
k) {
288 for (
j = 0;
j < 2; ++
j) {
289 for (
k = 0;
k < 5; ++
k) {
296 for (
j = 0;
j < 9; ++
j) {
297 for (
k = 0;
k < txsize[sizeSetter]; ++
k) {
304 for (
j = 0;
j < 4; ++
j) {
305 for (
k = 0;
k < 4; ++
k) {
312 for (
j = 0;
j < 4; ++
j) {
313 for (
k = 0;
k < 6; ++
k) {
320 for (
j = 0;
j < 4; ++
j) {
321 for (
k = 0;
k < 4; ++
k) {
328 for (
j = 0;
j < 4; ++
j) {
329 for (
k = 0;
k < 6; ++
k) {
336 for (
j = 0;
j < 4; ++
j) {
337 for (
k = 0;
k < 2; ++
k) {
338 for (
l = 0;
l < 2; ++
l) {
346 for (
j = 0;
j < 4; ++
j) {
347 for (
k = 0;
k < 4; ++
k) {
354 for (
j = 0;
j < 4; ++
j) {
355 for (
k = 0;
k < 4; ++
k) {
362 for (
j = 0;
j < 4; ++
j) {
363 for (
k = 0;
k < 4; ++
k) {
370 for (
j = 0;
j < 4; ++
j) {
371 for (
k = 0;
k < 4; ++
k) {
378 for (
j = 0;
j < 20; ++
j) {
381 if (
j == 9 ||
j == 19)
const edm::ESGetToken< SiPixelTemplateDBObject, SiPixelTemplateDBObjectRcd > the1DTemplateToken_
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
SiPixelTemplateDBObjectReader(const edm::ParameterSet &)
const bool theFullTemplateDBOutput
edm::ESWatcher< SiPixelTemplateDBObjectESProducerRcd > SiPixTemplDBObjectWatcher_
const std::string theTemplateCalibrationLocation
const edm::ESGetToken< SiPixelTemplateDBObject, SiPixelTemplateDBObjectESProducerRcd > the1DTemplateESProdToken_
const bool theDetailedTemplateDBErrorOutput
std::ostream & operator<<(std::ostream &s, const SiPixelTemplateDBObject &dbobject)
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
edm::ESWatcher< SiPixelTemplateDBObjectRcd > SiPixTemplDBObjWatcher_
std::vector< float > const & sVector() const
Log< level::Warning, true > LogPrint
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const std::map< unsigned int, short > & getTemplateIDs() const
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magneticFieldToken_
std::vector< float > sVector_
bool check(const edm::EventSetup &iSetup)
~SiPixelTemplateDBObjectReader() override=default
void analyze(const edm::Event &, const edm::EventSetup &) override
if(threadIdxLocalY==0 &&threadIdxLocalX==0)