13double eToADU(
double charge)
15 double minADC = -96000;
16 double maxADC = 288000;
17 double unitADC = (maxADC - minADC) / 1024.0;
18 return round(std::min(maxADC, std::max(minADC, charge)) / unitADC);
21int main(
int argc,
const char* argv[])
24 int input = atof(argv[1]);
25 std::cout <<
"Electrons: " << input <<
" ADU: " << eToADU(input) << std::endl;
27 std::cout <<
"Give charge in electrons as command-line parameter" << std::endl;