AmpGen 2.1
Loading...
Searching...
No Matches
ParticlePropertiesList.h
Go to the documentation of this file.
1#ifndef AMPGEN_PARTICLEPROPERTIESLIST_H
2#define AMPGEN_PARTICLEPROPERTIESLIST_H
3// author: Jonas Rademacker (Jonas.Rademacker@bristol.ac.uk)
4// status: Mon 9 Feb 2009 19:18:04 GMT
5
6#include <iostream>
7#include <map>
8#include <string>
9#include <utility>
10#include <vector>
11
13
14namespace AmpGen {
15 class ParticlePropertiesList {
16 static ParticlePropertiesList *ptr;
17 std::map<int, std::pair<std::string, std::string>> m_latexLabels;
18 std::string m_fname;
19 std::vector<ParticleProperties> m_theList;
20 std::map<std::string, ParticleProperties *> m_byName;
21 std::map<int, ParticleProperties *> m_byID;
22
23 explicit ParticlePropertiesList(const std::string &fname_in = "mass_width.csv");
24
25 protected:
26 const std::vector<std::string> dirList() const;
27
28 public:
29 bool readFile(const std::string &fname);
30 static const ParticlePropertiesList *getMe();
31 static ParticlePropertiesList *getMutable();
32 static const ParticleProperties *get(const std::string &name, const bool &quiet = false);
33 static const ParticleProperties *get(const int &PDG, const bool &quiet = false);
34 void makeAlias(const std::string &name, const std::string &alias);
35 const ParticleProperties *find(const std::string &name, bool quiet = false) const;
36 const ParticleProperties *find(int pdg_id, bool quiet = false) const;
37
38 std::vector<std::string> getParticleNames() const;
39 std::vector<int> getParticleIds() const;
40
41 std::vector<ParticleProperties>::const_iterator begin() const { return m_theList.cbegin(); }
42 std::vector<ParticleProperties>::const_iterator end() const { return m_theList.cend(); }
43 void print(std::ostream &out = std::cout) const;
44 bool readLatexLabels(const std::string &name);
46 void addParticle(const std::vector<std::string> &properties);
47 };
48 std::ostream &operator<<(std::ostream &out, const ParticlePropertiesList &ppl);
49} // namespace AmpGen
50#endif
Class that contains the PDG properties (mass, width, charges, etc.) for a single particle species,...
static const ParticleProperties * get(const int &PDG, const bool &quiet=false)
static const ParticlePropertiesList * getMe()
bool readFile(const std::string &fname)
std::vector< int > getParticleIds() const
bool readLatexLabels(const std::string &name)
const ParticleProperties * find(const std::string &name, bool quiet=false) const
static const ParticleProperties * get(const std::string &name, const bool &quiet=false)
std::vector< ParticleProperties >::const_iterator end() const
std::vector< ParticleProperties >::const_iterator begin() const
const ParticleProperties * find(int pdg_id, bool quiet=false) const
const std::vector< std::string > dirList() const
static ParticlePropertiesList * getMutable()
void addParticle(const std::vector< std::string > &properties)
void print(std::ostream &out=std::cout) const
void makeAlias(const std::string &name, const std::string &alias)
std::vector< std::string > getParticleNames() const
std::ostream & operator<<(std::ostream &os, const CompiledExpressionBase &expression)