AnalysisTree
Loading...
Searching...
No Matches
Hit.test.hpp
1/* Copyright (C) 2019-2021 GSI, Universität Tübingen
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Viktor Klochkov, Ilya Selyuzhenkov */
4#ifndef ANALYSISTREE_TEST_CORE_HIT_TEST_HPP_
5#define ANALYSISTREE_TEST_CORE_HIT_TEST_HPP_
6
7#include <gtest/gtest.h>
8
9#include "Hit.hpp"
10
11namespace {
12
13using namespace AnalysisTree;
14
15TEST(Test_AnalysisTreeCore, Test_Hit) {
16
17 Hit hit;
18
19 EXPECT_EQ(hit.GetSize<int>(), 0);
20 EXPECT_EQ(hit.GetSize<float>(), 0);
21 EXPECT_EQ(hit.GetSize<bool>(), 0);
22
23 hit.SetPosition({1., 2., 3.});
24 hit.SetSignal(10.);
25
26 EXPECT_EQ(hit.GetSize<int>(), 0);
27 EXPECT_EQ(hit.GetSize<float>(), 0);
28 EXPECT_EQ(hit.GetSize<bool>(), 0);
29
30 EXPECT_FLOAT_EQ(hit.GetX(), 1.);
31 EXPECT_FLOAT_EQ(hit.GetY(), 2.);
32 EXPECT_FLOAT_EQ(hit.GetZ(), 3.);
33 EXPECT_FLOAT_EQ(hit.GetPhi(), atan2(2., 1.));
34 EXPECT_FLOAT_EQ(hit.GetSignal(), 10.);
35
36 EXPECT_FLOAT_EQ(hit.GetX(), hit.GetField<float>(HitFields::kX));
37 EXPECT_FLOAT_EQ(hit.GetY(), hit.GetField<float>(HitFields::kY));
38 EXPECT_FLOAT_EQ(hit.GetZ(), hit.GetField<float>(HitFields::kZ));
39 EXPECT_FLOAT_EQ(hit.GetPhi(), hit.GetField<float>(HitFields::kPhi));
40 EXPECT_FLOAT_EQ(hit.GetSignal(), hit.GetField<float>(HitFields::kSignal));
41}
42}// namespace
43
44#endif//ANALYSISTREE_TEST_CORE_HIT_TEST_HPP_
Definition Hit.hpp:16
Cuts keep list of SimpleCuts. Logical AND is applied for all SimpleCut in the Cuts object.
Definition BranchConfig.cpp:10