ATLAS Offline Software
TLorentzVectorFactoryTest.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 "../src/TLorentzVectorFactory.h"
9 #include "gtest/gtest.h"
10 
11 TEST(TLorentzVectoryTest, positiveEta) {
12  double eta = 2.1;
13  double et = 101.;
14  double eps = 0.00001;
15  TLorentzVector tl = TLorentzVectorFactory().make(eta, et);
16  EXPECT_NEAR(tl.Eta(), eta, eps);
17  EXPECT_NEAR(tl.Et(), et, eps);
18 }
19 
20 TEST(TLorentzVectoryTest, negativeEta) {
21  double eta = -7.0;
22  double et = 1.;
23  double eps = 0.00001;
24  TLorentzVector tl = TLorentzVectorFactory().make(eta, et);
25  EXPECT_NEAR(tl.Eta(), eta, eps);
26  EXPECT_NEAR(tl.Et(), et, eps);
27 }
28 
29 
30 TEST(TLorentzVectoryTest, vals0) {
31  double eta = 0.5;
32  double et = 100.;
33  double eps = 0.00001;
34  TLorentzVector tl = TLorentzVectorFactory().make(eta, et);
35  EXPECT_NEAR(tl.Eta(), eta, eps);
36  EXPECT_NEAR(tl.Et(), et, eps);
37 }
38 
39 TEST(TLorentzVectoryTest, thowsOnBadEt) {
40  double eta = -7.0;
41  double et = 0.;
42  EXPECT_THROW(TLorentzVectorFactory().make(eta, et), std::out_of_range);
43  et = -1.;
44  EXPECT_THROW(TLorentzVectorFactory().make(eta, et), std::out_of_range);
45 }
46 
TLorentzVectorFactory
Definition: TLorentzVectorFactory.h:13
et
Extra patterns decribing particle interation process.
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
TLorentzVectorFactory::make
virtual TLorentzVector make(double eta, double et) const override
Definition: TLorentzVectorFactory.h:15
ATLAS_NO_CHECK_FILE_THREAD_SAFETY
ATLAS_NO_CHECK_FILE_THREAD_SAFETY
Definition: TLorentzVectorFactoryTest.cxx:6
TEST
TEST(TLorentzVectoryTest, positiveEta)
Definition: TLorentzVectorFactoryTest.cxx:11
dqt_zlumi_alleff_HIST.tl
tl
Definition: dqt_zlumi_alleff_HIST.py:73
checker_macros.h
Define macros for attributes used to control the static checker.