FModelsXMLManager.h
Go to the documentation of this file.
1 #ifndef _fdet_FModelsXMLManager_h_
2 #define _fdet_FModelsXMLManager_h_
3 
4 #include <map>
5 #include <string>
6 #include <det/VManager.h>
7 #include <utl/ErrorLogger.h>
8 
9 
10 namespace utl {
11  class Reader;
12  class Branch;
13  class TabulatedFunction;
14 }
15 
16 namespace fdet {
17 
37 
38  public:
39  virtual ~FModelsXMLManager() { }
40 
41  void Init(const std::string& configLink);
42 
45  VMANAGER_GETDATA_CALL(GetModelData, std::string)
46  VMANAGER_GETDATA_CALL(GetModelData, std::vector<double>)
47  VMANAGER_GETDATA_CALL(GetModelData, std::vector<std::string>)
48  VMANAGER_GETDATA_CALL(GetModelData, std::vector<int>)
49  VMANAGER_GETDATA_CALL(GetModelData, std::list<double>)
50  VMANAGER_GETDATA_CALL(GetModelData, std::list<std::string>)
51  VMANAGER_GETDATA_CALL(GetModelData, std::list<int>)
52  //VMANAGER_GETDATA_NOTFOUND(unsigned long long int)
53 
54 
56 
67  VMANAGER_GETDATA_CALL(GetTabulatedModelData, utl::TabulatedFunction)
68 
69  VMANAGER_GETDATA_DENIED(std::list<std::pair<int, int> >)
70 
71  VMANAGER_GETDATA_NOTFOUND(std::map<int, utl::TabulatedFunction>)
72  VMANAGER_GETDATA_NOTFOUND(utl::TabulatedFunctionComplexLgAmpPhase)
73  VMANAGER_GETDATA_NOTFOUND(std::map<std::string, double>)
74  VMANAGER_GETDATA_DENIED(std::vector<bool>)
75 
76  private:
77  // Implement generic getters with template
78  template<typename T>
79  Status GetModelData(T& returnData,
80  const std::string& componentProperty,
81  const std::string& componentName,
82  const IndexMap& componentIndex) const;
83 
84  // Tabulated data has a special getter to do the tabulation
85  Status GetTabulatedModelData(utl::TabulatedFunction& returnData,
86  const std::string& componentProperty,
87  const std::string& componentName,
88  const IndexMap& componentIndex) const;
89 
90  // Find Branch where the requested data resides
91  utl::Branch FindBranch(const std::string& property,
92  const std::string& modelType,
93  const IndexMap& componentIndex ) const;
94 
95  // map telescope Id to a map of model type, model id
96  // (map <Id, map<model type, model id>)
97  //
98  // The telescope Id is the sum of two strings (separated by a single
99  // space character): eyeIdString (1 to 5) and telescopeIdString (1 to 6)
100  std::map<std::string, IndexMap> fTelescopeModelMap;
101 
102  // Utility function to fill aforementioned maps
103  void FillMaps();
104 
106 
107  };
108 
109 }
110 
111 
112 #endif
113 
114 // Configure (x)emacs for this file ...
115 // Local Variables:
116 // mode: c++
117 // compile-command: "make -C .. FDetector/FModelsXMLManager.o -k"
118 // End:
Interface for detector managers.
Definition: VManager.h:115
#define VMANAGER_GETDATA_CALL(_GetData_, _T_...)
Definition: VManager.h:59
Status GetModelData(T &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const
Return data as a TabulatedFunction.
Status GetTabulatedModelData(utl::TabulatedFunction &returnData, const std::string &componentProperty, const std::string &componentName, const IndexMap &componentIndex) const
utl::Branch FindBranch(const std::string &property, const std::string &modelType, const IndexMap &componentIndex) const
#define VMANAGER_GETDATA_DENIED(_T_...)
Definition: VManager.h:21
#define VMANAGER_GETDATA_HANDLE_DENIED
Definition: VManager.h:75
void Init(const std::string &configLink)
Manager Initialization. configLink is the CentralConfig hook for the configuration file...
std::map< std::string, std::string > IndexMap
Definition: VManager.h:133
#define VMANAGER_GETDATA_NOTFOUND(_T_...)
Definition: VManager.h:41
std::map< std::string, IndexMap > fTelescopeModelMap
Status
Specifies success or (eventually) various possible failure modes.
Definition: VManager.h:127
Manager for FD description in XML &quot;model&quot; files.

, generated on Tue Sep 26 2023.