Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-27 07:24:20

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 // Project include(s).
0010 #include "detray/definitions/pdg_particle.hpp"
0011 
0012 // GTest include(s)
0013 #include <gtest/gtest.h>
0014 
0015 using namespace detray;
0016 
0017 /// This tests the functionality of a pdg particle
0018 GTEST_TEST(detray_core, pdg_particle) {
0019   constexpr auto mu = muon<float>();
0020   constexpr auto ep = positron<float>();
0021 
0022   ASSERT_EQ(ep.pdg_num(), -11);
0023   ASSERT_FLOAT_EQ(ep.charge(), 1.f);
0024   ASSERT_FLOAT_EQ(ep.mass(), 0.51099895069f * unit<float>::MeV);
0025   ASSERT_FLOAT_EQ(ep.mass(), electron<float>().mass());
0026 
0027   ASSERT_EQ(mu.pdg_num(), 13);
0028   ASSERT_FLOAT_EQ(mu.charge(), -1.f);
0029   ASSERT_FLOAT_EQ(mu.mass(), 105.6583755f * unit<float>::MeV);
0030   ASSERT_FLOAT_EQ(mu.mass(), antimuon<float>().mass());
0031 
0032   ASSERT_FLOAT_EQ(pion_plus<float>().mass(), pion_minus<float>().mass());
0033 }