1183 if (!
CheckDataSize(d,
"Feedback:CalibratedCurrents", (416+1+1+1+1+1+416+1+1)*
sizeof(
float)+
sizeof(uint32_t)))
1186 const float *ptr = d.
Ptr<
float>();
1188 double power_tot = 0;
1189 double power_apd = 0;
1194 for (
int i=0;
i<320;
i++)
1197 if (
i==66 ||
i==191 ||
i==193)
1208 double Iapd = ptr[
i] * 1e-6;
1209 double Iout = Iapd*N;
1211 double UdrpCam = 1000 *Iout;
1212 double UdrpApd = (R5+2000)*Iout;
1220 power_tot += pwrCam;
1223 power_apd += pwrApd;
1228 power_apd /= (320-3)*1e-3;
1240 vector<float> val(320, 0);
1241 for (
int i=0;
i<320;
i++)
1248 WriteCam(d,
"cam-biascontrol-current", val, 100);
1255 vector<float> cpy(ptr, ptr+320);
1259 const Statistics stat(cpy);
1301 out << setprecision(3);
1304 out << col1 <<
'\t' << stat.min <<
'\n';
1305 out << col2 <<
'\t' << stat.med <<
'\n';
1306 out << col3 <<
'\t' << stat.avg <<
'\n';
1307 out << col4 <<
'\t' << stat.max <<
'\n';
1308 out <<
HTML::kWhite <<
'\t' << power_tot <<
"W [" << power_apd <<
"mW]\n";
1309 ofstream(
fPath+
"/current.data") << out.str();
1313 const float Unom = ptr[2*416+6];
1314 const float Utmp = ptr[2*416+7];
1316 vector<float> Uov(ptr+416+6, ptr+416+6+320);
1318 WriteCam(d,
"cam-feedback-overvoltage", Uov, 0.2, -0.1);
1320 const Statistics stat2(Uov);
1324 out << setprecision(3);
1331 ofstream(
fPath+
"/feedback.data") << out.str();
int GetCurrentState() const
return the current state of the machine
static const string kYellow
bool CheckDataSize(const EventImp &d, const char *name, size_t size, bool min=false)
deque< float > fBiasControlCurrentHist
void WriteHist(const EventImp &d, const string &fname, const T &t, double scale, double offset=0)
vector< float > fBiasControlVoltageVec
float fBiasControlPowerTot
static const string kWhite
uint64_t GetJavaDate() const
static const string kGreen
float fBiasControlCurrentMed
float fBiasControlCurrentMax
void WriteCam(const EventImp &d, const string &fname, const T &t, double scale, double offset=0)
const T * Ptr(size_t offset=0) const
const PixelMapEntry & hv(int board, int channel) const