00001 // 00002 // Gena Kukartsev (Brown), Feb. 22, 2008 00003 // 00004 // 00005 #ifndef HcalQIEManager_h 00006 #define HcalQIEManager_h 00007 00008 #include <iostream> 00009 #include <string.h> 00010 #include "CaloOnlineTools/HcalOnlineDb/interface/HCALConfigDB.h" 00011 00020 class HcalChannelId{ 00021 00022 public: 00023 00024 HcalChannelId(){}; 00025 ~HcalChannelId(){}; 00026 00027 int eta, phi, depth; 00028 std::string subdetector; 00029 00030 bool operator<( const HcalChannelId & other) const; 00031 00032 }; 00033 00034 class HcalQIECaps{ 00035 00036 public: 00037 00038 HcalQIECaps(){}; 00039 ~HcalQIECaps(){}; 00040 00041 // cap0 offset x 4, cap1 offset x 4... 00042 // cap0 slope x 4, cap1 slope x 4... 00043 double caps[32]; 00044 }; 00045 00046 class HcalQIEManager{ 00047 public: 00048 00049 HcalQIEManager( ); 00050 ~HcalQIEManager( ); 00051 00052 std::map<HcalChannelId,HcalQIECaps> & getQIETableFromFile( std::string _filename ); 00053 void getTableFromDb( std::string query_file, std::string output_file ); 00054 int generateQieTable( std::string db_file, std::string old_file, std::string output_file ); 00055 int getHfQieTable( std::string input_file, std::string output_file ); 00056 00057 static std::vector <std::string> splitString (const std::string& fLine); 00058 00059 protected: 00060 00061 00062 }; 00063 #endif