ATLAS Offline Software
JetGroupRegisterTest.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 #include "gtest/gtest.h"
12 #include "../src/TLorentzVectorFactory.h"
13 #include "../src/TLorentzVectorAsIJet.h"
14 
15 #include <vector>
16 #include <map>
17 
18 using res = std::pair<std::vector<unsigned int>, bool>;
19 using vec = std::vector<unsigned int>;
20 
21 TEST(JetGroupRegisterTester, empty) {
22 
23  double eta = 2.1;
24  double et = 101.;
25 
26  TLorentzVector tlv = TLorentzVectorFactory().make(eta, et);
27  pHypoJet hjet(nullptr);
28  hjet.reset(new TLorentzVectorAsIJet(tlv));
29  HypoJetVector jets {hjet};
30 
31  JetGroupRegister jg_register;
32 
33  std::size_t idx = jg_register.record(jets);
34 
35  EXPECT_EQ(idx, 0u);
36 
37  idx = jg_register.record(jets);
38 
39  EXPECT_EQ(idx, 0u);
40 
41  HypoJetVector jets2 = jets;
42 
43  jets2.push_back(hjet);
44 
45  idx = jg_register.record(jets2);
46 
47  EXPECT_EQ(idx, 1u);
48 
49  idx = jg_register.record(jets);
50  EXPECT_EQ(idx, 0u);
51 }
52 
53 
54 
TLorentzVectorFactory
Definition: TLorentzVectorFactory.h:13
et
Extra patterns decribing particle interation process.
HypoJetDefs.h
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
ATLAS_NO_CHECK_FILE_THREAD_SAFETY
ATLAS_NO_CHECK_FILE_THREAD_SAFETY
Definition: JetGroupRegisterTest.cxx:6
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
pHypoJet
std::shared_ptr< const HypoJet::IJet > pHypoJet
Definition: HypoJetDefs.h:25
DebugInfoCollector.h
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
HypoJetVector
std::vector< pHypoJet > HypoJetVector
Definition: HypoJetDefs.h:27
TLorentzVectorFactory::make
virtual TLorentzVector make(double eta, double et) const override
Definition: TLorentzVectorFactory.h:15
JetGroupRegister
Definition: JetGroupRegister.h:35
TLorentzVectorAsIJet
Definition: TLorentzVectorAsIJet.h:12
TEST
TEST(JetGroupRegisterTester, empty)
Definition: JetGroupRegisterTest.cxx:21
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
JetGroupRegister::record
std::size_t record(HypoJetVector v)
Definition: JetGroupRegister.cxx:7
defineDB.jets
list jets
Definition: JetTagCalibration/share/defineDB.py:24
JetGroupRegister.h
checker_macros.h
Define macros for attributes used to control the static checker.