Changeset 15212


Ignore:
Timestamp:
03/31/13 11:35:58 (12 years ago)
Author:
tbretz
Message:
Made aware of Mars.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/PixelMap.cc

    r13167 r15212  
    11#include "PixelMap.h"
    22
    3 #include <boost/regex.hpp>
     3#ifdef __EXCEPTIONS
     4#include <stdexcept>
     5#endif
    46
    5 //#ifdef HAS_SQL
    6 #include <mysql++/mysql++.h>
    7 //#endif
     7#ifdef __MARS__
     8#include "MLog.h"
     9#include "MLogManip.h"
     10#endif
    811
    912using namespace std;
     
    1215const BiasMapEntry  BiasMap::empty  = { -1, 0, 0, 0 };
    1316
    14 void BiasMap::Read(const std::string &fname)
     17bool BiasMap::Read(const std::string &fname)
    1518{
    1619    std::ifstream fin(fname);
     
    3740        str >> entry.Voff;
    3841
     42#ifdef __EXCEPTIONS
    3943        if (entry.hv_channel+32*entry.hv_board>=416)
    4044            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
    4153
    4254        (*this)[entry.hv()] = entry;
     
    4557    }
    4658
     59#ifdef __EXCEPTIONS
    4760    if (l!=416)
    4861        throw runtime_error("Number of lines read from "+fname+" does not match 416.");
     
    5063    if (size()!=416)
    5164        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;
    5282}
     83
     84#ifndef __MARS__
     85#include <boost/regex.hpp>
     86#include <mysql++/mysql++.h>
    5387
    5488void BiasMap::Retrieve(const std::string &database)
     
    114148        throw runtime_error("Number of entries retrived from database does not match 416.");
    115149}
     150#endif
  • trunk/FACT++/src/PixelMap.h

    r13239 r15212  
    22#define FACT_PixelMap
    33
    4 #include<vector>
    5 #include<string>
    6 #include<fstream>
    7 #include<sstream>
     4#include <vector>
     5#include <string>
     6#include <fstream>
     7#include <sstream>
    88
    99#include "tools.h"
    1010
    1111#ifdef DEBUG
    12 #include<iostream>  // cerr -- to be removed?
     12#include <iostream>  // cerr -- to be removed?
    1313#endif
    1414
     
    204204    }
    205205
     206#ifndef __MARS__
    206207    void Retrieve(const std::string &database);
    207     void Read(const std::string &fname);
     208#endif
     209    bool Read(const std::string &fname);
    208210
    209211    const BiasMapEntry &hv(int board, int channel) const
Note: See TracChangeset for help on using the changeset viewer.