Ignore:
Timestamp:
07/17/08 19:15:35 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mcamera/MCameraDC.cc

    r2893 r9010  
    1818!   Author(s): Thomas Bretz, 5/2003 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2003
     20!   Copyright: MAGIC Software Development, 2000-2008
    2121!
    2222!
     
    2626//
    2727// MCameraDC (PRELIMINARY)
     28//
     29//
     30// Version 2:
     31// ----------
     32//   + fStatus
     33//
    2834//
    2935/////////////////////////////////////////////////////////////////////////////
     
    4450//
    4551MCameraDC::MCameraDC(Int_t size, const char *name, const char *title)
    46     : fArray(size)
     52    : fStatus(0), fArray(size)
    4753{
    4854    fName  = name  ? name  : "MCameraDC";
    4955    fTitle = title ? title : "Storage container for the pixel currents";
     56}
     57
     58// --------------------------------------------------------------------------
     59//
     60// Interprete a DC report context
     61//
     62Int_t MCameraDC::Interprete(TString &str, Int_t len)
     63{
     64    const char *pos = str.Data()+len;
     65    const char *end = pos+577*4;
     66
     67    Int_t i=0;
     68    while (pos<end)
     69    {
     70        Int_t c;
     71        const Char_t hex[5] = { pos[0], pos[1], pos[2], pos[3], 0 };
     72        pos += 4;
     73
     74        const Int_t nn=sscanf(hex, "%4x", &c);
     75        if (nn!=1)
     76        {
     77            *fLog << warn << "WARNING - Reading hexadecimal DC information." << endl;
     78            return kCONTINUE;
     79        }
     80
     81        fArray[i++] = 0.001*c;
     82    }
     83
     84    str.Remove(0, pos-str.Data()); // Remove DC currents
     85    str=str.Strip(TString::kLeading);
     86
     87    return str.IsNull() ? kTRUE : kCONTINUE;
    5088}
    5189
Note: See TracChangeset for help on using the changeset viewer.