Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace 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
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerator
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
Classes
Class List
Class Index
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
z
Enumerations
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
Enumerator
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
Properties
Related Functions
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
v
w
x
z
Files
File List
File 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
l
m
n
o
p
q
r
s
t
u
v
w
x
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
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
v
x
z
Enumerator
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
Macros
_
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
GitLab
LXR
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Reconstruction
PanTau
PanTauAlgs
Root
Reconstruction/PanTau/PanTauAlgs/Root/HelperFunctions.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
PanTauAlgs/HelperFunctions.h
"
6
#include "
PanTauAlgs/TauConstituent.h
"
7
#include "Math/SpecFuncMathMore.h"
8
#include "TMath.h"
9
#include "TLorentzVector.h"
10
#include "TVector3.h"
11
#include <vector>
12
#include <sstream>
13
#include <cmath>
14
15
std::string
PanTau::HelperFunctions::convertNumberToString
(
double
x
)
const
{
16
std::stringstream tmpStream;
17
tmpStream <<
x
;
18
return
tmpStream.str();
19
}
20
21
22
int
PanTau::HelperFunctions::getBinIndex
(
const
std::vector<double>& binEdges,
double
value
)
const
{
23
int
resBin = -1;
24
for
(
unsigned
int
i
=0;
i
<binEdges.size()-1;
i
++) {
25
double
lowerEdge = binEdges[
i
];
26
double
upperEdge = binEdges[
i
+1];
27
if
(lowerEdge <=
value
&&
value
< upperEdge) resBin =
i
;
28
}
29
if
(resBin == -1) {
30
ATH_MSG_WARNING
(
"Could not find matching bin for value "
<<
value
<<
" in these bin edges:"
);
31
for
(
unsigned
int
i
=0;
i
<binEdges.size();
i
++)
ATH_MSG_WARNING
(
"\tbin edge "
<<
i
<<
": "
<< binEdges[
i
]);
32
}
33
return
resBin;
34
}
35
36
37
double
PanTau::HelperFunctions::stddev
(
double
sumOfSquares,
double
sumOfValues,
int
numConsts)
const
{
38
// calculate standard deviations according to:
39
// sigma^2 = (sum_i x_i^2) / N - ((sum_i x_i)/N)^2 (biased maximum-likelihood estimate)
40
// directly set sigma^2 to 0 in case of N=1, otherwise numerical effects may yield very small negative sigma^2
41
if
(numConsts == 1)
return
0;
42
double
a
= sumOfSquares / ((
double
)numConsts);
43
double
b
= sumOfValues / ((
double
)numConsts);
44
double
stdDev =
a
-
b
*
b
;
45
if
(stdDev < 0.) stdDev = 0;
46
return
std::sqrt(stdDev);
47
}
48
49
50
double
PanTau::HelperFunctions::deltaRprime
(
const
TVector3& vec1,
const
TVector3&
vec2
)
const
{
51
const
double
a
= vec1.DeltaPhi(
vec2
);
52
const
double
b
= vec1.Theta() -
vec2
.Theta();
53
double
dRprime = std::sqrt(
a
*
a
+
b
*
b
);
54
return
dRprime;
55
}
56
D3PDMakerTestInstan::vec2
std::vector< D3PDTest::MyVec2 > vec2
Definition:
D3PDMakerTestDict.h:14
HelperFunctions.h
athena.value
value
Definition:
athena.py:124
x
#define x
PanTau::HelperFunctions::deltaRprime
virtual double deltaRprime(const TVector3 &vec1, const TVector3 &vec2) const
Definition:
Reconstruction/PanTau/PanTauAlgs/Root/HelperFunctions.cxx:50
TauConstituent.h
lumiFormat.i
int i
Definition:
lumiFormat.py:85
PanTau::HelperFunctions::getBinIndex
virtual int getBinIndex(const std::vector< double > &binEdges, double value) const
Definition:
Reconstruction/PanTau/PanTauAlgs/Root/HelperFunctions.cxx:22
PanTau::HelperFunctions::convertNumberToString
virtual std::string convertNumberToString(double x) const
Definition:
Reconstruction/PanTau/PanTauAlgs/Root/HelperFunctions.cxx:15
xAOD::double
double
Definition:
CompositeParticle_v1.cxx:159
plotBeamSpotMon.b
b
Definition:
plotBeamSpotMon.py:77
a
TList * a
Definition:
liststreamerinfos.cxx:10
PanTau::HelperFunctions::stddev
virtual double stddev(double sumOfSquares, double sumOfValues, int numConsts) const
Definition:
Reconstruction/PanTau/PanTauAlgs/Root/HelperFunctions.cxx:37
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition:
AthMsgStreamMacros.h:32
Generated on Sun Apr 27 2025 21:11:26 for ATLAS Offline Software by
1.8.18