Ignore:
Timestamp:
06/14/08 15:19:45 (16 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mcamera
Files:
6 edited

Legend:

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

    r7726 r8955  
    5757// --------------------------------------------------------------------------
    5858//
     59// Interprete the receiver board temperature part of the report
     60//
     61Bool_t MCameraRecTemp::InterpreteRecTemp(TString &str)
     62{
     63    Int_t len;
     64    for (Int_t i=0; i<76; i++)
     65    {
     66        const Int_t n=sscanf(str.Data(), "%f %n", &fRecTemp[i], &len);
     67        str.Remove(0, len);
     68
     69        if (n==1)
     70            continue;
     71
     72        if (n==0 && i==0)
     73        {
     74            *fLog << inf << "Receiver Board Temperatures empty." << endl;
     75            Invalidate();
     76            break;
     77        }
     78
     79        *fLog << warn << "WARNING - Reading Receiver Board Temperature information." << endl;
     80        return kFALSE;
     81    }
     82
     83    return kTRUE;
     84}
     85
     86
     87// --------------------------------------------------------------------------
     88//
    5989// Print the dc currents
    6090//
  • trunk/MagicSoft/Mars/mcamera/MCameraRecTemp.h

    r7726 r8955  
    1313{
    1414    friend class MReportCC;
     15    friend class MReportRec;
    1516private:
    1617    TArrayF fRecTemp; // [deg C] receiver board temperatures
    1718    Bool_t  fIsValid; // fRecTemp contains valid information
     19
     20    Bool_t InterpreteRecTemp(TString &str);
    1821
    1922public:
  • trunk/MagicSoft/Mars/mcamera/MCameraTD.cc

    r7719 r8955  
    1919!   Author(s): Florian Goebel 11/2005 <mailto:fgoebel@mppmu.mpg.de>
    2020!
    21 !   Copyright: MAGIC Software Development, 2000-2006
     21!   Copyright: MAGIC Software Development, 2000-2008
    2222!
    2323!
     
    5757// --------------------------------------------------------------------------
    5858//
     59// Interprete the TD (discriminator delays) part of the report
     60//
     61Bool_t MCameraTD::InterpreteTD(TString &str, Int_t ver)
     62{
     63    // Skip the TD (discriminator delays) part of the report (for old
     64    // CC files with wrong or nonsense number of TD-Bytes)
     65    if (ver<200412210)
     66    {
     67        Ssiz_t pr = str.First(' ');
     68        if (pr<0)
     69        {
     70            *fLog << warn << "WARNING - No TD information found at all." << endl;
     71            return kFALSE;
     72        }
     73        if (pr!=1000)
     74        {
     75            Invalidate();
     76
     77            str.Remove(0, pr);
     78            str=str.Strip(TString::kLeading);
     79            return kTRUE;
     80        }
     81    }
     82
     83    // Older files have less bytes (pixels) stored
     84    const Int_t numpix = ver<200510250 ? 500 : 577;
     85
     86    const char *pos = str.Data();
     87    const char *end = str.Data()+numpix*2;
     88
     89    Int_t i=0;
     90    while (pos<end)
     91    {
     92        const Char_t hex[3] = { pos[0], pos[1], 0 };
     93        pos += 2;
     94
     95        const Int_t n=sscanf(hex, "%2hhx", &fTD[i++]);
     96        if (n==1)
     97            continue;
     98
     99        *fLog << warn << "WARNING - Reading hexadecimal TD information." << endl;
     100        return kFALSE;
     101    }
     102
     103    SetValid();
     104
     105    str.Remove(0, end-str.Data()); // Remove TD
     106    str=str.Strip(TString::kLeading);
     107
     108    return kTRUE;
     109}
     110
     111// --------------------------------------------------------------------------
     112//
    59113// Print the discrimintaor delays
    60114//
  • trunk/MagicSoft/Mars/mcamera/MCameraTD.h

    r7719 r8955  
    1616{
    1717    friend class MReportCC;
     18    friend class MReportRec;
    1819private:
    1920    TArrayC fTD;      // [au] discriminator delays
    2021    Bool_t  fIsValid; // fTD contains valid information
     22
     23    Bool_t InterpreteTD(TString &str, Int_t ver);
    2124
    2225public:
  • 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
  • trunk/MagicSoft/Mars/mcamera/MCameraTH.h

    r8287 r8955  
    11/* ======================================================================== *\
    2 !  $Name: not supported by cvs2svn $:$Id: MCameraTH.h,v 1.7 2007-02-01 15:56:17 tbretz Exp $
     2!  $Name: not supported by cvs2svn $:$Id: MCameraTH.h,v 1.8 2008-06-14 14:19:03 tbretz Exp $
    33\* ======================================================================== */
    44#ifndef MARS_MCameraTH
     
    1616#endif
    1717
     18class MCameraTD;
     19
    1820class MCameraTH : public MParContainer, public MCamEvent
    1921{
    2022    friend class MReportCC;
     23    friend class MReportRec;
    2124private:
    2225    TArrayC fTH;      // [au] discriminator thresholds
    2326    Bool_t  fIsValid; // fTH contains valid information
     27
     28    Bool_t InterpreteTH(TString &str, Int_t ver, MCameraTD &td);
    2429
    2530public:
Note: See TracChangeset for help on using the changeset viewer.