Belle II Software
release-06-02-00
Main Page
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
z
Variables
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
w
z
Typedefs
a
b
c
d
e
i
k
l
m
n
p
r
s
t
u
v
w
Enumerations
Enumerator
c
d
f
p
t
u
v
w
Classes
Class List
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Enumerations
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
Enumerator
a
b
c
d
e
f
g
h
k
l
m
n
o
p
r
s
t
u
v
w
z
Related Functions
b
c
d
g
i
o
r
s
t
Files
File List
File Members
All
Functions
eToADU.cc
1
/**************************************************************************
2
* basf2 (Belle II Analysis Software Framework) *
3
* Author: The Belle II Collaboration *
4
* *
5
* See git log for contributors and copyright holders. *
6
* This file is licensed under LGPL-3.0, see LICENSE.md. *
7
**************************************************************************/
8
9
#include <iostream>
10
#include <math.h>
11
13
double
eToADU(
double
charge)
14
{
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);
19
}
20
21
int
main
(
int
argc,
const
char
* argv[])
22
{
23
if
(argc) {
24
int
input = atof(argv[1]);
25
std::cout <<
"Electrons: "
<< input <<
" ADU: "
<< eToADU(input) << std::endl;
26
}
else
{
27
std::cout <<
"Give charge in electrons as command-line parameter"
<< std::endl;
28
}
29
return
0;
30
}
31
32
33
34
main
int main(int argc, char **argv)
Run all tests.
Definition:
test_main.cc:75
svd
online
tools
eToADU.cc
Generated on Thu Dec 28 2023 02:31:45 for Belle II Software by
1.9.1