Ignore:
Timestamp:
06/14/08 15:19:45 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 edited

Legend:

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

    r7719 r8955  
    4040#include "MLogManip.h"
    4141
     42#include "MCameraTD.h"
     43
    4244ClassImp(MCameraTH);
    4345
     
    5355    fName  = name  ? name  : "MCameraTH";
    5456    fTitle = title ? title : "Storage container for the pixel discriminator threshold";
     57}
     58
     59// --------------------------------------------------------------------------
     60//
     61// Interprete the TH (discriminator thresholds) part of the report
     62//
     63Bool_t MCameraTH::InterpreteTH(TString &str, Int_t ver, MCameraTD &td)
     64{
     65    // Skip the TH (discriminator thresholds) part of the report (for old
     66    // CC files with wrong or nonsense number of TH-Bytes)
     67    if (ver<200507190)
     68    {
     69        Ssiz_t pr = str.First(' ');
     70        if (pr<0)
     71        {
     72            *fLog << warn << "WARNING - No TH information found at all." << endl;
     73            return kFALSE;
     74        }
     75        if (pr!=1154)
     76        {
     77            td.Invalidate();
     78
     79            str.Remove(0, pr);
     80            str=str.Strip(TString::kLeading);
     81            return kTRUE;
     82        }
     83    }
     84
     85    const char *pos = str.Data();
     86    const char *end = str.Data()+577*2;
     87
     88    Int_t i=0;
     89    while (pos<end)
     90    {
     91        const Char_t hex[3] = { pos[0], pos[1], 0 };
     92        pos += 2;
     93
     94        const Int_t n=sscanf(hex, "%2hhx", &fTH[i++]);
     95        if (n==1)
     96            continue;
     97
     98        *fLog << warn << "WARNING - Reading hexadecimal TH information." << endl;
     99        return kFALSE;
     100    }
     101
     102    SetValid();
     103
     104    str.Remove(0, end-str.Data()); // Remove TH
     105    str=str.Strip(TString::kLeading);
     106    return kTRUE;
    55107}
    56108
Note: See TracChangeset for help on using the changeset viewer.