Class Reference for E1039 Core & Analysis Software
PHParametersContainer.h
Go to the documentation of this file.
1 #ifndef PHParametersContainer__h
2 #define PHParametersContainer__h
3 
4 #include <phool/PHObject.h>
5 
6 #include <map>
7 #include <string>
8 
9 class PHParameters;
11 class PHCompositeNode;
12 
14 {
15  public:
16  typedef std::map<int, PHParameters *> Map;
17  typedef Map::iterator Iterator;
18  typedef Map::const_iterator ConstIterator;
19  typedef std::pair<Iterator, Iterator> Range;
20  typedef std::pair<ConstIterator, ConstIterator> ConstRange;
21 
22  explicit PHParametersContainer(const std::string &name = "NONE");
23  virtual ~PHParametersContainer();
24 
25  void AddPHParameters(const int layer, PHParameters *params);
26  const PHParameters *GetParameters(const int layer) const;
27  PHParameters *GetParametersToModify(const int layer);
28  int WriteToFile(const std::string &extension, const std::string &dir);
29  int WriteToDB();
30 
31  void set_name(const std::string &name) { superdetectorname = name; }
32  std::string Name() const { return superdetectorname; }
33  // std::pair<std::map<int, PHParameters *>::const_iterator, std::map<int, PHParameters *>::const_iterator> GetAllParameters() {return std::make_pair(parametermap.begin(),parametermap.end());}
34  ConstRange GetAllParameters() const { return std::make_pair(parametermap.begin(), parametermap.end()); }
35  void Print() const;
36  void SaveToNodeTree(PHCompositeNode *topNode, const std::string &nodename);
37  int ExistDetid(const int detid) const;
38  void clear() { parametermap.clear(); }
39  void FillFrom(const PdbParameterMapContainer *saveparamcontainer);
40 
41  protected:
43  std::string superdetectorname;
44  std::map<int, PHParameters *> parametermap;
45 };
46 
47 #endif //PHParametersContainer__h
std::string Name() const
std::map< int, PHParameters * > Map
void CopyToPdbParameterMapContainer(PdbParameterMapContainer *myparm)
int WriteToFile(const std::string &extension, const std::string &dir)
Map::const_iterator ConstIterator
ConstRange GetAllParameters() const
PHParametersContainer(const std::string &name="NONE")
std::map< int, PHParameters * > parametermap
void set_name(const std::string &name)
int ExistDetid(const int detid) const
void SaveToNodeTree(PHCompositeNode *topNode, const std::string &nodename)
PHParameters * GetParametersToModify(const int layer)
const PHParameters * GetParameters(const int layer) const
void AddPHParameters(const int layer, PHParameters *params)
std::pair< Iterator, Iterator > Range
std::pair< ConstIterator, ConstIterator > ConstRange
void FillFrom(const PdbParameterMapContainer *saveparamcontainer)