5 #include "EEsmdPlain.h"
8 EEsmdPlain::EEsmdPlain(){
14 hitOver=dotArray+oneOff;
19 void EEsmdPlain::set(
float th,
int nd,
char uv0) {
25 assert(len+2<MaxSmdStrips);
27 memset(pattXX,
'.',len);
32 memset(pattX,
'.',len);
36 printf(
"Set %c-plain , nDot=%d, thrE/MeV=%.2f, pattXX='%s'\n",uv,nDot,thresE*1000.,pattXX);
41 void EEsmdPlain::clear(){
42 memset(dotArray,
'.',
sizeof(dotArray));
43 dotArray[2*oneOff+MaxSmdStrips]=0;
45 memset(iStrip,-1,
sizeof(iStrip));
46 memset(type,0,
sizeof(type));
51 void EEsmdPlain::print(
int k){
52 printf(
"nMatch=%d to plain='%c' \n",nMatch,uv);
54 for(i=0;i<nMatch;i++) printf(
"i=%d, iStrip=%d type=%d\n",i,iStrip[i],type[i]);
57 printf(
"%c-plain , X-off=%d, nDot='%s'\n",uv,nDot,pattXX);
60 for(i=0;i<MaxSmdStrips;i++) {
61 if(hitOver[i]==0)
break;
62 if(i%50==0) printf(
"\ni=%3d ",i);
63 if(i%10==0) printf(
" ");
64 printf(
"%c",hitOver[i]);
71 void EEsmdPlain::findMipPattern(){
79 while((p=strstr(p,pattXX))) {
81 assert(j>=0 && j<MaxSmdStrips);
88 #if 1 //smdMap -- take it off for mapping test
91 while((p=strstr(p,pattX))) {
94 assert(j>=0 && j<MaxSmdStrips);
106 void EEsmdPlain::scanAdc(
float *val,
float thr) {
109 for(istrip=0;istrip<MaxSmdStrips;istrip++) {
110 if( val[istrip]>thr) hitOver[istrip]=
'x';