OPAL (Object Oriented Parallel Accelerator Library)  2024.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 
26 enum class ParticleType: short {
27  UNNAMED = -1,
28  ELECTRON,
29  POSITRON,
30  MUON,
31  PROTON,
32  ANTIPROTON,
33  DEUTERON,
34  HMINUS,
35  HYDROGEN,
36  H2P,
37  H3P,
38  ALPHA,
39  CARBON,
40  XENON,
41  URANIUM
42 };
43 
44 enum class ParticleOrigin: unsigned short {
45  REGULAR,
46  SECONDARY,
47  STRIPPED
48 };
49 
50 
52 public:
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 
62 private:
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
static ParticleType getParticleType(const std::string &str)
static const std::map< ParticleType, double > particleMass_m
static const std::map< ParticleType, double > particleCharge_m
static double getParticleCharge(const ParticleType &type)
ParticleType
static double getParticleChargeInCoulomb(const ParticleType &type)
static double getParticleMass(const ParticleType &type)
static const boost::bimap< ParticleType, std::string > bmParticleType_s
SDDS1 &description type
Definition: test.stat:4
static std::string getParticleTypeString(const ParticleType &type)