00001 #ifndef GUARD_HDQMInspectorConfigBase_h 00002 #define GUARD_HDQMInspectorConfigBase_h 00003 00004 #include <algorithm> 00005 #include <string> 00006 #include <vector> 00007 #include <map> 00008 #include <stdint.h> 00009 00034 class HDQMInspectorConfigBase 00035 { 00036 public: 00037 HDQMInspectorConfigBase () {}; 00038 virtual ~HDQMInspectorConfigBase () {}; 00040 virtual std::string translateDetId( const uint32_t ) const = 0; 00042 virtual bool valueErrorMap(std::vector<std::pair<std::string, std::string> > & valueErrorVector) const {return false;} 00044 virtual bool computeIntegralList(const std::vector<std::string> & computeIntegralVector) 00045 { 00046 fComputeIntegral = computeIntegralVector; 00047 return true; 00048 } 00049 bool computeIntegral(const std::string & in) const 00050 { 00051 if (std::find(fComputeIntegral.begin(), fComputeIntegral.end(), in) != fComputeIntegral.end()) { 00052 return true; 00053 } 00054 return false; 00055 } 00056 00057 std::string getErrorForQuantity(const std::string & QuantityName) const 00058 { 00059 // Return the error name for a quantity name given. This is designed to be used for the 00060 // "user" input quantities 00061 00062 for (std::map<std::string, std::string>::const_iterator It = fErrorMap.begin(); It != fErrorMap.end(); ++It) { 00063 if (QuantityName.find( It->first ) != std::string::npos) { 00064 return It->second; 00065 } 00066 } 00067 00068 return ""; 00069 } 00070 00071 private: 00072 std::map<std::string, std::string> fErrorMap; 00073 std::vector<std::string> fComputeIntegral; 00074 }; 00075 00076 00077 /* 00078 * valueErrorMap: don't I need a way to access what is input here in the HDQMI code?? 00079 * map should be vlist=>error right? 00080 * 00081 * computeIntegralList: need a way to access that as well. 00082 * 00083 */ 00084 00085 00086 00087 #endif