Changeset 11965 for trunk


Ignore:
Timestamp:
09/05/11 16:25:53 (13 years ago)
Author:
tbretz
Message:
Replaced reading of the FACTmapV5 by the PixelMap class.
File:
1 edited

Legend:

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

    r11958 r11965  
    1111#include "Console.h"
    1212#include "Converter.h"
     13#include "PixelMap.h"
    1314
    1415#include "tools.h"
     
    17851786        // --------------------------------------------------------------------------
    17861787
    1787         ifstream fin("FACTmapV5.txt");
    1788 
    1789         int l = 0;
    1790 
    1791         vector<float> vec(kNumChannels);
    1792 
    1793         string buf;
    1794         while (getline(fin, buf, '\n'))
    1795         {
    1796             if (l>1439)
    1797                 break;
    1798 
    1799             buf = Tools::Trim(buf);
    1800             if (buf[0]=='#')
    1801                 continue;
    1802 
    1803             stringstream str(buf);
    1804 
    1805             int   idummy, board, channel;
    1806             float fdummy, volt;
    1807 
    1808             str >> idummy >> idummy >> idummy >> idummy >> idummy;
    1809             str >> volt;
    1810             str >> board;
    1811             str >> channel;
    1812             str >> fdummy >> fdummy >> fdummy;
    1813 
    1814             if (channel+32*board>=kNumChannels)
    1815             {
    1816                 T::Error("Invalid board/channel read from FACTmapV5.txt.");
    1817                 return 4;
    1818             }
    1819 
    1820             vec[channel+32*board] = volt;
    1821             l++;
    1822         }
    1823 
    1824         if (l!=1440)
     1788        PixelMap map;
     1789        if (!map.Read("FACTmapV5.txt"))
    18251790        {
    18261791            T::Error("Reading reference voltages from FACTmapV5.txt failed.");
     
    18281793        }
    18291794
    1830         if (!fBias.SetNewGapdVoltage(vec))
     1795        if (!fBias.SetNewGapdVoltage(map.Vgapd()))
    18311796        {
    18321797            T::Error("Setting reference voltages failed.");
Note: See TracChangeset for help on using the changeset viewer.