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
Generators
TruthUtils
TruthUtils
DecayProducts.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
#ifndef TRUTHUTILS_DECAYPRODUCTS_H
5
#define TRUTHUTILS_DECAYPRODUCTS_H
6
#include <vector>
7
#include <type_traits>
8
#include <algorithm>
9
#include <map>
10
#include <vector>
13
template
<
class
T>
class
DecayBase
{
14
public
:
15
void
count
(
const
int
c
) {
m_pids
[
c
]++;
m_apids
[std::abs(
c
)]++;
m_size
++;}
16
int
pd
(
int
i
)
const
{
return
m_pids
.count(
i
)?
m_pids
.at(
i
):0; }
17
int
pd
(
int
i1,
int
i2)
const
{
int
ret = 0;
for
(
auto
&
a
:
m_pids
)
if
(i1 <=
a
.first &&
a
.first <= i2) ret +=
a
.second;
return
ret; }
18
int
apd
(
int
i1,
int
i2)
const
{
int
ret = 0;
for
(
auto
&
a
:
m_apids
)
if
(i1 <=
a
.first &&
a
.first <= i2) ret +=
a
.second;
return
ret; }
19
int
apd
(
int
i
)
const
{
return
m_apids
.count(
i
)?
m_apids
.at(
i
):0; }
20
int
pd
(
const
std::vector<int>&
i
)
const
{
int
ret = 0;
for
(
auto
ii:
i
) ret +=
pd
(ii);
return
ret;}
21
int
apd
(
const
std::vector<int>&
i
)
const
{
int
ret = 0;
for
(
auto
ii:
i
) ret +=
apd
(ii);
return
ret; }
22
size_t
size
()
const
{
return
m_size
; }
23
int
apply
(
bool
(*func)(
const
int
&))
const
{
int
ret = 0;
for
(
auto
&
a
:
m_pids
)
if
(func(
a
.first)) ret+=
a
.second;
return
ret; }
24
std::map<int,int>
m_pids
;
25
std::map<int,int>
m_apids
;
26
size_t
m_size
;
27
};
28
#ifdef ATLASHEPMC_GENEVENT_H
29
#ifdef ATLASHEPMC_GENPARTICLE_H
30
template <class Y,std::enable_if_t<std::is_same<Y, HepMC::GenParticlePtr>::value
||
std::is_same<Y, HepMC::ConstGenParticlePtr>::value
,
bool
> =
true
>
31
DecayBase<Y>
DecayProducts(
const
Y
&
p
) {
32
DecayBase<Y>
t
;
33
auto
v
=
p
->end_vertex();
34
if
(
v
)
for
(
auto
prod: *
v
)
if
(prod)
t
.count(prod->pdg_id());
35
return
t
;
36
}
37
#endif
38
#ifdef ATLASHEPMC_GENVERTEX_H
39
template <class Y,std::enable_if_t<std::is_same<Y, HepMC::GenVertexPtr>::value
||
std::is_same<Y, HepMC::ConstGenVertexPtr>::value
,
bool
> =
true
>
40
DecayBase<Y>
DecayProducts(
const
Y
&
p
) {
41
DecayBase<Y>
t
;
42
if
(
p
)
for
(
auto
prod: *
p
)
if
(prod)
t
.count(prod->pdg_id());
43
return
t
;
44
}
45
#endif
46
#endif
47
#ifdef XAODTRUTH_TRUTHPARTICLE_H
48
template <class Y,std::enable_if_t<std::is_same<Y, xAOD::TruthParticle>::value
,
bool
> =
true
>
49
DecayBase<Y>
DecayProducts(
const
Y
&
p
) {
50
DecayBase<Y>
t
;
51
auto
v
=
p
.end_vertex();
52
if
(
v
)
for
(
auto
prod:
v
->particles_out())
if
(prod)
t
.count(prod->pdg_id());
53
return
t
;
54
}
55
template <class Y,std::enable_if_t<std::is_same<Y, xAOD::TruthParticle*>::value
||
std::is_same<Y, xAOD::TruthParticle const*>::value
,
bool
> =
true
>
56
DecayBase<Y>
DecayProducts(
const
Y
&
p
) {
57
DecayBase<Y>
t
;
58
auto
v
=
p
->end_vertex();
59
if
(
v
)
for
(
auto
prod:
v
->particles_out())
if
(prod)
t
.count(prod->pdg_id());
60
return
t
;
61
}
62
template
<
class
Y,std::enable_if_t<std::is_same<Y, std::vector<const xAOD::TruthParticle*> >::value,
bool
> = true>
63
DecayBase<Y>
DecayProducts(
const
Y
&
p
) {
64
DecayBase<Y>
t
;
65
for
(
auto
prod:
p
)
if
(prod)
t
.count(prod->pdg_id());
66
return
t
;
67
}
68
#endif
69
#ifdef XAODTRUTH_TRUTHVERTEX_H
70
template <class Y,std::enable_if_t<std::is_same<Y, xAOD::TruthVertex*>::value
||
std::is_same<Y, xAOD::TruthVertex const*>::value
,
bool
> =
true
>
71
DecayBase<Y>
DecayProducts(
const
Y
&
p
) {
72
DecayBase<Y>
t
;
73
if
(
p
)
for
(
auto
prod:
p
->particles_out())
if
(prod)
t
.count(prod->pdg_id());
74
return
t
;
75
}
76
#endif
77
#endif
DecayBase::apply
int apply(bool(*func)(const int &)) const
Definition:
DecayProducts.h:23
DecayBase::apd
int apd(int i1, int i2) const
Definition:
DecayProducts.h:18
DecayBase
A class that allows for a fast calculation of the flavours of the descendants of a vertex,...
Definition:
DecayProducts.h:13
athena.value
value
Definition:
athena.py:124
read_hist_ntuple.t
t
Definition:
read_hist_ntuple.py:5
DecayBase::size
size_t size() const
Definition:
DecayProducts.h:22
DecayBase::m_size
size_t m_size
Definition:
DecayProducts.h:26
DecayBase::apd
int apd(int i) const
Definition:
DecayProducts.h:19
DecayBase::m_pids
std::map< int, int > m_pids
Definition:
DecayProducts.h:24
python.utils.AtlRunQueryDQUtils.p
p
Definition:
AtlRunQueryDQUtils.py:210
lumiFormat.i
int i
Definition:
lumiFormat.py:85
Monitored::Y
@ Y
Definition:
HistogramFillerUtils.h:24
DecayBase::pd
int pd(int i1, int i2) const
Definition:
DecayProducts.h:17
python.PyAthena.v
v
Definition:
PyAthena.py:154
a
TList * a
Definition:
liststreamerinfos.cxx:10
DecayBase::pd
int pd(const std::vector< int > &i) const
Definition:
DecayProducts.h:20
DecayBase::m_apids
std::map< int, int > m_apids
Definition:
DecayProducts.h:25
python.compressB64.c
def c
Definition:
compressB64.py:93
DecayBase::count
void count(const int c)
Definition:
DecayProducts.h:15
DecayBase::pd
int pd(int i) const
Definition:
DecayProducts.h:16
DecayBase::apd
int apd(const std::vector< int > &i) const
Definition:
DecayProducts.h:21
Generated on Tue Apr 1 2025 21:09:33 for ATLAS Offline Software by
1.8.18