ATLAS Offline Software
PhysicsAnalysis
DerivationFramework
DerivationFrameworkSUSY
src
PdgConditional.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
PdgConditional.h
"
6
#include <cmath>
//for std::abs
7
8
9
namespace
DerivationFramework
{
10
PdgConditional::PdgConditional
():m_condition(0){
11
//nop
12
}
13
PdgConditional::PdgConditional
(
int
equalInt):m_condition(equalInt){
14
//nop
15
}
16
PdgConditional::PdgConditional
(
unsigned
equalInt):m_condition(equalInt){
17
//nop
18
}
19
20
PdgConditional::PdgConditional
(std::function<
bool
(
int
)>
b
):m_condition(
b
){
21
//nop
22
}
23
24
bool
25
PdgConditional::operator==
(
int
v
)
const
{
26
//compare with the held integer
27
if
(std::holds_alternative<int>(
m_condition
)){
28
auto
rawValue = std::get<0>(
m_condition
);
29
return
v
== rawValue;
30
}
31
//use abs(value) if the held integer is unsigned
32
if
(std::holds_alternative<unsigned>(
m_condition
)){
33
auto
rawValue = std::get<1>(
m_condition
);
34
return
unsigned
(std::abs(
v
)) == rawValue;
35
}
36
//otherwise use user-defined binary predicate
37
return
std::get<2>(
m_condition
)(
v
);
38
}
39
40
}
DerivationFramework::PdgConditional::operator==
bool operator==(int v) const
Definition:
PdgConditional.cxx:25
xAOD::unsigned
unsigned
Definition:
RingSetConf_v1.cxx:662
PdgConditional.h
DerivationFramework
THE reconstruction tool.
Definition:
ParticleSortingAlg.h:24
plotBeamSpotMon.b
b
Definition:
plotBeamSpotMon.py:77
python.PyAthena.v
v
Definition:
PyAthena.py:154
DerivationFramework::PdgConditional::m_condition
const std::variant< int, unsigned, std::function< bool(int)> > m_condition
Definition:
PdgConditional.h:30
DerivationFramework::PdgConditional::PdgConditional
PdgConditional()
Definition:
PdgConditional.cxx:10
Generated on Thu Nov 7 2024 21:23:21 for ATLAS Offline Software by
1.8.18