MINT2
ResonancePropertiesList.h
Go to the documentation of this file.
1 #ifndef RESONANCEPROPERTIESLIST_HH
2 #define RESONANCEPROPERTIESLIST_HH
3 // author: Philippe d'Argent (p.dargent@cern.ch)
4 
5 #include <string>
6 #include <list>
7 #include <vector>
8 #include <map>
9 #include <iostream>
10 #include <utility>
11 
15 #include "Mint/FitParameter.h"
16 
17 class ResonancePropertiesList{ // NOT a singleton - but for each prefix (to be used to pre-fix the parameter name) it ensures everyone using it
18  // uses the same particle properties, which is initialised
19  // only once. Saves space and time
20  // and (maybe) increases consistency.
21  // To get access do:
22  // ParticlePropertiesList* PPL = ParticlePropertiesList::getMe();
23  // and then:
24  // ParticleProperties* pionProps = PPL->get("pion");
25  // ParticleProperties* pionProps = PPL->get(221);
26  //
27 
28  // static ResonancePropertiesList* ptr;
29  static std::map<std::pair<std::string, const MINT::MinuitParameterSet*>, ResonancePropertiesList*> _mapOfLists;
30  ResonancePropertiesList(const std::string& namePrefix="", MINT::MinuitParameterSet* mps=0);
31 
32  protected:
33 
35  std::string _prefix;
36 
38  //ResonanceProperties _rp;
39  std::vector<ResonanceProperties*> theList;
40  //std::map<std::string, std::list<ResonanceProperties>::iterator > byName;
41  std::map<int, ResonanceProperties* > byID;
43 
46 
47  public:
48  static ResonancePropertiesList* getMe(const std::string& prefix="", MINT::MinuitParameterSet* mps=0);
50 
51  const std::string& prefix()const {return _prefix;}
52  //const ResonanceProperties* get(const std::string& name) const;
53  const ResonanceProperties* get(int i) const;
54  const MINT::FitParameter& radius() const {return _radius;}
55 
56  //void print(std::ostream& out=std::cout) const;
57 
58  /*
59  // fast fuss-free access:
60  static double mass(const std::string& name);
61  static double mass(int PDG);
62  static double width(const std::string& name);
63  static double width(int PDG);
64  */
65 };
66 
67 
68 //std::ostream& operator<<(std::ostream& out, const ParticlePropertiesList& ppl);
69 
70 #endif
71 //
std::vector< ResonanceProperties * > theList
const std::string & prefix() const
ResonancePropertiesList(const std::string &namePrefix="", MINT::MinuitParameterSet *mps=0)
const ResonanceProperties * get(int i) const
static ResonancePropertiesList * getMe(const std::string &prefix="", MINT::MinuitParameterSet *mps=0)
std::map< int, ResonanceProperties * > byID
MINT::MinuitParameterSet * getMinuitParameterSet()
const MINT::FitParameter & radius() const
MINT::MinuitParameterSet * _mps
const ResonanceProperties * AddToList(ResonanceProperties *rp)
static std::map< std::pair< std::string, const MINT::MinuitParameterSet * >, ResonancePropertiesList * > _mapOfLists
const ResonanceProperties * AddToListIfMissing(int pdg)