51 : the2DTemplateCalibrationLocation(iConfig.getParameter<
std::
string>(
"siPixel2DTemplateCalibrationLocation")),
52 theDetailed2DTemplateDBErrorOutput(iConfig.getParameter<
bool>(
"wantDetailed2DTemplateDBErrorOutput")),
53 theFull2DTemplateDBOutput(iConfig.getParameter<
bool>(
"wantFull2DTemplateDBOutput")),
54 testGlobalTag(iConfig.getParameter<
bool>(
"TestGlobalTag")),
55 hasTriggeredWatcher(
false),
71 float theMagField =
magfield.product()->inTesla(center).mag();
73 edm::LogPrint(
"SiPixel2DTemplateDBObjectReader") <<
"\nTesting global tag at magnetic field = " << theMagField;
75 edm::LogPrint(
"SiPixel2DTemplateDBObjectESProducerRcd") <<
"With record SiPixel2DTemplateDBObjectESProducerRcd";
80 edm::LogPrint(
"SiPixel2DTemplateDBObjectReader") <<
"\nLoading from file " << std::endl;
82 edm::LogPrint(
"SiPixelTemplateDBObjectReader") <<
"With record SiPixel2DTemplateDBObjectRcd";
89 std::vector<short> tempMapId;
92 edm::LogPrint(
"SiPixel2DTemplateDBObjectReader") <<
"Map info" << std::endl;
93 std::map<unsigned int, short> templMap = dbobject.
getTemplateIDs();
94 for (std::map<unsigned int, short>::const_iterator it = templMap.begin(); it != templMap.end(); ++it) {
95 if (tempMapId.empty())
96 tempMapId.push_back(it->second);
97 for (
unsigned int i = 0;
i < tempMapId.size(); ++
i) {
98 if (tempMapId[
i] == it->second)
100 else if (
i == tempMapId.size() - 1) {
101 tempMapId.push_back(it->second);
106 <<
"DetId: " << it->first <<
" 2DTemplateID: " << it->second <<
"\n";
110 edm::LogPrint(
"SiPixel2DTemplateDBObjectReader") <<
"\nMap stores 2DTemplate Id(s): ";
111 for (
unsigned int vindex = 0; vindex < tempMapId.size(); ++vindex)
112 edm::LogPrint(
"SiPixel2DTemplateDBObjectReader") << tempMapId[vindex] <<
" ";
113 edm::LogPrint(
"SiPixel2DTemplateDBObjectReader") << std::endl;
116 const char* tempfile;
119 float tempnum = 0,
diff = 0;
121 bool error =
false, givenErrorMsg =
false;
125 <<
"\nChecking 2DTemplate 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 2DTemplate ID " << dbobject.
sVector()[
index]
134 <<
"\tand Version " << dbobject.
sVector()[
index + 1] <<
"\t-------- ";
137 std::ostringstream tout;
140 << std::setfill(
'0') << std::right << dbobject.
sVector()[
index] <<
".out" << std::ends;
143 tempfile = (
file.fullPath()).c_str();
160 edm::LogPrint(
"SiPixel2DTemplateDBObjectReader") <<
"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(
"SiPixel2DTemplateDBObjectReader") <<
"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(
"SiPixel2DTemplateDBObjectReader") << dbobject << std::endl;
203 int txsize[4] = {7, 13, 0, 0};
204 int tysize[4] = {21, 21, 0, 0};
206 int entries[4] = {0};
208 int i,
j,
k,
l,
m,
n, entry_it;
210 int sizeSetter = 0, generrorVersion = 0;
212 edm::LogPrint(
"SiPixel2DTemplateDBObjectReader") <<
"\n\nDBobject version: " << dbobject.
version() << std::endl;
217 if (generrorVersion <= 10) {
219 <<
"*****WARNING***** This code will not format this 2DTemplate version properly *****WARNING*****\n";
221 }
else if (generrorVersion <= 16)
225 <<
"*****WARNING***** This code has not been tested at formatting this version *****WARNING*****\n";
228 <<
"\n\n*********************************************************************************************" 231 <<
"*************** Reading 2DTemplate ID " << dbobject.
sVector_[
index + 20] <<
"\t(" <<
m + 1
232 <<
"/" << dbobject.
numOfTempl_ <<
") ***************" << std::endl;
234 <<
"*********************************************************************************************\n\n" 239 for (
n = 0;
n < 20; ++
n) {
259 for (entry_it = 0; entry_it < 4; ++entry_it) {
261 for (
i = 0;
i < entries[entry_it]; ++
i) {
274 for (
j = 0;
j < 2; ++
j) {
275 for (
k = 0;
k < 5; ++
k) {
282 for (
j = 0;
j < 9; ++
j) {
283 for (
k = 0;
k < tysize[sizeSetter]; ++
k) {
290 for (
j = 0;
j < 2; ++
j) {
291 for (
k = 0;
k < 5; ++
k) {
298 for (
j = 0;
j < 9; ++
j) {
299 for (
k = 0;
k < txsize[sizeSetter]; ++
k) {
306 for (
j = 0;
j < 4; ++
j) {
307 for (
k = 0;
k < 4; ++
k) {
314 for (
j = 0;
j < 4; ++
j) {
315 for (
k = 0;
k < 6; ++
k) {
322 for (
j = 0;
j < 4; ++
j) {
323 for (
k = 0;
k < 4; ++
k) {
330 for (
j = 0;
j < 4; ++
j) {
331 for (
k = 0;
k < 6; ++
k) {
338 for (
j = 0;
j < 4; ++
j) {
339 for (
k = 0;
k < 2; ++
k) {
340 for (
l = 0;
l < 2; ++
l) {
348 for (
j = 0;
j < 4; ++
j) {
349 for (
k = 0;
k < 4; ++
k) {
356 for (
j = 0;
j < 4; ++
j) {
357 for (
k = 0;
k < 4; ++
k) {
364 for (
j = 0;
j < 4; ++
j) {
365 for (
k = 0;
k < 4; ++
k) {
372 for (
j = 0;
j < 4; ++
j) {
373 for (
k = 0;
k < 4; ++
k) {
380 for (
j = 0;
j < 20; ++
j) {
383 if (
j == 9 ||
j == 19)
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magneticFieldToken_
std::ostream & operator<<(std::ostream &s, const SiPixel2DTemplateDBObject &dbobject)
#define DEFINE_FWK_MODULE(type)
void analyze(const edm::Event &, const edm::EventSetup &) override
bool theDetailed2DTemplateDBErrorOutput
edm::ESGetToken< SiPixel2DTemplateDBObject, SiPixel2DTemplateDBObjectRcd > the2DTemplateToken_
std::string the2DTemplateCalibrationLocation
edm::ESWatcher< SiPixel2DTemplateDBObjectESProducerRcd > SiPix2DTemplDBObjectWatcher_
edm::ESGetToken< SiPixel2DTemplateDBObject, SiPixel2DTemplateDBObjectESProducerRcd > the2DTemplateESProdToken_
SiPixel2DTemplateDBObjectReader(const edm::ParameterSet &)
Abs< T >::type abs(const T &t)
~SiPixel2DTemplateDBObjectReader() override
bool getData(T &iHolder) const
Log< level::Warning, true > LogPrint
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
edm::ESWatcher< SiPixel2DTemplateDBObjectRcd > SiPix2DTemplDBObjWatcher_
bool check(const edm::EventSetup &iSetup)
std::vector< float > sVector() const
bool theFull2DTemplateDBOutput
std::vector< float > sVector_
const std::map< unsigned int, short > & getTemplateIDs() const