93 {
94
95
96 int lflag[44][288] = { {0} };
97 int pflag[44][288] = { {0} };
98 int ix,iy,iyp,iyn,cellMax;
99
100
101 int ipoison=0;
102
104
105
106 int k=0;
109 k++;
111 }
112
113
114 if (ipoison){
115 for (ix=0; ix<lastlay; ix++){
117
118 for (iy=0; iy<cellMax; iy++){
119 iyp=iy+1; if (iyp == cellMax)iyp=0;
120 iyn=iy-1; if (iyn == -1)iyn=cellMax-1;
121 if ((lflag[ix][iyp] != 0) && (lflag[ix][iyn] != 0)) {
122 pflag[ix][iy] = 1;
123 lflag[ix][iy] = 0;
124
125 }
126 }
127
128 }
129 }
130
134
135
136 for (
sl = 0;
sl < lastsl;
sl++) {
138 int l0=fsl, l1=fsl+1, l2=fsl+2, l3=fsl+3;
139 int iprt = 0;
140
144 for (
int i = 0; i < nslay; i++) layArray[i] = slayer->
layer(i);
146 cout<<
"slayer No. "<<slayer->
index()<<endl;
147 }
148
149 cellMax = layArray[1]->
nWires();
150
151
152 for (int cellIndex=0; cellIndex<cellMax ; cellIndex++) {
154 unsigned int sig_mark = 0;
155 for (int ilayer = l0; ilayer <= l3; ilayer++) {
156 for (int iwire = 3; iwire >= 0; iwire--) {
157 if (lflag[ilayer][w[4*(ilayer-l0)+iwire]]) {
158 sig_mark |= 0x1;
159 }
160 sig_mark <<= 1;
161 }
162 }
163 sig_mark >>= 1;
164
165 int goodSegNo = 0;
167 int iPat = (sig_mark & 0x0200) ? 0 : 11;
168 for ( ; iPat < nPat; iPat++) {
170 if ((pat & sig_mark) == pat) {
172 cout<< "pat " << std::hex << pat << std::dec << " with wire";
173 for (int tmpi = 0; tmpi < 4; tmpi++) {
175 }
176 cout << endl;
177 }
182 int tw[4] = {w0, w1, w2, w3};
183
185 for (int iamb = 0; iamb < namb; iamb++) {
190 <<" <? csmax4 "<<csmax_4<< endl;
192 cout<<"Accept this seg"<<endl;
193 }else{
194 cout<<"DROP this seg"<<endl;
195 }
196 }
201 goodSegNo++;
202 }
203 }
204 }
205 }
206 if (goodSegNo != 0) continue;
208 iPat = (sig_mark & 0x0200) ? 0 : 14;
209 for ( ; iPat < nPat; iPat++) {
210 if (iPat > nPat-3) {
211 if ((iPat == nPat-2) && (sig_mark&0x2121 == 0x2121)) continue;
212 if ((iPat == nPat-1) && (sig_mark&0x2122 == 0x2122)) continue;
213 }
215 if ((pat & sig_mark) == pat) {
217 cout<<"MdcxFindSegs: in pat "<<std::hex<<pat<<std::dec<<" with wire";
218 for (int tmpi = 0; tmpi < 4; tmpi++) {
220 cout<<
" (" << l0+tmpi <<
"," << w[4*tmpi+
m_segPat.
wirePat3[iPat][tmpi]-1] <<
")";
221 }
222 cout<< endl;
223 }
224 int wn[3];
225 for (int iw = 0, iwp = 0; iwp < 4; iwp++) {
227 if(
wireNo == 0 )
continue;
228 wn[iw++] = lflag[l0+iwp][w[4*iwp+
wireNo-1]] - 1;
229 }
230
232 for (int iamb = 0; iamb < namb; iamb++) {
237 <<" <? csmax3 "<<csmax_3<< endl;
239 cout<<"Accept this seg"<<endl;
240 }else{
241 cout<<"DROP this seg"<<endl;
242 }
243 }
248 }
249 }
250 }
251 }
252 }
253 }
254
256 cout <<
"MdcxFindSegs found " <<
MdcxSeglist.length() <<
" segs" << endl;
257 }
258 return;
259}
AIDA::IHistogram1D * g_csmax3
AIDA::IHistogram1D * g_csmax4
const MdcLayer * Layer(unsigned id) const
void appendseg(MdcxFittedHel &fithel, int pat, int amb)
MdcxFittedHel trial(int i1, int i2, int i3, int i4, int amb)
void printseg(MdcxFittedHel &fithel, int pat, int amb, int subtry=0)
static const unsigned patt4[14]
static const int ambigPatt4[14][4]
static const int wirePat4[14][4]
static const int ambigPatt3[20][4]
static const int patt4_size
static const int ambPat3_size[20]
static const int ambPat4_size[14]
static const unsigned patt3[20]
static const int wirePat3[20][4]
static const int patt3_size