Belle II Software
release-05-01-25
eToADU.cc
1
/*
2
* eToADU.cc
3
*
4
* Created on: Jan 10, 2014
5
* Author: kvasnicka
6
*/
7
8
#include <iostream>
9
#include <math.h>
10
12
double
eToADU(
double
charge)
13
{
14
double
minADC = -96000;
15
double
maxADC = 288000;
16
double
unitADC = (maxADC - minADC) / 1024.0;
17
return
round(std::min(maxADC, std::max(minADC, charge)) / unitADC);
18
}
19
20
int
main
(
int
argc,
const
char
* argv[])
21
{
22
if
(argc) {
23
int
input = atof(argv[1]);
24
std::cout <<
"Electrons: "
<< input <<
" ADU: "
<< eToADU(input) << std::endl;
25
}
else
{
26
std::cout <<
"Give charge in electrons as command-line parameter"
<< std::endl;
27
}
28
return
0;
29
}
30
31
32
33
main
int main(int argc, char **argv)
Run all tests.
Definition:
test_main.cc:77
svd
online
tools
eToADU.cc
Generated on Fri Nov 5 2021 03:58:30 for Belle II Software by
1.8.17