10 void SetPattern(
int patternNumber);
13 void CheckPattern(
char* txtFileName,
int patternNumber=4)
15 SetPattern(patternNumber);
18 ifs.open(txtFileName);
19 int ew,pp,tt,ilev,adc;
21 for (
int i=0; i<744; i++){
22 ifs >> ew >> pp >> tt >> ilev >> adc;
23 int ewindex=(ew<0)?0:1;
24 if (ilev!=level[ewindex][pp-1][tt-1]){
25 cout <<
"MISMATCH!!! ew/pp/tt = " << ew <<
"/" << pp <<
"/" << tt <<
"\n";
31 cout <<
"Matching file " << txtFileName <<
" with Pattern " << patternNumber <<
" yields " << nerrors <<
" errors\n";
36 void SetPattern(
int patternNumber){
39 for (
int ew=0; ew<2; ew++){
40 for (
int pp=1; pp<13; pp++){
41 for (
int tt=1; tt<32; tt++){
42 level[ew][pp-1][tt-1]=-1;
47 switch (patternNumber){
49 for (
int pp=1; pp<13; pp++){
50 for (
int tt=1; tt<32; tt++){
51 level[0][pp-1][tt-1] = 1;
52 level[1][pp-1][tt-1] = 2;
57 for (
int ew=0; ew<2; ew++){
58 for (
int pp=1; pp<13; pp++){
61 if ((pp>4)&&(pp<9)) lev=1;
63 for (
int tt=1; tt<32; tt++){
64 level[ew][pp-1][tt-1]=lev;
70 for (
int ew=0; ew<2; ew++){
71 for (
int pp=1; pp<13; pp++){
72 for (
int tt=1; tt<32; tt++){
73 if ((pp==1)||(pp==5)||(pp==9)) level[ew][pp-1][tt-1]=0;
74 if ((pp==2)||(pp==6)||(pp==10)) level[ew][pp-1][tt-1]=1;
75 if ((pp==4)||(pp==8)||(pp==12)) level[ew][pp-1][tt-1]=2;
76 if ((pp==3)||(pp==7)||(pp==11)){
78 level[ew][pp-1][tt-1] = 1;
81 level[ew][pp-1][tt-1] = 2;
89 for (
int ew=0; ew<2; ew++){
90 for (
int pp=1; pp<13; pp++){
91 for (
int tt=1; tt<32; tt+=2){
92 if ((pp==1)||(pp==2)||(pp==5)||(pp==6)||(pp==9)||(pp==10)) level[ew][pp-1][tt-1] = 0;
93 if ((pp==4)||(pp==8)||(pp==12)) level[ew][pp-1][tt-1] = 1;
94 if ((pp==3)||(pp==7)||(pp==11)) level[ew][pp-1][tt-1] = 2;
96 for (
int tt=2; tt<32; tt+=2){
97 if ((pp==3)||(pp==7)||(pp==11)) level[ew][pp-1][tt-1] = 0;
98 if ((pp==1)||(pp==2)||(pp==5)||(pp==6)||(pp==9)||(pp==10)) level[ew][pp-1][tt-1] = 1;
99 if ((pp==4)||(pp==8)||(pp==12)) level[ew][pp-1][tt-1] = 2;
105 for (
int ew=0; ew<2; ew++){
106 for (
int pp=1; pp<13; pp++){
107 for (
int tt=1; tt<12; tt+=2){
108 level[ew][pp-1][tt-1] = 0;
110 for (
int tt=13; tt<22; tt+=2){
111 level[ew][pp-1][tt-1] = 1;
113 for (
int tt=23; tt<32; tt+=2){
114 level[ew][pp-1][tt-1] = 2;
117 for (
int tt=2; tt<11; tt+=2){
118 level[ew][pp-1][tt-1] = 0;
120 for (
int tt=12; tt<21; tt+=2){
121 level[ew][pp-1][tt-1] = 1;
123 for (
int tt=22; tt<31; tt+=2){
124 level[ew][pp-1][tt-1] = 2;
130 for (
int ew=0; ew<2; ew++){
131 for (
int pp=1; pp<13; pp++){
132 level[ew][pp-1][1-1] = 0;
133 level[ew][pp-1][2-1] = 0;
134 level[ew][pp-1][3-1] = 0;
135 level[ew][pp-1][4-1] = 0;
136 level[ew][pp-1][5-1] = 1;
137 level[ew][pp-1][6-1] = 1;
138 level[ew][pp-1][7-1] = 1;
139 level[ew][pp-1][8-1] = 1;
140 level[ew][pp-1][9-1] = 2;
141 level[ew][pp-1][10-1] =2 ;
142 level[ew][pp-1][11-1] = 2;
143 level[ew][pp-1][12-1] = 0;
144 level[ew][pp-1][13-1] = 0;
145 level[ew][pp-1][14-1] = 0;
146 level[ew][pp-1][15-1] = 0;
147 level[ew][pp-1][16-1] = 1;
148 level[ew][pp-1][17-1] = 1;
149 level[ew][pp-1][18-1] = 1;
150 level[ew][pp-1][19-1] = 1;
151 level[ew][pp-1][20-1] = 2;
152 level[ew][pp-1][21-1] = 2;
153 level[ew][pp-1][22-1] = 0;
154 level[ew][pp-1][23-1] = 0;
155 level[ew][pp-1][24-1] = 0;
156 level[ew][pp-1][25-1] = 0;
157 level[ew][pp-1][26-1] = 1;
158 level[ew][pp-1][27-1] = 1;
159 level[ew][pp-1][28-1] = 1;
160 level[ew][pp-1][29-1] = 1;
161 level[ew][pp-1][30-1] = 2;
162 level[ew][pp-1][31-1] = 2;
167 for (
int ew=0; ew<2; ew++){
168 for (
int pp=1; pp<13; pp++){
169 level[ew][pp-1][1-1] = 0;
170 level[ew][pp-1][2-1] = 0;
171 level[ew][pp-1][3-1] = 1;
172 level[ew][pp-1][4-1] = 1;
173 level[ew][pp-1][5-1] = 0;
174 level[ew][pp-1][6-1] = 0;
175 level[ew][pp-1][7-1] = 1;
176 level[ew][pp-1][8-1] = 1;
177 level[ew][pp-1][9-1] = 0;
178 level[ew][pp-1][10-1] = 2;
179 level[ew][pp-1][11-1] = 1;
180 level[ew][pp-1][12-1] = 0;
181 level[ew][pp-1][13-1] = 0;
182 level[ew][pp-1][14-1] = 1;
183 level[ew][pp-1][15-1] = 1;
184 level[ew][pp-1][16-1] = 0;
185 level[ew][pp-1][17-1] = 0;
186 level[ew][pp-1][18-1] = 1;
187 level[ew][pp-1][19-1] = 1;
188 level[ew][pp-1][20-1] = 2;
189 level[ew][pp-1][21-1] = 2;
190 level[ew][pp-1][22-1] = 0;
191 level[ew][pp-1][23-1] = 0;
192 level[ew][pp-1][24-1] = 1;
193 level[ew][pp-1][25-1] = 1;
194 level[ew][pp-1][26-1] = 0;
195 level[ew][pp-1][27-1] = 0;
196 level[ew][pp-1][28-1] = 1;
197 level[ew][pp-1][29-1] = 1;
198 level[ew][pp-1][30-1] = 2;
199 level[ew][pp-1][31-1] = 2;
204 cout <<
"No! not allowed pattern!\n";
209 for (
int ew=0; ew<2; ew++){
210 for (
int pp=1; pp<13; pp++){
211 for (
int tt=1; tt<32; tt++){
212 if (level[ew][pp-1][tt-1]<0)
213 cout <<
"Hey, no level set for EW=" << ew <<
" PP=" << pp <<
" TT=" << tt << endl;