ATLAS Offline Software
Trigger
TrigHypothesis
TrigHLTJetHypoUnitTests
tests
TreeTest.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 "
CxxUtils/checker_macros.h
"
6
ATLAS_NO_CHECK_FILE_THREAD_SAFETY
;
7
8
#include "gtest/gtest.h"
9
#include "
TrigHLTJetHypo/../src/Tree.h
"
10
#include <vector>
11
#include <map>
12
13
using
res
= std::pair<std::vector<unsigned int>,
bool
>;
14
using
vec
= std::vector<std::size_t>;
15
16
TEST
(TreeTester, empty) {
17
std::vector<std::size_t>
parents
;
18
19
Tree
tree
(
parents
);
20
21
EXPECT_EQ(
tree
.size(), 0
u
);
22
}
23
24
25
TEST
(TreeTester, simple) {
26
std::vector<std::size_t>
parents
{0
u
, 0
u
, 0
u
};
27
28
Tree
tree
(
parents
);
29
30
vec
leaves {1
u
, 2
u
};
31
EXPECT_EQ(
tree
.size(), 3
u
);
32
EXPECT_EQ(
tree
.leaves(), leaves);
33
EXPECT_FALSE(
tree
.is_leaf(0
u
));
34
EXPECT_TRUE(
tree
.is_leaf(1
u
));
35
EXPECT_TRUE(
tree
.is_leaf(1
u
));
36
37
EXPECT_TRUE(
tree
.is_simple());
38
39
}
40
41
42
TEST
(TreeTester, notsimple) {
43
std::vector<std::size_t>
parents
{0
u
, 0
u
, 1
u
};
44
45
Tree
tree
(
parents
);
46
47
vec
leaves {2
u
};
48
EXPECT_EQ(
tree
.size(), 3
u
);
49
EXPECT_EQ(
tree
.leaves(), leaves);
50
EXPECT_FALSE(
tree
.is_leaf(0
u
));
51
EXPECT_FALSE(
tree
.is_leaf(1
u
));
52
EXPECT_TRUE(
tree
.is_leaf(2
u
));
53
54
EXPECT_FALSE(
tree
.is_simple());
55
56
}
57
Tree
Definition:
Tree.h:18
python.DecayParser.parents
parents
print ("==> buf:",buf)
Definition:
DecayParser.py:31
tree
TChain * tree
Definition:
tile_monitor.h:30
TEST
TEST(TreeTester, empty)
Definition:
TreeTest.cxx:16
vec
std::vector< size_t > vec
Definition:
CombinationsGeneratorTest.cxx:12
ATLAS_NO_CHECK_FILE_THREAD_SAFETY
ATLAS_NO_CHECK_FILE_THREAD_SAFETY
Definition:
TreeTest.cxx:6
Trk::u
@ u
Enums for curvilinear frames.
Definition:
ParamDefs.h:77
res
std::pair< std::vector< unsigned int >, bool > res
Definition:
JetGroupProductTest.cxx:14
Tree.h
checker_macros.h
Define macros for attributes used to control the static checker.
Generated on Thu Nov 7 2024 21:29:19 for ATLAS Offline Software by
1.8.18