171 sort(medb.begin(), medb.end());
172 sort(medp.begin(), medp.end());
174 vector<float> devb(40);
175 for (
int i=0;
i<40;
i++)
178 vector<float> devp(160);
179 for (
int i=0; i<160; i++)
182 sort(devb.begin(), devb.end());
183 sort(devp.begin(), devp.end());
185 const double mb = (medb[19]+medb[20])/2;
186 const double mp = (medp[79]+medp[80])/2;
188 const double db = devb[27];
189 const double dp = devp[109];
192 if (mb==0 || mp==0 || db==0 || dp==0)
196 Out() <<
Tools::Form(
"Boards: Med=%3.1f +- %3.1f Hz Patches: Med=%3.1f +- %3.1f Hz", mb, db, mp, dp) << endl;
198 bool changed =
false;
200 for (
int i=0; i<40; i++)
210 const float dif = fabs(sdata.
fBoardRate[i]-mb)/db;
214 Out() <<
"Board " << setw(3) << i <<
": " << dif <<
" dev away from med" << endl;
219 for (
int j=1; j<4; j++)
227 for (
int j=0; j<4; j++)
236 const float step = (log10(sdata.
fPatchRate[i*4+j])-log10(mp+3.5*dp))/0.039;
238 changed |=
Step(i*4+j, step);
245 const float step = (log10(sdata.
fPatchRate[i*4+j])-log10(mp+3.5*dp))/0.039;
246 changed |=
Step(i*4+j, step);
250 const float step = -1.5*(log10(mp+dp)-log10(mp))/0.039;
251 changed |=
Step(i*4+j, step);
std::ostream & Out() const
void SendCommandNB(const std::string &command)
bool Step(int idx, float step)
vector< uint32_t > fThresholds