cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
describe_particles.cc
Go to the documentation of this file.
1/*
2 * CepGen: a central exclusive processes event generator
3 * Copyright (C) 2024 Laurent Forthomme
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
20#include "CepGen/Generator.h"
21#include "CepGen/Physics/PDG.h"
23#include "CepGen/Utils/Test.h"
25
26using namespace std;
27using namespace std::string_literals;
28
29int main(int argc, char* argv[]) {
30 cepgen::ArgumentsParser(argc, argv).parse();
32
33 for (const auto& part : vector<pair<cepgen::spdgid_t, string> >{
34 {11, "e"}, {12, "ve"}, {13, "mu"}, {14, "vm"}, {15, "ta"}, {16, "vt"}, {-11, "e+"}, {-12, "ve~"},
35 {-13, "mu+"}, {-14, "vm~"}, {-15, "ta+"}, {-16, "vt~"}, {22, "a"}, {23, "z"}, {-24, "w-"}, {24, "w+"},
36 {25, "h"}, {1, "d"}, {2, "u"}, {3, "s"}, {4, "c"}, {5, "b"}, {6, "t"}, {-1, "d~"},
37 {-2, "u~"}, {-3, "s~"}, {-4, "c~"}, {-5, "b~"}, {-6, "t~"}}) {
38 const auto mg_prop = cepgen::mg5amc::describeParticle(part.second, "sm");
39 const auto cg_prop = cepgen::PDG::get()(part.first);
40 const auto name = part.second + "/" + cepgen::PDG::get().name(part.first);
41 CG_TEST_EQUAL(mg_prop.pdgid, std::labs(part.first), name + " PDG");
42 CG_TEST_EQUAL(mg_prop.fermion, cg_prop.fermion, name + " fermion/boson");
43 CG_TEST_EQUIV(mg_prop.mass, cg_prop.mass, name + " mass");
44 CG_TEST_EQUIV(mg_prop.width, cg_prop.width, name + " width");
45 CG_TEST_EQUAL(mg_prop.charges, cg_prop.charges, name + " charges");
46 }
47
49}
#define CG_TEST_EQUIV(var1, var2, name)
Definition Test.h:61
#define CG_TEST_SUMMARY
Definition Test.h:127
#define CG_TEST_EQUAL(var1, var2, name)
Definition Test.h:45
A generic command line arguments parser.
ArgumentsParser & parse()
Associate command-line arguments to parameters.
const std::string & name(spdgid_t) const
Accessor for particle properties.
Definition PDG.cpp:81
static PDG & get()
Retrieve a unique instance of this particles info collection.
Definition PDG.cpp:41
ParticleProperties describeParticle(const std::string &part_name, const std::string &model)
Unpack all particle properties from MadGraph.
Definition Utils.cpp:68
void initialise(bool safe_mode)
int main()