90 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 97 #include "boost/multi_array.hpp" 106 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 112 #define LOGERROR(x) LogError(x) 113 #define LOGINFO(x) LogInfo(x) 114 #define LOGWARNING(x) LogWarning(x) 121 #define LOGERROR(x) std::cout << x << ": " 122 #define LOGINFO(x) std::cout << x << ": " 123 #define ENDL std::endl 140 const int code_version={17};
145 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 147 int nzeros = 4-tempfile.length();
152 tempfile = dir +
"template_summary_zp" + tempfile +
".out";
158 std::ostringstream tout;
159 tout <<
"template_summary_zp" << std::setw(4) << std::setfill(
'0') << std::right << filenum <<
".out" << std::ends;
160 tempfile = tout.str();
166 std::ifstream
in_file(tempfile);
167 if(in_file.is_open() && in_file.good()) {
176 for (i=0; (c=in_file.get()) !=
'\n'; ++
i) {
181 LOGINFO(
"SiPixelTemplate") <<
"Loading Pixel Template File - " << theCurrentTemp.
head.
title <<
ENDL;
189 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 0A, no template load" <<
ENDL;
return false;}
196 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 0B, no template load" 197 <<
ENDL;
return false;}
203 theCurrentTemp.
head.
fbin[1] = 1.00f;
204 theCurrentTemp.
head.
fbin[2] = 0.85f;
208 <<
", NTy = " << theCurrentTemp.
head.
NTy <<
", NTyx = " << theCurrentTemp.
head.
NTyx<<
", NTxx = " << theCurrentTemp.
head.
NTxx <<
", Dtype = " << theCurrentTemp.
head.
Dtype 209 <<
", Bias voltage " << theCurrentTemp.
head.
Vbias <<
", temperature " 211 <<
", 1/2 multi dcol threshold " << theCurrentTemp.
head.
s50 <<
", 1/2 single dcol threshold " << theCurrentTemp.
head.
ss50 214 <<
", Q/Q_avg fractions for Qbin defs " << theCurrentTemp.
head.
fbin[0] <<
", " << theCurrentTemp.
head.
fbin[1]
215 <<
", " << theCurrentTemp.
head.
fbin[2]
221 #ifdef SI_PIXEL_TEMPLATE_USE_BOOST 229 theCurrentTemp.
enty.resize(boost::extents[theCurrentTemp.
head.
NTy]);
237 for (i=0; i < theCurrentTemp.
head.
NTy; ++
i) {
242 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 1, no template load, run # " << theCurrentTemp.
enty[
i].
runnum <<
ENDL;
return false;}
257 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 2, no template load, run # " << theCurrentTemp.
enty[
i].
runnum <<
ENDL;
return false;}
262 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 3, no template load, run # " << theCurrentTemp.
enty[
i].
runnum <<
ENDL;
return false;}
265 if(theCurrentTemp.
enty[i].
qmin <= 0.) {
LOGERROR(
"SiPixelTemplate") <<
"Error in template ID " << theCurrentTemp.
head.
ID <<
" qmin = " << theCurrentTemp.
enty[
i].
qmin <<
", run # " << theCurrentTemp.
enty[
i].
runnum <<
ENDL;
return false;}
268 for (j=0; j<2; ++j) {
273 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 4, no template load, run # " << theCurrentTemp.
enty[
i].
runnum <<
ENDL;
return false;}
277 for (j=0; j<9; ++j) {
281 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 5, no template load, run # " << theCurrentTemp.
enty[
i].
runnum <<
ENDL;
return false;}
284 for (j=0; j<2; ++j) {
289 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 6, no template load, run # " << theCurrentTemp.
enty[
i].
runnum <<
ENDL;
return false;}
294 for (j=0; j<9; ++j) {
298 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 7, no template load, run # " << theCurrentTemp.
enty[
i].
runnum <<
ENDL;
return false;}
302 for (j=0; j<4; ++j) {
306 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 8, no template load, run # " << theCurrentTemp.
enty[
i].
runnum <<
ENDL;
return false;}
309 for (j=0; j<4; ++j) {
314 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 9, no template load, run # " << theCurrentTemp.
enty[
i].
runnum <<
ENDL;
return false;}
317 for (j=0; j<4; ++j) {
321 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 10, no template load, run # " << theCurrentTemp.
enty[
i].
runnum <<
ENDL;
return false;}
324 for (j=0; j<4; ++j) {
329 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 11, no template load, run # " << theCurrentTemp.
enty[
i].
runnum <<
ENDL;
return false;}
332 for (j=0; j<4; ++j) {
336 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 12, no template load, run # " << theCurrentTemp.
enty[
i].
runnum <<
ENDL;
return false;}
339 for (j=0; j<4; ++j) {
343 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 13, no template load, run # " << theCurrentTemp.
enty[
i].
runnum <<
ENDL;
return false;}
346 for (j=0; j<4; ++j) {
350 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 14, no template load, run # " << theCurrentTemp.
enty[
i].
runnum <<
ENDL;
return false;}
353 for (j=0; j<4; ++j) {
357 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 14a, no template load, run # " << theCurrentTemp.
enty[
i].
runnum <<
ENDL;
return false;}
360 for (j=0; j<4; ++j) {
364 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 14b, no template load, run # " << theCurrentTemp.
enty[
i].
runnum <<
ENDL;
return false;}
370 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 15, no template load, run # " << theCurrentTemp.
enty[
i].
runnum <<
ENDL;
return false;}
376 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 16, no template load, run # " << theCurrentTemp.
enty[
i].
runnum <<
ENDL;
return false;}
382 for (k=0; k < theCurrentTemp.
head.
NTyx; ++
k) {
384 for (i=0; i < theCurrentTemp.
head.
NTxx; ++
i) {
389 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 17, no template load, run # " << theCurrentTemp.
entx[
k][
i].
runnum <<
ENDL;
return false;}
397 theCurrentTemp.
entx[
k][
i].
beta =
static_cast<float>(atan2((
double)theCurrentTemp.
entx[k][i].
costrk[2], (
double)theCurrentTemp.
entx[k][i].
costrk[1]));
404 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 18, no template load, run # " << theCurrentTemp.
entx[
k][
i].
runnum <<
ENDL;
return false;}
410 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 19, no template load, run # " << theCurrentTemp.
entx[
k][
i].
runnum <<
ENDL;
return false;}
412 for (j=0; j<2; ++j) {
417 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 20, no template load, run # " << theCurrentTemp.
entx[
k][
i].
runnum <<
ENDL;
return false;}
420 for (j=0; j<9; ++j) {
424 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 21, no template load, run # " << theCurrentTemp.
entx[
k][
i].
runnum <<
ENDL;
return false;}
427 for (j=0; j<2; ++j) {
433 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 22, no template load, run # " << theCurrentTemp.
entx[
k][
i].
runnum <<
ENDL;
return false;}
437 for (j=0; j<9; ++j) {
441 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 23, no template load, run # " << theCurrentTemp.
entx[
k][
i].
runnum <<
ENDL;
return false;}
445 for (j=0; j<4; ++j) {
449 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 24, no template load, run # " << theCurrentTemp.
entx[
k][
i].
runnum <<
ENDL;
return false;}
452 for (j=0; j<4; ++j) {
457 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 25, no template load, run # " << theCurrentTemp.
entx[
k][
i].
runnum <<
ENDL;
return false;}
460 for (j=0; j<4; ++j) {
464 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 26, no template load, run # " << theCurrentTemp.
entx[
k][
i].
runnum <<
ENDL;
return false;}
467 for (j=0; j<4; ++j) {
472 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 27, no template load, run # " << theCurrentTemp.
entx[
k][
i].
runnum <<
ENDL;
return false;}
475 for (j=0; j<4; ++j) {
479 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 28, no template load, run # " << theCurrentTemp.
entx[
k][
i].
runnum <<
ENDL;
return false;}
482 for (j=0; j<4; ++j) {
486 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 29, no template load, run # " << theCurrentTemp.
entx[
k][
i].
runnum <<
ENDL;
return false;}
489 for (j=0; j<4; ++j) {
493 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 30, no template load, run # " << theCurrentTemp.
entx[
k][
i].
runnum <<
ENDL;
return false;}
496 for (j=0; j<4; ++j) {
500 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 30a, no template load, run # " << theCurrentTemp.
entx[
k][
i].
runnum <<
ENDL;
return false;}
503 for (j=0; j<4; ++j) {
507 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 30b, no template load, run # " << theCurrentTemp.
entx[
k][
i].
runnum <<
ENDL;
return false;}
513 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 31, no template load, run # " << theCurrentTemp.
entx[
k][
i].
runnum <<
ENDL;
return false;}
519 if(in_file.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 32, no template load, run # " << theCurrentTemp.
entx[
k][
i].
runnum <<
ENDL;
return false;}
529 pixelTemp.push_back(theCurrentTemp);
538 LOGERROR(
"SiPixelTemplate") <<
"Error opening File" << tempfile <<
ENDL;
546 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 561 const int code_version={17};
564 auto db(dbobject.
reader());
568 auto tmpPtr = std::make_unique<SiPixelTemplateStore>();
569 auto & theCurrentTemp = *tmpPtr;
572 for(
int m=0;
m<db.numOfTempl(); ++
m) {
577 for (i=0; i<20; ++
i) {
578 temp.
f = db.sVector()[db.index()];
579 theCurrentTemp.head.title[4*
i] = temp.
c[0];
580 theCurrentTemp.head.title[4*i+1] = temp.
c[1];
581 theCurrentTemp.head.title[4*i+2] = temp.
c[2];
582 theCurrentTemp.head.title[4*i+3] = temp.
c[3];
583 db.incrementIndex(1);
585 theCurrentTemp.head.title[79] =
'\0';
586 LOGINFO(
"SiPixelTemplate") <<
"Loading Pixel Template File - " << theCurrentTemp.head.title <<
ENDL;
590 db >> theCurrentTemp.head.ID >> theCurrentTemp.head.templ_version >> theCurrentTemp.head.Bfield >> theCurrentTemp.head.NTy >> theCurrentTemp.head.NTyx >> theCurrentTemp.head.NTxx
591 >> theCurrentTemp.head.Dtype >> theCurrentTemp.head.Vbias >> theCurrentTemp.head.temperature >> theCurrentTemp.head.fluence >> theCurrentTemp.head.qscale
592 >> theCurrentTemp.head.s50 >> theCurrentTemp.head.lorywidth >> theCurrentTemp.head.lorxwidth >> theCurrentTemp.head.ysize >> theCurrentTemp.head.xsize >> theCurrentTemp.head.zsize;
594 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 0A, no template load" <<
ENDL;
return false;}
596 LOGINFO(
"SiPixelTemplate") <<
"Loading Pixel Template File - " << theCurrentTemp.head.title
597 <<
" code version = "<<code_version
598 <<
" object version "<<theCurrentTemp.head.templ_version
601 if(theCurrentTemp.head.templ_version > 17) {
602 db >> theCurrentTemp.head.ss50 >> theCurrentTemp.head.lorybias >> theCurrentTemp.head.lorxbias >> theCurrentTemp.head.fbin[0] >> theCurrentTemp.head.fbin[1] >> theCurrentTemp.head.fbin[2];
604 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 0B, no template load" 605 <<
ENDL;
return false;}
607 theCurrentTemp.head.ss50 = theCurrentTemp.head.s50;
608 theCurrentTemp.head.lorybias = theCurrentTemp.head.lorywidth/2.f;
609 theCurrentTemp.head.lorxbias = theCurrentTemp.head.lorxwidth/2.f;
610 theCurrentTemp.head.fbin[0] = 1.50f;
611 theCurrentTemp.head.fbin[1] = 1.00f;
612 theCurrentTemp.head.fbin[2] = 0.85f;
618 <<
"Template ID = " << theCurrentTemp.head.ID <<
", Template Version " 619 << theCurrentTemp.head.templ_version <<
", Bfield = " 620 << theCurrentTemp.head.Bfield<<
", NTy = " << theCurrentTemp.head.NTy <<
", NTyx = " 621 << theCurrentTemp.head.NTyx<<
", NTxx = " << theCurrentTemp.head.NTxx <<
", Dtype = " 622 << theCurrentTemp.head.Dtype<<
", Bias voltage " << theCurrentTemp.head.Vbias <<
", temperature " 623 << theCurrentTemp.head.temperature <<
", fluence " << theCurrentTemp.head.fluence
624 <<
", Q-scaling factor " << theCurrentTemp.head.qscale
625 <<
", 1/2 multi dcol threshold " << theCurrentTemp.head.s50 <<
", 1/2 single dcol threshold " 626 << theCurrentTemp.head.ss50<<
", y Lorentz Width " << theCurrentTemp.head.lorywidth
627 <<
", y Lorentz Bias " << theCurrentTemp.head.lorybias
628 <<
", x Lorentz width " << theCurrentTemp.head.lorxwidth
629 <<
", x Lorentz Bias " << theCurrentTemp.head.lorxbias
630 <<
", Q/Q_avg fractions for Qbin defs " << theCurrentTemp.head.fbin[0]
631 <<
", " << theCurrentTemp.head.fbin[1]
632 <<
", " << theCurrentTemp.head.fbin[2]
633 <<
", pixel x-size " << theCurrentTemp.head.xsize
634 <<
", y-size " << theCurrentTemp.head.ysize <<
", zsize " << theCurrentTemp.head.zsize <<
ENDL;
636 if(theCurrentTemp.head.templ_version < code_version) {
637 LOGINFO(
"SiPixelTemplate") <<
"code expects version "<< code_version <<
" finds " 638 << theCurrentTemp.head.templ_version <<
", load anyway " <<
ENDL;
643 #ifdef SI_PIXEL_TEMPLATE_USE_BOOST 646 theCurrentTemp.cotbetaY =
new float[theCurrentTemp.head.NTy];
647 theCurrentTemp.cotbetaX =
new float[theCurrentTemp.head.NTyx];
648 theCurrentTemp.cotalphaX =
new float[theCurrentTemp.head.NTxx];
649 theCurrentTemp.enty.resize(boost::extents[theCurrentTemp.head.NTy]);
650 theCurrentTemp.entx.resize(boost::extents[theCurrentTemp.head.NTyx][theCurrentTemp.head.NTxx]);
656 for (i=0; i < theCurrentTemp.head.NTy; ++
i) {
658 db >> theCurrentTemp.enty[
i].runnum >> theCurrentTemp.enty[
i].costrk[0]
659 >> theCurrentTemp.enty[
i].costrk[1] >> theCurrentTemp.enty[
i].costrk[2];
661 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 1, no template load, run # " << theCurrentTemp.enty[
i].runnum <<
ENDL;
return false;}
665 theCurrentTemp.enty[
i].alpha =
static_cast<float>(atan2((
double)theCurrentTemp.enty[i].costrk[2], (
double)theCurrentTemp.enty[i].costrk[0]));
667 theCurrentTemp.enty[
i].cotalpha = theCurrentTemp.enty[
i].costrk[0]/theCurrentTemp.enty[
i].costrk[2];
669 theCurrentTemp.enty[
i].beta =
static_cast<float>(atan2((
double)theCurrentTemp.enty[i].costrk[2], (
double)theCurrentTemp.enty[i].costrk[1]));
671 theCurrentTemp.enty[
i].cotbeta = theCurrentTemp.enty[
i].costrk[1]/theCurrentTemp.enty[
i].costrk[2];
673 db >> theCurrentTemp.enty[
i].qavg >> theCurrentTemp.enty[
i].pixmax >> theCurrentTemp.enty[
i].symax >> theCurrentTemp.enty[
i].dyone
674 >> theCurrentTemp.enty[
i].syone >> theCurrentTemp.enty[
i].sxmax >> theCurrentTemp.enty[
i].dxone >> theCurrentTemp.enty[
i].sxone;
676 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 2, no template load, run # " << theCurrentTemp.enty[
i].runnum <<
ENDL;
return false;}
678 db >> theCurrentTemp.enty[
i].dytwo >> theCurrentTemp.enty[
i].sytwo >> theCurrentTemp.enty[
i].dxtwo
679 >> theCurrentTemp.enty[
i].sxtwo >> theCurrentTemp.enty[
i].qmin >> theCurrentTemp.enty[
i].clsleny >> theCurrentTemp.enty[
i].clslenx;
682 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 3, no template load, run # " << theCurrentTemp.enty[
i].runnum <<
ENDL;
return false;}
684 if(theCurrentTemp.enty[i].qmin <= 0.) {
LOGERROR(
"SiPixelTemplate") <<
"Error in template ID " << theCurrentTemp.head.ID <<
" qmin = " << theCurrentTemp.enty[
i].qmin <<
", run # " << theCurrentTemp.enty[
i].runnum <<
ENDL;
return false;}
686 for (j=0; j<2; ++j) {
688 db >> theCurrentTemp.enty[
i].ypar[j][0] >> theCurrentTemp.enty[
i].ypar[j][1]
689 >> theCurrentTemp.enty[
i].ypar[j][2] >> theCurrentTemp.enty[
i].ypar[j][3] >> theCurrentTemp.enty[
i].ypar[j][4];
691 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 4, no template load, run # " << theCurrentTemp.enty[
i].runnum <<
ENDL;
return false;}
695 for (j=0; j<9; ++j) {
697 for (k=0; k<
TYSIZE; ++
k) {db >> theCurrentTemp.enty[
i].ytemp[j][
k];}
699 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 5, no template load, run # " << theCurrentTemp.enty[
i].runnum <<
ENDL;
return false;}
702 for (j=0; j<2; ++j) {
704 db >> theCurrentTemp.enty[
i].xpar[j][0] >> theCurrentTemp.enty[
i].xpar[j][1]
705 >> theCurrentTemp.enty[
i].xpar[j][2] >> theCurrentTemp.enty[
i].xpar[j][3] >> theCurrentTemp.enty[
i].xpar[j][4];
707 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 6, no template load, run # " << theCurrentTemp.enty[
i].runnum <<
ENDL;
return false;}
712 for (j=0; j<9; ++j) {
714 for (k=0; k<
TXSIZE; ++
k) {db >> theCurrentTemp.enty[
i].xtemp[j][
k]; qavg_avg += theCurrentTemp.enty[
i].xtemp[j][
k];}
716 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 7, no template load, run # " << theCurrentTemp.enty[
i].runnum <<
ENDL;
return false;}
718 theCurrentTemp.enty[
i].qavg_avg = qavg_avg/9.;
720 for (j=0; j<4; ++j) {
722 db >> theCurrentTemp.enty[
i].yavg[j] >> theCurrentTemp.enty[
i].yrms[j] >> theCurrentTemp.enty[
i].ygx0[j] >> theCurrentTemp.enty[
i].ygsig[j];
724 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 8, no template load, run # " << theCurrentTemp.enty[
i].runnum <<
ENDL;
return false;}
727 for (j=0; j<4; ++j) {
729 db >> theCurrentTemp.enty[
i].yflpar[j][0] >> theCurrentTemp.enty[
i].yflpar[j][1] >> theCurrentTemp.enty[
i].yflpar[j][2]
730 >> theCurrentTemp.enty[
i].yflpar[j][3] >> theCurrentTemp.enty[
i].yflpar[j][4] >> theCurrentTemp.enty[
i].yflpar[j][5];
732 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 9, no template load, run # " << theCurrentTemp.enty[
i].runnum <<
ENDL;
return false;}
735 for (j=0; j<4; ++j) {
737 db >> theCurrentTemp.enty[
i].xavg[j] >> theCurrentTemp.enty[
i].xrms[j] >> theCurrentTemp.enty[
i].xgx0[j] >> theCurrentTemp.enty[
i].xgsig[j];
739 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 10, no template load, run # " << theCurrentTemp.enty[
i].runnum <<
ENDL;
return false;}
742 for (j=0; j<4; ++j) {
744 db >> theCurrentTemp.enty[
i].xflpar[j][0] >> theCurrentTemp.enty[
i].xflpar[j][1] >> theCurrentTemp.enty[
i].xflpar[j][2]
745 >> theCurrentTemp.enty[
i].xflpar[j][3] >> theCurrentTemp.enty[
i].xflpar[j][4] >> theCurrentTemp.enty[
i].xflpar[j][5];
747 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 11, no template load, run # " << theCurrentTemp.enty[
i].runnum <<
ENDL;
return false;}
750 for (j=0; j<4; ++j) {
752 db >> theCurrentTemp.enty[
i].chi2yavg[j] >> theCurrentTemp.enty[
i].chi2ymin[j] >> theCurrentTemp.enty[
i].chi2xavg[j] >> theCurrentTemp.enty[
i].chi2xmin[j];
754 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 12, no template load, run # " << theCurrentTemp.enty[
i].runnum <<
ENDL;
return false;}
757 for (j=0; j<4; ++j) {
759 db >> theCurrentTemp.enty[
i].yavgc2m[j] >> theCurrentTemp.enty[
i].yrmsc2m[j] >> theCurrentTemp.enty[
i].chi2yavgc2m[j] >> theCurrentTemp.enty[
i].chi2yminc2m[j];
761 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 13, no template load, run # " << theCurrentTemp.enty[
i].runnum <<
ENDL;
return false;}
764 for (j=0; j<4; ++j) {
766 db >> theCurrentTemp.enty[
i].xavgc2m[j] >> theCurrentTemp.enty[
i].xrmsc2m[j] >> theCurrentTemp.enty[
i].chi2xavgc2m[j] >> theCurrentTemp.enty[
i].chi2xminc2m[j];
768 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 14, no template load, run # " << theCurrentTemp.enty[
i].runnum <<
ENDL;
return false;}
771 for (j=0; j<4; ++j) {
773 db >> theCurrentTemp.enty[
i].yavggen[j] >> theCurrentTemp.enty[
i].yrmsgen[j] >> theCurrentTemp.enty[
i].ygx0gen[j] >> theCurrentTemp.enty[
i].ygsiggen[j];
775 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 14a, no template load, run # " << theCurrentTemp.enty[
i].runnum <<
ENDL;
return false;}
778 for (j=0; j<4; ++j) {
780 db >> theCurrentTemp.enty[
i].xavggen[j] >> theCurrentTemp.enty[
i].xrmsgen[j] >> theCurrentTemp.enty[
i].xgx0gen[j] >> theCurrentTemp.enty[
i].xgsiggen[j];
782 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 14b, no template load, run # " << theCurrentTemp.enty[
i].runnum <<
ENDL;
return false;}
786 db >> theCurrentTemp.enty[
i].chi2yavgone >> theCurrentTemp.enty[
i].chi2yminone >> theCurrentTemp.enty[
i].chi2xavgone >> theCurrentTemp.enty[
i].chi2xminone >> theCurrentTemp.enty[
i].qmin2
787 >> theCurrentTemp.enty[
i].mpvvav >> theCurrentTemp.enty[
i].sigmavav >> theCurrentTemp.enty[
i].kappavav >> theCurrentTemp.enty[
i].r_qMeas_qTrue >> theCurrentTemp.enty[
i].spare[0];
789 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 15, no template load, run # " << theCurrentTemp.enty[
i].runnum <<
ENDL;
return false;}
791 db >> theCurrentTemp.enty[
i].mpvvav2 >> theCurrentTemp.enty[
i].sigmavav2 >> theCurrentTemp.enty[
i].kappavav2 >> theCurrentTemp.enty[
i].qbfrac[0] >> theCurrentTemp.enty[
i].qbfrac[1]
792 >> theCurrentTemp.enty[
i].qbfrac[2] >> theCurrentTemp.enty[
i].fracyone >> theCurrentTemp.enty[
i].fracxone >> theCurrentTemp.enty[
i].fracytwo >> theCurrentTemp.enty[
i].fracxtwo;
795 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 16, no template load, run # " << theCurrentTemp.enty[
i].runnum <<
ENDL;
return false;}
801 for (k=0; k < theCurrentTemp.head.NTyx; ++
k) {
803 for (i=0; i < theCurrentTemp.head.NTxx; ++
i) {
805 db >> theCurrentTemp.entx[
k][
i].runnum >> theCurrentTemp.entx[
k][
i].costrk[0]
806 >> theCurrentTemp.entx[
k][
i].costrk[1] >> theCurrentTemp.entx[
k][
i].costrk[2];
808 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 17, no template load, run # " << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
return false;}
812 theCurrentTemp.entx[
k][
i].alpha =
static_cast<float>(atan2((
double)theCurrentTemp.entx[k][i].costrk[2], (
double)theCurrentTemp.entx[k][i].costrk[0]));
814 theCurrentTemp.entx[
k][
i].cotalpha = theCurrentTemp.entx[
k][
i].costrk[0]/theCurrentTemp.entx[
k][
i].costrk[2];
816 theCurrentTemp.entx[
k][
i].beta =
static_cast<float>(atan2((
double)theCurrentTemp.entx[k][i].costrk[2], (
double)theCurrentTemp.entx[k][i].costrk[1]));
818 theCurrentTemp.entx[
k][
i].cotbeta = theCurrentTemp.entx[
k][
i].costrk[1]/theCurrentTemp.entx[
k][
i].costrk[2];
820 db >> theCurrentTemp.entx[
k][
i].qavg >> theCurrentTemp.entx[
k][
i].pixmax >> theCurrentTemp.entx[
k][
i].symax >> theCurrentTemp.entx[
k][
i].dyone
821 >> theCurrentTemp.entx[
k][
i].syone >> theCurrentTemp.entx[
k][
i].sxmax >> theCurrentTemp.entx[
k][
i].dxone >> theCurrentTemp.entx[
k][
i].sxone;
823 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 18, no template load, run # " << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
return false;}
825 db >> theCurrentTemp.entx[
k][
i].dytwo >> theCurrentTemp.entx[
k][
i].sytwo >> theCurrentTemp.entx[
k][
i].dxtwo
826 >> theCurrentTemp.entx[
k][
i].sxtwo >> theCurrentTemp.entx[
k][
i].qmin >> theCurrentTemp.entx[
k][
i].clsleny >> theCurrentTemp.entx[
k][
i].clslenx;
829 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 19, no template load, run # " << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
return false;}
831 for (j=0; j<2; ++j) {
833 db >> theCurrentTemp.entx[
k][
i].ypar[j][0] >> theCurrentTemp.entx[
k][
i].ypar[j][1]
834 >> theCurrentTemp.entx[
k][
i].ypar[j][2] >> theCurrentTemp.entx[
k][
i].ypar[j][3] >> theCurrentTemp.entx[
k][
i].ypar[j][4];
836 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 20, no template load, run # " << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
return false;}
839 for (j=0; j<9; ++j) {
841 for (l=0; l<
TYSIZE; ++
l) {db >> theCurrentTemp.entx[
k][
i].ytemp[j][
l];}
843 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 21, no template load, run # " << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
return false;}
848 for (j=0; j<2; ++j) {
850 db >> theCurrentTemp.entx[
k][
i].xpar[j][0] >> theCurrentTemp.entx[
k][
i].xpar[j][1]
851 >> theCurrentTemp.entx[
k][
i].xpar[j][2] >> theCurrentTemp.entx[
k][
i].xpar[j][3] >> theCurrentTemp.entx[
k][
i].xpar[j][4];
854 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 22, no template load, run # " << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
return false;}
858 for (j=0; j<9; ++j) {
860 for (l=0; l<
TXSIZE; ++
l) {db >> theCurrentTemp.entx[
k][
i].xtemp[j][
l]; qavg_avg += theCurrentTemp.entx[
k][
i].xtemp[j][
l];}
862 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 23, no template load, run # " << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
return false;}
864 theCurrentTemp.entx[
k][
i].qavg_avg = qavg_avg/9.;
866 for (j=0; j<4; ++j) {
868 db >> theCurrentTemp.entx[
k][
i].yavg[j] >> theCurrentTemp.entx[
k][
i].yrms[j] >> theCurrentTemp.entx[
k][
i].ygx0[j] >> theCurrentTemp.entx[
k][
i].ygsig[j];
870 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 24, no template load, run # " << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
return false;}
873 for (j=0; j<4; ++j) {
875 db >> theCurrentTemp.entx[
k][
i].yflpar[j][0] >> theCurrentTemp.entx[
k][
i].yflpar[j][1] >> theCurrentTemp.entx[
k][
i].yflpar[j][2]
876 >> theCurrentTemp.entx[
k][
i].yflpar[j][3] >> theCurrentTemp.entx[
k][
i].yflpar[j][4] >> theCurrentTemp.entx[
k][
i].yflpar[j][5];
878 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 25, no template load, run # " << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
return false;}
881 for (j=0; j<4; ++j) {
883 db >> theCurrentTemp.entx[
k][
i].xavg[j] >> theCurrentTemp.entx[
k][
i].xrms[j] >> theCurrentTemp.entx[
k][
i].xgx0[j] >> theCurrentTemp.entx[
k][
i].xgsig[j];
885 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 26, no template load, run # " << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
return false;}
888 for (j=0; j<4; ++j) {
890 db >> theCurrentTemp.entx[
k][
i].xflpar[j][0] >> theCurrentTemp.entx[
k][
i].xflpar[j][1] >> theCurrentTemp.entx[
k][
i].xflpar[j][2]
891 >> theCurrentTemp.entx[
k][
i].xflpar[j][3] >> theCurrentTemp.entx[
k][
i].xflpar[j][4] >> theCurrentTemp.entx[
k][
i].xflpar[j][5];
893 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 27, no template load, run # " << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
return false;}
896 for (j=0; j<4; ++j) {
898 db >> theCurrentTemp.entx[
k][
i].chi2yavg[j] >> theCurrentTemp.entx[
k][
i].chi2ymin[j] >> theCurrentTemp.entx[
k][
i].chi2xavg[j] >> theCurrentTemp.entx[
k][
i].chi2xmin[j];
900 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 28, no template load, run # " << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
return false;}
903 for (j=0; j<4; ++j) {
905 db >> theCurrentTemp.entx[
k][
i].yavgc2m[j] >> theCurrentTemp.entx[
k][
i].yrmsc2m[j] >> theCurrentTemp.entx[
k][
i].chi2yavgc2m[j] >> theCurrentTemp.entx[
k][
i].chi2yminc2m[j];
907 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 29, no template load, run # " << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
return false;}
910 for (j=0; j<4; ++j) {
912 db >> theCurrentTemp.entx[
k][
i].xavgc2m[j] >> theCurrentTemp.entx[
k][
i].xrmsc2m[j] >> theCurrentTemp.entx[
k][
i].chi2xavgc2m[j] >> theCurrentTemp.entx[
k][
i].chi2xminc2m[j];
914 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 30, no template load, run # " << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
return false;}
917 for (j=0; j<4; ++j) {
919 db >> theCurrentTemp.entx[
k][
i].yavggen[j] >> theCurrentTemp.entx[
k][
i].yrmsgen[j] >> theCurrentTemp.entx[
k][
i].ygx0gen[j] >> theCurrentTemp.entx[
k][
i].ygsiggen[j];
921 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 30a, no template load, run # " << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
return false;}
924 for (j=0; j<4; ++j) {
926 db >> theCurrentTemp.entx[
k][
i].xavggen[j] >> theCurrentTemp.entx[
k][
i].xrmsgen[j] >> theCurrentTemp.entx[
k][
i].xgx0gen[j] >> theCurrentTemp.entx[
k][
i].xgsiggen[j];
928 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 30b, no template load, run # " << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
return false;}
932 db >> theCurrentTemp.entx[
k][
i].chi2yavgone >> theCurrentTemp.entx[
k][
i].chi2yminone >> theCurrentTemp.entx[
k][
i].chi2xavgone >> theCurrentTemp.entx[
k][
i].chi2xminone >> theCurrentTemp.entx[
k][
i].qmin2
933 >> theCurrentTemp.entx[
k][
i].mpvvav >> theCurrentTemp.entx[
k][
i].sigmavav >> theCurrentTemp.entx[
k][
i].kappavav >> theCurrentTemp.entx[
k][
i].r_qMeas_qTrue >> theCurrentTemp.entx[
k][
i].spare[0];
935 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 31, no template load, run # " << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
return false;}
937 db >> theCurrentTemp.entx[
k][
i].mpvvav2 >> theCurrentTemp.entx[
k][
i].sigmavav2 >> theCurrentTemp.entx[
k][
i].kappavav2 >> theCurrentTemp.entx[
k][
i].qbfrac[0] >> theCurrentTemp.entx[
k][
i].qbfrac[1]
938 >> theCurrentTemp.entx[
k][
i].qbfrac[2] >> theCurrentTemp.entx[
k][
i].fracyone >> theCurrentTemp.entx[
k][
i].fracxone >> theCurrentTemp.entx[
k][
i].fracytwo >> theCurrentTemp.entx[
k][
i].fracxtwo;
941 if(db.fail()) {
LOGERROR(
"SiPixelTemplate") <<
"Error reading file 32, no template load, run # " << theCurrentTemp.entx[
k][
i].runnum <<
ENDL;
return false;}
949 pixelTemp.push_back(theCurrentTemp);
978 for (
auto & templ : thePixelTemp_) {
979 for (
auto iy=0; iy<templ.head.NTy; ++iy ) templ.cotbetaY[iy]=templ.enty[iy].cotbeta;
980 for (
auto iy=0; iy<templ.head.NTyx; ++iy ) templ.cotbetaX[iy]= templ.entx[iy][0].cotbeta;
981 for (
auto ix=0; ix<templ.head.NTxx; ++ix ) templ.cotalphaX[ix]=templ.entx[0][ix].cotalpha;
1006 int ilow, ihigh, iylow, iyhigh, Ny, Nxx, Nyx, imidy, imaxx;
1007 float yratio, yxratio, xxratio, sxmax, qcorrect, qxtempcor, symax, chi2xavgone, chi2xminone, cota, cotb, cotalpha0, cotbeta0;
1008 bool flip_x, flip_y;
1010 float chi2xavg[4], chi2xmin[4], chi2xavgc2m[4], chi2xminc2m[4];
1014 if(
id != id_current_ || cotalpha != cota_current_ || cotbeta != cotb_current_) {
1016 cota_current_ = cotalpha; cotb_current_ = cotbeta; success_ =
true;
1018 if(
id != id_current_) {
1023 for(i=0; i<(
int)thePixelTemp_.size(); ++
i) {
1027 if(
id == thePixelTemp_[i].head.ID) {
1034 qscale_ = thePixelTemp_[index_id_].head.qscale;
1038 s50_ = thePixelTemp_[index_id_].head.s50;
1042 for(j=0; j<3; ++j) {fbin_[j] = thePixelTemp_[index_id_].head.fbin[j];}
1047 xsize_ = thePixelTemp_[index_id_].head.xsize;
1048 ysize_ = thePixelTemp_[index_id_].head.ysize;
1049 zsize_ = thePixelTemp_[index_id_].head.zsize;
1056 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 1057 if(index_id_ < 0 || index_id_ >= (
int)thePixelTemp_.size()) {
1058 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::interpolate can't find needed template ID = " <<
id << std::endl;
1067 assert(index_id_ >= 0 && index_id_ < (
int)thePixelTemp_.size());
1076 cotalpha0 = thePixelTemp_[index_id_].enty[0].cotalpha;
1077 qcorrect=
std::sqrt((1.
f+cotbeta*cotbeta+cotalpha*cotalpha)/(1.
f+cotbeta*cotbeta+cotalpha0*cotalpha0));
1084 switch(thePixelTemp_[index_id_].head.Dtype) {
1086 if(cotbeta < 0.
f) {flip_y =
true;}
1100 if(locBx*locBz < 0.
f) {
1112 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 1113 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::illegal subdetector ID = " << thePixelTemp_[index_id_].head.Dtype << std::endl;
1115 std::cout <<
"SiPixelTemplate::illegal subdetector ID = " << thePixelTemp_[index_id_].head.Dtype << std::endl;
1119 Ny = thePixelTemp_[index_id_].head.NTy;
1120 Nyx = thePixelTemp_[index_id_].head.NTyx;
1121 Nxx = thePixelTemp_[index_id_].head.NTxx;
1123 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 1124 if(Ny < 2 || Nyx < 1 || Nxx < 2) {
1125 throw cms::Exception(
"DataCorrupt") <<
"template ID = " << id_current_ <<
"has too few entries: Ny/Nyx/Nxx = " << Ny <<
"/" << Nyx <<
"/" << Nxx << std::endl;
1128 assert(Ny > 1 && Nyx > 0 && Nxx > 1);
1138 if(cotb >= thePixelTemp_[index_id_].enty[Ny-1].cotbeta) {
1146 if(cotb >= thePixelTemp_[index_id_].enty[0].cotbeta) {
1148 for (i=0; i<Ny-1; ++
i) {
1150 if( thePixelTemp_[index_id_].enty[i].cotbeta <= cotb && cotb < thePixelTemp_[index_id_].enty[i+1].cotbeta) {
1153 yratio = (cotb - thePixelTemp_[index_id_].enty[
i].cotbeta)/(thePixelTemp_[index_id_].enty[i+1].cotbeta - thePixelTemp_[index_id_].enty[i].cotbeta);
1157 }
else { success_ =
false; }
1165 qavg_ = (1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].qavg + yratio*thePixelTemp_[index_id_].enty[ihigh].qavg;
1167 symax = (1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].symax + yratio*thePixelTemp_[index_id_].enty[ihigh].symax;
1169 sxmax = (1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].sxmax + yratio*thePixelTemp_[index_id_].enty[ihigh].sxmax;
1170 dyone_ = (1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].dyone + yratio*thePixelTemp_[index_id_].enty[ihigh].dyone;
1171 if(flip_y) {dyone_ = -dyone_;}
1172 syone_ = (1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].syone + yratio*thePixelTemp_[index_id_].enty[ihigh].syone;
1173 dytwo_ = (1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].dytwo + yratio*thePixelTemp_[index_id_].enty[ihigh].dytwo;
1174 if(flip_y) {dytwo_ = -dytwo_;}
1175 sytwo_ = (1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].sytwo + yratio*thePixelTemp_[index_id_].enty[ihigh].sytwo;
1176 qmin_ = (1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].qmin + yratio*thePixelTemp_[index_id_].enty[ihigh].qmin;
1178 qmin2_ = (1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].qmin2 + yratio*thePixelTemp_[index_id_].enty[ihigh].qmin2;
1180 mpvvav_ = (1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].mpvvav + yratio*thePixelTemp_[index_id_].enty[ihigh].mpvvav;
1181 mpvvav_ *= qcorrect;
1182 sigmavav_ = (1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].sigmavav + yratio*thePixelTemp_[index_id_].enty[ihigh].sigmavav;
1183 kappavav_ = (1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].kappavav + yratio*thePixelTemp_[index_id_].enty[ihigh].kappavav;
1184 mpvvav2_ = (1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].mpvvav2 + yratio*thePixelTemp_[index_id_].enty[ihigh].mpvvav2;
1185 mpvvav2_ *= qcorrect;
1186 sigmavav2_ = (1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].sigmavav2 + yratio*thePixelTemp_[index_id_].enty[ihigh].sigmavav2;
1187 kappavav2_ = (1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].kappavav2 + yratio*thePixelTemp_[index_id_].enty[ihigh].kappavav2;
1188 clsleny_ = fminf(thePixelTemp_[index_id_].enty[ilow].clsleny, thePixelTemp_[index_id_].enty[ihigh].clsleny);
1189 qavg_avg_ = (1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].qavg_avg + yratio*thePixelTemp_[index_id_].enty[ihigh].qavg_avg;
1190 qavg_avg_ *= qcorrect;
1191 for(i=0; i<2 ; ++
i) {
1192 for(j=0; j<5 ; ++j) {
1195 yparl_[1-
i][j] = thePixelTemp_[index_id_].enty[ilow].ypar[
i][j];
1196 yparh_[1-
i][j] = thePixelTemp_[index_id_].enty[ihigh].ypar[
i][j];
1198 yparl_[
i][j] = thePixelTemp_[index_id_].enty[ilow].ypar[
i][j];
1199 yparh_[
i][j] = thePixelTemp_[index_id_].enty[ihigh].ypar[
i][j];
1202 xparly0_[1-
i][j] = thePixelTemp_[index_id_].enty[ilow].xpar[
i][j];
1203 xparhy0_[1-
i][j] = thePixelTemp_[index_id_].enty[ihigh].xpar[
i][j];
1205 xparly0_[
i][j] = thePixelTemp_[index_id_].enty[ilow].xpar[
i][j];
1206 xparhy0_[
i][j] = thePixelTemp_[index_id_].enty[ihigh].xpar[
i][j];
1211 for(i=0; i<4; ++
i) {
1212 yavg_[
i]=(1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].yavg[i] + yratio*thePixelTemp_[index_id_].enty[ihigh].yavg[i];
1213 if(flip_y) {yavg_[
i] = -yavg_[
i];}
1214 yrms_[
i]=(1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].yrms[i] + yratio*thePixelTemp_[index_id_].enty[ihigh].yrms[i];
1220 chi2yavg_[
i]=(1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].chi2yavg[i] + yratio*thePixelTemp_[index_id_].enty[ihigh].chi2yavg[i];
1221 chi2ymin_[
i]=(1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].chi2ymin[i] + yratio*thePixelTemp_[index_id_].enty[ihigh].chi2ymin[i];
1222 chi2xavg[
i]=(1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].chi2xavg[i] + yratio*thePixelTemp_[index_id_].enty[ihigh].chi2xavg[i];
1223 chi2xmin[
i]=(1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].chi2xmin[i] + yratio*thePixelTemp_[index_id_].enty[ihigh].chi2xmin[i];
1224 yavgc2m_[
i]=(1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].yavgc2m[i] + yratio*thePixelTemp_[index_id_].enty[ihigh].yavgc2m[i];
1225 if(flip_y) {yavgc2m_[
i] = -yavgc2m_[
i];}
1226 yrmsc2m_[
i]=(1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].yrmsc2m[i] + yratio*thePixelTemp_[index_id_].enty[ihigh].yrmsc2m[i];
1227 chi2yavgc2m_[
i]=(1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].chi2yavgc2m[i] + yratio*thePixelTemp_[index_id_].enty[ihigh].chi2yavgc2m[i];
1229 chi2yminc2m_[
i]=(1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].chi2yminc2m[i] + yratio*thePixelTemp_[index_id_].enty[ihigh].chi2yminc2m[i];
1231 chi2xavgc2m[
i]=(1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].chi2xavgc2m[i] + yratio*thePixelTemp_[index_id_].enty[ihigh].chi2xavgc2m[i];
1232 chi2xminc2m[
i]=(1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].chi2xminc2m[i] + yratio*thePixelTemp_[index_id_].enty[ihigh].chi2xminc2m[i];
1233 for(j=0; j<6 ; ++j) {
1234 yflparl_[
i][j] = thePixelTemp_[index_id_].enty[ilow].yflpar[
i][j];
1235 yflparh_[
i][j] = thePixelTemp_[index_id_].enty[ihigh].yflpar[
i][j];
1239 if(flip_y && (j == 0 || j == 2 || j == 4)) {
1240 yflparl_[
i][j] = - yflparl_[
i][j];
1241 yflparh_[
i][j] = - yflparh_[
i][j];
1248 chi2yavgone_=(1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].chi2yavgone + yratio*thePixelTemp_[index_id_].enty[ihigh].chi2yavgone;
1249 chi2yminone_=(1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].chi2yminone + yratio*thePixelTemp_[index_id_].enty[ihigh].chi2yminone;
1250 chi2xavgone=(1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].chi2xavgone + yratio*thePixelTemp_[index_id_].enty[ihigh].chi2xavgone;
1251 chi2xminone=(1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].chi2xminone + yratio*thePixelTemp_[index_id_].enty[ihigh].chi2xminone;
1253 fracyone_ = (1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].fracyone + yratio*thePixelTemp_[index_id_].enty[ihigh].fracyone;
1254 fracytwo_ = (1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].fracytwo + yratio*thePixelTemp_[index_id_].enty[ihigh].fracytwo;
1261 for(i=0; i<9; ++
i) {
1264 ytemp_[
i][
BYM2] = 0.f;
1265 ytemp_[
i][
BYM1] = 0.f;
1266 for(j=0; j<
TYSIZE; ++j) {
1271 ytemp_[8-
i][
BYM3-j]=(1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].ytemp[i][j] + yratio*thePixelTemp_[index_id_].enty[ihigh].ytemp[i][j];
1273 ytemp_[
i][j+2]=(1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].ytemp[i][j] + yratio*thePixelTemp_[index_id_].enty[ihigh].ytemp[i][j];
1283 if(abs_cotb_ >= thePixelTemp_[index_id_].entx[Nyx-1][0].cotbeta) {
1288 }
else if(abs_cotb_ >= thePixelTemp_[index_id_].entx[0][0].cotbeta) {
1290 for (i=0; i<Nyx-1; ++
i) {
1292 if( thePixelTemp_[index_id_].entx[i][0].cotbeta <= abs_cotb_ && abs_cotb_ < thePixelTemp_[index_id_].entx[i+1][0].cotbeta) {
1295 yxratio = (abs_cotb_ - thePixelTemp_[index_id_].entx[
i][0].cotbeta)/(thePixelTemp_[index_id_].entx[i+1][0].cotbeta - thePixelTemp_[index_id_].entx[i][0].cotbeta);
1306 if(cota >= thePixelTemp_[index_id_].entx[0][Nxx-1].cotalpha) {
1314 if(cota >= thePixelTemp_[index_id_].entx[0][0].cotalpha) {
1316 for (i=0; i<Nxx-1; ++
i) {
1318 if( thePixelTemp_[index_id_].entx[0][i].cotalpha <= cota && cota < thePixelTemp_[index_id_].entx[0][i+1].cotalpha) {
1321 xxratio = (cota - thePixelTemp_[index_id_].entx[0][
i].cotalpha)/(thePixelTemp_[index_id_].entx[0][i+1].cotalpha - thePixelTemp_[index_id_].entx[0][i].cotalpha);
1325 }
else { success_ =
false; }
1337 sxparmax_ = (1.f - xxratio)*thePixelTemp_[index_id_].entx[imaxx][ilow].sxmax + xxratio*thePixelTemp_[index_id_].entx[imaxx][ihigh].sxmax;
1339 if(thePixelTemp_[index_id_].entx[imaxx][imidy].sxmax != 0.
f) {sxmax_=sxmax_/thePixelTemp_[index_id_].entx[imaxx][imidy].sxmax*sxmax;}
1340 symax_ = (1.f - xxratio)*thePixelTemp_[index_id_].entx[imaxx][ilow].symax + xxratio*thePixelTemp_[index_id_].entx[imaxx][ihigh].symax;
1341 if(thePixelTemp_[index_id_].entx[imaxx][imidy].symax != 0.
f) {symax_=symax_/thePixelTemp_[index_id_].entx[imaxx][imidy].symax*symax;}
1342 dxone_ = (1.f - xxratio)*thePixelTemp_[index_id_].entx[0][ilow].dxone + xxratio*thePixelTemp_[index_id_].entx[0][ihigh].dxone;
1343 if(flip_x) {dxone_ = -dxone_;}
1344 sxone_ = (1.f - xxratio)*thePixelTemp_[index_id_].entx[0][ilow].sxone + xxratio*thePixelTemp_[index_id_].entx[0][ihigh].sxone;
1345 dxtwo_ = (1.f - xxratio)*thePixelTemp_[index_id_].entx[0][ilow].dxtwo + xxratio*thePixelTemp_[index_id_].entx[0][ihigh].dxtwo;
1346 if(flip_x) {dxtwo_ = -dxtwo_;}
1347 sxtwo_ = (1.f - xxratio)*thePixelTemp_[index_id_].entx[0][ilow].sxtwo + xxratio*thePixelTemp_[index_id_].entx[0][ihigh].sxtwo;
1348 clslenx_ = fminf(thePixelTemp_[index_id_].entx[0][ilow].clslenx, thePixelTemp_[index_id_].entx[0][ihigh].clslenx);
1350 for(i=0; i<2 ; ++
i) {
1351 for(j=0; j<5 ; ++j) {
1354 xpar0_[1-
i][j] = thePixelTemp_[index_id_].entx[imaxx][imidy].xpar[
i][j];
1355 xparl_[1-
i][j] = thePixelTemp_[index_id_].entx[imaxx][ilow].xpar[
i][j];
1356 xparh_[1-
i][j] = thePixelTemp_[index_id_].entx[imaxx][ihigh].xpar[
i][j];
1358 xpar0_[
i][j] = thePixelTemp_[index_id_].entx[imaxx][imidy].xpar[
i][j];
1359 xparl_[
i][j] = thePixelTemp_[index_id_].entx[imaxx][ilow].xpar[
i][j];
1360 xparh_[
i][j] = thePixelTemp_[index_id_].entx[imaxx][ihigh].xpar[
i][j];
1367 pixmax_=(1.f - yxratio)*((1.
f - xxratio)*thePixelTemp_[index_id_].entx[iylow][ilow].pixmax + xxratio*thePixelTemp_[index_id_].entx[iylow][ihigh].pixmax)
1368 +yxratio*((1.
f - xxratio)*thePixelTemp_[index_id_].entx[iyhigh][ilow].pixmax + xxratio*thePixelTemp_[index_id_].entx[iyhigh][ihigh].pixmax);
1371 r_qMeas_qTrue_=(1.f - yxratio)*((1.
f - xxratio)*thePixelTemp_[index_id_].entx[iylow][ilow].r_qMeas_qTrue + xxratio*thePixelTemp_[index_id_].entx[iylow][ihigh].r_qMeas_qTrue)
1372 +yxratio*((1.
f - xxratio)*thePixelTemp_[index_id_].entx[iyhigh][ilow].r_qMeas_qTrue + xxratio*thePixelTemp_[index_id_].entx[iyhigh][ihigh].r_qMeas_qTrue);
1375 for(i=0; i<4; ++
i) {
1376 xavg_[
i]=(1.f - yxratio)*((1.
f - xxratio)*thePixelTemp_[index_id_].entx[iylow][ilow].xavg[
i] + xxratio*thePixelTemp_[index_id_].entx[iylow][ihigh].xavg[
i])
1377 +yxratio*((1.
f - xxratio)*thePixelTemp_[index_id_].entx[iyhigh][ilow].xavg[
i] + xxratio*thePixelTemp_[index_id_].entx[iyhigh][ihigh].xavg[
i]);
1378 if(flip_x) {xavg_[
i] = -xavg_[
i];}
1380 xrms_[
i]=(1.f - yxratio)*((1.
f - xxratio)*thePixelTemp_[index_id_].entx[iylow][ilow].xrms[
i] + xxratio*thePixelTemp_[index_id_].entx[iylow][ihigh].xrms[
i])
1381 +yxratio*((1.
f - xxratio)*thePixelTemp_[index_id_].entx[iyhigh][ilow].xrms[
i] + xxratio*thePixelTemp_[index_id_].entx[iyhigh][ihigh].xrms[
i]);
1389 xavgc2m_[
i]=(1.f - yxratio)*((1.
f - xxratio)*thePixelTemp_[index_id_].entx[iylow][ilow].xavgc2m[
i] + xxratio*thePixelTemp_[index_id_].entx[iylow][ihigh].xavgc2m[
i])
1390 +yxratio*((1.
f - xxratio)*thePixelTemp_[index_id_].entx[iyhigh][ilow].xavgc2m[
i] + xxratio*thePixelTemp_[index_id_].entx[iyhigh][ihigh].xavgc2m[
i]);
1391 if(flip_x) {xavgc2m_[
i] = -xavgc2m_[
i];}
1393 xrmsc2m_[
i]=(1.f - yxratio)*((1.
f - xxratio)*thePixelTemp_[index_id_].entx[iylow][ilow].xrmsc2m[
i] + xxratio*thePixelTemp_[index_id_].entx[iylow][ihigh].xrmsc2m[
i])
1394 +yxratio*((1.
f - xxratio)*thePixelTemp_[index_id_].entx[iyhigh][ilow].xrmsc2m[
i] + xxratio*thePixelTemp_[index_id_].entx[iyhigh][ihigh].xrmsc2m[
i]);
1410 chi2xavg_[
i]=((1.f - xxratio)*thePixelTemp_[index_id_].entx[iyhigh][ilow].chi2xavg[i] + xxratio*thePixelTemp_[index_id_].entx[iyhigh][ihigh].chi2xavg[i]);
1411 if(thePixelTemp_[index_id_].entx[iyhigh][imidy].chi2xavg[i] != 0.
f) {chi2xavg_[
i]=chi2xavg_[
i]/thePixelTemp_[index_id_].entx[iyhigh][imidy].chi2xavg[
i]*chi2xavg[
i];}
1413 chi2xmin_[
i]=((1.f - xxratio)*thePixelTemp_[index_id_].entx[iyhigh][ilow].chi2xmin[i] + xxratio*thePixelTemp_[index_id_].entx[iyhigh][ihigh].chi2xmin[i]);
1414 if(thePixelTemp_[index_id_].entx[iyhigh][imidy].chi2xmin[i] != 0.
f) {chi2xmin_[
i]=chi2xmin_[
i]/thePixelTemp_[index_id_].entx[iyhigh][imidy].chi2xmin[
i]*chi2xmin[
i];}
1416 chi2xavgc2m_[
i]=((1.f - xxratio)*thePixelTemp_[index_id_].entx[iyhigh][ilow].chi2xavgc2m[i] + xxratio*thePixelTemp_[index_id_].entx[iyhigh][ihigh].chi2xavgc2m[i]);
1417 if(thePixelTemp_[index_id_].entx[iyhigh][imidy].chi2xavgc2m[i] != 0.
f) {chi2xavgc2m_[
i]=chi2xavgc2m_[
i]/thePixelTemp_[index_id_].entx[iyhigh][imidy].chi2xavgc2m[
i]*chi2xavgc2m[
i];}
1419 chi2xminc2m_[
i]=((1.f - xxratio)*thePixelTemp_[index_id_].entx[iyhigh][ilow].chi2xminc2m[i] + xxratio*thePixelTemp_[index_id_].entx[iyhigh][ihigh].chi2xminc2m[i]);
1420 if(thePixelTemp_[index_id_].entx[iyhigh][imidy].chi2xminc2m[i] != 0.
f) {chi2xminc2m_[
i]=chi2xminc2m_[
i]/thePixelTemp_[index_id_].entx[iyhigh][imidy].chi2xminc2m[
i]*chi2xminc2m[
i];}
1422 for(j=0; j<6 ; ++j) {
1423 xflparll_[
i][j] = thePixelTemp_[index_id_].entx[iylow][ilow].xflpar[
i][j];
1424 xflparlh_[
i][j] = thePixelTemp_[index_id_].entx[iylow][ihigh].xflpar[
i][j];
1425 xflparhl_[
i][j] = thePixelTemp_[index_id_].entx[iyhigh][ilow].xflpar[
i][j];
1426 xflparhh_[
i][j] = thePixelTemp_[index_id_].entx[iyhigh][ihigh].xflpar[
i][j];
1428 if(flip_x && (j == 0 || j == 2 || j == 4)) {
1429 xflparll_[
i][j] = -xflparll_[
i][j];
1430 xflparlh_[
i][j] = -xflparlh_[
i][j];
1431 xflparhl_[
i][j] = -xflparhl_[
i][j];
1432 xflparhh_[
i][j] = -xflparhh_[
i][j];
1440 chi2xavgone_=((1.f - xxratio)*thePixelTemp_[index_id_].entx[iyhigh][ilow].chi2xavgone + xxratio*thePixelTemp_[index_id_].entx[iyhigh][ihigh].chi2xavgone);
1441 if(thePixelTemp_[index_id_].entx[iyhigh][imidy].chi2xavgone != 0.
f) {chi2xavgone_=chi2xavgone_/thePixelTemp_[index_id_].entx[iyhigh][imidy].chi2xavgone*chi2xavgone;}
1443 chi2xminone_=((1.f - xxratio)*thePixelTemp_[index_id_].entx[iyhigh][ilow].chi2xminone + xxratio*thePixelTemp_[index_id_].entx[iyhigh][ihigh].chi2xminone);
1444 if(thePixelTemp_[index_id_].entx[iyhigh][imidy].chi2xminone != 0.
f) {chi2xminone_=chi2xminone_/thePixelTemp_[index_id_].entx[iyhigh][imidy].chi2xminone*chi2xminone;}
1446 fracxone_ = (1.f - yxratio)*((1.
f - xxratio)*thePixelTemp_[index_id_].entx[iylow][ilow].fracxone + xxratio*thePixelTemp_[index_id_].entx[iylow][ihigh].fracxone)
1447 +yxratio*((1.
f - xxratio)*thePixelTemp_[index_id_].entx[iyhigh][ilow].fracxone + xxratio*thePixelTemp_[index_id_].entx[iyhigh][ihigh].fracxone);
1448 fracxtwo_ = (1.f - yxratio)*((1.
f - xxratio)*thePixelTemp_[index_id_].entx[iylow][ilow].fracxtwo + xxratio*thePixelTemp_[index_id_].entx[iylow][ihigh].fracxtwo)
1449 +yxratio*((1.
f - xxratio)*thePixelTemp_[index_id_].entx[iyhigh][ilow].fracxtwo + xxratio*thePixelTemp_[index_id_].entx[iyhigh][ihigh].fracxtwo);
1460 cotbeta0 = thePixelTemp_[index_id_].entx[iyhigh][0].cotbeta;
1461 qxtempcor=
std::sqrt((1.
f+cotbeta*cotbeta+cotalpha*cotalpha)/(1.
f+cotbeta0*cotbeta0+cotalpha*cotalpha));
1463 for(i=0; i<9; ++
i) {
1466 xtemp_[
i][
BXM2] = 0.f;
1467 xtemp_[
i][
BXM1] = 0.f;
1468 for(j=0; j<
TXSIZE; ++j) {
1473 xtemp_[8-
i][
BXM3-j]=qxtempcor*((1.f - xxratio)*thePixelTemp_[index_id_].entx[iyhigh][ilow].xtemp[i][j] + xxratio*thePixelTemp_[index_id_].entx[iyhigh][ihigh].xtemp[i][j]);
1475 xtemp_[
i][j+2]=qxtempcor*((1.f - xxratio)*thePixelTemp_[index_id_].entx[iyhigh][ilow].xtemp[i][j] + xxratio*thePixelTemp_[index_id_].entx[iyhigh][ihigh].xtemp[i][j]);
1480 lorywidth_ = thePixelTemp_[index_id_].head.lorywidth;
1481 lorxwidth_ = thePixelTemp_[index_id_].head.lorxwidth;
1482 lorybias_ = thePixelTemp_[index_id_].head.lorybias;
1483 lorxbias_ = thePixelTemp_[index_id_].head.lorxbias;
1484 if(flip_x) {lorxwidth_ = -lorxwidth_; lorxbias_ = -lorxbias_;}
1485 if(flip_y) {lorywidth_ = -lorywidth_; lorybias_ = -lorybias_;}
1510 if(cotbeta < 0.
f) {locBx = -1.f;}
1511 float locBz = locBx;
1512 if(cotalpha < 0.
f) {locBz = -locBx;}
1551 float sigi, sigi2, sigi3, sigi4, symax, qscale, s25;
1555 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 1556 if(fypix < 2 || fypix >=
BYM2) {
1557 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::ysigma2 called with fypix = " << fypix << std::endl;
1560 assert(fypix > 1 && fypix <
BYM2);
1562 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 1563 if(lypix < fypix || lypix >=
BYM2) {
1564 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::ysigma2 called with lypix/fypix = " << lypix <<
"/" << fypix << std::endl;
1567 assert(lypix >= fypix && lypix <
BYM2);
1574 if(symax_ > syparmax_) {symax = syparmax_;}
1578 for(i=fypix-2; i<=lypix+2; ++
i) {
1579 if(i < fypix || i > lypix) {
1583 ysig2[
i] = s50_*s50_;
1585 if(ysum[i] < symax) {
1588 if(sigi < s25) sigi = s25;
1591 qscale = ysum[
i]/symax;
1593 sigi2 = sigi*sigi; sigi3 = sigi2*sigi; sigi4 = sigi3*sigi;
1595 ysig2[
i] = (1.f-yratio_)*
1596 (yparl_[0][0]+yparl_[0][1]*sigi+yparl_[0][2]*sigi2+yparl_[0][3]*sigi3+yparl_[0][4]*sigi4)
1598 (yparh_[0][0]+yparh_[0][1]*sigi+yparh_[0][2]*sigi2+yparh_[0][3]*sigi3+yparh_[0][4]*sigi4);
1600 ysig2[
i] = (1.f-yratio_)*
1601 (yparl_[1][0]+yparl_[1][1]*sigi+yparl_[1][2]*sigi2+yparl_[1][3]*sigi3+yparl_[1][4]*sigi4)
1603 (yparh_[1][0]+yparh_[1][1]*sigi+yparh_[1][2]*sigi2+yparh_[1][3]*sigi3+yparh_[1][4]*sigi4);
1606 if(ysum[i] > sythr) {ysig2[
i] = 1.e8;}
1607 if(ysig2[i] <= 0.
f) {
LOGERROR(
"SiPixelTemplate") <<
"neg y-error-squared, id = " << id_current_ <<
", index = " << index_id_ <<
1608 ", cot(alpha) = " << cota_current_ <<
", cot(beta) = " << cotb_current_ <<
", sigi = " << sigi <<
ENDL;}
1630 float sigi, sigi2, sigi3, sigi4, symax, qscale, err2, s25;
1634 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 1635 if(index < 2 || index >=
BYM2) {
1636 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::ysigma2 called with index = " << index << std::endl;
1639 assert(index > 1 && index <
BYM2);
1646 if(symax_ > syparmax_) {symax = syparmax_;}
1650 if(qpixel < symax) {
1653 if(sigi < s25) sigi = s25;
1656 qscale = qpixel/symax;
1658 sigi2 = sigi*sigi; sigi3 = sigi2*sigi; sigi4 = sigi3*sigi;
1660 err2 = (1.f-yratio_)*
1661 (yparl_[0][0]+yparl_[0][1]*sigi+yparl_[0][2]*sigi2+yparl_[0][3]*sigi3+yparl_[0][4]*sigi4)
1663 (yparh_[0][0]+yparh_[0][1]*sigi+yparh_[0][2]*sigi2+yparh_[0][3]*sigi3+yparh_[0][4]*sigi4);
1665 err2 = (1.f-yratio_)*
1666 (yparl_[1][0]+yparl_[1][1]*sigi+yparl_[1][2]*sigi2+yparl_[1][3]*sigi3+yparl_[1][4]*sigi4)
1668 (yparh_[1][0]+yparh_[1][1]*sigi+yparh_[1][2]*sigi2+yparh_[1][3]*sigi3+yparh_[1][4]*sigi4);
1671 if(ysig2 <= 0.
f) {
LOGERROR(
"SiPixelTemplate") <<
"neg y-error-squared, id = " << id_current_ <<
", index = " << index_id_ <<
1672 ", cot(alpha) = " << cota_current_ <<
", cot(beta) = " << cotb_current_ <<
", sigi = " << sigi <<
ENDL;}
1698 float sigi, sigi2, sigi3, sigi4, yint, sxmax, x0, qscale, s25;
1702 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 1703 if(fxpix < 2 || fxpix >=
BXM2) {
1704 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::xsigma2 called with fxpix = " << fxpix << std::endl;
1707 assert(fxpix > 1 && fxpix <
BXM2);
1709 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 1710 if(lxpix < fxpix || lxpix >=
BXM2) {
1711 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::xsigma2 called with lxpix/fxpix = " << lxpix <<
"/" << fxpix << std::endl;
1714 assert(lxpix >= fxpix && lxpix <
BXM2);
1721 if(sxmax_ > sxparmax_) {sxmax = sxparmax_;}
1725 for(i=fxpix-2; i<=lxpix+2; ++
i) {
1726 if(i < fxpix || i > lxpix) {
1730 xsig2[
i] = s50_*s50_;
1732 if(xsum[i] < sxmax) {
1735 if(sigi < s25) sigi = s25;
1738 qscale = xsum[
i]/sxmax;
1740 sigi2 = sigi*sigi; sigi3 = sigi2*sigi; sigi4 = sigi3*sigi;
1745 yint = (1.f-yratio_)*
1746 (xparly0_[0][0]+xparly0_[0][1]*sigi+xparly0_[0][2]*sigi2+xparly0_[0][3]*sigi3+xparly0_[0][4]*sigi4)
1748 (xparhy0_[0][0]+xparhy0_[0][1]*sigi+xparhy0_[0][2]*sigi2+xparhy0_[0][3]*sigi3+xparhy0_[0][4]*sigi4);
1750 yint = (1.f-yratio_)*
1751 (xparly0_[1][0]+xparly0_[1][1]*sigi+xparly0_[1][2]*sigi2+xparly0_[1][3]*sigi3+xparly0_[1][4]*sigi4)
1753 (xparhy0_[1][0]+xparhy0_[1][1]*sigi+xparhy0_[1][2]*sigi2+xparhy0_[1][3]*sigi3+xparhy0_[1][4]*sigi4);
1759 xsig2[
i] = (1.f-xxratio_)*
1760 (xparl_[0][0]+xparl_[0][1]*sigi+xparl_[0][2]*sigi2+xparl_[0][3]*sigi3+xparl_[0][4]*sigi4)
1762 (xparh_[0][0]+xparh_[0][1]*sigi+xparh_[0][2]*sigi2+xparh_[0][3]*sigi3+xparh_[0][4]*sigi4);
1764 xsig2[
i] = (1.f-xxratio_)*
1765 (xparl_[1][0]+xparl_[1][1]*sigi+xparl_[1][2]*sigi2+xparl_[1][3]*sigi3+xparl_[1][4]*sigi4)
1767 (xparh_[1][0]+xparh_[1][1]*sigi+xparh_[1][2]*sigi2+xparh_[1][3]*sigi3+xparh_[1][4]*sigi4);
1773 x0 = xpar0_[0][0]+xpar0_[0][1]*sigi+xpar0_[0][2]*sigi2+xpar0_[0][3]*sigi3+xpar0_[0][4]*sigi4;
1775 x0 = xpar0_[1][0]+xpar0_[1][1]*sigi+xpar0_[1][2]*sigi2+xpar0_[1][3]*sigi3+xpar0_[1][4]*sigi4;
1780 if(x0 != 0.
f) {xsig2[
i] = xsig2[
i]/x0 * yint;}
1782 if(xsum[i] > sxthr) {xsig2[
i] = 1.e8;}
1783 if(xsig2[i] <= 0.
f) {
LOGERROR(
"SiPixelTemplate") <<
"neg x-error-squared, id = " << id_current_ <<
", index = " << index_id_ <<
1784 ", cot(alpha) = " << cota_current_ <<
", cot(beta) = " << cotb_current_ <<
", sigi = " << sigi <<
ENDL;}
1808 float qfl, qfl2, qfl3, qfl4, qfl5,
dy;
1812 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 1813 if(binq < 0 || binq > 3) {
1814 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::yflcorr called with binq = " << binq << std::endl;
1817 assert(binq >= 0 && binq < 4);
1819 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 1820 if(fabs((
double)qfly) > 1.) {
1821 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::yflcorr called with qfly = " << qfly << std::endl;
1824 assert(fabs((
double)qfly) <= 1.);
1831 if(qfl < -0.9
f) {qfl = -0.9f;}
1832 if(qfl > 0.9
f) {qfl = 0.9f;}
1836 qfl2 = qfl*qfl; qfl3 = qfl2*qfl; qfl4 = qfl3*qfl; qfl5 = qfl4*qfl;
1837 dy = (1.f-yratio_)*(yflparl_[binq][0]+yflparl_[binq][1]*qfl+yflparl_[binq][2]*qfl2+yflparl_[binq][3]*qfl3+yflparl_[binq][4]*qfl4+yflparl_[binq][5]*qfl5)
1838 + yratio_*(yflparh_[binq][0]+yflparh_[binq][1]*qfl+yflparh_[binq][2]*qfl2+yflparh_[binq][3]*qfl3+yflparh_[binq][4]*qfl4+yflparh_[binq][5]*qfl5);
1860 float qfl, qfl2, qfl3, qfl4, qfl5,
dx;
1864 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 1865 if(binq < 0 || binq > 3) {
1866 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::xflcorr called with binq = " << binq << std::endl;
1869 assert(binq >= 0 && binq < 4);
1871 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 1872 if(fabs((
double)qflx) > 1.) {
1873 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::xflcorr called with qflx = " << qflx << std::endl;
1876 assert(fabs((
double)qflx) <= 1.);
1883 if(qfl < -0.9
f) {qfl = -0.9f;}
1884 if(qfl > 0.9
f) {qfl = 0.9f;}
1888 qfl2 = qfl*qfl; qfl3 = qfl2*qfl; qfl4 = qfl3*qfl; qfl5 = qfl4*qfl;
1889 dx = (1.f - yxratio_)*((1.
f-xxratio_)*(xflparll_[binq][0]+xflparll_[binq][1]*qfl+xflparll_[binq][2]*qfl2+xflparll_[binq][3]*qfl3+xflparll_[binq][4]*qfl4+xflparll_[binq][5]*qfl5)
1890 + xxratio_*(xflparlh_[binq][0]+xflparlh_[binq][1]*qfl+xflparlh_[binq][2]*qfl2+xflparlh_[binq][3]*qfl3+xflparlh_[binq][4]*qfl4+xflparlh_[binq][5]*qfl5))
1891 + yxratio_*((1.
f-xxratio_)*(xflparhl_[binq][0]+xflparhl_[binq][1]*qfl+xflparhl_[binq][2]*qfl2+xflparhl_[binq][3]*qfl3+xflparhl_[binq][4]*qfl4+xflparhl_[binq][5]*qfl5)
1892 + xxratio_*(xflparhh_[binq][0]+xflparhh_[binq][1]*qfl+xflparhh_[binq][2]*qfl2+xflparhh_[binq][3]*qfl3+xflparhh_[binq][4]*qfl4+xflparhh_[binq][5]*qfl5));
1916 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 1917 if(fybin < 0 || fybin > 40) {
1918 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::ytemp called with fybin = " << fybin << std::endl;
1921 assert(fybin >= 0 && fybin < 41);
1923 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 1924 if(lybin < 0 || lybin > 40) {
1925 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::ytemp called with lybin = " << lybin << std::endl;
1928 assert(lybin >= 0 && lybin < 41);
1933 for(i=0; i<9; ++
i) {
1934 for(j=0; j<
BYSIZE; ++j) {
1935 ytemplate[i+16][j]=ytemp_[
i][j];
1938 for(i=0; i<8; ++
i) {
1939 ytemplate[i+8][
BYM1] = 0.f;
1940 for(j=0; j<
BYM1; ++j) {
1941 ytemplate[i+8][j]=ytemp_[
i][j+1];
1944 for(i=1; i<9; ++
i) {
1945 ytemplate[i+24][0] = 0.f;
1946 for(j=0; j<
BYM1; ++j) {
1947 ytemplate[i+24][j+1]=ytemp_[
i][j];
1954 for(i=0; i<8; ++
i) {
1955 ytemplate[
i][
BYM2] = 0.f;
1956 ytemplate[
i][
BYM1] = 0.f;
1957 for(j=0; j<
BYM2; ++j) {
1958 ytemplate[
i][j]=ytemp_[
i][j+2];
1963 for(i=1; i<9; ++
i) {
1964 ytemplate[i+32][0] = 0.f;
1965 ytemplate[i+32][1] = 0.f;
1966 for(j=0; j<
BYM2; ++j) {
1967 ytemplate[i+32][j+2]=ytemp_[
i][j];
1994 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 1995 if(fxbin < 0 || fxbin > 40) {
1996 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::xtemp called with fxbin = " << fxbin << std::endl;
1999 assert(fxbin >= 0 && fxbin < 41);
2001 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2002 if(lxbin < 0 || lxbin > 40) {
2003 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::xtemp called with lxbin = " << lxbin << std::endl;
2006 assert(lxbin >= 0 && lxbin < 41);
2011 for(i=0; i<9; ++
i) {
2012 for(j=0; j<
BXSIZE; ++j) {
2013 xtemplate[i+16][j]=xtemp_[
i][j];
2016 for(i=0; i<8; ++
i) {
2017 xtemplate[i+8][
BXM1] = 0.f;
2018 for(j=0; j<
BXM1; ++j) {
2019 xtemplate[i+8][j]=xtemp_[
i][j+1];
2022 for(i=1; i<9; ++
i) {
2023 xtemplate[i+24][0] = 0.f;
2024 for(j=0; j<
BXM1; ++j) {
2025 xtemplate[i+24][j+1]=xtemp_[
i][j];
2032 for(i=0; i<8; ++
i) {
2033 xtemplate[
i][
BXM2] = 0.f;
2034 xtemplate[
i][
BXM1] = 0.f;
2035 for(j=0; j<
BXM2; ++j) {
2036 xtemplate[
i][j]=xtemp_[
i][j+2];
2041 for(i=1; i<9; ++
i) {
2042 xtemplate[i+32][0] = 0.f;
2043 xtemplate[i+32][1] = 0.f;
2044 for(j=0; j<
BXM2; ++j) {
2045 xtemplate[i+32][j+2]=xtemp_[
i][j];
2070 float qedge = 2.*s50_;
2073 for(j=0; j<
BYSIZE; ++j) {
2074 if(ytemp_[4][j] > sigmax) {
2075 sigmax = ytemp_[4][j];
2079 if(sigmax < qedge) {qedge = s50_;}
2080 if(sigmax < qedge || jmax<1 || jmax>
BYM2) {
return -1;}
2086 for(j=jmax+1; j<
BYM1; ++j) {
2087 if(ytemp_[4][j] < qedge)
break;
2093 for(j=jmax-1; j>0; --j) {
2094 if(ytemp_[4][j] < qedge)
break;
2098 return (jbeg+jend)/2;
2119 float qedge = 2.*s50_;
2122 for(j=0; j<
BXSIZE; ++j) {
2123 if(xtemp_[4][j] > sigmax) {
2124 sigmax = xtemp_[4][j];
2128 if(sigmax < qedge) {qedge = s50_;}
2129 if(sigmax < qedge || jmax<1 || jmax>
BXM2) {
return -1;}
2135 for(j=jmax+1; j<
BXM1; ++j) {
2136 if(xtemp_[4][j] < qedge)
break;
2142 for(j=jmax-1; j>0; --j) {
2143 if(xtemp_[4][j] < qedge)
break;
2147 return (jbeg+jend)/2;
2165 int ioff0, ioffp, ioffm;
2169 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2170 if(nypix < 1 || nypix >=
BYM3) {
2171 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::ytemp3d called with nypix = " << nypix << std::endl;
2174 assert(nypix > 0 && nypix <
BYM3);
2179 float diff = fabsf(nypix - clsleny_)/2. + 1.f;
2180 int nshift = (
int)diff;
2181 if((diff - nshift) > 0.5f) {++nshift;}
2185 nybins_ = 9 + 16*nshift;
2189 temp2dy_.resize(boost::extents[nybins_][
BYSIZE]);
2195 for(i=0; i<9; ++
i) {
2196 for(j=0; j<
BYSIZE; ++j) {
2197 temp2dy_[i+ioff0][j]=ytemp_[
i][j];
2203 for(k=1; k<=nshift; ++
k) {
2205 for(i=0; i<8; ++
i) {
2206 for(j=0; j<
k; ++j) {
2207 temp2dy_[i+ioffm][
BYM1-j] = 0.f;
2209 for(j=0; j<BYSIZE-
k; ++j) {
2210 temp2dy_[i+ioffm][j]=ytemp_[
i][j+
k];
2214 for(i=1; i<9; ++
i) {
2215 for(j=0; j<
k; ++j) {
2216 temp2dy_[i+ioffp][j] = 0.f;
2218 for(j=0; j<BYSIZE-
k; ++j) {
2219 temp2dy_[i+ioffp][j+
k]=ytemp_[
i][j];
2239 if(i >= 0 && i < nybins_ && j <= i) {
2241 ytemplate[
k]=temp2dy_[
i][
k]+temp2dy_[j][
k];
2266 int ioff0, ioffp, ioffm;
2270 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2271 if(nxpix < 1 || nxpix >=
BXM3) {
2272 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::xtemp3d called with nxpix = " << nxpix << std::endl;
2275 assert(nxpix > 0 && nxpix <
BXM3);
2280 float diff = fabsf(nxpix - clslenx_)/2.f + 1.f;
2281 int nshift = (
int)diff;
2282 if((diff - nshift) > 0.5f) {++nshift;}
2286 nxbins_ = 9 + 16*nshift;
2290 temp2dx_.resize(boost::extents[nxbins_][
BXSIZE]);
2296 for(i=0; i<9; ++
i) {
2297 for(j=0; j<
BXSIZE; ++j) {
2298 temp2dx_[i+ioff0][j]=xtemp_[
i][j];
2304 for(k=1; k<=nshift; ++
k) {
2306 for(i=0; i<8; ++
i) {
2307 for(j=0; j<
k; ++j) {
2308 temp2dx_[i+ioffm][
BXM1-j] = 0.f;
2310 for(j=0; j<BXSIZE-
k; ++j) {
2311 temp2dx_[i+ioffm][j]=xtemp_[
i][j+
k];
2315 for(i=1; i<9; ++
i) {
2316 for(j=0; j<
k; ++j) {
2317 temp2dx_[i+ioffp][j] = 0.f;
2319 for(j=0; j<BXSIZE-
k; ++j) {
2320 temp2dx_[i+ioffp][j+
k]=xtemp_[
i][j];
2342 if(i >= 0 && i < nxbins_ && j <= i) {
2344 xtemplate[
k]=temp2dx_[
i][
k]+temp2dx_[j][
k];
2387 float& sigmay,
float& deltay,
float& sigmax,
float& deltax,
float& sy1,
float& dy1,
float& sy2,
2388 float& dy2,
float& sx1,
float& dx1,
float& sx2,
float& dx2)
2396 for(
int i=0;
i<(
int)thePixelTemp_.size(); ++
i) {
2397 if(
id == thePixelTemp_[
i].head.ID) {
2403 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2404 if(index < 0 || index >= (
int)thePixelTemp_.size()) {
2405 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::qbin can't find needed template ID = " <<
id << std::endl;
2408 assert(index >= 0 && index < (
int)thePixelTemp_.size());
2414 auto const & templ = thePixelTemp_[
index];
2422 auto cotalpha0 = thePixelTemp_[
index].enty[0].cotalpha;
2423 auto qcorrect=
std::sqrt((1.
f+cotbeta*cotbeta+cotalpha*cotalpha)/(1.
f+cotbeta*cotbeta+cotalpha0*cotalpha0));
2427 float cota = cotalpha;
2428 float cotb = abs_cotb_;
2429 bool flip_x =
false;
2430 bool flip_y =
false;
2431 switch(thePixelTemp_[index_id_].head.Dtype) {
2433 if(cotbeta < 0.
f) {flip_y =
true;}
2447 if(locBx*locBz < 0.
f) {
2459 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2460 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::illegal subdetector ID = " << thePixelTemp_[index_id_].head.Dtype << std::endl;
2462 std::cout <<
"SiPixelTemplate::illegal subdetector ID = " << thePixelTemp_[index_id_].head.Dtype << std::endl;
2470 auto qscale = thePixelTemp_[
index].head.qscale;
2480 auto Ny = thePixelTemp_[
index].head.NTy;
2481 auto Nyx = thePixelTemp_[
index].head.NTyx;
2482 auto Nxx = thePixelTemp_[
index].head.NTxx;
2484 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2485 if(Ny < 2 || Nyx < 1 || Nxx < 2) {
2486 throw cms::Exception(
"DataCorrupt") <<
"template ID = " << id_current_ <<
"has too few entries: Ny/Nyx/Nxx = " << Ny <<
"/" << Nyx <<
"/" << Nxx << std::endl;
2489 assert(Ny > 1 && Nyx > 0 && Nxx > 1);
2500 if (j==templ.cotbetaY+Ny) { --j; yratio = 1.f; }
2501 else if (j==templ.cotbetaY) { ++j; yratio = 0.f;}
2502 else { yratio = (cotb - (*(j-1)) )/( (*j) - (*(j-1)) ) ; }
2504 ihigh = j-templ.cotbetaY;
2512 dy1 = (1.f - yratio)*thePixelTemp_[index].enty[ilow].dyone + yratio*thePixelTemp_[index].enty[ihigh].dyone;
2513 if(flip_y) {dy1 = -dy1;}
2514 sy1 = (1.f - yratio)*thePixelTemp_[index].enty[ilow].syone + yratio*thePixelTemp_[index].enty[ihigh].syone;
2515 dy2 = (1.f - yratio)*thePixelTemp_[index].enty[ilow].dytwo + yratio*thePixelTemp_[index].enty[ihigh].dytwo;
2516 if(flip_y) {dy2 = -dy2;}
2517 sy2 = (1.f - yratio)*thePixelTemp_[index].enty[ilow].sytwo + yratio*thePixelTemp_[index].enty[ihigh].sytwo;
2519 auto qavg = (1.f - yratio)*thePixelTemp_[index].enty[ilow].qavg + yratio*thePixelTemp_[index].enty[ihigh].qavg;
2521 auto qmin = (1.f - yratio)*thePixelTemp_[index].enty[ilow].qmin + yratio*thePixelTemp_[index].enty[ihigh].qmin;
2523 auto qmin2 = (1.f - yratio)*thePixelTemp_[index].enty[ilow].qmin2 + yratio*thePixelTemp_[index].enty[ihigh].qmin2;
2527 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2528 if(qavg <= 0.
f || qmin <= 0.
f) {
2529 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::qbin, qavg or qmin <= 0," 2530 <<
" Probably someone called the generic pixel reconstruction with an illegal trajectory state" << std::endl;
2533 assert(qavg > 0.
f && qmin > 0.
f);
2538 auto qtotal = qscale*qclus;
2541 auto fq = qtotal/qavg;
2560 auto yavggen =(1.f - yratio)*thePixelTemp_[index].enty[ilow].yavggen[binq] + yratio*thePixelTemp_[index].enty[ihigh].yavggen[binq];
2561 if(flip_y) {yavggen = -yavggen;}
2562 auto yrmsgen =(1.f - yratio)*thePixelTemp_[index].enty[ilow].yrmsgen[binq] + yratio*thePixelTemp_[index].enty[ihigh].yrmsgen[binq];
2574 if (j==templ.cotbetaX+Nyx) { --j; yxratio = 1.f; }
2575 else if (j==templ.cotbetaX) { ++j; yxratio = 0.f;}
2576 else { yxratio = (acotb - (*(j-1)) )/( (*j) - (*(j-1)) ) ; }
2578 iyhigh = j-templ.cotbetaX;
2589 if (j==templ.cotalphaX+Nxx) { --j; xxratio = 1.f; }
2590 else if (j==templ.cotalphaX) { ++j; xxratio = 0.f;}
2591 else { xxratio = (cota - (*(j-1)) )/( (*j) - (*(j-1)) ) ; }
2593 ihigh = j-templ.cotalphaX;
2599 dx1 = (1.f - xxratio)*thePixelTemp_[index].entx[0][ilow].dxone + xxratio*thePixelTemp_[index].entx[0][ihigh].dxone;
2600 if(flip_x) {dx1 = -dx1;}
2601 sx1 = (1.f - xxratio)*thePixelTemp_[index].entx[0][ilow].sxone + xxratio*thePixelTemp_[index].entx[0][ihigh].sxone;
2602 dx2 = (1.f - xxratio)*thePixelTemp_[index].entx[0][ilow].dxtwo + xxratio*thePixelTemp_[index].entx[0][ihigh].dxtwo;
2603 if(flip_x) {dx2 = -dx2;}
2604 sx2 = (1.f - xxratio)*thePixelTemp_[index].entx[0][ilow].sxtwo + xxratio*thePixelTemp_[index].entx[0][ihigh].sxtwo;
2608 pixmx=(1.f - yxratio)*((1.
f - xxratio)*thePixelTemp_[
index].entx[iylow][ilow].pixmax + xxratio*thePixelTemp_[
index].entx[iylow][ihigh].pixmax)
2609 +yxratio*((1.
f - xxratio)*thePixelTemp_[
index].entx[iyhigh][ilow].pixmax + xxratio*thePixelTemp_[
index].entx[iyhigh][ihigh].pixmax);
2611 auto xavggen = (1.f - yxratio)*((1.
f - xxratio)*thePixelTemp_[
index].entx[iylow][ilow].xavggen[binq] + xxratio*thePixelTemp_[
index].entx[iylow][ihigh].xavggen[binq])
2612 +yxratio*((1.
f - xxratio)*thePixelTemp_[
index].entx[iyhigh][ilow].xavggen[binq] + xxratio*thePixelTemp_[
index].entx[iyhigh][ihigh].xavggen[binq]);
2613 if(flip_x) {xavggen = -xavggen;}
2615 auto xrmsgen = (1.f - yxratio)*((1.
f - xxratio)*thePixelTemp_[
index].entx[iylow][ilow].xrmsgen[binq] + xxratio*thePixelTemp_[
index].entx[iylow][ihigh].xrmsgen[binq])
2616 +yxratio*((1.
f - xxratio)*thePixelTemp_[
index].entx[iyhigh][ilow].xrmsgen[binq] + xxratio*thePixelTemp_[
index].entx[iyhigh][ihigh].xrmsgen[binq]);
2622 sigmay = yrmsgen; deltay = yavggen;
2624 sigmax = xrmsgen; deltax = xavggen;
2628 if(qtotal < 0.95
f*qmin) {binq = 5;}
else {
if(qtotal < 0.95
f*qmin2) {binq = 4;}}
2665 float& sigmay,
float& deltay,
float& sigmax,
float& deltax,
float& sy1,
float& dy1,
float& sy2,
2666 float& dy2,
float& sx1,
float& dx1,
float& sx2,
float& dx2)
2673 return SiPixelTemplate::qbin(
id, cotalpha, cotbeta, locBz, locBx, qclus, pixmx, sigmay, deltay, sigmax, deltax,
2674 sy1, dy1, sy2, dy2, sx1, dx1, sx2, dx2);
2726 float pixmx, sigmay, deltay, sigmax, deltax, sy1, dy1, sy2, dy2, sx1, dx1, sx2, dx2, locBz;
2729 if(cotbeta < 0.
f) {locBx = -1.f;}
2731 if(cotalpha < 0.
f) {locBz = -locBx;}
2733 return SiPixelTemplate::qbin(
id, cotalpha, cotbeta, locBz, locBx, qclus, pixmx, sigmay, deltay, sigmax, deltax,
2734 sy1, dy1, sy2, dy2, sx1, dx1, sx2, dx2);
2750 float pixmx, sigmay, deltay, sigmax, deltax, sy1, dy1, sy2, dy2, sx1, dx1, sx2, dx2, locBz, locBx;
2751 const float cotalpha = 0.f;
2753 if(cotbeta < 0.
f) {locBx = -1.f;}
2755 if(cotalpha < 0.
f) {locBz = -locBx;}
2756 return SiPixelTemplate::qbin(
id, cotalpha, cotbeta, locBz, locBx, qclus, pixmx, sigmay, deltay, sigmax, deltax,
2757 sy1, dy1, sy2, dy2, sx1, dx1, sx2, dx2);
2784 int ilow, ihigh, iylow, iyhigh, Ny, Nxx, Nyx,
index;
2785 float yratio, yxratio, xxratio;
2794 for(i=0; i<(
int)thePixelTemp_.size(); ++
i) {
2796 if(
id == thePixelTemp_[i].head.ID) {
2803 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2804 if(index < 0 || index >= (
int)thePixelTemp_.size()) {
2805 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::temperrors can't find needed template ID = " <<
id << std::endl;
2808 assert(index >= 0 && index < (
int)thePixelTemp_.size());
2812 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2813 if(qBin < 0 || qBin > 5) {
2814 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::temperrors called with illegal qBin = " << qBin << std::endl;
2817 assert(qBin >= 0 && qBin < 6);
2822 if(qBin > 3) {qBin = 3;}
2827 acotb = fabs((
double)cotbeta);
2848 Ny = thePixelTemp_[
index].head.NTy;
2849 Nyx = thePixelTemp_[
index].head.NTyx;
2850 Nxx = thePixelTemp_[
index].head.NTxx;
2852 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 2853 if(Ny < 2 || Nyx < 1 || Nxx < 2) {
2854 throw cms::Exception(
"DataCorrupt") <<
"template ID = " << id_current_ <<
"has too few entries: Ny/Nyx/Nxx = " << Ny <<
"/" << Nyx <<
"/" << Nxx << std::endl;
2857 assert(Ny > 1 && Nyx > 0 && Nxx > 1);
2865 if(cotb >= thePixelTemp_[index].enty[Ny-1].cotbeta) {
2872 if(cotb >= thePixelTemp_[index].enty[0].cotbeta) {
2874 for (i=0; i<Ny-1; ++
i) {
2876 if( thePixelTemp_[index].enty[i].cotbeta <= cotb && cotb < thePixelTemp_[index].enty[i+1].cotbeta) {
2879 yratio = (cotb - thePixelTemp_[
index].enty[
i].cotbeta)/(thePixelTemp_[index].enty[i+1].cotbeta - thePixelTemp_[index].enty[i].cotbeta);
2890 sy1 = (1.f - yratio)*thePixelTemp_[index].enty[ilow].syone + yratio*thePixelTemp_[index].enty[ihigh].syone;
2891 sy2 = (1.f - yratio)*thePixelTemp_[index].enty[ilow].sytwo + yratio*thePixelTemp_[index].enty[ihigh].sytwo;
2892 yrms=(1.f - yratio)*thePixelTemp_[index].enty[ilow].yrms[qBin] + yratio*thePixelTemp_[index].enty[ihigh].yrms[qBin];
2900 if(acotb >= thePixelTemp_[index].entx[Nyx-1][0].cotbeta) {
2905 }
else if(acotb >= thePixelTemp_[index].entx[0][0].cotbeta) {
2907 for (i=0; i<Nyx-1; ++
i) {
2909 if( thePixelTemp_[index].entx[i][0].cotbeta <= acotb && acotb < thePixelTemp_[index].entx[i+1][0].cotbeta) {
2912 yxratio = (acotb - thePixelTemp_[
index].entx[
i][0].cotbeta)/(thePixelTemp_[index].entx[i+1][0].cotbeta - thePixelTemp_[index].entx[i][0].cotbeta);
2923 if(cotalpha >= thePixelTemp_[index].entx[0][Nxx-1].cotalpha) {
2930 if(cotalpha >= thePixelTemp_[index].entx[0][0].cotalpha) {
2932 for (i=0; i<Nxx-1; ++
i) {
2934 if( thePixelTemp_[index].entx[0][i].cotalpha <= cotalpha && cotalpha < thePixelTemp_[index].entx[0][i+1].cotalpha) {
2937 xxratio = (cotalpha - thePixelTemp_[
index].entx[0][
i].cotalpha)/(thePixelTemp_[index].entx[0][i+1].cotalpha - thePixelTemp_[index].entx[0][i].cotalpha);
2946 sx1 = (1.f - xxratio)*thePixelTemp_[index].entx[0][ilow].sxone + xxratio*thePixelTemp_[index].entx[0][ihigh].sxone;
2947 sx2 = (1.f - xxratio)*thePixelTemp_[index].entx[0][ilow].sxtwo + xxratio*thePixelTemp_[index].entx[0][ihigh].sxtwo;
2949 xrms=(1.f - yxratio)*((1.
f - xxratio)*thePixelTemp_[
index].entx[iylow][ilow].xrms[
qBin] + xxratio*thePixelTemp_[
index].entx[iylow][ihigh].xrms[
qBin])
2950 +yxratio*((1.
f - xxratio)*thePixelTemp_[
index].entx[iyhigh][ilow].xrms[
qBin] + xxratio*thePixelTemp_[
index].entx[iyhigh][ihigh].xrms[
qBin]);
2976 void SiPixelTemplate::qbin_dist(
int id,
float cotalpha,
float cotbeta,
float qbin_frac[4],
float& ny1_frac,
float& ny2_frac,
float& nx1_frac,
float& nx2_frac)
2983 int ilow, ihigh, iylow, iyhigh, Ny, Nxx, Nyx,
index;
2984 float yratio, yxratio, xxratio;
2992 for(i=0; i<(
int)thePixelTemp_.size(); ++
i) {
2994 if(
id == thePixelTemp_[i].head.ID) {
3002 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 3003 if(index < 0 || index >= (
int)thePixelTemp_.size()) {
3004 throw cms::Exception(
"DataCorrupt") <<
"SiPixelTemplate::temperrors can't find needed template ID = " <<
id << std::endl;
3007 assert(index >= 0 && index < (
int)thePixelTemp_.size());
3014 acotb = fabs((
double)cotbeta);
3036 Ny = thePixelTemp_[
index].head.NTy;
3037 Nyx = thePixelTemp_[
index].head.NTyx;
3038 Nxx = thePixelTemp_[
index].head.NTxx;
3040 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 3041 if(Ny < 2 || Nyx < 1 || Nxx < 2) {
3042 throw cms::Exception(
"DataCorrupt") <<
"template ID = " << id_current_ <<
"has too few entries: Ny/Nyx/Nxx = " << Ny <<
"/" << Nyx <<
"/" << Nxx << std::endl;
3045 assert(Ny > 1 && Nyx > 0 && Nxx > 1);
3053 if(cotb >= thePixelTemp_[index].enty[Ny-1].cotbeta) {
3060 if(cotb >= thePixelTemp_[index].enty[0].cotbeta) {
3062 for (i=0; i<Ny-1; ++
i) {
3064 if( thePixelTemp_[index].enty[i].cotbeta <= cotb && cotb < thePixelTemp_[index].enty[i+1].cotbeta) {
3067 yratio = (cotb - thePixelTemp_[
index].enty[
i].cotbeta)/(thePixelTemp_[index].enty[i+1].cotbeta - thePixelTemp_[index].enty[i].cotbeta);
3077 ny1_frac = (1.f - yratio)*thePixelTemp_[index].enty[ilow].fracyone + yratio*thePixelTemp_[index].enty[ihigh].fracyone;
3078 ny2_frac = (1.f - yratio)*thePixelTemp_[index].enty[ilow].fracytwo + yratio*thePixelTemp_[index].enty[ihigh].fracytwo;
3085 if(acotb >= thePixelTemp_[index].entx[Nyx-1][0].cotbeta) {
3090 }
else if(acotb >= thePixelTemp_[index].entx[0][0].cotbeta) {
3092 for (i=0; i<Nyx-1; ++
i) {
3094 if( thePixelTemp_[index].entx[i][0].cotbeta <= acotb && acotb < thePixelTemp_[index].entx[i+1][0].cotbeta) {
3097 yxratio = (acotb - thePixelTemp_[
index].entx[
i][0].cotbeta)/(thePixelTemp_[index].entx[i+1][0].cotbeta - thePixelTemp_[index].entx[i][0].cotbeta);
3108 if(cotalpha >= thePixelTemp_[index].entx[0][Nxx-1].cotalpha) {
3115 if(cotalpha >= thePixelTemp_[index].entx[0][0].cotalpha) {
3117 for (i=0; i<Nxx-1; ++
i) {
3119 if( thePixelTemp_[index].entx[0][i].cotalpha <= cotalpha && cotalpha < thePixelTemp_[index].entx[0][i+1].cotalpha) {
3122 xxratio = (cotalpha - thePixelTemp_[
index].entx[0][
i].cotalpha)/(thePixelTemp_[index].entx[0][i+1].cotalpha - thePixelTemp_[index].entx[0][i].cotalpha);
3131 for(i=0; i<3; ++
i) {
3132 qfrac[
i]=(1.f - yxratio)*((1.
f - xxratio)*thePixelTemp_[
index].entx[iylow][ilow].qbfrac[
i] + xxratio*thePixelTemp_[
index].entx[iylow][ihigh].qbfrac[
i])
3133 +yxratio*((1.
f - xxratio)*thePixelTemp_[
index].entx[iyhigh][ilow].qbfrac[
i] + xxratio*thePixelTemp_[
index].entx[iyhigh][ihigh].qbfrac[
i]);
3135 nx1_frac = (1.f - yxratio)*((1.
f - xxratio)*thePixelTemp_[
index].entx[iylow][ilow].fracxone + xxratio*thePixelTemp_[
index].entx[iylow][ihigh].fracxone)
3136 +yxratio*((1.
f - xxratio)*thePixelTemp_[
index].entx[iyhigh][ilow].fracxone + xxratio*thePixelTemp_[
index].entx[iyhigh][ihigh].fracxone);
3137 nx2_frac = (1.f - yxratio)*((1.
f - xxratio)*thePixelTemp_[
index].entx[iylow][ilow].fracxtwo + xxratio*thePixelTemp_[
index].entx[iylow][ihigh].fracxtwo)
3138 +yxratio*((1.
f - xxratio)*thePixelTemp_[
index].entx[iyhigh][ilow].fracxtwo + xxratio*thePixelTemp_[
index].entx[iyhigh][ihigh].fracxtwo);
3142 qbin_frac[0] = qfrac[0];
3143 qbin_frac[1] = qbin_frac[0] + qfrac[1];
3144 qbin_frac[2] = qbin_frac[1] + qfrac[2];
3165 float x0, y0, xf, yf,
xi, yi, sf, si, s0, qpix, slopey, slopex, ds;
3166 int i, j, jpix0, ipix0, jpixf, ipixf, jpix, ipix, nx, ny, anx,
any, jmax, imax;
3169 std::list<SimplePixel>
list;
3170 std::list<SimplePixel>::iterator listIter, listEnd;
3174 x0 = xhit - 0.5*zsize_*cota_current_;
3175 y0 = yhit - 0.5*zsize_*cotb_current_;
3177 jpix0 = floor(x0/xsize_)+1;
3178 ipix0 = floor(y0/ysize_)+1;
3180 if(jpix0 < 0 || jpix0 >
BXM3) {
return false;}
3181 if(ipix0 < 0 || ipix0 >
BYM3) {
return false;}
3183 xf = xhit + 0.5*zsize_*cota_current_ + lorxwidth_;
3184 yf = yhit + 0.5*zsize_*cotb_current_ + lorywidth_;
3186 jpixf = floor(xf/xsize_)+1;
3187 ipixf = floor(yf/ysize_)+1;
3189 if(jpixf < 0 || jpixf > BXM3) {
return false;}
3190 if(ipixf < 0 || ipixf > BYM3) {
return false;}
3194 sf =
std::sqrt((xf-x0)*(xf-x0) + (yf-y0)*(yf-y0));
3195 if((xf-x0) != 0.
f) {slopey = (yf-y0)/(xf-x0);}
else { slopey = 1.e10;}
3196 if((yf-y0) != 0.f) {slopex = (xf-x0)/(yf-y0);}
else { slopex = 1.e10;}
3209 list.push_back(element);
3217 for(j=jpix0; j<jpixf; ++j) {
3219 yi = slopey*(xi-x0) + y0;
3220 ipix = (
int)(yi/ysize_)+1;
3221 si =
std::sqrt((xi-x0)*(xi-x0) + (yi-y0)*(yi-y0));
3228 list.push_back(element);
3231 for(j=jpix0; j>jpixf; --j) {
3233 yi = slopey*(xi-x0) + y0;
3234 ipix = (
int)(yi/ysize_)+1;
3235 si =
std::sqrt((xi-x0)*(xi-x0) + (yi-y0)*(yi-y0));
3242 list.push_back(element);
3251 for(i=ipix0; i<ipixf; ++
i) {
3253 xi = slopex*(yi-y0) + x0;
3254 jpix = (
int)(xi/xsize_)+1;
3255 si =
std::sqrt((xi-x0)*(xi-x0) + (yi-y0)*(yi-y0));
3262 list.push_back(element);
3265 for(i=ipix0; i>ipixf; --
i) {
3267 xi = slopex*(yi-y0) + x0;
3268 jpix = (
int)(xi/xsize_)+1;
3269 si =
std::sqrt((xi-x0)*(xi-x0) + (yi-y0)*(yi-y0));
3276 list.push_back(element);
3290 for(i=1; i<imax; ++
i) {
3292 listIter = list.begin();
3294 while(listIter != list.end()) {
3295 if(listIter->i == i && listIter->btype == 2) {
3296 listIter = list.erase(listIter);
3299 if(listIter->i > i) {
3305 while(listIter != list.end()) {
3306 if(listIter->i == i+1 && listIter->btype == 2) {
3307 listIter = list.erase(listIter);
3310 if(listIter->i > i+1) {
3319 for(j=1; j<jmax; ++j) {
3321 listIter = list.begin();
3323 while(listIter != list.end()) {
3324 if(listIter->j == j && listIter->btype == 1) {
3325 listIter = list.erase(listIter);
3328 if(listIter->j > j) {
3334 while(listIter != list.end()) {
3335 if(listIter->j == j+1 && listIter->btype == 1) {
3336 listIter = list.erase(listIter);
3339 if(listIter->j > j+1) {
3351 listIter = list.begin();
3352 listEnd = list.end();
3353 for( ;listIter != listEnd; ++listIter) {
3359 if(sf > 0.
f) { qpix = qtotal*ds/sf;}
else {qpix = qtotal;}
3360 template2d[j][
i] += qpix;
3379 int ilow, ihigh, Ny;
3380 float yratio, cotb, cotalpha0,
arg;
3384 cotalpha0 = thePixelTemp_[index_id_].enty[0].cotalpha;
3385 arg = cotb_current_*cotb_current_ + cota_current_*cota_current_ - cotalpha0*cotalpha0;
3386 if(arg < 0.
f) arg = 0.f;
3391 Ny = thePixelTemp_[index_id_].head.NTy;
3393 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 3395 throw cms::Exception(
"DataCorrupt") <<
"template ID = " << id_current_ <<
"has too few entries: Ny = " << Ny << std::endl;
3406 if(cotb >= thePixelTemp_[index_id_].enty[Ny-1].cotbeta) {
3413 if(cotb >= thePixelTemp_[index_id_].enty[0].cotbeta) {
3415 for (i=0; i<Ny-1; ++
i) {
3417 if( thePixelTemp_[index_id_].enty[i].cotbeta <= cotb && cotb < thePixelTemp_[index_id_].enty[i+1].cotbeta) {
3420 yratio = (cotb - thePixelTemp_[index_id_].enty[
i].cotbeta)/(thePixelTemp_[index_id_].enty[i+1].cotbeta - thePixelTemp_[index_id_].enty[i].cotbeta);
3431 mpvvav_ = (1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].mpvvav + yratio*thePixelTemp_[index_id_].enty[ihigh].mpvvav;
3432 sigmavav_ = (1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].sigmavav + yratio*thePixelTemp_[index_id_].enty[ihigh].sigmavav;
3433 kappavav_ = (1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].kappavav + yratio*thePixelTemp_[index_id_].enty[ihigh].kappavav;
3438 mpv = (double)mpvvav_;
3439 sigma = (double)sigmavav_;
3440 kappa = (double)kappavav_;
3457 int ilow, ihigh, Ny;
3458 float yratio, cotb, cotalpha0,
arg;
3462 cotalpha0 = thePixelTemp_[index_id_].enty[0].cotalpha;
3463 arg = cotb_current_*cotb_current_ + cota_current_*cota_current_ - cotalpha0*cotalpha0;
3464 if(arg < 0.
f) arg = 0.f;
3469 Ny = thePixelTemp_[index_id_].head.NTy;
3471 #ifndef SI_PIXEL_TEMPLATE_STANDALONE 3473 throw cms::Exception(
"DataCorrupt") <<
"template ID = " << id_current_ <<
"has too few entries: Ny = " << Ny << std::endl;
3484 if(cotb >= thePixelTemp_[index_id_].enty[Ny-1].cotbeta) {
3491 if(cotb >= thePixelTemp_[index_id_].enty[0].cotbeta) {
3493 for (i=0; i<Ny-1; ++
i) {
3495 if( thePixelTemp_[index_id_].enty[i].cotbeta <= cotb && cotb < thePixelTemp_[index_id_].enty[i+1].cotbeta) {
3498 yratio = (cotb - thePixelTemp_[index_id_].enty[
i].cotbeta)/(thePixelTemp_[index_id_].enty[i+1].cotbeta - thePixelTemp_[index_id_].enty[i].cotbeta);
3509 mpvvav2_ = (1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].mpvvav2 + yratio*thePixelTemp_[index_id_].enty[ihigh].mpvvav2;
3510 sigmavav2_ = (1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].sigmavav2 + yratio*thePixelTemp_[index_id_].enty[ihigh].sigmavav2;
3511 kappavav2_ = (1.f - yratio)*thePixelTemp_[index_id_].enty[ilow].kappavav2 + yratio*thePixelTemp_[index_id_].enty[ihigh].kappavav2;
3515 mpv = (double)mpvvav2_;
3516 sigma = (double)sigmavav2_;
3517 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)
constexpr bool isFinite(T x)
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]
29 Barrel x templates spanning cluster lengths from -6px (-1.125Rad) to +6px (+1.125Rad) in each of 5...
float ygsig[4]
average sigma_y from Gaussian fit binned in 4 charge bins
SiPixelTemplateEntry enty[60]
60 Barrel y templates spanning cluster lengths from 0px to +18px [28 entries for fpix] ...
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