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{
16 class ParticlePropertiesList
17 {
18 static ParticlePropertiesList* ptr;
19 std::map<int, std::pair<std::string, std::string>> m_latexLabels;
20 std::string m_fname;
21 std::vector<ParticleProperties> m_theList;
22 std::map<std::string, ParticleProperties*> m_byName;
23 std::map<int, ParticleProperties*> m_byID;
24 double m_quasiStableThreshold;
25
26 explicit ParticlePropertiesList( const std::string& fname_in = "mass_width.csv" );
27
28 protected:
29 const std::vector<std::string> dirList() const;
30
31 public:
32 bool readFile( const std::string& fname );
33 static const ParticlePropertiesList* getMe();
34 static ParticlePropertiesList* getMutable();
35 static const ParticleProperties* get( const std::string& name, const bool& quiet = false );
36 static const ParticleProperties* get( const int& PDG, const bool& quiet = false );
37 void makeAlias( const std::string& name, const std::string& alias );
38 const ParticleProperties* find( const std::string& name, bool quiet = false ) const;
39 const ParticleProperties* find( int pdg_id, bool quiet = false ) const;
40
41 double quasiStableThreshold() const ;
42 std::vector<std::string> getParticleNames() const;
43 std::vector<int> getParticleIds() const;
44
45 std::vector<ParticleProperties>::const_iterator begin() const { return m_theList.cbegin() ; }
46 std::vector<ParticleProperties>::const_iterator end() const { return m_theList.cend() ; }
47 void print( std::ostream& out = std::cout ) const;
48 bool readLatexLabels( const std::string& name );
50 void addParticle(const std::vector<std::string>& properties );
51 };
52 std::ostream& operator<<( std::ostream& out, const ParticlePropertiesList& ppl );
53} // namespace AmpGen
54#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
double quasiStableThreshold() 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)