ATLAS Offline Software
Classes | Functions | Variables
xAODJetCollectorTest.cxx File Reference
#include "CxxUtils/checker_macros.h"
#include "xAODJet/Jet.h"
#include "TrigHLTJetHypo/TrigHLTJetHypoUtils/xAODJetAsIJet.h"
#include "../src/TLorentzVectorAsIJet.h"
#include "TrigHLTJetHypo/../src/xAODJetCollector.h"
#include <TLorentzVector.h>
#include "gtest/gtest.h"
Include dependency graph for xAODJetCollectorTest.cxx:

Go to the source code of this file.

Classes

class  xAODJetCollectorTest
 

Functions

 TEST_F (xAODJetCollectorTest, zeroJets)
 
 TEST_F (xAODJetCollectorTest, multipleInputJets)
 
 TEST_F (xAODJetCollectorTest, nonXAODJets)
 

Variables

 ATLAS_NO_CHECK_FILE_THREAD_SAFETY
 

Function Documentation

◆ TEST_F() [1/3]

TEST_F ( xAODJetCollectorTest  ,
multipleInputJets   
)

Definition at line 37 of file xAODJetCollectorTest.cxx.

37  {
38  //multiple jets in. Jet collector is not empty and has the correct number.
39 
40  constexpr std::size_t njets{11};
41  std::vector<xAOD::Jet> xaodjets (njets);
43  jets.reserve (njets);
44  for(unsigned int ijet = 0; ijet < njets; ++ijet){
45  jets.emplace_back (new HypoJet::xAODJetAsIJet(&xaodjets[ijet], ijet));
46  }
47 
48  xAODJetCollector collector;
49  collector.addJets(jets.begin(), jets.end());
50 
51  EXPECT_FALSE(collector.empty());
52  EXPECT_FALSE((collector.xAODJets()).size() == 10);
53 }

◆ TEST_F() [2/3]

TEST_F ( xAODJetCollectorTest  ,
nonXAODJets   
)

Definition at line 56 of file xAODJetCollectorTest.cxx.

56  {
57  // multiple non-xAOD jets in. Jet collector is empty.
58 
59  unsigned int njets{11};
61  jets.reserve (njets);
62  for(unsigned int ijet = 0; ijet < njets; ++ijet){
63  TLorentzVector v;
64  jets.emplace_back (new TLorentzVectorAsIJet(v));
65  }
66 
67  xAODJetCollector collector;
68  collector.addJets(jets.begin(), jets.end());
69 
70  // These hypoJets are not xAOD jets.
71  EXPECT_FALSE(collector.empty());
72  EXPECT_TRUE(collector.size() == njets);
73  EXPECT_TRUE((collector.hypoJets()).size() == njets);
74  EXPECT_TRUE((collector.xAODJets()).size() == 0);
75 }

◆ TEST_F() [3/3]

TEST_F ( xAODJetCollectorTest  ,
zeroJets   
)

Definition at line 27 of file xAODJetCollectorTest.cxx.

27  {
28  // zero jets in. Jet collector is empty.
29 
31  xAODJetCollector collector;
32  collector.addJets(jets.begin(), jets.end());
33  EXPECT_TRUE(collector.empty());
34 }

Variable Documentation

◆ ATLAS_NO_CHECK_FILE_THREAD_SAFETY

ATLAS_NO_CHECK_FILE_THREAD_SAFETY

Definition at line 6 of file xAODJetCollectorTest.cxx.

xAODJetCollector::hypoJets
HypoJetVector hypoJets() const
Definition: xAODJetCollector.cxx:44
xAODJetCollector::xAODJets
std::vector< const xAOD::Jet * > xAODJets() const
Definition: xAODJetCollector.cxx:18
xAODJetCollector::size
std::size_t size() const
Definition: xAODJetCollector.cxx:66
xAODJetCollector::addJets
void addJets(const HypoJetCIter &begin, const HypoJetCIter &end, int chainPartInd=-1)
Definition: xAODJetCollector.cxx:10
HypoJetVector
std::vector< pHypoJet > HypoJetVector
Definition: HypoJetDefs.h:27
xAODJetCollector::empty
bool empty() const
Definition: xAODJetCollector.cxx:68
xAODJetCollector
Definition: xAODJetCollector.h:20
TLorentzVectorAsIJet
Definition: TLorentzVectorAsIJet.h:12
python.PyAthena.v
v
Definition: PyAthena.py:154
HypoJet::xAODJetAsIJet
Definition: xAODJetAsIJet.h:16
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24