cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches
HeavyIon.h
Go to the documentation of this file.
1/*
2 * CepGen: a central exclusive processes event generator
3 * Copyright (C) 2013-2022 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
19#ifndef CepGen_Physics_HeavyIon_h
20#define CepGen_Physics_HeavyIon_h
21
22#include <ostream>
23
25
26namespace cepgen {
28 enum class Element {
29 invalid = -1,
30 neutron = 0,
31 H = 1,
32 C = 6,
33 O = 8,
34 Al = 13,
35 Cu = 29,
36 Xe = 54,
37 Au = 79,
38 Pb = 82,
39 U = 92
40 };
41 std::ostream& operator<<(std::ostream& os, const Element& elem);
42
44 struct HeavyIon {
46 explicit HeavyIon(unsigned short, const Element&);
47
48 bool operator==(const HeavyIon& oth) const { return Z == oth.Z && A == oth.A; }
49 bool operator!=(const HeavyIon& oth) const { return !(*this == oth); }
50
52 double massN() const;
54 double massP() const;
56 double mass() const { return massN() + massP(); }
58 double radius() const;
59
63 static bool isHI(const spdgid_t&);
65 static bool isHI(const ParticleProperties&);
68 static double mass(const HeavyIon& hi) { return hi.mass(); }
69
71 static inline HeavyIon proton() { return HeavyIon(1, Element::H); }
73 static inline HeavyIon neutron() { return HeavyIon(1, Element::neutron); }
75 static inline HeavyIon Au() { return HeavyIon(197, Element::Au); }
77 static inline HeavyIon Pb() { return HeavyIon(207, Element::Pb); }
78
80 operator pdgid_t() const;
82 friend std::ostream& operator<<(std::ostream& os, const HeavyIon& hi);
83
87 unsigned short A{0};
88 };
89} // namespace cepgen
90
91#endif
Common namespace for this Monte Carlo generator.
Element
Enumeration of chemical elements.
Definition HeavyIon.h:28
unsigned long long pdgid_t
Alias for the integer-like particle PDG id.
long long spdgid_t
std::ostream & operator<<(std::ostream &os, const Exception::Type &type)
Definition Exception.cpp:59
Heavy ion container (Z+A)
Definition HeavyIon.h:44
static double mass(const HeavyIon &hi)
Mass of a heavy ion, in GeV/c .
Definition HeavyIon.h:68
double massP() const
Protons mass, in GeV/c2.
Definition HeavyIon.cpp:60
bool operator==(const HeavyIon &oth) const
Definition HeavyIon.h:48
double radius() const
Heavy ion radius, in m.
Definition HeavyIon.cpp:72
static HeavyIon Pb()
Standard lead.
Definition HeavyIon.h:77
Element Z
Atomic number.
Definition HeavyIon.h:85
static HeavyIon fromPdgId(pdgid_t)
Build from a custom PDG id.
Definition HeavyIon.cpp:34
double massN() const
Neutrons mass, in GeV/c2.
Definition HeavyIon.cpp:66
static HeavyIon neutron()
Simple neutron.
Definition HeavyIon.h:73
unsigned short A
Mass number.
Definition HeavyIon.h:87
double mass() const
Total heavy ion mass, in GeV/c2.
Definition HeavyIon.h:56
friend std::ostream & operator<<(std::ostream &os, const HeavyIon &hi)
Human-readable expression of the ion.
Definition HeavyIon.cpp:95
static bool isHI(const spdgid_t &)
Check if the PDG id is compatible with a HI.
Definition HeavyIon.cpp:54
static HeavyIon proton()
Simple proton.
Definition HeavyIon.h:71
bool operator!=(const HeavyIon &oth) const
Definition HeavyIon.h:49
static HeavyIon Au()
Standard gold.
Definition HeavyIon.h:75
A collection of physics constants associated to a single particle.