43 cout <<
"DTBtiChip::findTrig called" << endl;
57 int RON =
config()->RONflag();
59 for(
int i=0;
i<32;
i++){
64 for(
int hl=0;hl<2;hl++){
66 if( keepTrigPatt(PTMS[0],0,1,hl) )
return;
68 if( keepTrigPatt(PTMS[1],1,2,hl) )
return;
69 if( keepTrigPatt(PTMS[2],2,1,hl) )
return;
70 if( keepTrigPatt(PTMS[3],3,1,hl) )
return;
71 if( keepTrigPatt(PTMS[4],4,3,hl) )
return;
72 if( keepTrigPatt(PTMS[5],5,1,hl) )
return;
73 if( keepTrigPatt(PTMS[6],6,1,hl) )
return;
74 if( keepTrigPatt(PTMS[7],7,5,hl) )
return;
75 if( keepTrigPatt(PTMS[8],8,6,hl) )
return;
76 if( keepTrigPatt(PTMS[9],9,7,hl) )
return;
77 if( keepTrigPatt(PTMS[10],10,1,hl) )
return;
78 if( keepTrigPatt(PTMS[11],11,1,hl) )
return;
79 if( keepTrigPatt(PTMS[12],12,6,hl) )
return;
80 if( keepTrigPatt(PTMS[13],13,1,hl) )
return;
81 if( keepTrigPatt(PTMS[14],14,1,hl) )
return;
82 if( keepTrigPatt(PTMS[15],15,5,hl) )
return;
83 if( keepTrigPatt(PTMS[16],16,1,hl) )
return;
84 if( keepTrigPatt(PTMS[17],17,1,hl) )
return;
85 if( keepTrigPatt(PTMS[18],18,1,hl) )
return;
86 if( keepTrigPatt(PTMS[19],19,4,hl) )
return;
87 if( keepTrigPatt(PTMS[20],20,1,hl) )
return;
88 if( keepTrigPatt(PTMS[21],21,1,hl) )
return;
89 if( keepTrigPatt(PTMS[22],22,7,hl) )
return;
90 if( keepTrigPatt(PTMS[23],23,3,hl) )
return;
91 if( keepTrigPatt(PTMS[24],24,2,hl) )
return;
92 if( keepTrigPatt(PTMS[25],25,4,hl) )
return;
93 if( keepTrigPatt(PTMS[26],26,1,hl) )
return;
95 if( keepTrigPatt(PTMS[27],27,2,hl) )
return;
96 if( keepTrigPatt(PTMS[28],28,1,hl) )
return;
97 if( keepTrigPatt(PTMS[29],29,1,hl) )
return;
98 if( keepTrigPatt(PTMS[30],30,1,hl) )
return;
99 if( keepTrigPatt(PTMS[31],31,1,hl) )
return;
332 int AC1 =
config()->AccPattAC1();
333 int AC2 =
config()->AccPattAC2();
334 int ACH =
config()->AccPattACH();
335 int ACL =
config()->AccPattACL();
336 int tiKes =
config()->XON();
339 cout <<
"DTBtiChip::keepTrigPatt called with arguments: ";
340 cout << eq <<
", " << pattType <<
", " << hlflag << endl;
341 cout<<
"AC1,AC2,ACH,ACL="<<AC1<<
" "<<AC2<<
" "<<ACH<<
" "<<ACL<<endl;
349 int K0 = int (
config()->ST());
352 float Keqfloat[6] = {0,0,0,0,0,0};
355 int mk = (int)(_Keq[eq][i] - K0);
357 if(
abs(mk) > 2*K0)
continue;
358 Keqfloat[
i]=_Keq[
eq][
i];
359 mm[
i]=(int)(_Keq[eq][i]);
379 acceptMask(&val0,mm[0],AC2);
380 acceptMask(&val1,mm[1],AC2);
381 acceptMask(&val2,mm[2],AC2);
386 acceptMask(&val0,mm[0],AC1);
387 acceptMask(&val1,mm[1],ACL);
388 acceptMask(&val2,mm[2],AC1);
392 acceptMask(&val0,mm[0],AC1);
393 acceptMask(&val1,mm[1],AC1);
394 acceptMask(&val2,mm[2],ACL);
398 acceptMask(&val0,mm[0],ACL);
399 acceptMask(&val1,mm[1],AC1);
400 acceptMask(&val2,mm[2],AC1);
404 acceptMask(&val0,mm[0],AC1);
405 acceptMask(&val1,mm[1],ACH);
406 acceptMask(&val2,mm[2],AC1);
410 acceptMask(&val0,mm[0],AC1);
411 acceptMask(&val1,mm[1],AC1);
412 acceptMask(&val2,mm[2],ACH);
416 acceptMask(&val0,mm[0],ACH);
417 acceptMask(&val1,mm[1],AC1);
418 acceptMask(&val2,mm[2],AC1);
422 acceptMask(&val0,mm[0],AC2);
423 acceptMask(&val1,mm[1],AC2);
424 acceptMask(&val2,mm[2],AC2);
430 acceptMask(&val3,mm[3],acc);
431 acceptMask(&val4,mm[4],acc);
440 cout <<
" dump of val arrays: " << endl;
487 store(eq,code,LKMax,X,Keqfloat[0],Keqfloat[1],
488 Keqfloat[2],Keqfloat[3],Keqfloat[4],Keqfloat[5]);
497 int RON =
config()->RONflag();
502 cout <<
"SelTrig: searching low-B" << endl;
513 if(eq==3 || eq==13 || eq==17 || eq==21 || eq==29){
515 cout <<
"SelTrig: doing XON suppression!"<<endl;
524 cout <<
"SelTrig: doing RON low triggers suppression!"<<endl;
538 store(eq,code,LKMax,X,Keqfloat[0],Keqfloat[1],
539 Keqfloat[2],Keqfloat[3],Keqfloat[4],Keqfloat[5]);
547 cout <<
"SelTrig: searching low-C" << endl;
557 if(eq==0 || eq==6 || eq==10 || eq==16 || eq==26 || eq==30){
559 cout <<
"SelTrig: doing XON suppression!"<<endl;
574 store(eq,code,LKMax,X,Keqfloat[0],Keqfloat[1],
575 Keqfloat[2],Keqfloat[3],Keqfloat[4],Keqfloat[5]);
586 acceptMask(&val0,mm[0],AC1);
587 acceptMask(&val1,mm[1],AC1);
588 acceptMask(&val2,mm[2],AC1);
593 cout <<
"SelTrig: searching low-A" << endl;
596 if(val==3 && i==mm[4]){
603 if(eq==9 || eq==19 || eq==22 || eq==25 ){
605 cout <<
"SelTrig: doing low-A XON suppression!"<<endl;
613 cout <<
"SelTrig: doing RON low triggers suppression!"<<endl;
623 store(eq,code,LKMax,
int(_Xeq[eq][0]),Keqfloat[0],Keqfloat[1],
624 Keqfloat[2],Keqfloat[3],Keqfloat[4],Keqfloat[5]);
633 cout <<
"SelTrig: searching low-D" << endl;
636 if(val==3 && i==mm[3]){
643 if(eq==4 || eq==8 || eq==12 || eq==23){
645 cout <<
"SelTrig: doing XON suppression!"<<endl;
652 if(eq==1 || eq==2 || eq==3 || eq==24 || eq==25){
654 cout <<
"SelTrig: doing RON low triggers suppression!"<<endl;
664 store(eq,code,LKMax,
int(_Xeq[eq][0]),Keqfloat[0],Keqfloat[1],
665 Keqfloat[2],Keqfloat[3],Keqfloat[4],Keqfloat[5]);
682 cout<<
"DTBtiChip::acceptMask -> Setting acceptance for k="<<k<<endl;
715 cout<<
"DTBtiChip::acceptMask -> END "<<endl;
725 cout <<
"DTBtiChip::keepTrig called with arguments: ";
726 cout << eq <<
", " << acp <<
", " << code << endl;
736 int mk = (int)(2*_Keq[eq][i]);
739 mm[
i]=(int)(_Keq[eq][i]*2)+KCen;
747 if(mm[0]>0 && (code==8 || code==3 || code==4) ){
751 if(acp==2 && (code==8 || code==3) ) {
757 if(mm[1]>0 && (code==8 || code==1 || code==4) ){
761 if(acp==2 && code==8 ) {
767 if(mm[2]>0 && (code==8 || code==1 || code==2) ){
771 if(acp==2 && (code==8 || code==2) ) {
777 if(mm[3]>0 && (code==8 || code==2 || code==4) ){
783 if(mm[4]>0 && (code==8 || code==1 || code==3) ){
789 if(mm[5]>0 && (code==8 || code==2 || code==3) ){
795 cout <<
" dump of val arrays: " << endl;
833 if (KMax==6 && code==8) {
834 store(eq,8,LKMax-KCen,
int(_Xeq[eq][1]));
836 }
else if (KMax==3 && code!=8) {
837 if(code==1 || code==4) {
838 store(eq,code,LKMax-KCen,
int(_Xeq[eq][0]));
840 store(eq,code,LKMax-KCen,
int(_Xeq[eq][1]));
int keepTrig(const int eq, const int acp, const int code)
int element(const int pos) const
int keepTrigPatt(int flag, const int eq, const int pattType, int hlflag)
std::ostream & print(std::ostream &o=std::cout) const
void acceptMask(BitArray< 80 > *BitArrPtr, int k, int accep)