89 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 96 #include "boost/multi_array.hpp" 103 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 108 #define LOGERROR(x) LogError(x) 109 #define LOGINFO(x) LogInfo(x) 110 #define LOGWARNING(x) LogWarning(x) 117 #define LOGERROR(x) std::cout << x << ": " 118 #define LOGINFO(x) std::cout << x << ": " 119 #define ENDL std::endl 135 const int code_version = {17};
140 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 142 int nzeros = 4 - tempfile.length();
147 tempfile = dir +
"template_summary_zp" + tempfile +
".out";
153 std::ostringstream tout;
154 tout <<
"template_summary_zp" << std::setw(4) << std::setfill(
'0') << std::right << filenum <<
".out" << std::ends;
155 tempfile = tout.str();
161 std::ifstream in_file(tempfile);
162 if (in_file.is_open() && in_file.good()) {
169 for (i = 0; (c = in_file.get()) !=
'\n'; ++
i) {
178 LOGINFO(
"SiPixelTemplate") <<
"Loading Pixel Template File - " << theCurrentTemp.
head.
title <<
ENDL;
189 if (in_file.fail()) {
190 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 0A, no template load" <<
ENDL;
198 if (in_file.fail()) {
199 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 0B, no template load" <<
ENDL;
207 theCurrentTemp.
head.
fbin[1] = 1.00f;
208 theCurrentTemp.
head.
fbin[2] = 0.85f;
211 LOGINFO(
"SiPixelTemplate") <<
"Template ID = " << theCurrentTemp.
head.
ID <<
", Template Version " 213 <<
", NTy = " << theCurrentTemp.
head.
NTy <<
", NTyx = " << theCurrentTemp.
head.
NTyx 214 <<
", NTxx = " << theCurrentTemp.
head.
NTxx <<
", Dtype = " << theCurrentTemp.
head.
Dtype 215 <<
", Bias voltage " << theCurrentTemp.
head.
Vbias <<
", temperature " 217 <<
", Q-scaling factor " << theCurrentTemp.
head.
qscale <<
", 1/2 multi dcol threshold " 218 << theCurrentTemp.
head.
s50 <<
", 1/2 single dcol threshold " << theCurrentTemp.
head.
ss50 219 <<
", y Lorentz Width " << theCurrentTemp.
head.
lorywidth <<
", y Lorentz Bias " 222 <<
", Q/Q_avg fractions for Qbin defs " << theCurrentTemp.
head.
fbin[0] <<
", " 224 <<
", pixel x-size " << theCurrentTemp.
head.
xsize <<
", y-size " 228 LOGERROR(
"SiPixelTemplate") <<
"code expects version " << code_version <<
" finds " 233 #ifdef SI_PIXEL_TEMPLATE_USE_BOOST 241 theCurrentTemp.
enty.resize(boost::extents[theCurrentTemp.
head.
NTy]);
249 for (i = 0; i < theCurrentTemp.
head.
NTy; ++
i) {
253 if (in_file.fail()) {
254 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 1, no template load, run # " << theCurrentTemp.
enty[
i].
runnum 262 static_cast<float>(atan2((
double)theCurrentTemp.
enty[i].
costrk[2], (
double)theCurrentTemp.
enty[i].
costrk[0]));
267 static_cast<float>(atan2((
double)theCurrentTemp.
enty[i].
costrk[2], (
double)theCurrentTemp.
enty[i].
costrk[1]));
275 if (in_file.fail()) {
276 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 2, no template load, run # " << theCurrentTemp.
enty[
i].
runnum 285 if (in_file.fail()) {
286 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 3, no template load, run # " << theCurrentTemp.
enty[
i].
runnum 291 if (theCurrentTemp.
enty[i].
qmin <= 0.) {
292 LOGERROR(
"SiPixelTemplate") <<
"Error in template ID " << theCurrentTemp.
head.
ID 293 <<
" qmin = " << theCurrentTemp.
enty[
i].
qmin <<
", run # " 298 for (j = 0; j < 2; ++
j) {
302 if (in_file.fail()) {
303 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 4, no template load, run # " 309 for (j = 0; j < 9; ++
j) {
314 if (in_file.fail()) {
315 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 5, no template load, run # " 321 for (j = 0; j < 2; ++
j) {
325 if (in_file.fail()) {
326 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 6, no template load, run # " 333 for (j = 0; j < 9; ++
j) {
339 if (in_file.fail()) {
340 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 7, no template load, run # " 347 for (j = 0; j < 4; ++
j) {
351 if (in_file.fail()) {
352 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 8, no template load, run # " 358 for (j = 0; j < 4; ++
j) {
363 if (in_file.fail()) {
364 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 9, no template load, run # " 370 for (j = 0; j < 4; ++
j) {
374 if (in_file.fail()) {
375 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 10, no template load, run # " 381 for (j = 0; j < 4; ++
j) {
386 if (in_file.fail()) {
387 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 11, no template load, run # " 393 for (j = 0; j < 4; ++
j) {
397 if (in_file.fail()) {
398 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 12, no template load, run # " 404 for (j = 0; j < 4; ++
j) {
408 if (in_file.fail()) {
409 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 13, no template load, run # " 415 for (j = 0; j < 4; ++
j) {
419 if (in_file.fail()) {
420 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 14, no template load, run # " 426 for (j = 0; j < 4; ++
j) {
430 if (in_file.fail()) {
431 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 14a, no template load, run # " 437 for (j = 0; j < 4; ++
j) {
441 if (in_file.fail()) {
442 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 14b, no template load, run # " 453 if (in_file.fail()) {
454 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 15, no template load, run # " 465 if (in_file.fail()) {
466 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 16, no template load, run # " 474 for (k = 0; k < theCurrentTemp.
head.
NTyx; ++
k) {
475 for (i = 0; i < theCurrentTemp.
head.
NTxx; ++
i) {
479 if (in_file.fail()) {
480 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 17, no template load, run # " 487 theCurrentTemp.
entx[
k][
i].
alpha =
static_cast<float>(
488 atan2((
double)theCurrentTemp.
entx[k][i].
costrk[2], (
double)theCurrentTemp.
entx[k][i].
costrk[0]));
492 theCurrentTemp.
entx[
k][
i].
beta =
static_cast<float>(
493 atan2((
double)theCurrentTemp.
entx[k][i].
costrk[2], (
double)theCurrentTemp.
entx[k][i].
costrk[1]));
501 if (in_file.fail()) {
502 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 18, no template load, run # " 512 if (in_file.fail()) {
513 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 19, no template load, run # " 518 for (j = 0; j < 2; ++
j) {
523 if (in_file.fail()) {
524 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 20, no template load, run # " 530 for (j = 0; j < 9; ++
j) {
535 if (in_file.fail()) {
536 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 21, no template load, run # " 542 for (j = 0; j < 2; ++
j) {
547 if (in_file.fail()) {
548 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 22, no template load, run # " 555 for (j = 0; j < 9; ++
j) {
561 if (in_file.fail()) {
562 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 23, no template load, run # " 569 for (j = 0; j < 4; ++
j) {
573 if (in_file.fail()) {
574 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 24, no template load, run # " 580 for (j = 0; j < 4; ++
j) {
585 if (in_file.fail()) {
586 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 25, no template load, run # " 592 for (j = 0; j < 4; ++
j) {
596 if (in_file.fail()) {
597 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 26, no template load, run # " 603 for (j = 0; j < 4; ++
j) {
608 if (in_file.fail()) {
609 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 27, no template load, run # " 615 for (j = 0; j < 4; ++
j) {
619 if (in_file.fail()) {
620 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 28, no template load, run # " 626 for (j = 0; j < 4; ++
j) {
630 if (in_file.fail()) {
631 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 29, no template load, run # " 637 for (j = 0; j < 4; ++
j) {
641 if (in_file.fail()) {
642 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 30, no template load, run # " 648 for (j = 0; j < 4; ++
j) {
652 if (in_file.fail()) {
653 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 30a, no template load, run # " 659 for (j = 0; j < 4; ++
j) {
663 if (in_file.fail()) {
664 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 30b, no template load, run # " 676 if (in_file.fail()) {
677 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 31, no template load, run # " 689 if (in_file.fail()) {
690 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 32, no template load, run # " 701 pixelTemp.push_back(theCurrentTemp);
709 LOGERROR(
"SiPixelTemplate") <<
"Error opening File" << tempfile <<
ENDL;
715 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 728 const int code_version = {17};
735 auto tmpPtr = std::make_unique<SiPixelTemplateStore>();
736 auto& theCurrentTemp = *tmpPtr;
739 for (
int m = 0;
m <
db.numOfTempl(); ++
m) {
743 for (i = 0; i < 20; ++
i) {
744 temp.
f =
db.sVector()[
db.index()];
745 theCurrentTemp.head.title[4 *
i] = temp.
c[0];
746 theCurrentTemp.head.title[4 * i + 1] = temp.
c[1];
747 theCurrentTemp.head.title[4 * i + 2] = temp.
c[2];
748 theCurrentTemp.head.title[4 * i + 3] = temp.
c[3];
749 db.incrementIndex(1);
751 theCurrentTemp.head.title[79] =
'\0';
752 LOGINFO(
"SiPixelTemplate") <<
"Loading Pixel Template File - " << theCurrentTemp.head.title <<
ENDL;
756 db >> theCurrentTemp.head.ID >> theCurrentTemp.head.templ_version >> theCurrentTemp.head.Bfield >>
757 theCurrentTemp.head.NTy >> theCurrentTemp.head.NTyx >> theCurrentTemp.head.NTxx >> theCurrentTemp.head.Dtype >>
758 theCurrentTemp.head.Vbias >> theCurrentTemp.head.temperature >> theCurrentTemp.head.fluence >>
759 theCurrentTemp.head.qscale >> theCurrentTemp.head.s50 >> theCurrentTemp.head.lorywidth >>
760 theCurrentTemp.head.lorxwidth >> theCurrentTemp.head.ysize >> theCurrentTemp.head.xsize >>
761 theCurrentTemp.head.zsize;
764 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 0A, no template load" <<
ENDL;
768 LOGINFO(
"SiPixelTemplate") <<
"Loading Pixel Template File - " << theCurrentTemp.head.title
769 <<
" code version = " << code_version <<
" object version " 770 << theCurrentTemp.head.templ_version <<
ENDL;
772 if (theCurrentTemp.head.templ_version > 17) {
773 db >> theCurrentTemp.head.ss50 >> theCurrentTemp.head.lorybias >> theCurrentTemp.head.lorxbias >>
774 theCurrentTemp.head.fbin[0] >> theCurrentTemp.head.fbin[1] >> theCurrentTemp.head.fbin[2];
777 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 0B, no template load" <<
ENDL;
781 theCurrentTemp.head.ss50 = theCurrentTemp.head.s50;
782 theCurrentTemp.head.lorybias = theCurrentTemp.head.lorywidth / 2.f;
783 theCurrentTemp.head.lorxbias = theCurrentTemp.head.lorxwidth / 2.f;
784 theCurrentTemp.head.fbin[0] = 1.50f;
785 theCurrentTemp.head.fbin[1] = 1.00f;
786 theCurrentTemp.head.fbin[2] = 0.85f;
791 LOGINFO(
"SiPixelTemplate") <<
"Template ID = " << theCurrentTemp.head.ID <<
", Template Version " 792 << theCurrentTemp.head.templ_version <<
", Bfield = " << theCurrentTemp.head.Bfield
793 <<
", NTy = " << theCurrentTemp.head.NTy <<
", NTyx = " << theCurrentTemp.head.NTyx
794 <<
", NTxx = " << theCurrentTemp.head.NTxx <<
", Dtype = " << theCurrentTemp.head.Dtype
795 <<
", Bias voltage " << theCurrentTemp.head.Vbias <<
", temperature " 796 << theCurrentTemp.head.temperature <<
", fluence " << theCurrentTemp.head.fluence
797 <<
", Q-scaling factor " << theCurrentTemp.head.qscale <<
", 1/2 multi dcol threshold " 798 << theCurrentTemp.head.s50 <<
", 1/2 single dcol threshold " << theCurrentTemp.head.ss50
799 <<
", y Lorentz Width " << theCurrentTemp.head.lorywidth <<
", y Lorentz Bias " 800 << theCurrentTemp.head.lorybias <<
", x Lorentz width " << theCurrentTemp.head.lorxwidth
801 <<
", x Lorentz Bias " << theCurrentTemp.head.lorxbias
802 <<
", Q/Q_avg fractions for Qbin defs " << theCurrentTemp.head.fbin[0] <<
", " 803 << theCurrentTemp.head.fbin[1] <<
", " << theCurrentTemp.head.fbin[2]
804 <<
", pixel x-size " << theCurrentTemp.head.xsize <<
", y-size " 805 << theCurrentTemp.head.ysize <<
", zsize " << theCurrentTemp.head.zsize <<
ENDL;
807 if (theCurrentTemp.head.templ_version < code_version) {
808 LOGINFO(
"SiPixelTemplate") <<
"code expects version " << code_version <<
" finds " 809 << theCurrentTemp.head.templ_version <<
", load anyway " <<
ENDL;
813 #ifdef SI_PIXEL_TEMPLATE_USE_BOOST 816 theCurrentTemp.cotbetaY =
new float[theCurrentTemp.head.NTy];
817 theCurrentTemp.cotbetaX =
new float[theCurrentTemp.head.NTyx];
818 theCurrentTemp.cotalphaX =
new float[theCurrentTemp.head.NTxx];
819 theCurrentTemp.enty.resize(boost::extents[theCurrentTemp.head.NTy]);
820 theCurrentTemp.entx.resize(boost::extents[theCurrentTemp.head.NTyx][theCurrentTemp.head.NTxx]);
826 for (i = 0; i < theCurrentTemp.head.NTy; ++
i) {
827 db >> theCurrentTemp.enty[
i].runnum >> theCurrentTemp.enty[
i].costrk[0] >> theCurrentTemp.enty[
i].costrk[1] >>
828 theCurrentTemp.enty[
i].costrk[2];
831 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 1, no template load, run # " << theCurrentTemp.enty[
i].runnum
838 theCurrentTemp.enty[
i].alpha =
839 static_cast<float>(atan2((
double)theCurrentTemp.enty[i].costrk[2], (
double)theCurrentTemp.enty[i].costrk[0]));
841 theCurrentTemp.enty[
i].cotalpha = theCurrentTemp.enty[
i].costrk[0] / theCurrentTemp.enty[
i].costrk[2];
843 theCurrentTemp.enty[
i].beta =
844 static_cast<float>(atan2((
double)theCurrentTemp.enty[i].costrk[2], (
double)theCurrentTemp.enty[i].costrk[1]));
846 theCurrentTemp.enty[
i].cotbeta = theCurrentTemp.enty[
i].costrk[1] / theCurrentTemp.enty[
i].costrk[2];
848 db >> theCurrentTemp.enty[
i].qavg >> theCurrentTemp.enty[
i].pixmax >> theCurrentTemp.enty[
i].symax >>
849 theCurrentTemp.enty[
i].dyone >> theCurrentTemp.enty[
i].syone >> theCurrentTemp.enty[
i].sxmax >>
850 theCurrentTemp.enty[
i].dxone >> theCurrentTemp.enty[
i].sxone;
853 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 2, no template load, run # " << theCurrentTemp.enty[
i].runnum
858 db >> theCurrentTemp.enty[
i].dytwo >> theCurrentTemp.enty[
i].sytwo >> theCurrentTemp.enty[
i].dxtwo >>
859 theCurrentTemp.enty[
i].sxtwo >> theCurrentTemp.enty[
i].qmin >> theCurrentTemp.enty[
i].clsleny >>
860 theCurrentTemp.enty[
i].clslenx;
864 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 3, no template load, run # " << theCurrentTemp.enty[
i].runnum
869 if (theCurrentTemp.enty[i].qmin <= 0.) {
870 LOGERROR(
"SiPixelTemplate") <<
"Error in template ID " << theCurrentTemp.head.ID
871 <<
" qmin = " << theCurrentTemp.enty[
i].qmin <<
", run # " 872 << theCurrentTemp.enty[
i].runnum <<
ENDL;
876 for (j = 0; j < 2; ++
j) {
877 db >> theCurrentTemp.enty[
i].ypar[
j][0] >> theCurrentTemp.enty[
i].ypar[
j][1] >>
878 theCurrentTemp.enty[
i].ypar[
j][2] >> theCurrentTemp.enty[
i].ypar[
j][3] >> theCurrentTemp.enty[
i].ypar[
j][4];
881 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 4, no template load, run # " 882 << theCurrentTemp.enty[
i].runnum <<
ENDL;
887 for (j = 0; j < 9; ++
j) {
889 db >> theCurrentTemp.enty[
i].ytemp[
j][
k];
893 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 5, no template load, run # " 894 << theCurrentTemp.enty[
i].runnum <<
ENDL;
899 for (j = 0; j < 2; ++
j) {
900 db >> theCurrentTemp.enty[
i].xpar[
j][0] >> theCurrentTemp.enty[
i].xpar[
j][1] >>
901 theCurrentTemp.enty[
i].xpar[
j][2] >> theCurrentTemp.enty[
i].xpar[
j][3] >> theCurrentTemp.enty[
i].xpar[
j][4];
904 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 6, no template load, run # " 905 << theCurrentTemp.enty[
i].runnum <<
ENDL;
911 for (j = 0; j < 9; ++
j) {
913 db >> theCurrentTemp.enty[
i].xtemp[
j][
k];
914 qavg_avg += theCurrentTemp.enty[
i].xtemp[
j][
k];
918 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 7, no template load, run # " 919 << theCurrentTemp.enty[
i].runnum <<
ENDL;
923 theCurrentTemp.enty[
i].qavg_avg = qavg_avg / 9.;
925 for (j = 0; j < 4; ++
j) {
926 db >> theCurrentTemp.enty[
i].yavg[
j] >> theCurrentTemp.enty[
i].yrms[
j] >> theCurrentTemp.enty[
i].ygx0[
j] >>
927 theCurrentTemp.enty[
i].ygsig[
j];
930 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 8, no template load, run # " 931 << theCurrentTemp.enty[
i].runnum <<
ENDL;
936 for (j = 0; j < 4; ++
j) {
937 db >> theCurrentTemp.enty[
i].yflpar[
j][0] >> theCurrentTemp.enty[
i].yflpar[
j][1] >>
938 theCurrentTemp.enty[
i].yflpar[
j][2] >> theCurrentTemp.enty[
i].yflpar[
j][3] >>
939 theCurrentTemp.enty[
i].yflpar[
j][4] >> theCurrentTemp.enty[
i].yflpar[
j][5];
942 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 9, no template load, run # " 943 << theCurrentTemp.enty[
i].runnum <<
ENDL;
948 for (j = 0; j < 4; ++
j) {
949 db >> theCurrentTemp.enty[
i].xavg[
j] >> theCurrentTemp.enty[
i].xrms[
j] >> theCurrentTemp.enty[
i].xgx0[
j] >>
950 theCurrentTemp.enty[
i].xgsig[
j];
953 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 10, no template load, run # " 954 << theCurrentTemp.enty[
i].runnum <<
ENDL;
959 for (j = 0; j < 4; ++
j) {
960 db >> theCurrentTemp.enty[
i].xflpar[
j][0] >> theCurrentTemp.enty[
i].xflpar[
j][1] >>
961 theCurrentTemp.enty[
i].xflpar[
j][2] >> theCurrentTemp.enty[
i].xflpar[
j][3] >>
962 theCurrentTemp.enty[
i].xflpar[
j][4] >> theCurrentTemp.enty[
i].xflpar[
j][5];
965 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 11, no template load, run # " 966 << theCurrentTemp.enty[
i].runnum <<
ENDL;
971 for (j = 0; j < 4; ++
j) {
972 db >> theCurrentTemp.enty[
i].chi2yavg[
j] >> theCurrentTemp.enty[
i].chi2ymin[
j] >>
973 theCurrentTemp.enty[
i].chi2xavg[
j] >> theCurrentTemp.enty[
i].chi2xmin[
j];
976 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 12, no template load, run # " 977 << theCurrentTemp.enty[
i].runnum <<
ENDL;
982 for (j = 0; j < 4; ++
j) {
983 db >> theCurrentTemp.enty[
i].yavgc2m[
j] >> theCurrentTemp.enty[
i].yrmsc2m[
j] >>
984 theCurrentTemp.enty[
i].chi2yavgc2m[
j] >> theCurrentTemp.enty[
i].chi2yminc2m[
j];
987 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 13, no template load, run # " 988 << theCurrentTemp.enty[
i].runnum <<
ENDL;
993 for (j = 0; j < 4; ++
j) {
994 db >> theCurrentTemp.enty[
i].xavgc2m[
j] >> theCurrentTemp.enty[
i].xrmsc2m[
j] >>
995 theCurrentTemp.enty[
i].chi2xavgc2m[
j] >> theCurrentTemp.enty[
i].chi2xminc2m[
j];
998 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 14, no template load, run # " 999 << theCurrentTemp.enty[
i].runnum <<
ENDL;
1004 for (j = 0; j < 4; ++
j) {
1005 db >> theCurrentTemp.enty[
i].yavggen[
j] >> theCurrentTemp.enty[
i].yrmsgen[
j] >>
1006 theCurrentTemp.enty[
i].ygx0gen[
j] >> theCurrentTemp.enty[
i].ygsiggen[
j];
1009 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 14a, no template load, run # " 1010 << theCurrentTemp.enty[
i].runnum <<
ENDL;
1015 for (j = 0; j < 4; ++
j) {
1016 db >> theCurrentTemp.enty[
i].xavggen[
j] >> theCurrentTemp.enty[
i].xrmsgen[
j] >>
1017 theCurrentTemp.enty[
i].xgx0gen[
j] >> theCurrentTemp.enty[
i].xgsiggen[
j];
1020 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 14b, no template load, run # " 1021 << theCurrentTemp.enty[
i].runnum <<
ENDL;
1026 db >> theCurrentTemp.enty[
i].chi2yavgone >> theCurrentTemp.enty[
i].chi2yminone >>
1027 theCurrentTemp.enty[
i].chi2xavgone >> theCurrentTemp.enty[
i].chi2xminone >> theCurrentTemp.enty[
i].qmin2 >>
1028 theCurrentTemp.enty[
i].mpvvav >> theCurrentTemp.enty[
i].sigmavav >> theCurrentTemp.enty[
i].kappavav >>
1029 theCurrentTemp.enty[
i].r_qMeas_qTrue >> theCurrentTemp.enty[
i].spare[0];
1032 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 15, no template load, run # " 1033 << theCurrentTemp.enty[
i].runnum <<
ENDL;
1037 db >> theCurrentTemp.enty[
i].mpvvav2 >> theCurrentTemp.enty[
i].sigmavav2 >> theCurrentTemp.enty[
i].kappavav2 >>
1038 theCurrentTemp.enty[
i].qbfrac[0] >> theCurrentTemp.enty[
i].qbfrac[1] >> theCurrentTemp.enty[
i].qbfrac[2] >>
1039 theCurrentTemp.enty[
i].fracyone >> theCurrentTemp.enty[
i].fracxone >> theCurrentTemp.enty[
i].fracytwo >>
1040 theCurrentTemp.enty[
i].fracxtwo;
1044 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 16, no template load, run # " 1045 << theCurrentTemp.enty[
i].runnum <<
ENDL;
1052 for (k = 0; k < theCurrentTemp.head.NTyx; ++
k) {
1053 for (i = 0; i < theCurrentTemp.head.NTxx; ++
i) {
1054 db >> theCurrentTemp.entx[
k][
i].runnum >> theCurrentTemp.entx[
k][
i].costrk[0] >>
1055 theCurrentTemp.entx[
k][
i].costrk[1] >> theCurrentTemp.entx[
k][
i].costrk[2];
1058 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 17, no template load, run # " 1059 << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
1065 theCurrentTemp.entx[
k][
i].alpha =
static_cast<float>(
1066 atan2((
double)theCurrentTemp.entx[k][i].costrk[2], (
double)theCurrentTemp.entx[k][i].costrk[0]));
1068 theCurrentTemp.entx[
k][
i].cotalpha = theCurrentTemp.entx[
k][
i].costrk[0] / theCurrentTemp.entx[
k][
i].costrk[2];
1070 theCurrentTemp.entx[
k][
i].beta =
static_cast<float>(
1071 atan2((
double)theCurrentTemp.entx[k][i].costrk[2], (
double)theCurrentTemp.entx[k][i].costrk[1]));
1073 theCurrentTemp.entx[
k][
i].cotbeta = theCurrentTemp.entx[
k][
i].costrk[1] / theCurrentTemp.entx[
k][
i].costrk[2];
1075 db >> theCurrentTemp.entx[
k][
i].qavg >> theCurrentTemp.entx[
k][
i].pixmax >> theCurrentTemp.entx[
k][
i].symax >>
1076 theCurrentTemp.entx[
k][
i].dyone >> theCurrentTemp.entx[
k][
i].syone >> theCurrentTemp.entx[
k][
i].sxmax >>
1077 theCurrentTemp.entx[
k][
i].dxone >> theCurrentTemp.entx[
k][
i].sxone;
1080 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 18, no template load, run # " 1081 << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
1085 db >> theCurrentTemp.entx[
k][
i].dytwo >> theCurrentTemp.entx[
k][
i].sytwo >> theCurrentTemp.entx[
k][
i].dxtwo >>
1086 theCurrentTemp.entx[
k][
i].sxtwo >> theCurrentTemp.entx[
k][
i].qmin >> theCurrentTemp.entx[
k][
i].clsleny >>
1087 theCurrentTemp.entx[
k][
i].clslenx;
1091 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 19, no template load, run # " 1092 << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
1096 for (j = 0; j < 2; ++
j) {
1097 db >> theCurrentTemp.entx[
k][
i].ypar[
j][0] >> theCurrentTemp.entx[
k][
i].ypar[
j][1] >>
1098 theCurrentTemp.entx[
k][
i].ypar[
j][2] >> theCurrentTemp.entx[
k][
i].ypar[
j][3] >>
1099 theCurrentTemp.entx[
k][
i].ypar[
j][4];
1102 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 20, no template load, run # " 1103 << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
1108 for (j = 0; j < 9; ++
j) {
1109 for (l = 0; l <
TYSIZE; ++
l) {
1110 db >> theCurrentTemp.entx[
k][
i].ytemp[
j][
l];
1114 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 21, no template load, run # " 1115 << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
1120 for (j = 0; j < 2; ++
j) {
1121 db >> theCurrentTemp.entx[
k][
i].xpar[
j][0] >> theCurrentTemp.entx[
k][
i].xpar[
j][1] >>
1122 theCurrentTemp.entx[
k][
i].xpar[
j][2] >> theCurrentTemp.entx[
k][
i].xpar[
j][3] >>
1123 theCurrentTemp.entx[
k][
i].xpar[
j][4];
1126 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 22, no template load, run # " 1127 << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
1133 for (j = 0; j < 9; ++
j) {
1134 for (l = 0; l <
TXSIZE; ++
l) {
1135 db >> theCurrentTemp.entx[
k][
i].xtemp[
j][
l];
1136 qavg_avg += theCurrentTemp.entx[
k][
i].xtemp[
j][
l];
1140 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 23, no template load, run # " 1141 << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
1145 theCurrentTemp.entx[
k][
i].qavg_avg = qavg_avg / 9.;
1147 for (j = 0; j < 4; ++
j) {
1148 db >> theCurrentTemp.entx[
k][
i].yavg[
j] >> theCurrentTemp.entx[
k][
i].yrms[
j] >>
1149 theCurrentTemp.entx[
k][
i].ygx0[
j] >> theCurrentTemp.entx[
k][
i].ygsig[
j];
1152 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 24, no template load, run # " 1153 << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
1158 for (j = 0; j < 4; ++
j) {
1159 db >> theCurrentTemp.entx[
k][
i].yflpar[
j][0] >> theCurrentTemp.entx[
k][
i].yflpar[
j][1] >>
1160 theCurrentTemp.entx[
k][
i].yflpar[
j][2] >> theCurrentTemp.entx[
k][
i].yflpar[
j][3] >>
1161 theCurrentTemp.entx[
k][
i].yflpar[
j][4] >> theCurrentTemp.entx[
k][
i].yflpar[
j][5];
1164 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 25, no template load, run # " 1165 << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
1170 for (j = 0; j < 4; ++
j) {
1171 db >> theCurrentTemp.entx[
k][
i].xavg[
j] >> theCurrentTemp.entx[
k][
i].xrms[
j] >>
1172 theCurrentTemp.entx[
k][
i].xgx0[
j] >> theCurrentTemp.entx[
k][
i].xgsig[
j];
1175 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 26, no template load, run # " 1176 << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
1181 for (j = 0; j < 4; ++
j) {
1182 db >> theCurrentTemp.entx[
k][
i].xflpar[
j][0] >> theCurrentTemp.entx[
k][
i].xflpar[
j][1] >>
1183 theCurrentTemp.entx[
k][
i].xflpar[
j][2] >> theCurrentTemp.entx[
k][
i].xflpar[
j][3] >>
1184 theCurrentTemp.entx[
k][
i].xflpar[
j][4] >> theCurrentTemp.entx[
k][
i].xflpar[
j][5];
1187 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 27, no template load, run # " 1188 << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
1193 for (j = 0; j < 4; ++
j) {
1194 db >> theCurrentTemp.entx[
k][
i].chi2yavg[
j] >> theCurrentTemp.entx[
k][
i].chi2ymin[
j] >>
1195 theCurrentTemp.entx[
k][
i].chi2xavg[
j] >> theCurrentTemp.entx[
k][
i].chi2xmin[
j];
1198 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 28, no template load, run # " 1199 << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
1204 for (j = 0; j < 4; ++
j) {
1205 db >> theCurrentTemp.entx[
k][
i].yavgc2m[
j] >> theCurrentTemp.entx[
k][
i].yrmsc2m[
j] >>
1206 theCurrentTemp.entx[
k][
i].chi2yavgc2m[
j] >> theCurrentTemp.entx[
k][
i].chi2yminc2m[
j];
1209 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 29, no template load, run # " 1210 << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
1215 for (j = 0; j < 4; ++
j) {
1216 db >> theCurrentTemp.entx[
k][
i].xavgc2m[
j] >> theCurrentTemp.entx[
k][
i].xrmsc2m[
j] >>
1217 theCurrentTemp.entx[
k][
i].chi2xavgc2m[
j] >> theCurrentTemp.entx[
k][
i].chi2xminc2m[
j];
1220 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 30, no template load, run # " 1221 << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
1226 for (j = 0; j < 4; ++
j) {
1227 db >> theCurrentTemp.entx[
k][
i].yavggen[
j] >> theCurrentTemp.entx[
k][
i].yrmsgen[
j] >>
1228 theCurrentTemp.entx[
k][
i].ygx0gen[
j] >> theCurrentTemp.entx[
k][
i].ygsiggen[
j];
1231 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 30a, no template load, run # " 1232 << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
1237 for (j = 0; j < 4; ++
j) {
1238 db >> theCurrentTemp.entx[
k][
i].xavggen[
j] >> theCurrentTemp.entx[
k][
i].xrmsgen[
j] >>
1239 theCurrentTemp.entx[
k][
i].xgx0gen[
j] >> theCurrentTemp.entx[
k][
i].xgsiggen[
j];
1242 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 30b, no template load, run # " 1243 << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
1248 db >> theCurrentTemp.entx[
k][
i].chi2yavgone >> theCurrentTemp.entx[
k][
i].chi2yminone >>
1249 theCurrentTemp.entx[
k][
i].chi2xavgone >> theCurrentTemp.entx[
k][
i].chi2xminone >>
1250 theCurrentTemp.entx[
k][
i].qmin2 >> theCurrentTemp.entx[
k][
i].mpvvav >> theCurrentTemp.entx[
k][
i].sigmavav >>
1251 theCurrentTemp.entx[
k][
i].kappavav >> theCurrentTemp.entx[
k][
i].r_qMeas_qTrue >>
1252 theCurrentTemp.entx[
k][
i].spare[0];
1255 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 31, no template load, run # " 1256 << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
1260 db >> theCurrentTemp.entx[
k][
i].mpvvav2 >> theCurrentTemp.entx[
k][
i].sigmavav2 >>
1261 theCurrentTemp.entx[
k][
i].kappavav2 >> theCurrentTemp.entx[
k][
i].qbfrac[0] >>
1262 theCurrentTemp.entx[
k][
i].qbfrac[1] >> theCurrentTemp.entx[
k][
i].qbfrac[2] >>
1263 theCurrentTemp.entx[
k][
i].fracyone >> theCurrentTemp.entx[
k][
i].fracxone >>
1264 theCurrentTemp.entx[
k][
i].fracytwo >> theCurrentTemp.entx[
k][
i].fracxtwo;
1268 LOGERROR(
"SiPixelTemplate") <<
"Error reading file 32, no template load, run # " 1269 << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
1277 pixelTemp.push_back(theCurrentTemp);
1279 postInit(pixelTemp);
1304 for (
auto& templ : thePixelTemp_) {
1305 for (
auto iy = 0; iy < templ.head.NTy; ++iy)
1306 templ.cotbetaY[iy] = templ.enty[iy].cotbeta;
1307 for (
auto iy = 0; iy < templ.head.NTyx; ++iy)
1308 templ.cotbetaX[iy] = templ.entx[iy][0].cotbeta;
1309 for (
auto ix = 0; ix < templ.head.NTxx; ++ix)
1310 templ.cotalphaX[ix] = templ.entx[0][ix].cotalpha;
1331 int ilow, ihigh, iylow, iyhigh, Ny, Nxx, Nyx, imidy, imaxx;
1332 float yratio, yxratio, xxratio, sxmax, qcorrect, qxtempcor, symax, chi2xavgone, chi2xminone, cota, cotb, cotalpha0,
1334 bool flip_x, flip_y;
1336 float chi2xavg[4], chi2xmin[4], chi2xavgc2m[4], chi2xminc2m[4];
1339 if (
id != id_current_ || cotalpha != cota_current_ || cotbeta != cotb_current_) {
1340 cota_current_ = cotalpha;
1341 cotb_current_ = cotbeta;
1344 if (
id != id_current_) {
1348 for (i = 0; i < (
int)thePixelTemp_.size(); ++
i) {
1351 if (
id == thePixelTemp_[i].head.ID) {
1357 qscale_ = thePixelTemp_[index_id_].head.qscale;
1361 s50_ = thePixelTemp_[index_id_].head.s50;
1365 for (j = 0; j < 3; ++
j) {
1366 fbin_[
j] = thePixelTemp_[index_id_].head.fbin[
j];
1372 xsize_ = thePixelTemp_[index_id_].head.xsize;
1373 ysize_ = thePixelTemp_[index_id_].head.ysize;
1374 zsize_ = thePixelTemp_[index_id_].head.zsize;
1381 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 1382 if (index_id_ < 0 || index_id_ >= (
int)thePixelTemp_.size()) {
1384 <<
"SiPixelTemplate::interpolate can't find needed template ID = " <<
id << std::endl;
1387 assert(index_id_ >= 0 && index_id_ < (
int)thePixelTemp_.size());
1396 cotalpha0 = thePixelTemp_[index_id_].enty[0].cotalpha;
1398 std::sqrt((1.
f + cotbeta * cotbeta + cotalpha * cotalpha) / (1.
f + cotbeta * cotbeta + cotalpha0 * cotalpha0));
1405 switch (thePixelTemp_[index_id_].head.Dtype) {
1407 if (cotbeta < 0.
f) {
1423 if (locBx * locBz < 0.
f) {
1435 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 1437 <<
"SiPixelTemplate::illegal subdetector ID = " << thePixelTemp_[index_id_].head.Dtype << std::endl;
1439 std::cout <<
"SiPixelTemplate::illegal subdetector ID = " << thePixelTemp_[index_id_].head.Dtype << std::endl;
1443 Ny = thePixelTemp_[index_id_].head.NTy;
1444 Nyx = thePixelTemp_[index_id_].head.NTyx;
1445 Nxx = thePixelTemp_[index_id_].head.NTxx;
1447 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 1448 if (Ny < 2 || Nyx < 1 || Nxx < 2) {
1450 <<
"template ID = " << id_current_ <<
"has too few entries: Ny/Nyx/Nxx = " << Ny <<
"/" << Nyx <<
"/" << Nxx
1454 assert(Ny > 1 && Nyx > 0 && Nxx > 1);
1464 if (cotb >= thePixelTemp_[index_id_].enty[Ny - 1].cotbeta) {
1470 if (cotb >= thePixelTemp_[index_id_].enty[0].cotbeta) {
1471 for (i = 0; i < Ny - 1; ++
i) {
1472 if (thePixelTemp_[index_id_].enty[i].cotbeta <= cotb && cotb < thePixelTemp_[index_id_].enty[i + 1].cotbeta) {
1474 yratio = (cotb - thePixelTemp_[index_id_].enty[
i].cotbeta) /
1475 (thePixelTemp_[index_id_].enty[i + 1].cotbeta - thePixelTemp_[index_id_].enty[i].cotbeta);
1490 (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].qavg + yratio * thePixelTemp_[index_id_].enty[ihigh].qavg;
1492 symax = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].symax +
1493 yratio * thePixelTemp_[index_id_].enty[ihigh].symax;
1495 sxmax = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].sxmax +
1496 yratio * thePixelTemp_[index_id_].enty[ihigh].sxmax;
1497 dyone_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].dyone +
1498 yratio * thePixelTemp_[index_id_].enty[ihigh].dyone;
1502 syone_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].syone +
1503 yratio * thePixelTemp_[index_id_].enty[ihigh].syone;
1504 dytwo_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].dytwo +
1505 yratio * thePixelTemp_[index_id_].enty[ihigh].dytwo;
1509 sytwo_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].sytwo +
1510 yratio * thePixelTemp_[index_id_].enty[ihigh].sytwo;
1512 (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].qmin + yratio * thePixelTemp_[index_id_].enty[ihigh].qmin;
1514 qmin2_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].qmin2 +
1515 yratio * thePixelTemp_[index_id_].enty[ihigh].qmin2;
1517 mpvvav_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].mpvvav +
1518 yratio * thePixelTemp_[index_id_].enty[ihigh].mpvvav;
1519 mpvvav_ *= qcorrect;
1520 sigmavav_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].sigmavav +
1521 yratio * thePixelTemp_[index_id_].enty[ihigh].sigmavav;
1522 kappavav_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].kappavav +
1523 yratio * thePixelTemp_[index_id_].enty[ihigh].kappavav;
1524 mpvvav2_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].mpvvav2 +
1525 yratio * thePixelTemp_[index_id_].enty[ihigh].mpvvav2;
1526 mpvvav2_ *= qcorrect;
1527 sigmavav2_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].sigmavav2 +
1528 yratio * thePixelTemp_[index_id_].enty[ihigh].sigmavav2;
1529 kappavav2_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].kappavav2 +
1530 yratio * thePixelTemp_[index_id_].enty[ihigh].kappavav2;
1531 clsleny_ = fminf(thePixelTemp_[index_id_].enty[ilow].clsleny, thePixelTemp_[index_id_].enty[ihigh].clsleny);
1532 qavg_avg_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].qavg_avg +
1533 yratio * thePixelTemp_[index_id_].enty[ihigh].qavg_avg;
1534 qavg_avg_ *= qcorrect;
1535 for (i = 0; i < 2; ++
i) {
1536 for (j = 0; j < 5; ++
j) {
1539 yparl_[1 -
i][
j] = thePixelTemp_[index_id_].enty[ilow].ypar[
i][
j];
1540 yparh_[1 -
i][
j] = thePixelTemp_[index_id_].enty[ihigh].ypar[
i][
j];
1542 yparl_[
i][
j] = thePixelTemp_[index_id_].enty[ilow].ypar[
i][
j];
1543 yparh_[
i][
j] = thePixelTemp_[index_id_].enty[ihigh].ypar[
i][
j];
1546 xparly0_[1 -
i][
j] = thePixelTemp_[index_id_].enty[ilow].xpar[
i][
j];
1547 xparhy0_[1 -
i][
j] = thePixelTemp_[index_id_].enty[ihigh].xpar[
i][
j];
1549 xparly0_[
i][
j] = thePixelTemp_[index_id_].enty[ilow].xpar[
i][
j];
1550 xparhy0_[
i][
j] = thePixelTemp_[index_id_].enty[ihigh].xpar[
i][
j];
1555 for (i = 0; i < 4; ++
i) {
1556 yavg_[
i] = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].yavg[i] +
1557 yratio * thePixelTemp_[index_id_].enty[ihigh].yavg[i];
1559 yavg_[
i] = -yavg_[
i];
1561 yrms_[
i] = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].yrms[i] +
1562 yratio * thePixelTemp_[index_id_].enty[ihigh].yrms[i];
1568 chi2yavg_[
i] = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].chi2yavg[i] +
1569 yratio * thePixelTemp_[index_id_].enty[ihigh].chi2yavg[i];
1570 chi2ymin_[
i] = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].chi2ymin[i] +
1571 yratio * thePixelTemp_[index_id_].enty[ihigh].chi2ymin[i];
1572 chi2xavg[
i] = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].chi2xavg[i] +
1573 yratio * thePixelTemp_[index_id_].enty[ihigh].chi2xavg[i];
1574 chi2xmin[
i] = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].chi2xmin[i] +
1575 yratio * thePixelTemp_[index_id_].enty[ihigh].chi2xmin[i];
1576 yavgc2m_[
i] = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].yavgc2m[i] +
1577 yratio * thePixelTemp_[index_id_].enty[ihigh].yavgc2m[i];
1579 yavgc2m_[
i] = -yavgc2m_[
i];
1581 yrmsc2m_[
i] = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].yrmsc2m[i] +
1582 yratio * thePixelTemp_[index_id_].enty[ihigh].yrmsc2m[i];
1583 chi2yavgc2m_[
i] = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].chi2yavgc2m[i] +
1584 yratio * thePixelTemp_[index_id_].enty[ihigh].chi2yavgc2m[i];
1586 chi2yminc2m_[
i] = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].chi2yminc2m[i] +
1587 yratio * thePixelTemp_[index_id_].enty[ihigh].chi2yminc2m[i];
1589 chi2xavgc2m[
i] = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].chi2xavgc2m[i] +
1590 yratio * thePixelTemp_[index_id_].enty[ihigh].chi2xavgc2m[i];
1591 chi2xminc2m[
i] = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].chi2xminc2m[i] +
1592 yratio * thePixelTemp_[index_id_].enty[ihigh].chi2xminc2m[i];
1593 for (j = 0; j < 6; ++
j) {
1594 yflparl_[
i][
j] = thePixelTemp_[index_id_].enty[ilow].yflpar[
i][
j];
1595 yflparh_[
i][
j] = thePixelTemp_[index_id_].enty[ihigh].yflpar[
i][
j];
1599 if (flip_y && (j == 0 || j == 2 || j == 4)) {
1600 yflparl_[
i][
j] = -yflparl_[
i][
j];
1601 yflparh_[
i][
j] = -yflparh_[
i][
j];
1608 chi2yavgone_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].chi2yavgone +
1609 yratio * thePixelTemp_[index_id_].enty[ihigh].chi2yavgone;
1610 chi2yminone_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].chi2yminone +
1611 yratio * thePixelTemp_[index_id_].enty[ihigh].chi2yminone;
1612 chi2xavgone = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].chi2xavgone +
1613 yratio * thePixelTemp_[index_id_].enty[ihigh].chi2xavgone;
1614 chi2xminone = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].chi2xminone +
1615 yratio * thePixelTemp_[index_id_].enty[ihigh].chi2xminone;
1617 fracyone_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].fracyone +
1618 yratio * thePixelTemp_[index_id_].enty[ihigh].fracyone;
1619 fracytwo_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].fracytwo +
1620 yratio * thePixelTemp_[index_id_].enty[ihigh].fracytwo;
1627 for (i = 0; i < 9; ++
i) {
1630 ytemp_[
i][
BYM2] = 0.f;
1631 ytemp_[
i][
BYM1] = 0.f;
1632 for (j = 0; j <
TYSIZE; ++
j) {
1636 ytemp_[8 -
i][
BYM3 -
j] = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].ytemp[i][j] +
1637 yratio * thePixelTemp_[index_id_].enty[ihigh].ytemp[i][j];
1639 ytemp_[
i][j + 2] = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].ytemp[i][j] +
1640 yratio * thePixelTemp_[index_id_].enty[ihigh].ytemp[i][j];
1650 if (abs_cotb_ >= thePixelTemp_[index_id_].entx[Nyx - 1][0].cotbeta) {
1654 }
else if (abs_cotb_ >= thePixelTemp_[index_id_].entx[0][0].cotbeta) {
1655 for (i = 0; i < Nyx - 1; ++
i) {
1656 if (thePixelTemp_[index_id_].entx[i][0].cotbeta <= abs_cotb_ &&
1657 abs_cotb_ < thePixelTemp_[index_id_].entx[i + 1][0].cotbeta) {
1659 yxratio = (abs_cotb_ - thePixelTemp_[index_id_].entx[
i][0].cotbeta) /
1660 (thePixelTemp_[index_id_].entx[i + 1][0].cotbeta - thePixelTemp_[index_id_].entx[i][0].cotbeta);
1671 if (cota >= thePixelTemp_[index_id_].entx[0][Nxx - 1].cotalpha) {
1677 if (cota >= thePixelTemp_[index_id_].entx[0][0].cotalpha) {
1678 for (i = 0; i < Nxx - 1; ++
i) {
1679 if (thePixelTemp_[index_id_].entx[0][i].cotalpha <= cota &&
1680 cota < thePixelTemp_[index_id_].entx[0][i + 1].cotalpha) {
1682 xxratio = (cota - thePixelTemp_[index_id_].entx[0][
i].cotalpha) /
1683 (thePixelTemp_[index_id_].entx[0][i + 1].cotalpha - thePixelTemp_[index_id_].entx[0][i].cotalpha);
1701 sxparmax_ = (1.f - xxratio) * thePixelTemp_[index_id_].entx[imaxx][ilow].sxmax +
1702 xxratio * thePixelTemp_[index_id_].entx[imaxx][ihigh].sxmax;
1704 if (thePixelTemp_[index_id_].entx[imaxx][imidy].sxmax != 0.
f) {
1705 sxmax_ = sxmax_ / thePixelTemp_[index_id_].entx[imaxx][imidy].sxmax * sxmax;
1707 symax_ = (1.f - xxratio) * thePixelTemp_[index_id_].entx[imaxx][ilow].symax +
1708 xxratio * thePixelTemp_[index_id_].entx[imaxx][ihigh].symax;
1709 if (thePixelTemp_[index_id_].entx[imaxx][imidy].symax != 0.
f) {
1710 symax_ = symax_ / thePixelTemp_[index_id_].entx[imaxx][imidy].symax * symax;
1712 dxone_ = (1.f - xxratio) * thePixelTemp_[index_id_].entx[0][ilow].dxone +
1713 xxratio * thePixelTemp_[index_id_].entx[0][ihigh].dxone;
1717 sxone_ = (1.f - xxratio) * thePixelTemp_[index_id_].entx[0][ilow].sxone +
1718 xxratio * thePixelTemp_[index_id_].entx[0][ihigh].sxone;
1719 dxtwo_ = (1.f - xxratio) * thePixelTemp_[index_id_].entx[0][ilow].dxtwo +
1720 xxratio * thePixelTemp_[index_id_].entx[0][ihigh].dxtwo;
1724 sxtwo_ = (1.f - xxratio) * thePixelTemp_[index_id_].entx[0][ilow].sxtwo +
1725 xxratio * thePixelTemp_[index_id_].entx[0][ihigh].sxtwo;
1726 clslenx_ = fminf(thePixelTemp_[index_id_].entx[0][ilow].clslenx, thePixelTemp_[index_id_].entx[0][ihigh].clslenx);
1728 for (i = 0; i < 2; ++
i) {
1729 for (j = 0; j < 5; ++
j) {
1732 xpar0_[1 -
i][
j] = thePixelTemp_[index_id_].entx[imaxx][imidy].xpar[
i][
j];
1733 xparl_[1 -
i][
j] = thePixelTemp_[index_id_].entx[imaxx][ilow].xpar[
i][
j];
1734 xparh_[1 -
i][
j] = thePixelTemp_[index_id_].entx[imaxx][ihigh].xpar[
i][
j];
1736 xpar0_[
i][
j] = thePixelTemp_[index_id_].entx[imaxx][imidy].xpar[
i][
j];
1737 xparl_[
i][
j] = thePixelTemp_[index_id_].entx[imaxx][ilow].xpar[
i][
j];
1738 xparh_[
i][
j] = thePixelTemp_[index_id_].entx[imaxx][ihigh].xpar[
i][
j];
1745 pixmax_ = (1.f - yxratio) * ((1.
f - xxratio) * thePixelTemp_[index_id_].entx[iylow][ilow].pixmax +
1746 xxratio * thePixelTemp_[index_id_].entx[iylow][ihigh].pixmax) +
1747 yxratio * ((1.
f - xxratio) * thePixelTemp_[index_id_].entx[iyhigh][ilow].pixmax +
1748 xxratio * thePixelTemp_[index_id_].entx[iyhigh][ihigh].pixmax);
1750 r_qMeas_qTrue_ = (1.f - yxratio) * ((1.
f - xxratio) * thePixelTemp_[index_id_].entx[iylow][ilow].r_qMeas_qTrue +
1751 xxratio * thePixelTemp_[index_id_].entx[iylow][ihigh].r_qMeas_qTrue) +
1752 yxratio * ((1.
f - xxratio) * thePixelTemp_[index_id_].entx[iyhigh][ilow].r_qMeas_qTrue +
1753 xxratio * thePixelTemp_[index_id_].entx[iyhigh][ihigh].r_qMeas_qTrue);
1755 for (i = 0; i < 4; ++
i) {
1756 xavg_[
i] = (1.f - yxratio) * ((1.
f - xxratio) * thePixelTemp_[index_id_].entx[iylow][ilow].xavg[
i] +
1757 xxratio * thePixelTemp_[index_id_].entx[iylow][ihigh].xavg[
i]) +
1758 yxratio * ((1.
f - xxratio) * thePixelTemp_[index_id_].entx[iyhigh][ilow].xavg[
i] +
1759 xxratio * thePixelTemp_[index_id_].entx[iyhigh][ihigh].xavg[
i]);
1761 xavg_[
i] = -xavg_[
i];
1764 xrms_[
i] = (1.f - yxratio) * ((1.
f - xxratio) * thePixelTemp_[index_id_].entx[iylow][ilow].xrms[
i] +
1765 xxratio * thePixelTemp_[index_id_].entx[iylow][ihigh].xrms[
i]) +
1766 yxratio * ((1.
f - xxratio) * thePixelTemp_[index_id_].entx[iyhigh][ilow].xrms[
i] +
1767 xxratio * thePixelTemp_[index_id_].entx[iyhigh][ihigh].xrms[
i]);
1775 xavgc2m_[
i] = (1.f - yxratio) * ((1.
f - xxratio) * thePixelTemp_[index_id_].entx[iylow][ilow].xavgc2m[
i] +
1776 xxratio * thePixelTemp_[index_id_].entx[iylow][ihigh].xavgc2m[
i]) +
1777 yxratio * ((1.
f - xxratio) * thePixelTemp_[index_id_].entx[iyhigh][ilow].xavgc2m[
i] +
1778 xxratio * thePixelTemp_[index_id_].entx[iyhigh][ihigh].xavgc2m[
i]);
1780 xavgc2m_[
i] = -xavgc2m_[
i];
1783 xrmsc2m_[
i] = (1.f - yxratio) * ((1.
f - xxratio) * thePixelTemp_[index_id_].entx[iylow][ilow].xrmsc2m[
i] +
1784 xxratio * thePixelTemp_[index_id_].entx[iylow][ihigh].xrmsc2m[
i]) +
1785 yxratio * ((1.
f - xxratio) * thePixelTemp_[index_id_].entx[iyhigh][ilow].xrmsc2m[
i] +
1786 xxratio * thePixelTemp_[index_id_].entx[iyhigh][ihigh].xrmsc2m[
i]);
1802 chi2xavg_[
i] = ((1.f - xxratio) * thePixelTemp_[index_id_].entx[iyhigh][ilow].chi2xavg[i] +
1803 xxratio * thePixelTemp_[index_id_].entx[iyhigh][ihigh].chi2xavg[i]);
1804 if (thePixelTemp_[index_id_].entx[iyhigh][imidy].chi2xavg[i] != 0.
f) {
1805 chi2xavg_[
i] = chi2xavg_[
i] / thePixelTemp_[index_id_].entx[iyhigh][imidy].chi2xavg[
i] * chi2xavg[
i];
1808 chi2xmin_[
i] = ((1.f - xxratio) * thePixelTemp_[index_id_].entx[iyhigh][ilow].chi2xmin[i] +
1809 xxratio * thePixelTemp_[index_id_].entx[iyhigh][ihigh].chi2xmin[i]);
1810 if (thePixelTemp_[index_id_].entx[iyhigh][imidy].chi2xmin[i] != 0.
f) {
1811 chi2xmin_[
i] = chi2xmin_[
i] / thePixelTemp_[index_id_].entx[iyhigh][imidy].chi2xmin[
i] * chi2xmin[
i];
1814 chi2xavgc2m_[
i] = ((1.f - xxratio) * thePixelTemp_[index_id_].entx[iyhigh][ilow].chi2xavgc2m[i] +
1815 xxratio * thePixelTemp_[index_id_].entx[iyhigh][ihigh].chi2xavgc2m[i]);
1816 if (thePixelTemp_[index_id_].entx[iyhigh][imidy].chi2xavgc2m[i] != 0.
f) {
1818 chi2xavgc2m_[
i] / thePixelTemp_[index_id_].entx[iyhigh][imidy].chi2xavgc2m[
i] * chi2xavgc2m[
i];
1821 chi2xminc2m_[
i] = ((1.f - xxratio) * thePixelTemp_[index_id_].entx[iyhigh][ilow].chi2xminc2m[i] +
1822 xxratio * thePixelTemp_[index_id_].entx[iyhigh][ihigh].chi2xminc2m[i]);
1823 if (thePixelTemp_[index_id_].entx[iyhigh][imidy].chi2xminc2m[i] != 0.
f) {
1825 chi2xminc2m_[
i] / thePixelTemp_[index_id_].entx[iyhigh][imidy].chi2xminc2m[
i] * chi2xminc2m[
i];
1828 for (j = 0; j < 6; ++
j) {
1829 xflparll_[
i][
j] = thePixelTemp_[index_id_].entx[iylow][ilow].xflpar[
i][
j];
1830 xflparlh_[
i][
j] = thePixelTemp_[index_id_].entx[iylow][ihigh].xflpar[
i][
j];
1831 xflparhl_[
i][
j] = thePixelTemp_[index_id_].entx[iyhigh][ilow].xflpar[
i][
j];
1832 xflparhh_[
i][
j] = thePixelTemp_[index_id_].entx[iyhigh][ihigh].xflpar[
i][
j];
1834 if (flip_x && (j == 0 || j == 2 || j == 4)) {
1835 xflparll_[
i][
j] = -xflparll_[
i][
j];
1836 xflparlh_[
i][
j] = -xflparlh_[
i][
j];
1837 xflparhl_[
i][
j] = -xflparhl_[
i][
j];
1838 xflparhh_[
i][
j] = -xflparhh_[
i][
j];
1845 chi2xavgone_ = ((1.f - xxratio) * thePixelTemp_[index_id_].entx[iyhigh][ilow].chi2xavgone +
1846 xxratio * thePixelTemp_[index_id_].entx[iyhigh][ihigh].chi2xavgone);
1847 if (thePixelTemp_[index_id_].entx[iyhigh][imidy].chi2xavgone != 0.
f) {
1848 chi2xavgone_ = chi2xavgone_ / thePixelTemp_[index_id_].entx[iyhigh][imidy].chi2xavgone * chi2xavgone;
1851 chi2xminone_ = ((1.f - xxratio) * thePixelTemp_[index_id_].entx[iyhigh][ilow].chi2xminone +
1852 xxratio * thePixelTemp_[index_id_].entx[iyhigh][ihigh].chi2xminone);
1853 if (thePixelTemp_[index_id_].entx[iyhigh][imidy].chi2xminone != 0.
f) {
1854 chi2xminone_ = chi2xminone_ / thePixelTemp_[index_id_].entx[iyhigh][imidy].chi2xminone * chi2xminone;
1857 fracxone_ = (1.f - yxratio) * ((1.
f - xxratio) * thePixelTemp_[index_id_].entx[iylow][ilow].fracxone +
1858 xxratio * thePixelTemp_[index_id_].entx[iylow][ihigh].fracxone) +
1859 yxratio * ((1.
f - xxratio) * thePixelTemp_[index_id_].entx[iyhigh][ilow].fracxone +
1860 xxratio * thePixelTemp_[index_id_].entx[iyhigh][ihigh].fracxone);
1861 fracxtwo_ = (1.f - yxratio) * ((1.
f - xxratio) * thePixelTemp_[index_id_].entx[iylow][ilow].fracxtwo +
1862 xxratio * thePixelTemp_[index_id_].entx[iylow][ihigh].fracxtwo) +
1863 yxratio * ((1.
f - xxratio) * thePixelTemp_[index_id_].entx[iyhigh][ilow].fracxtwo +
1864 xxratio * thePixelTemp_[index_id_].entx[iyhigh][ihigh].fracxtwo);
1875 cotbeta0 = thePixelTemp_[index_id_].entx[iyhigh][0].cotbeta;
1877 std::sqrt((1.
f + cotbeta * cotbeta + cotalpha * cotalpha) / (1.
f + cotbeta0 * cotbeta0 + cotalpha * cotalpha));
1879 for (i = 0; i < 9; ++
i) {
1882 xtemp_[
i][
BXM2] = 0.f;
1883 xtemp_[
i][
BXM1] = 0.f;
1884 for (j = 0; j <
TXSIZE; ++
j) {
1889 xtemp_[8 -
i][
BXM3 -
j] =
1890 qxtempcor * ((1.f - xxratio) * thePixelTemp_[index_id_].entx[iyhigh][ilow].xtemp[i][j] +
1891 xxratio * thePixelTemp_[index_id_].entx[iyhigh][ihigh].xtemp[i][j]);
1893 xtemp_[
i][j + 2] = qxtempcor * ((1.f - xxratio) * thePixelTemp_[index_id_].entx[iyhigh][ilow].xtemp[i][j] +
1894 xxratio * thePixelTemp_[index_id_].entx[iyhigh][ihigh].xtemp[i][j]);
1899 lorywidth_ = thePixelTemp_[index_id_].head.lorywidth;
1900 lorxwidth_ = thePixelTemp_[index_id_].head.lorxwidth;
1901 lorybias_ = thePixelTemp_[index_id_].head.lorybias;
1902 lorxbias_ = thePixelTemp_[index_id_].head.lorxbias;
1904 lorxwidth_ = -lorxwidth_;
1905 lorxbias_ = -lorxbias_;
1908 lorywidth_ = -lorywidth_;
1909 lorybias_ = -lorybias_;
1928 if (cotbeta < 0.
f) {
1931 float locBz = locBx;
1932 if (cotalpha < 0.
f) {
1969 float sigi, sigi2, sigi3, sigi4, symax, qscale, s25;
1973 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 1974 if (fypix < 2 || fypix >=
BYM2) {
1975 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::ysigma2 called with fypix = " << fypix << std::endl;
1978 assert(fypix > 1 && fypix <
BYM2);
1980 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 1981 if (lypix < fypix || lypix >=
BYM2) {
1982 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::ysigma2 called with lypix/fypix = " << lypix <<
"/" 1983 << fypix << std::endl;
1986 assert(lypix >= fypix && lypix <
BYM2);
1993 if (symax_ > syparmax_) {
1999 for (i = fypix - 2; i <= lypix + 2; ++
i) {
2000 if (i < fypix || i > lypix) {
2003 ysig2[
i] = s50_ * s50_;
2005 if (ysum[i] < symax) {
2012 qscale = ysum[
i] / symax;
2014 sigi2 = sigi * sigi;
2015 sigi3 = sigi2 * sigi;
2016 sigi4 = sigi3 * sigi;
2018 ysig2[
i] = (1.f - yratio_) * (yparl_[0][0] + yparl_[0][1] * sigi + yparl_[0][2] * sigi2 + yparl_[0][3] * sigi3 +
2019 yparl_[0][4] * sigi4) +
2020 yratio_ * (yparh_[0][0] + yparh_[0][1] * sigi + yparh_[0][2] * sigi2 + yparh_[0][3] * sigi3 +
2021 yparh_[0][4] * sigi4);
2023 ysig2[
i] = (1.f - yratio_) * (yparl_[1][0] + yparl_[1][1] * sigi + yparl_[1][2] * sigi2 + yparl_[1][3] * sigi3 +
2024 yparl_[1][4] * sigi4) +
2025 yratio_ * (yparh_[1][0] + yparh_[1][1] * sigi + yparh_[1][2] * sigi2 + yparh_[1][3] * sigi3 +
2026 yparh_[1][4] * sigi4);
2029 if (ysum[i] > sythr) {
2032 if (ysig2[i] <= 0.
f) {
2033 LOGERROR(
"SiPixelTemplate") <<
"neg y-error-squared, id = " << id_current_ <<
", index = " << index_id_
2034 <<
", cot(alpha) = " << cota_current_ <<
", cot(beta) = " << cotb_current_
2035 <<
", sigi = " << sigi <<
ENDL;
2057 float sigi, sigi2, sigi3, sigi4, symax, qscale, err2, s25;
2061 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2062 if (index < 2 || index >=
BYM2) {
2063 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::ysigma2 called with index = " << index << std::endl;
2066 assert(index > 1 && index <
BYM2);
2073 if (symax_ > syparmax_) {
2079 if (qpixel < symax) {
2086 qscale = qpixel / symax;
2088 sigi2 = sigi * sigi;
2089 sigi3 = sigi2 * sigi;
2090 sigi4 = sigi3 * sigi;
2094 (yparl_[0][0] + yparl_[0][1] * sigi + yparl_[0][2] * sigi2 + yparl_[0][3] * sigi3 + yparl_[0][4] * sigi4) +
2096 (yparh_[0][0] + yparh_[0][1] * sigi + yparh_[0][2] * sigi2 + yparh_[0][3] * sigi3 + yparh_[0][4] * sigi4);
2100 (yparl_[1][0] + yparl_[1][1] * sigi + yparl_[1][2] * sigi2 + yparl_[1][3] * sigi3 + yparl_[1][4] * sigi4) +
2102 (yparh_[1][0] + yparh_[1][1] * sigi + yparh_[1][2] * sigi2 + yparh_[1][3] * sigi3 + yparh_[1][4] * sigi4);
2104 ysig2 = qscale * err2;
2106 LOGERROR(
"SiPixelTemplate") <<
"neg y-error-squared, id = " << id_current_ <<
", index = " << index_id_
2107 <<
", cot(alpha) = " << cota_current_ <<
", cot(beta) = " << cotb_current_
2108 <<
", sigi = " << sigi <<
ENDL;
2131 float sigi, sigi2, sigi3, sigi4, yint, sxmax, x0, qscale, s25;
2135 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2136 if (fxpix < 2 || fxpix >=
BXM2) {
2137 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::xsigma2 called with fxpix = " << fxpix << std::endl;
2140 assert(fxpix > 1 && fxpix <
BXM2);
2142 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2143 if (lxpix < fxpix || lxpix >=
BXM2) {
2144 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::xsigma2 called with lxpix/fxpix = " << lxpix <<
"/" 2145 << fxpix << std::endl;
2148 assert(lxpix >= fxpix && lxpix <
BXM2);
2155 if (sxmax_ > sxparmax_) {
2161 for (i = fxpix - 2; i <= lxpix + 2; ++
i) {
2162 if (i < fxpix || i > lxpix) {
2165 xsig2[
i] = s50_ * s50_;
2167 if (xsum[i] < sxmax) {
2174 qscale = xsum[
i] / sxmax;
2176 sigi2 = sigi * sigi;
2177 sigi3 = sigi2 * sigi;
2178 sigi4 = sigi3 * sigi;
2183 yint = (1.f - yratio_) * (xparly0_[0][0] + xparly0_[0][1] * sigi + xparly0_[0][2] * sigi2 +
2184 xparly0_[0][3] * sigi3 + xparly0_[0][4] * sigi4) +
2185 yratio_ * (xparhy0_[0][0] + xparhy0_[0][1] * sigi + xparhy0_[0][2] * sigi2 + xparhy0_[0][3] * sigi3 +
2186 xparhy0_[0][4] * sigi4);
2188 yint = (1.f - yratio_) * (xparly0_[1][0] + xparly0_[1][1] * sigi + xparly0_[1][2] * sigi2 +
2189 xparly0_[1][3] * sigi3 + xparly0_[1][4] * sigi4) +
2190 yratio_ * (xparhy0_[1][0] + xparhy0_[1][1] * sigi + xparhy0_[1][2] * sigi2 + xparhy0_[1][3] * sigi3 +
2191 xparhy0_[1][4] * sigi4);
2197 xsig2[
i] = (1.f - xxratio_) * (xparl_[0][0] + xparl_[0][1] * sigi + xparl_[0][2] * sigi2 +
2198 xparl_[0][3] * sigi3 + xparl_[0][4] * sigi4) +
2199 xxratio_ * (xparh_[0][0] + xparh_[0][1] * sigi + xparh_[0][2] * sigi2 + xparh_[0][3] * sigi3 +
2200 xparh_[0][4] * sigi4);
2202 xsig2[
i] = (1.f - xxratio_) * (xparl_[1][0] + xparl_[1][1] * sigi + xparl_[1][2] * sigi2 +
2203 xparl_[1][3] * sigi3 + xparl_[1][4] * sigi4) +
2204 xxratio_ * (xparh_[1][0] + xparh_[1][1] * sigi + xparh_[1][2] * sigi2 + xparh_[1][3] * sigi3 +
2205 xparh_[1][4] * sigi4);
2211 x0 = xpar0_[0][0] + xpar0_[0][1] * sigi + xpar0_[0][2] * sigi2 + xpar0_[0][3] * sigi3 + xpar0_[0][4] * sigi4;
2213 x0 = xpar0_[1][0] + xpar0_[1][1] * sigi + xpar0_[1][2] * sigi2 + xpar0_[1][3] * sigi3 + xpar0_[1][4] * sigi4;
2219 xsig2[
i] = xsig2[
i] / x0 * yint;
2222 if (xsum[i] > sxthr) {
2225 if (xsig2[i] <= 0.
f) {
2226 LOGERROR(
"SiPixelTemplate") <<
"neg x-error-squared, id = " << id_current_ <<
", index = " << index_id_
2227 <<
", cot(alpha) = " << cota_current_ <<
", cot(beta) = " << cotb_current_
2228 <<
", sigi = " << sigi <<
ENDL;
2248 float qfl, qfl2, qfl3, qfl4, qfl5,
dy;
2252 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2253 if (binq < 0 || binq > 3) {
2254 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::yflcorr called with binq = " << binq << std::endl;
2257 assert(binq >= 0 && binq < 4);
2259 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2260 if (fabs((
double)qfly) > 1.) {
2261 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::yflcorr called with qfly = " << qfly << std::endl;
2264 assert(fabs((
double)qfly) <= 1.);
2284 dy = (1.f - yratio_) * (yflparl_[binq][0] + yflparl_[binq][1] * qfl + yflparl_[binq][2] * qfl2 +
2285 yflparl_[binq][3] * qfl3 + yflparl_[binq][4] * qfl4 + yflparl_[binq][5] * qfl5) +
2286 yratio_ * (yflparh_[binq][0] + yflparh_[binq][1] * qfl + yflparh_[binq][2] * qfl2 + yflparh_[binq][3] * qfl3 +
2287 yflparh_[binq][4] * qfl4 + yflparh_[binq][5] * qfl5);
2304 float qfl, qfl2, qfl3, qfl4, qfl5,
dx;
2308 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2309 if (binq < 0 || binq > 3) {
2310 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::xflcorr called with binq = " << binq << std::endl;
2313 assert(binq >= 0 && binq < 4);
2315 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2316 if (fabs((
double)qflx) > 1.) {
2317 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::xflcorr called with qflx = " << qflx << std::endl;
2320 assert(fabs((
double)qflx) <= 1.);
2340 dx = (1.f - yxratio_) *
2341 ((1.
f - xxratio_) * (xflparll_[binq][0] + xflparll_[binq][1] * qfl + xflparll_[binq][2] * qfl2 +
2342 xflparll_[binq][3] * qfl3 + xflparll_[binq][4] * qfl4 + xflparll_[binq][5] * qfl5) +
2343 xxratio_ * (xflparlh_[binq][0] + xflparlh_[binq][1] * qfl + xflparlh_[binq][2] * qfl2 +
2344 xflparlh_[binq][3] * qfl3 + xflparlh_[binq][4] * qfl4 + xflparlh_[binq][5] * qfl5)) +
2346 ((1.
f - xxratio_) * (xflparhl_[binq][0] + xflparhl_[binq][1] * qfl + xflparhl_[binq][2] * qfl2 +
2347 xflparhl_[binq][3] * qfl3 + xflparhl_[binq][4] * qfl4 + xflparhl_[binq][5] * qfl5) +
2348 xxratio_ * (xflparhh_[binq][0] + xflparhh_[binq][1] * qfl + xflparhh_[binq][2] * qfl2 +
2349 xflparhh_[binq][3] * qfl3 + xflparhh_[binq][4] * qfl4 + xflparhh_[binq][5] * qfl5));
2371 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2372 if (fybin < 0 || fybin > 40) {
2373 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::ytemp called with fybin = " << fybin << std::endl;
2376 assert(fybin >= 0 && fybin < 41);
2378 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2379 if (lybin < 0 || lybin > 40) {
2380 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::ytemp called with lybin = " << lybin << std::endl;
2383 assert(lybin >= 0 && lybin < 41);
2388 for (i = 0; i < 9; ++
i) {
2389 for (j = 0; j <
BYSIZE; ++
j) {
2390 ytemplate[i + 16][
j] = ytemp_[
i][
j];
2393 for (i = 0; i < 8; ++
i) {
2394 ytemplate[i + 8][
BYM1] = 0.f;
2395 for (j = 0; j <
BYM1; ++
j) {
2396 ytemplate[i + 8][
j] = ytemp_[
i][j + 1];
2399 for (i = 1; i < 9; ++
i) {
2400 ytemplate[i + 24][0] = 0.f;
2401 for (j = 0; j <
BYM1; ++
j) {
2402 ytemplate[i + 24][j + 1] = ytemp_[
i][
j];
2409 for (i = 0; i < 8; ++
i) {
2410 ytemplate[
i][
BYM2] = 0.f;
2411 ytemplate[
i][
BYM1] = 0.f;
2412 for (j = 0; j <
BYM2; ++
j) {
2413 ytemplate[
i][
j] = ytemp_[
i][j + 2];
2418 for (i = 1; i < 9; ++
i) {
2419 ytemplate[i + 32][0] = 0.f;
2420 ytemplate[i + 32][1] = 0.f;
2421 for (j = 0; j <
BYM2; ++
j) {
2422 ytemplate[i + 32][j + 2] = ytemp_[
i][
j];
2447 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2448 if (fxbin < 0 || fxbin > 40) {
2449 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::xtemp called with fxbin = " << fxbin << std::endl;
2452 assert(fxbin >= 0 && fxbin < 41);
2454 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2455 if (lxbin < 0 || lxbin > 40) {
2456 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::xtemp called with lxbin = " << lxbin << std::endl;
2459 assert(lxbin >= 0 && lxbin < 41);
2464 for (i = 0; i < 9; ++
i) {
2465 for (j = 0; j <
BXSIZE; ++
j) {
2466 xtemplate[i + 16][
j] = xtemp_[
i][
j];
2469 for (i = 0; i < 8; ++
i) {
2470 xtemplate[i + 8][
BXM1] = 0.f;
2471 for (j = 0; j <
BXM1; ++
j) {
2472 xtemplate[i + 8][
j] = xtemp_[
i][j + 1];
2475 for (i = 1; i < 9; ++
i) {
2476 xtemplate[i + 24][0] = 0.f;
2477 for (j = 0; j <
BXM1; ++
j) {
2478 xtemplate[i + 24][j + 1] = xtemp_[
i][
j];
2485 for (i = 0; i < 8; ++
i) {
2486 xtemplate[
i][
BXM2] = 0.f;
2487 xtemplate[
i][
BXM1] = 0.f;
2488 for (j = 0; j <
BXM2; ++
j) {
2489 xtemplate[
i][
j] = xtemp_[
i][j + 2];
2494 for (i = 1; i < 9; ++
i) {
2495 xtemplate[i + 32][0] = 0.f;
2496 xtemplate[i + 32][1] = 0.f;
2497 for (j = 0; j <
BXM2; ++
j) {
2498 xtemplate[i + 32][j + 2] = xtemp_[
i][
j];
2522 float qedge = 2. * s50_;
2525 for (j = 0; j <
BYSIZE; ++
j) {
2526 if (ytemp_[4][j] > sigmax) {
2527 sigmax = ytemp_[4][
j];
2531 if (sigmax < qedge) {
2534 if (sigmax < qedge || jmax < 1 || jmax >
BYM2) {
2542 for (j = jmax + 1; j <
BYM1; ++
j) {
2543 if (ytemp_[4][j] < qedge)
2550 for (j = jmax - 1; j > 0; --
j) {
2551 if (ytemp_[4][j] < qedge)
2556 return (jbeg + jend) / 2;
2575 float qedge = 2. * s50_;
2578 for (j = 0; j <
BXSIZE; ++
j) {
2579 if (xtemp_[4][j] > sigmax) {
2580 sigmax = xtemp_[4][
j];
2584 if (sigmax < qedge) {
2587 if (sigmax < qedge || jmax < 1 || jmax >
BXM2) {
2595 for (j = jmax + 1; j <
BXM1; ++
j) {
2596 if (xtemp_[4][j] < qedge)
2603 for (j = jmax - 1; j > 0; --
j) {
2604 if (xtemp_[4][j] < qedge)
2609 return (jbeg + jend) / 2;
2625 int ioff0, ioffp, ioffm;
2629 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2630 if (nypix < 1 || nypix >=
BYM3) {
2631 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::ytemp3d called with nypix = " << nypix << std::endl;
2634 assert(nypix > 0 && nypix <
BYM3);
2639 float diff = fabsf(nypix - clsleny_) / 2. + 1.f;
2640 int nshift = (
int)diff;
2641 if ((diff - nshift) > 0.5f) {
2647 nybins_ = 9 + 16 * nshift;
2651 temp2dy_.resize(boost::extents[nybins_][
BYSIZE]);
2657 for (i = 0; i < 9; ++
i) {
2658 for (j = 0; j <
BYSIZE; ++
j) {
2659 temp2dy_[i + ioff0][
j] = ytemp_[
i][
j];
2665 for (k = 1; k <= nshift; ++
k) {
2666 ioffm = ioff0 - k * 8;
2667 for (i = 0; i < 8; ++
i) {
2668 for (j = 0; j <
k; ++
j) {
2669 temp2dy_[i + ioffm][
BYM1 -
j] = 0.f;
2671 for (j = 0; j < BYSIZE -
k; ++
j) {
2672 temp2dy_[i + ioffm][
j] = ytemp_[
i][j +
k];
2675 ioffp = ioff0 + k * 8;
2676 for (i = 1; i < 9; ++
i) {
2677 for (j = 0; j <
k; ++
j) {
2678 temp2dy_[i + ioffp][
j] = 0.f;
2680 for (j = 0; j < BYSIZE -
k; ++
j) {
2681 temp2dy_[i + ioffp][j +
k] = ytemp_[
i][
j];
2700 if (i >= 0 && i < nybins_ && j <= i) {
2702 ytemplate[
k] = temp2dy_[
i][
k] + temp2dy_[
j][
k];
2726 int ioff0, ioffp, ioffm;
2730 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2731 if (nxpix < 1 || nxpix >=
BXM3) {
2732 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::xtemp3d called with nxpix = " << nxpix << std::endl;
2735 assert(nxpix > 0 && nxpix <
BXM3);
2740 float diff = fabsf(nxpix - clslenx_) / 2.f + 1.f;
2741 int nshift = (
int)diff;
2742 if ((diff - nshift) > 0.5f) {
2748 nxbins_ = 9 + 16 * nshift;
2752 temp2dx_.resize(boost::extents[nxbins_][
BXSIZE]);
2758 for (i = 0; i < 9; ++
i) {
2759 for (j = 0; j <
BXSIZE; ++
j) {
2760 temp2dx_[i + ioff0][
j] = xtemp_[
i][
j];
2766 for (k = 1; k <= nshift; ++
k) {
2767 ioffm = ioff0 - k * 8;
2768 for (i = 0; i < 8; ++
i) {
2769 for (j = 0; j <
k; ++
j) {
2770 temp2dx_[i + ioffm][
BXM1 -
j] = 0.f;
2772 for (j = 0; j < BXSIZE -
k; ++
j) {
2773 temp2dx_[i + ioffm][
j] = xtemp_[
i][j +
k];
2776 ioffp = ioff0 + k * 8;
2777 for (i = 1; i < 9; ++
i) {
2778 for (j = 0; j <
k; ++
j) {
2779 temp2dx_[i + ioffp][
j] = 0.f;
2781 for (j = 0; j < BXSIZE -
k; ++
j) {
2782 temp2dx_[i + ioffp][j +
k] = xtemp_[
i][
j];
2802 if (i >= 0 && i < nxbins_ && j <= i) {
2804 xtemplate[
k] = temp2dx_[
i][
k] + temp2dx_[
j][
k];
2870 for (
int i = 0;
i < (
int)thePixelTemp_.size(); ++
i) {
2871 if (
id == thePixelTemp_[
i].head.ID) {
2877 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2878 if (index < 0 || index >= (
int)thePixelTemp_.size()) {
2879 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::qbin can't find needed template ID = " <<
id << std::endl;
2882 assert(index >= 0 && index < (
int)thePixelTemp_.size());
2887 auto const& templ = thePixelTemp_[
index];
2895 auto cotalpha0 = thePixelTemp_[
index].enty[0].cotalpha;
2897 std::sqrt((1.
f + cotbeta * cotbeta + cotalpha * cotalpha) / (1.
f + cotbeta * cotbeta + cotalpha0 * cotalpha0));
2901 float cota = cotalpha;
2902 float cotb = abs_cotb_;
2903 bool flip_x =
false;
2904 bool flip_y =
false;
2905 switch (thePixelTemp_[index_id_].head.Dtype) {
2907 if (cotbeta < 0.
f) {
2923 if (locBx * locBz < 0.
f) {
2935 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2937 <<
"SiPixelTemplate::illegal subdetector ID = " << thePixelTemp_[index_id_].head.Dtype << std::endl;
2939 std::cout <<
"SiPixelTemplate::illegal subdetector ID = " << thePixelTemp_[index_id_].head.Dtype << std::endl;
2945 auto qscale = thePixelTemp_[
index].head.qscale;
2953 auto Ny = thePixelTemp_[
index].head.NTy;
2954 auto Nyx = thePixelTemp_[
index].head.NTyx;
2955 auto Nxx = thePixelTemp_[
index].head.NTxx;
2957 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2958 if (Ny < 2 || Nyx < 1 || Nxx < 2) {
2959 throw cms::Exception(
"DataCorrupt") <<
"template ID = " << id_current_ <<
"has too few entries: Ny/Nyx/Nxx = " << Ny
2960 <<
"/" << Nyx <<
"/" << Nxx << std::endl;
2963 assert(Ny > 1 && Nyx > 0 && Nxx > 1);
2973 auto j = std::lower_bound(templ.cotbetaY, templ.cotbetaY + Ny, cotb);
2974 if (
j == templ.cotbetaY + Ny) {
2977 }
else if (
j == templ.cotbetaY) {
2981 yratio = (cotb - (*(
j - 1))) / ((*
j) - (*(
j - 1)));
2984 ihigh =
j - templ.cotbetaY;
2990 dy1 = (1.f - yratio) * thePixelTemp_[index].enty[ilow].dyone + yratio * thePixelTemp_[index].enty[ihigh].dyone;
2994 sy1 = (1.f - yratio) * thePixelTemp_[index].enty[ilow].syone + yratio * thePixelTemp_[index].enty[ihigh].syone;
2995 dy2 = (1.f - yratio) * thePixelTemp_[index].enty[ilow].dytwo + yratio * thePixelTemp_[index].enty[ihigh].dytwo;
2999 sy2 = (1.f - yratio) * thePixelTemp_[index].enty[ilow].sytwo + yratio * thePixelTemp_[index].enty[ihigh].sytwo;
3001 auto qavg = (1.f - yratio) * thePixelTemp_[index].enty[ilow].qavg + yratio * thePixelTemp_[index].enty[ihigh].qavg;
3003 auto qmin = (1.f - yratio) * thePixelTemp_[index].enty[ilow].qmin + yratio * thePixelTemp_[index].enty[ihigh].qmin;
3005 auto qmin2 = (1.f - yratio) * thePixelTemp_[index].enty[ilow].qmin2 + yratio * thePixelTemp_[index].enty[ihigh].qmin2;
3008 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 3009 if (qavg <= 0.
f || qmin <= 0.
f) {
3011 <<
"SiPixelTemplate::qbin, qavg or qmin <= 0," 3012 <<
" Probably someone called the generic pixel reconstruction with an illegal trajectory state" << std::endl;
3015 assert(qavg > 0.
f && qmin > 0.
f);
3020 auto qtotal = qscale * qclus;
3023 auto fq = qtotal / qavg;
3026 if (fq > fbin_[0]) {
3031 if (fq > fbin_[1]) {
3034 if (fq > fbin_[2]) {
3042 auto yavggen = (1.f - yratio) * thePixelTemp_[index].enty[ilow].yavggen[binq] +
3043 yratio * thePixelTemp_[index].enty[ihigh].yavggen[binq];
3047 auto yrmsgen = (1.f - yratio) * thePixelTemp_[index].enty[ilow].yrmsgen[binq] +
3048 yratio * thePixelTemp_[index].enty[ihigh].yrmsgen[binq];
3057 auto j = std::lower_bound(templ.cotbetaX, templ.cotbetaX + Nyx, acotb);
3058 if (
j == templ.cotbetaX + Nyx) {
3061 }
else if (
j == templ.cotbetaX) {
3065 yxratio = (acotb - (*(
j - 1))) / ((*
j) - (*(
j - 1)));
3068 iyhigh =
j - templ.cotbetaX;
3076 auto j = std::lower_bound(templ.cotalphaX, templ.cotalphaX + Nxx, cota);
3077 if (
j == templ.cotalphaX + Nxx) {
3080 }
else if (
j == templ.cotalphaX) {
3084 xxratio = (cota - (*(
j - 1))) / ((*
j) - (*(
j - 1)));
3087 ihigh =
j - templ.cotalphaX;
3092 (1.f - xxratio) * thePixelTemp_[index].entx[0][ilow].dxone + xxratio * thePixelTemp_[index].entx[0][ihigh].dxone;
3097 (1.f - xxratio) * thePixelTemp_[index].entx[0][ilow].sxone + xxratio * thePixelTemp_[index].entx[0][ihigh].sxone;
3099 (1.f - xxratio) * thePixelTemp_[index].entx[0][ilow].dxtwo + xxratio * thePixelTemp_[index].entx[0][ihigh].dxtwo;
3104 (1.f - xxratio) * thePixelTemp_[index].entx[0][ilow].sxtwo + xxratio * thePixelTemp_[index].entx[0][ihigh].sxtwo;
3108 pixmx = (1.f - yxratio) * ((1.
f - xxratio) * thePixelTemp_[
index].entx[iylow][ilow].pixmax +
3109 xxratio * thePixelTemp_[
index].entx[iylow][ihigh].pixmax) +
3110 yxratio * ((1.
f - xxratio) * thePixelTemp_[
index].entx[iyhigh][ilow].pixmax +
3111 xxratio * thePixelTemp_[
index].entx[iyhigh][ihigh].pixmax);
3113 auto xavggen = (1.f - yxratio) * ((1.
f - xxratio) * thePixelTemp_[
index].entx[iylow][ilow].xavggen[binq] +
3114 xxratio * thePixelTemp_[
index].entx[iylow][ihigh].xavggen[binq]) +
3115 yxratio * ((1.
f - xxratio) * thePixelTemp_[
index].entx[iyhigh][ilow].xavggen[binq] +
3116 xxratio * thePixelTemp_[
index].entx[iyhigh][ihigh].xavggen[binq]);
3121 auto xrmsgen = (1.f - yxratio) * ((1.
f - xxratio) * thePixelTemp_[
index].entx[iylow][ilow].xrmsgen[binq] +
3122 xxratio * thePixelTemp_[
index].entx[iylow][ihigh].xrmsgen[binq]) +
3123 yxratio * ((1.
f - xxratio) * thePixelTemp_[
index].entx[iyhigh][ilow].xrmsgen[binq] +
3124 xxratio * thePixelTemp_[
index].entx[iyhigh][ihigh].xrmsgen[binq]);
3136 if (qtotal < 0.95
f * qmin) {
3139 if (qtotal < 0.95
f * qmin2) {
3270 float pixmx, sigmay, deltay, sigmax, deltax, sy1, dy1, sy2, dy2, sx1, dx1, sx2, dx2, locBz;
3273 if (cotbeta < 0.
f) {
3277 if (cotalpha < 0.
f) {
3314 float pixmx, sigmay, deltay, sigmax, deltax, sy1, dy1, sy2, dy2, sx1, dx1, sx2, dx2, locBz,
3316 const float cotalpha = 0.f;
3318 if (cotbeta < 0.
f) {
3322 if (cotalpha < 0.
f) {
3376 int ilow, ihigh, iylow, iyhigh, Ny, Nxx, Nyx,
index;
3377 float yratio, yxratio, xxratio;
3385 for (i = 0; i < (
int)thePixelTemp_.size(); ++
i) {
3386 if (
id == thePixelTemp_[i].head.ID) {
3392 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 3393 if (index < 0 || index >= (
int)thePixelTemp_.size()) {
3394 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::temperrors can't find needed template ID = " <<
id 3398 assert(index >= 0 && index < (
int)thePixelTemp_.size());
3401 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 3402 if (qBin < 0 || qBin > 5) {
3403 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::temperrors called with illegal qBin = " << qBin
3407 assert(qBin >= 0 && qBin < 6);
3419 acotb = fabs((
double)cotbeta);
3440 Ny = thePixelTemp_[
index].head.NTy;
3441 Nyx = thePixelTemp_[
index].head.NTyx;
3442 Nxx = thePixelTemp_[
index].head.NTxx;
3444 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 3445 if (Ny < 2 || Nyx < 1 || Nxx < 2) {
3446 throw cms::Exception(
"DataCorrupt") <<
"template ID = " << id_current_ <<
"has too few entries: Ny/Nyx/Nxx = " << Ny
3447 <<
"/" << Nyx <<
"/" << Nxx << std::endl;
3450 assert(Ny > 1 && Nyx > 0 && Nxx > 1);
3458 if (cotb >= thePixelTemp_[index].enty[Ny - 1].cotbeta) {
3463 if (cotb >= thePixelTemp_[index].enty[0].cotbeta) {
3464 for (i = 0; i < Ny - 1; ++
i) {
3465 if (thePixelTemp_[index].enty[i].cotbeta <= cotb && cotb < thePixelTemp_[index].enty[i + 1].cotbeta) {
3467 yratio = (cotb - thePixelTemp_[
index].enty[
i].cotbeta) /
3468 (thePixelTemp_[index].enty[i + 1].cotbeta - thePixelTemp_[index].enty[i].cotbeta);
3479 sy1 = (1.f - yratio) * thePixelTemp_[index].enty[ilow].syone + yratio * thePixelTemp_[index].enty[ihigh].syone;
3480 sy2 = (1.f - yratio) * thePixelTemp_[index].enty[ilow].sytwo + yratio * thePixelTemp_[index].enty[ihigh].sytwo;
3481 yrms = (1.f - yratio) * thePixelTemp_[index].enty[ilow].yrms[qBin] +
3482 yratio * thePixelTemp_[index].enty[ihigh].yrms[qBin];
3489 if (acotb >= thePixelTemp_[index].entx[Nyx - 1][0].cotbeta) {
3493 }
else if (acotb >= thePixelTemp_[index].entx[0][0].cotbeta) {
3494 for (i = 0; i < Nyx - 1; ++
i) {
3495 if (thePixelTemp_[index].entx[i][0].cotbeta <= acotb && acotb < thePixelTemp_[index].entx[i + 1][0].cotbeta) {
3497 yxratio = (acotb - thePixelTemp_[
index].entx[
i][0].cotbeta) /
3498 (thePixelTemp_[index].entx[i + 1][0].cotbeta - thePixelTemp_[index].entx[i][0].cotbeta);
3509 if (cotalpha >= thePixelTemp_[index].entx[0][Nxx - 1].cotalpha) {
3514 if (cotalpha >= thePixelTemp_[index].entx[0][0].cotalpha) {
3515 for (i = 0; i < Nxx - 1; ++
i) {
3516 if (thePixelTemp_[index].entx[0][i].cotalpha <= cotalpha &&
3517 cotalpha < thePixelTemp_[index].entx[0][i + 1].cotalpha) {
3519 xxratio = (cotalpha - thePixelTemp_[
index].entx[0][
i].cotalpha) /
3520 (thePixelTemp_[index].entx[0][i + 1].cotalpha - thePixelTemp_[index].entx[0][i].cotalpha);
3530 (1.f - xxratio) * thePixelTemp_[index].entx[0][ilow].sxone + xxratio * thePixelTemp_[index].entx[0][ihigh].sxone;
3532 (1.f - xxratio) * thePixelTemp_[index].entx[0][ilow].sxtwo + xxratio * thePixelTemp_[index].entx[0][ihigh].sxtwo;
3534 xrms = (1.f - yxratio) * ((1.
f - xxratio) * thePixelTemp_[
index].entx[iylow][ilow].xrms[
qBin] +
3535 xxratio * thePixelTemp_[
index].entx[iylow][ihigh].xrms[
qBin]) +
3536 yxratio * ((1.
f - xxratio) * thePixelTemp_[
index].entx[iyhigh][ilow].xrms[
qBin] +
3537 xxratio * thePixelTemp_[
index].entx[iyhigh][ihigh].xrms[
qBin]);
3574 int ilow, ihigh, iylow, iyhigh, Ny, Nxx, Nyx,
index;
3575 float yratio, yxratio, xxratio;
3583 for (i = 0; i < (
int)thePixelTemp_.size(); ++
i) {
3584 if (
id == thePixelTemp_[i].head.ID) {
3591 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 3592 if (index < 0 || index >= (
int)thePixelTemp_.size()) {
3593 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::temperrors can't find needed template ID = " <<
id 3597 assert(index >= 0 && index < (
int)thePixelTemp_.size());
3604 acotb = fabs((
double)cotbeta);
3625 Ny = thePixelTemp_[
index].head.NTy;
3626 Nyx = thePixelTemp_[
index].head.NTyx;
3627 Nxx = thePixelTemp_[
index].head.NTxx;
3629 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 3630 if (Ny < 2 || Nyx < 1 || Nxx < 2) {
3631 throw cms::Exception(
"DataCorrupt") <<
"template ID = " << id_current_ <<
"has too few entries: Ny/Nyx/Nxx = " << Ny
3632 <<
"/" << Nyx <<
"/" << Nxx << std::endl;
3635 assert(Ny > 1 && Nyx > 0 && Nxx > 1);
3643 if (cotb >= thePixelTemp_[index].enty[Ny - 1].cotbeta) {
3648 if (cotb >= thePixelTemp_[index].enty[0].cotbeta) {
3649 for (i = 0; i < Ny - 1; ++
i) {
3650 if (thePixelTemp_[index].enty[i].cotbeta <= cotb && cotb < thePixelTemp_[index].enty[i + 1].cotbeta) {
3652 yratio = (cotb - thePixelTemp_[
index].enty[
i].cotbeta) /
3653 (thePixelTemp_[index].enty[i + 1].cotbeta - thePixelTemp_[index].enty[i].cotbeta);
3664 (1.f - yratio) * thePixelTemp_[index].enty[ilow].fracyone + yratio * thePixelTemp_[index].enty[ihigh].fracyone;
3666 (1.f - yratio) * thePixelTemp_[index].enty[ilow].fracytwo + yratio * thePixelTemp_[index].enty[ihigh].fracytwo;
3673 if (acotb >= thePixelTemp_[index].entx[Nyx - 1][0].cotbeta) {
3677 }
else if (acotb >= thePixelTemp_[index].entx[0][0].cotbeta) {
3678 for (i = 0; i < Nyx - 1; ++
i) {
3679 if (thePixelTemp_[index].entx[i][0].cotbeta <= acotb && acotb < thePixelTemp_[index].entx[i + 1][0].cotbeta) {
3681 yxratio = (acotb - thePixelTemp_[
index].entx[
i][0].cotbeta) /
3682 (thePixelTemp_[index].entx[i + 1][0].cotbeta - thePixelTemp_[index].entx[i][0].cotbeta);
3693 if (cotalpha >= thePixelTemp_[index].entx[0][Nxx - 1].cotalpha) {
3698 if (cotalpha >= thePixelTemp_[index].entx[0][0].cotalpha) {
3699 for (i = 0; i < Nxx - 1; ++
i) {
3700 if (thePixelTemp_[index].entx[0][i].cotalpha <= cotalpha &&
3701 cotalpha < thePixelTemp_[index].entx[0][i + 1].cotalpha) {
3703 xxratio = (cotalpha - thePixelTemp_[
index].entx[0][
i].cotalpha) /
3704 (thePixelTemp_[index].entx[0][i + 1].cotalpha - thePixelTemp_[index].entx[0][i].cotalpha);
3713 for (i = 0; i < 3; ++
i) {
3714 qfrac[
i] = (1.f - yxratio) * ((1.
f - xxratio) * thePixelTemp_[
index].entx[iylow][ilow].qbfrac[
i] +
3715 xxratio * thePixelTemp_[
index].entx[iylow][ihigh].qbfrac[
i]) +
3716 yxratio * ((1.
f - xxratio) * thePixelTemp_[
index].entx[iyhigh][ilow].qbfrac[
i] +
3717 xxratio * thePixelTemp_[
index].entx[iyhigh][ihigh].qbfrac[
i]);
3719 nx1_frac = (1.f - yxratio) * ((1.
f - xxratio) * thePixelTemp_[
index].entx[iylow][ilow].fracxone +
3720 xxratio * thePixelTemp_[
index].entx[iylow][ihigh].fracxone) +
3721 yxratio * ((1.
f - xxratio) * thePixelTemp_[
index].entx[iyhigh][ilow].fracxone +
3722 xxratio * thePixelTemp_[
index].entx[iyhigh][ihigh].fracxone);
3723 nx2_frac = (1.f - yxratio) * ((1.
f - xxratio) * thePixelTemp_[
index].entx[iylow][ilow].fracxtwo +
3724 xxratio * thePixelTemp_[
index].entx[iylow][ihigh].fracxtwo) +
3725 yxratio * ((1.
f - xxratio) * thePixelTemp_[
index].entx[iyhigh][ilow].fracxtwo +
3726 xxratio * thePixelTemp_[
index].entx[iyhigh][ihigh].fracxtwo);
3728 qbin_frac[0] = qfrac[0];
3729 qbin_frac[1] = qbin_frac[0] + qfrac[1];
3730 qbin_frac[2] = qbin_frac[1] + qfrac[2];
3747 float xhit,
float yhit, std::vector<bool>& ydouble, std::vector<bool>& xdouble,
float template2d[
BXM2][
BYM2]) {
3750 float x0, y0, xf, yf,
xi, yi, sf, si, s0, qpix, slopey, slopex, ds;
3751 int i,
j, jpix0, ipix0, jpixf, ipixf, jpix, ipix, nx, ny, anx,
any, jmax, imax;
3754 std::list<SimplePixel>
list;
3755 std::list<SimplePixel>::iterator listIter, listEnd;
3759 x0 = xhit - 0.5 * zsize_ * cota_current_;
3760 y0 = yhit - 0.5 * zsize_ * cotb_current_;
3762 jpix0 = floor(x0 / xsize_) + 1;
3763 ipix0 = floor(y0 / ysize_) + 1;
3765 if (jpix0 < 0 || jpix0 >
BXM3) {
3768 if (ipix0 < 0 || ipix0 >
BYM3) {
3772 xf = xhit + 0.5 * zsize_ * cota_current_ + lorxwidth_;
3773 yf = yhit + 0.5 * zsize_ * cotb_current_ + lorywidth_;
3775 jpixf = floor(xf / xsize_) + 1;
3776 ipixf = floor(yf / ysize_) + 1;
3778 if (jpixf < 0 || jpixf > BXM3) {
3781 if (ipixf < 0 || ipixf > BYM3) {
3787 sf =
std::sqrt((xf - x0) * (xf - x0) + (yf - y0) * (yf - y0));
3788 if ((xf - x0) != 0.
f) {
3789 slopey = (yf - y0) / (xf - x0);
3793 if ((yf - y0) != 0.f) {
3794 slopex = (xf - x0) / (yf - y0);
3810 list.push_back(element);
3818 for (j = jpix0; j < jpixf; ++
j) {
3820 yi = slopey * (xi - x0) + y0;
3821 ipix = (
int)(yi / ysize_) + 1;
3822 si =
std::sqrt((xi - x0) * (xi - x0) + (yi - y0) * (yi - y0));
3829 list.push_back(element);
3832 for (j = jpix0; j > jpixf; --
j) {
3833 xi = xsize_ * (j - 1);
3834 yi = slopey * (xi - x0) + y0;
3835 ipix = (
int)(yi / ysize_) + 1;
3836 si =
std::sqrt((xi - x0) * (xi - x0) + (yi - y0) * (yi - y0));
3843 list.push_back(element);
3852 for (i = ipix0; i < ipixf; ++
i) {
3854 xi = slopex * (yi - y0) + x0;
3855 jpix = (
int)(xi / xsize_) + 1;
3856 si =
std::sqrt((xi - x0) * (xi - x0) + (yi - y0) * (yi - y0));
3863 list.push_back(element);
3866 for (i = ipix0; i > ipixf; --
i) {
3867 yi = ysize_ * (i - 1);
3868 xi = slopex * (yi - y0) + x0;
3869 jpix = (
int)(xi / xsize_) + 1;
3870 si =
std::sqrt((xi - x0) * (xi - x0) + (yi - y0) * (yi - y0));
3877 list.push_back(element);
3891 for (i = 1; i < imax; ++
i) {
3892 if (ydouble[i - 1]) {
3893 listIter = list.begin();
3895 while (listIter != list.end()) {
3896 if (listIter->i == i && listIter->btype == 2) {
3897 listIter = list.erase(listIter);
3900 if (listIter->i > i) {
3906 while (listIter != list.end()) {
3907 if (listIter->i == i + 1 && listIter->btype == 2) {
3908 listIter = list.erase(listIter);
3911 if (listIter->i > i + 1) {
3920 for (j = 1; j < jmax; ++
j) {
3921 if (xdouble[j - 1]) {
3922 listIter = list.begin();
3924 while (listIter != list.end()) {
3925 if (listIter->j == j && listIter->btype == 1) {
3926 listIter = list.erase(listIter);
3929 if (listIter->j > j) {
3935 while (listIter != list.end()) {
3936 if (listIter->j == j + 1 && listIter->btype == 1) {
3937 listIter = list.erase(listIter);
3940 if (listIter->j > j + 1) {
3952 listIter = list.begin();
3953 listEnd = list.end();
3954 for (; listIter != listEnd; ++listIter) {
3961 qpix = qtotal * ds / sf;
3965 template2d[
j][
i] += qpix;
3983 int ilow, ihigh, Ny;
3984 float yratio, cotb, cotalpha0,
arg;
3988 cotalpha0 = thePixelTemp_[index_id_].enty[0].cotalpha;
3989 arg = cotb_current_ * cotb_current_ + cota_current_ * cota_current_ - cotalpha0 * cotalpha0;
3996 Ny = thePixelTemp_[index_id_].head.NTy;
3998 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 4000 throw cms::Exception(
"DataCorrupt") <<
"template ID = " << id_current_ <<
"has too few entries: Ny = " << Ny
4012 if (cotb >= thePixelTemp_[index_id_].enty[Ny - 1].cotbeta) {
4017 if (cotb >= thePixelTemp_[index_id_].enty[0].cotbeta) {
4018 for (i = 0; i < Ny - 1; ++
i) {
4019 if (thePixelTemp_[index_id_].enty[i].cotbeta <= cotb && cotb < thePixelTemp_[index_id_].enty[i + 1].cotbeta) {
4021 yratio = (cotb - thePixelTemp_[index_id_].enty[
i].cotbeta) /
4022 (thePixelTemp_[index_id_].enty[i + 1].cotbeta - thePixelTemp_[index_id_].enty[i].cotbeta);
4033 mpvvav_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].mpvvav +
4034 yratio * thePixelTemp_[index_id_].enty[ihigh].mpvvav;
4035 sigmavav_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].sigmavav +
4036 yratio * thePixelTemp_[index_id_].enty[ihigh].sigmavav;
4037 kappavav_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].kappavav +
4038 yratio * thePixelTemp_[index_id_].enty[ihigh].kappavav;
4042 mpv = (double)mpvvav_;
4043 sigma = (double)sigmavav_;
4044 kappa = (double)kappavav_;
4061 int ilow, ihigh, Ny;
4062 float yratio, cotb, cotalpha0,
arg;
4066 cotalpha0 = thePixelTemp_[index_id_].enty[0].cotalpha;
4067 arg = cotb_current_ * cotb_current_ + cota_current_ * cota_current_ - cotalpha0 * cotalpha0;
4074 Ny = thePixelTemp_[index_id_].head.NTy;
4076 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 4078 throw cms::Exception(
"DataCorrupt") <<
"template ID = " << id_current_ <<
"has too few entries: Ny = " << Ny
4090 if (cotb >= thePixelTemp_[index_id_].enty[Ny - 1].cotbeta) {
4095 if (cotb >= thePixelTemp_[index_id_].enty[0].cotbeta) {
4096 for (i = 0; i < Ny - 1; ++
i) {
4097 if (thePixelTemp_[index_id_].enty[i].cotbeta <= cotb && cotb < thePixelTemp_[index_id_].enty[i + 1].cotbeta) {
4099 yratio = (cotb - thePixelTemp_[index_id_].enty[
i].cotbeta) /
4100 (thePixelTemp_[index_id_].enty[i + 1].cotbeta - thePixelTemp_[index_id_].enty[i].cotbeta);
4111 mpvvav2_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].mpvvav2 +
4112 yratio * thePixelTemp_[index_id_].enty[ihigh].mpvvav2;
4113 sigmavav2_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].sigmavav2 +
4114 yratio * thePixelTemp_[index_id_].enty[ihigh].sigmavav2;
4115 kappavav2_ = (1.f - yratio) * thePixelTemp_[index_id_].enty[ilow].kappavav2 +
4116 yratio * thePixelTemp_[index_id_].enty[ihigh].kappavav2;
4120 mpv = (double)mpvvav2_;
4121 sigma = (double)sigmavav2_;
4122 kappa = (double)kappavav2_;
float qavg_avg
average cluster charge of clusters that are less than qavg (normalize 2-D simple templates) ...
int runnum
< Basic template entry corresponding to a single set of track angles
float xflpar[4][6]
Aqfl-parameterized x-correction in 4 charge bins.
float xrms[4]
average x-rms of reconstruction binned in 4 charge bins
void vavilov2_pars(double &mpv, double &sigma, double &kappa)
float clslenx
cluster x-length in pixels at signal height sxmax/2
float qavg
average cluster charge for this set of track angles (now includes threshold effects) ...
float syone
rms for one pixel y-clusters
float chi2yavgone
average y chi^2 for 1 pixel clusters
bool interpolate(int id, float cotalpha, float cotbeta, float locBz, float locBx)
int cytemp()
Return central pixel of y template pixels above readout threshold.
float dyone
mean offset/correction for one pixel y-clusters
float sigmavav
"sigma" scale fctor for Vavilov distribution
float fracxtwo
fraction of double pixel sample with xsize = 1
float yavggen[4]
generic algorithm: average y-bias of reconstruction binned in 4 charge bins
float sxmax
average pixel signal for x-projection of cluster
int btype
type of boundary (0=end, 1 = x-boundary, 2 = y-boundary)
void xsigma2(int fxpix, int lxpix, float sxthr, float xsum[13+4], float xsig2[13+4])
float chi2yminc2m[4]
1st pass chi2 min search: minimum of y chi^2 in 4 charge bins (merged clusters)
float xavgc2m[4]
1st pass chi2 min search: average x-bias of reconstruction binned in 4 charge bins ...
bool any(const std::vector< T > &v, const T &what)
float chi2xavgone
average x chi^2 for 1 pixel clusters
float fracytwo
fraction of double pixel sample with ysize = 1
float yrms[4]
average y-rms of reconstruction binned in 4 charge bins
float mpvvav2
most probable charge in Vavilov distribution for 2 merged clusters (not actually for larger kappa) ...
float ygx0gen[4]
generic algorithm: average y0 from Gaussian fit binned in 4 charge bins
float xavg[4]
average x-bias of reconstruction binned in 4 charge bins
bool simpletemplate2D(float xhitp, float yhitp, std::vector< bool > &ydouble, std::vector< bool > &xdouble, float template2d[13+2][21+2])
Make simple 2-D templates from track angles set in interpolate and hit position.
float y
y coordinate of boundary intersection
float dytwo
mean offset/correction for one double-pixel y-clusters
float dxone
mean offset/correction for one pixel x-clusters
float pixmax
maximum charge for individual pixels in cluster
float chi2yavgc2m[4]
1st pass chi2 min search: average y chi^2 in 4 charge bins (merged clusters)
float qmin
minimum cluster charge for valid hit (keeps 99.9% of simulated hits)
float chi2xavgc2m[4]
1st pass chi2 min search: average x chi^2 in 4 charge bins (merged clusters)
float xflcorr(int binq, float qflx)
float xgsiggen[4]
generic algorithm: average sigma_x from Gaussian fit binned in 4 charge bins
float chi2xminc2m[4]
1st pass chi2 min search: minimum of x chi^2 in 4 charge bins (merged clusters)
float cotalphaX[29]
60 Barrel y templates spanning cluster lengths from 0px to +18px [28 entries for fpix] ...
float cotalpha
cot(alpha) is proportional to cluster length in x and is basis of interpolation
float ytemp[9][21]
templates for y-reconstruction (binned over 1 central pixel)
float yrmsc2m[4]
1st pass chi2 min search: average y-rms of reconstruction binned in 4 charge bins ...
void ytemp(int fybin, int lybin, float ytemplate[41][21+4])
int cxtemp()
Return central pixel of x-template pixels above readout threshold.
float xpar[2][5]
projected x-pixel uncertainty parameterization
float ygx0[4]
average y0 from Gaussian fit binned in 4 charge bins
float xgx0gen[4]
generic algorithm: average x0 from Gaussian fit binned in 4 charge bins
float symax
average pixel signal for y-projection of cluster
float kappavav2
kappa parameter for Vavilov distribution for 2 merged clusters
float xgsig[4]
average sigma_x from Gaussian fit binned in 4 charge bins
float cotbeta
cot(beta) is proportional to cluster length in y and is basis of interpolation
float beta
beta track angle (defined in CMS CMS IN 2004/014)
void vavilov_pars(double &mpv, double &sigma, double &kappa)
float yflcorr(int binq, float qfly)
float s
distance from track entry
float xrmsc2m[4]
1st pass chi2 min search: average x-rms of reconstruction binned in 4 charge bins ...
void ytemp3d(int j, int k, std::vector< float > &ytemplate)
void temperrors(int id, float cotalpha, float cotbeta, int qBin, float &sigmay, float &sigmax, float &sy1, float &sy2, float &sx1, float &sx2)
float xgx0[4]
average x0 from Gaussian fit binned in 4 charge bins
Abs< T >::type abs(const T &t)
void ysigma2(int fypix, int lypix, float sythr, float ysum[21+4], float ysig2[21+4])
int j
y index of traversed pixel
float ygsiggen[4]
generic algorithm: average sigma_y from Gaussian fit binned in 4 charge bins
float fracxone
fraction of sample with xsize = 1
float mpvvav
most probable charge in Vavilov distribution (not actually for larger kappa)
float sxtwo
rms for one double-pixel x-clusters
float r_qMeas_qTrue
ratio of measured to true cluster charge
float chi2yavg[4]
average y chi^2 in 4 charge bins
float alpha
alpha track angle (defined in CMS CMS IN 2004/014)
float xtemp[9][13]
templates for x-reconstruction (binned over 1 central pixel)
SiPixelTemplateHeader head
< template storage structure
float chi2xminone
minimum of x chi^2 for 1 pixel clusters
float ypar[2][5]
projected y-pixel uncertainty parameterization
void xtemp3d(int j, int k, std::vector< float > &xtemplate)
void xtemp(int fxbin, int lxbin, float xtemplate[41][13+4])
void qbin_dist(int id, float cotalpha, float cotbeta, float qbin_frac[4], float &ny1_frac, float &ny2_frac, float &nx1_frac, float &nx2_frac)
float qbfrac[3]
fraction of sample in qbin = 0-2 (>=3 is the complement)
void ytemp3d_int(int nypix, int &nybins)
float fracyone
fraction of sample with ysize = 1
float qmin2
tighter minimum cluster charge for valid hit (keeps 99.8% of simulated hits)
float yavg[4]
average y-bias of reconstruction binned in 4 charge bins
void xtemp3d_int(int nxpix, int &nxbins)
static bool pushfile(int filenum, std::vector< SiPixelTemplateStore > &pixelTemp, std::string dir="CalibTracker/SiPixelESProducers/data/")
float chi2ymin[4]
minimum of y chi^2 in 4 charge bins
float yavgc2m[4]
1st pass chi2 min search: average y-bias of reconstruction binned in 4 charge bins ...
float x
x coordinate of boundary intersection
float dxtwo
mean offset/correction for one double-pixel x-clusters
int i
x index of traversed pixel
float yflpar[4][6]
Aqfl-parameterized y-correction in 4 charge bins.
std::string fullPath() const
float sxone
rms for one pixel x-clusters
float chi2xmin[4]
minimum of x chi^2 in 4 charge bins
static const G4double kappa
float chi2yminone
minimum of y chi^2 for 1 pixel clusters
int qbin(int id, float cotalpha, float cotbeta, float locBz, float locBx, float qclus, float &pixmx, float &sigmay, float &deltay, float &sigmax, float &deltax, float &sy1, float &dy1, float &sy2, float &dy2, float &sx1, float &dx1, float &sx2, float &dx2)
float costrk[3]
direction cosines of tracks used to generate this entry
static void postInit(std::vector< SiPixelTemplateStore > &thePixelTemp_)
SiPixelTemplateEntry entx[5][29]
float ygsig[4]
average sigma_y from Gaussian fit binned in 4 charge bins
SiPixelTemplateEntry enty[60]
29 Barrel x templates spanning cluster lengths from -6px (-1.125Rad) to +6px (+1.125Rad) in each of 5...
float sigmavav2
"sigma" scale fctor for Vavilov distribution for 2 merged clusters
float sytwo
rms for one double-pixel y-clusters
float xrmsgen[4]
generic algorithm: average x-rms of reconstruction binned in 4 charge bins
float chi2xavg[4]
average x chi^2 in 4 charge bins
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
float kappavav
kappa parameter for Vavilov distribution
float xavggen[4]
generic algorithm: average x-bias of reconstruction binned in 4 charge bins
float yrmsgen[4]
generic algorithm: average y-rms of reconstruction binned in 4 charge bins
float clsleny
cluster y-length in pixels at signal height symax/2