ECCE @ EIC 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:
16  PHParameterContainerInterface(const std::string &name);
17  // PHParameterContainerInterface contains pointer to memory
18  // copy ctor needs explicit implementation, do just delete it here
20 
22 
23  void set_name(const std::string &name);
24  virtual void SetDefaultParameters() = 0;
25 
26  // Get/Set parameters from macro
27  void set_double_param(const int id, const std::string &name, const double dval);
28  double get_double_param(const int id, const std::string &name) const;
29  void set_int_param(const int id, const std::string &name, const int ival);
30  int get_int_param(const int id, const std::string &name) const;
31  void set_string_param(const int id, const std::string &name, const std::string &sval);
32  std::string get_string_param(const int id, const std::string &name) const;
33 
35  void CreateInitialize(const int detid);
36  void SaveToNodeTree(PHCompositeNode *runNode, const std::string &nodename);
37  void PutOnParNode(PHCompositeNode *parNode, const std::string &nodename);
38  int ExistDetid(const int detid) const;
39 
40  protected:
41  void set_default_double_param(const std::string &name, const double dval);
42  void set_default_int_param(const std::string &name, const int ival);
43  void set_default_string_param(const std::string &name, const std::string &sval);
44  void InitializeParameters();
48 
49  private:
52  std::map<int, PHParameters *> macroparams;
53 };
54 
55 #endif // PHPARAMETER_PHPARAMETERCONTAINERINTERFACE_H