Changeset 15212
- Timestamp:
- 03/31/13 11:35:58 (12 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/PixelMap.cc
r13167 r15212 1 1 #include "PixelMap.h" 2 2 3 #include <boost/regex.hpp> 3 #ifdef __EXCEPTIONS 4 #include <stdexcept> 5 #endif 4 6 5 //#ifdef HAS_SQL 6 #include <mysql++/mysql++.h> 7 //#endif 7 #ifdef __MARS__ 8 #include "MLog.h" 9 #include "MLogManip.h" 10 #endif 8 11 9 12 using namespace std; … … 12 15 const BiasMapEntry BiasMap::empty = { -1, 0, 0, 0 }; 13 16 14 voidBiasMap::Read(const std::string &fname)17 bool BiasMap::Read(const std::string &fname) 15 18 { 16 19 std::ifstream fin(fname); … … 37 40 str >> entry.Voff; 38 41 42 #ifdef __EXCEPTIONS 39 43 if (entry.hv_channel+32*entry.hv_board>=416) 40 44 throw runtime_error("Invalid board/channel read from "+fname+"."); 45 #endif 46 #ifdef __MARS__ 47 if (entry.hv_channel+32*entry.hv_board>=416) 48 { 49 gLog << err << "Invalid board/channel read from " << fname << "." << endl; 50 return false; 51 } 52 #endif 41 53 42 54 (*this)[entry.hv()] = entry; … … 45 57 } 46 58 59 #ifdef __EXCEPTIONS 47 60 if (l!=416) 48 61 throw runtime_error("Number of lines read from "+fname+" does not match 416."); … … 50 63 if (size()!=416) 51 64 throw runtime_error("Number of entries read from "+fname+" does not match 416."); 65 #endif 66 67 #ifdef __MARS__ 68 if (l!=416) 69 { 70 gLog << err << "Number of lines read from " << fname << " does not match 416." << endl; 71 return false; 72 } 73 74 if (size()!=416) 75 { 76 gLog << "Number of entries read from " << fname << " does not match 416." << endl; 77 return false; 78 } 79 #endif 80 81 return true; 52 82 } 83 84 #ifndef __MARS__ 85 #include <boost/regex.hpp> 86 #include <mysql++/mysql++.h> 53 87 54 88 void BiasMap::Retrieve(const std::string &database) … … 114 148 throw runtime_error("Number of entries retrived from database does not match 416."); 115 149 } 150 #endif -
trunk/FACT++/src/PixelMap.h
r13239 r15212 2 2 #define FACT_PixelMap 3 3 4 #include <vector>5 #include <string>6 #include <fstream>7 #include <sstream>4 #include <vector> 5 #include <string> 6 #include <fstream> 7 #include <sstream> 8 8 9 9 #include "tools.h" 10 10 11 11 #ifdef DEBUG 12 #include <iostream> // cerr -- to be removed?12 #include <iostream> // cerr -- to be removed? 13 13 #endif 14 14 … … 204 204 } 205 205 206 #ifndef __MARS__ 206 207 void Retrieve(const std::string &database); 207 void Read(const std::string &fname); 208 #endif 209 bool Read(const std::string &fname); 208 210 209 211 const BiasMapEntry &hv(int board, int channel) const
Note:
See TracChangeset
for help on using the changeset viewer.