294 float costrk[3] = {0, 0, 0};
296 const int code_version = {1};
303 auto tmpPtr = std::make_unique<SiPixelGenErrorStore>();
304 auto& theCurrentTemp = *tmpPtr;
307 for (
int m = 0;
m <
db.numOfTempl(); ++
m) {
311 for (
i = 0;
i < 20; ++
i) {
313 theCurrentTemp.head.title[4 *
i] =
temp.c[0];
314 theCurrentTemp.head.title[4 *
i + 1] =
temp.c[1];
315 theCurrentTemp.head.title[4 *
i + 2] =
temp.c[2];
316 theCurrentTemp.head.title[4 *
i + 3] =
temp.c[3];
317 db.incrementIndex(1);
320 theCurrentTemp.head.title[79] =
'\0';
321 LOGINFO(
"SiPixelGenError") <<
"Loading Pixel GenError File - " << theCurrentTemp.head.title <<
ENDL;
325 db >> theCurrentTemp.head.ID >> theCurrentTemp.head.templ_version >> theCurrentTemp.head.Bfield >>
326 theCurrentTemp.head.NTy >> theCurrentTemp.head.NTyx >> theCurrentTemp.head.NTxx >> theCurrentTemp.head.Dtype >>
327 theCurrentTemp.head.Vbias >> theCurrentTemp.head.temperature >> theCurrentTemp.head.fluence >>
328 theCurrentTemp.head.qscale >> theCurrentTemp.head.s50 >> theCurrentTemp.head.lorywidth >>
329 theCurrentTemp.head.lorxwidth >> theCurrentTemp.head.ysize >> theCurrentTemp.head.xsize >>
330 theCurrentTemp.head.zsize >> theCurrentTemp.head.ss50 >> theCurrentTemp.head.lorybias >>
331 theCurrentTemp.head.lorxbias >> theCurrentTemp.head.fbin[0] >> theCurrentTemp.head.fbin[1] >>
332 theCurrentTemp.head.fbin[2];
335 LOGERROR(
"SiPixelGenError") <<
"Error reading file, no GenError load" <<
ENDL;
339 LOGINFO(
"SiPixelGenError") <<
"GenError ID = " << theCurrentTemp.head.ID <<
", GenError Version "
340 << theCurrentTemp.head.templ_version <<
", Bfield = " << theCurrentTemp.head.Bfield
341 <<
", NTy = " << theCurrentTemp.head.NTy <<
", NTyx = " << theCurrentTemp.head.NTyx
342 <<
", NTxx = " << theCurrentTemp.head.NTxx <<
", Dtype = " << theCurrentTemp.head.Dtype
343 <<
", Bias voltage " << theCurrentTemp.head.Vbias <<
", temperature "
344 << theCurrentTemp.head.temperature <<
", fluence " << theCurrentTemp.head.fluence
345 <<
", Q-scaling factor " << theCurrentTemp.head.qscale <<
", 1/2 multi dcol threshold "
346 << theCurrentTemp.head.s50 <<
", 1/2 single dcol threshold " << theCurrentTemp.head.ss50
347 <<
", y Lorentz Width " << theCurrentTemp.head.lorywidth <<
", y Lorentz Bias "
348 << theCurrentTemp.head.lorybias <<
", x Lorentz width " << theCurrentTemp.head.lorxwidth
349 <<
", x Lorentz Bias " << theCurrentTemp.head.lorxbias
350 <<
", Q/Q_avg fractions for Qbin defs " << theCurrentTemp.head.fbin[0] <<
", "
351 << theCurrentTemp.head.fbin[1] <<
", " << theCurrentTemp.head.fbin[2]
352 <<
", pixel x-size " << theCurrentTemp.head.xsize <<
", y-size "
353 << theCurrentTemp.head.ysize <<
", zsize " << theCurrentTemp.head.zsize <<
ENDL;
355 LOGINFO(
"SiPixelGenError") <<
"Loading Pixel GenError - " << theCurrentTemp.head.title <<
" version "
356 << theCurrentTemp.head.templ_version <<
" code v." << code_version <<
ENDL;
357 if (theCurrentTemp.head.templ_version < code_version) {
358 LOGERROR(
"SiPixelGenError") <<
"code expects version " << code_version <<
", no GenError load" <<
ENDL;
362 #ifdef SI_PIXEL_TEMPLATE_USE_BOOST
367 theCurrentTemp.cotbetaY =
new float[theCurrentTemp.head.NTy];
368 theCurrentTemp.cotbetaX =
new float[theCurrentTemp.head.NTyx];
369 theCurrentTemp.cotalphaX =
new float[theCurrentTemp.head.NTxx];
371 theCurrentTemp.enty.resize(boost::extents[theCurrentTemp.head.NTy]);
373 theCurrentTemp.entx.resize(boost::extents[theCurrentTemp.head.NTyx][theCurrentTemp.head.NTxx]);
379 for (
i = 0;
i < theCurrentTemp.head.NTy; ++
i) {
380 db >> theCurrentTemp.enty[
i].runnum >> costrk[0] >> costrk[1] >> costrk[2];
383 LOGERROR(
"SiPixelGenError") <<
"Error reading file 1, no GenError load, run # " << theCurrentTemp.enty[
i].runnum
390 theCurrentTemp.enty[
i].cotalpha = costrk[0] / costrk[2];
392 theCurrentTemp.enty[
i].cotbeta = costrk[1] / costrk[2];
394 db >> theCurrentTemp.enty[
i].qavg >> theCurrentTemp.enty[
i].pixmax >> theCurrentTemp.enty[
i].dyone >>
395 theCurrentTemp.enty[
i].syone >> theCurrentTemp.enty[
i].dxone >> theCurrentTemp.enty[
i].sxone;
398 LOGERROR(
"SiPixelGenError") <<
"Error reading file 2, no GenError load, run # " << theCurrentTemp.enty[
i].runnum
403 db >> theCurrentTemp.enty[
i].dytwo >> theCurrentTemp.enty[
i].sytwo >> theCurrentTemp.enty[
i].dxtwo >>
404 theCurrentTemp.enty[
i].sxtwo >> theCurrentTemp.enty[
i].qmin >> theCurrentTemp.enty[
i].qmin2;
406 for (
j = 0;
j < 4; ++
j) {
407 db >> theCurrentTemp.enty[
i].yavggen[
j] >> theCurrentTemp.enty[
i].yrmsgen[
j] >>
408 theCurrentTemp.enty[
i].xavggen[
j] >> theCurrentTemp.enty[
i].xrmsgen[
j];
411 LOGERROR(
"SiPixelGenError") <<
"Error reading file 14a, no GenError load, run # "
412 << theCurrentTemp.enty[
i].runnum <<
ENDL;
420 for (
k = 0;
k < theCurrentTemp.head.NTyx; ++
k) {
421 for (
i = 0;
i < theCurrentTemp.head.NTxx; ++
i) {
422 db >> theCurrentTemp.entx[
k][
i].runnum >> costrk[0] >> costrk[1] >> costrk[2];
425 LOGERROR(
"SiPixelGenError") <<
"Error reading file 17, no GenError load, run # "
426 << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
432 theCurrentTemp.entx[
k][
i].cotalpha = costrk[0] / costrk[2];
434 theCurrentTemp.entx[
k][
i].cotbeta = costrk[1] / costrk[2];
436 db >> theCurrentTemp.entx[
k][
i].qavg >> theCurrentTemp.entx[
k][
i].pixmax >> theCurrentTemp.entx[
k][
i].dyone >>
437 theCurrentTemp.entx[
k][
i].syone >> theCurrentTemp.entx[
k][
i].dxone >> theCurrentTemp.entx[
k][
i].sxone;
440 LOGERROR(
"SiPixelGenError") <<
"Error reading file 18, no GenError load, run # "
441 << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
445 db >> theCurrentTemp.entx[
k][
i].dytwo >> theCurrentTemp.entx[
k][
i].sytwo >> theCurrentTemp.entx[
k][
i].dxtwo >>
446 theCurrentTemp.entx[
k][
i].sxtwo >> theCurrentTemp.entx[
k][
i].qmin >> theCurrentTemp.entx[
k][
i].qmin2;
448 for (
j = 0;
j < 4; ++
j) {
449 db >> theCurrentTemp.entx[
k][
i].yavggen[
j] >> theCurrentTemp.entx[
k][
i].yrmsgen[
j] >>
450 theCurrentTemp.entx[
k][
i].xavggen[
j] >> theCurrentTemp.entx[
k][
i].xrmsgen[
j];
453 LOGERROR(
"SiPixelGenError") <<
"Error reading file 30a, no GenError load, run # "
454 << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
463 pixelTemp.push_back(theCurrentTemp);