Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PHParameterContainerInterface.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PHParameterContainerInterface.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef PHPARAMETER_PHPARAMETERCONTAINERINTERFACE_H
4 #define PHPARAMETER_PHPARAMETERCONTAINERINTERFACE_H
5 
6 #include <map>
7 #include <string>
8 
9 class PHCompositeNode;
10 class PHParameters;
12 
14 {
15  public:
17  // PHParameterContainerInterface contains pointer to memory
18  // copy ctor and = operator need explicit implementation, do just delete it here
21 
23 
24  void set_name(const std::string &name);
25  virtual void SetDefaultParameters() = 0;
26 
27  // Get/Set parameters from macro
28  void set_double_param(const int id, const std::string &name, const double dval);
29  double get_double_param(const int id, const std::string &name) const;
30  void set_int_param(const int id, const std::string &name, const int ival);
31  int get_int_param(const int id, const std::string &name) const;
32  void set_string_param(const int id, const std::string &name, const std::string &sval);
33  std::string get_string_param(const int id, const std::string &name) const;
34 
36  void CreateInitialize(const int detid);
37  void SaveToNodeTree(PHCompositeNode *runNode, const std::string &nodename);
38  void PutOnParNode(PHCompositeNode *parNode, const std::string &nodename);
39  int ExistDetid(const int detid) const;
40 
41  protected:
42  void set_default_double_param(const std::string &name, const double dval);
43  void set_default_int_param(const std::string &name, const int ival);
44  void set_default_string_param(const std::string &name, const std::string &sval);
45  void InitializeParameters();
49 
50  private:
53  std::map<int, PHParameters *> macroparams;
54 };
55 
56 #endif // PHPARAMETER_PHPARAMETERCONTAINERINTERFACE_H