ATLAS Offline Software
Typedefs | Functions | Variables
JetGroupUnionTest.cxx File Reference
#include "CxxUtils/checker_macros.h"
#include "gtest/gtest.h"
#include "TrigHLTJetHypo/../src/JetGroupUnion.h"
#include <vector>
#include <map>
Include dependency graph for JetGroupUnionTest.cxx:

Go to the source code of this file.

Typedefs

using res = std::pair< std::vector< unsigned int >, bool >
 
using vec = std::vector< unsigned int >
 

Functions

 TEST (JetGroupUnionTester, empty)
 
 TEST (JetGroupUnionTester, one_elementary_cond)
 
 TEST (JetGroupUnionTester, two_elem_nooverlap)
 
 TEST (JetGroupUnionTester, two_elem_withoverlap)
 

Variables

 ATLAS_NO_CHECK_FILE_THREAD_SAFETY
 

Typedef Documentation

◆ res

using res = std::pair<std::vector<unsigned int>, bool>

Definition at line 13 of file JetGroupUnionTest.cxx.

◆ vec

using vec = std::vector<unsigned int>

Definition at line 14 of file JetGroupUnionTest.cxx.

Function Documentation

◆ TEST() [1/4]

TEST ( JetGroupUnionTester  ,
empty   
)

Definition at line 16 of file JetGroupUnionTest.cxx.

16  {
17  std::vector<std::size_t> siblings;
18  CondInd2JetGroupsInds satisfiedBy;
19 
20  auto collector = std::unique_ptr<ITrigJetHypoInfoCollector>(nullptr);
21 
22  JetGroupUnion jgu(siblings, satisfiedBy);
23 
24  EXPECT_TRUE(jgu.next(collector).empty());
25 }

◆ TEST() [2/4]

TEST ( JetGroupUnionTester  ,
one_elementary_cond   
)

Definition at line 28 of file JetGroupUnionTest.cxx.

28  {
29  std::vector<std::size_t> siblings{0};
30 
31  CondInd2JetGroupsInds satisfiedBy;
32  satisfiedBy[0] = std::vector<std::size_t> {0, 1, 2};
33 
34  auto collector = std::unique_ptr<ITrigJetHypoInfoCollector>(nullptr);
35 
36  JetGroupUnion jgu(siblings, satisfiedBy);
37 
38  auto exp = std::vector<std::size_t>{0, 1, 2};
39  EXPECT_EQ(jgu.next(collector), exp);
40  EXPECT_TRUE(jgu.next(collector).empty());
41 }

◆ TEST() [3/4]

TEST ( JetGroupUnionTester  ,
two_elem_nooverlap   
)

Definition at line 44 of file JetGroupUnionTest.cxx.

44  {
45  std::vector<std::size_t> siblings{0, 1};
46 
47  CondInd2JetGroupsInds satisfiedBy;
48  satisfiedBy[0] = std::vector<std::size_t> {0, 1, 2};
49  satisfiedBy[1] = std::vector<std::size_t> {3, 4, 5};
50  auto collector = std::unique_ptr<ITrigJetHypoInfoCollector>(nullptr);
51 
52  JetGroupUnion jgu(siblings, satisfiedBy);
53 
54  auto exp = std::vector<std::size_t>{0, 1, 2, 3, 4, 5};
55  EXPECT_EQ(jgu.next(collector), exp);
56  EXPECT_TRUE(jgu.next(collector).empty());
57 }

◆ TEST() [4/4]

TEST ( JetGroupUnionTester  ,
two_elem_withoverlap   
)

Definition at line 59 of file JetGroupUnionTest.cxx.

59  {
60  std::vector<std::size_t> siblings{0, 1};
61 
62  CondInd2JetGroupsInds satisfiedBy;
63  satisfiedBy[0] = std::vector<std::size_t> {0, 1, 2};
64  satisfiedBy[1] = std::vector<std::size_t> {3, 1, 5};
65 
66  auto collector = std::unique_ptr<ITrigJetHypoInfoCollector>(nullptr);
67 
68  JetGroupUnion jgu(siblings, satisfiedBy);
69 
70  auto exp = std::vector<std::size_t>{0, 1, 2, 3, 5};
71  EXPECT_EQ(jgu.next(collector), exp);
72  EXPECT_TRUE(jgu.next(collector).empty());
73 }

Variable Documentation

◆ ATLAS_NO_CHECK_FILE_THREAD_SAFETY

ATLAS_NO_CHECK_FILE_THREAD_SAFETY

Definition at line 6 of file JetGroupUnionTest.cxx.

JetGroupUnion
Definition: JetGroupUnion.h:20
CondInd2JetGroupsInds
std::map< int, std::vector< std::size_t > > CondInd2JetGroupsInds
Definition: JetGroupProduct.h:15
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36