OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
ParticleProperties.h
Go to the documentation of this file.
1//
2// Class ParticleProperties
3// Base class for representing particle properties
4//
5// Copyright (c) 2021, Pedro Calvo, CIEMAT, Spain
6// All rights reserved
7//
8// This file is part of OPAL.
9//
10// OPAL is free software: you can redistribute it and/or modify
11// it under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// You should have received a copy of the GNU General Public License
16// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
17//
18#ifndef PARTICLEPROPERTIES_H
19#define PARTICLEPROPERTIES_H
20
21#include <boost/bimap.hpp>
22
23#include <map>
24#include <string>
25
26enum class ParticleType: short {
27 UNNAMED = -1,
30 MUON,
31 PROTON,
34 HMINUS,
36 H2P,
37 H3P,
38 ALPHA,
39 CARBON,
40 XENON,
42};
43
44enum class ParticleOrigin: unsigned short {
45 REGULAR,
48};
49
50
52public:
53 static ParticleType getParticleType (const std::string& str);
54
55 static std::string getParticleTypeString(const ParticleType& type);
56
57 static double getParticleMass(const ParticleType& type);
58
59 static double getParticleCharge(const ParticleType& type);
60 static double getParticleChargeInCoulomb(const ParticleType& type);
61
62private:
63 static const boost::bimap<ParticleType, std::string> bmParticleType_s;
64
65 static const std::map<ParticleType, double> particleMass_m;
66 static const std::map<ParticleType, double> particleCharge_m;
67};
68
69#endif /* PARTICLEPROPERTIES_H */
ParticleOrigin
ParticleType
boost::function< boost::tuple< double, bool >(arguments_t)> type
Definition: function.hpp:21
static std::string getParticleTypeString(const ParticleType &type)
static const boost::bimap< ParticleType, std::string > bmParticleType_s
static double getParticleMass(const ParticleType &type)
static const std::map< ParticleType, double > particleCharge_m
static double getParticleCharge(const ParticleType &type)
static const std::map< ParticleType, double > particleMass_m
static double getParticleChargeInCoulomb(const ParticleType &type)
static ParticleType getParticleType(const std::string &str)