Changeset 7438 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
12/01/05 16:43:46 (20 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
2 added
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r7437 r7438  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
    20  2005/11/30 Thomas Bretz
    21 
    22    * showplot.cc:
    23      - fixed some warnings
     20 2005/12/01 Thomas Bretz
     21
     22   * readdaq.cc:
     23     - allow different file names
     24
     25   * mbase/MLog.[h,cc]:
     26     - replaced preprocessor directive by const data member
     27
     28   * mbase/MDirIter.cc:
     29     - removed special treatment of ?-character
     30
     31   * mbase/Makefile, mbase/BaseLinkDef.h:
     32     - added new class
     33
     34   * mimage/MHillas.cc:
     35     - changed atan2-output in Print to same convention as used
     36       in MGeomCam
     37
     38   * mjobs/MJCalibrateSignal.cc:
     39     - modified replacement rule for output file names
     40
     41   * mbase/MStatusDisplay.cc:
     42     - fixed initial size
     43     - automatically call SetFrameBorderMode for each new canvas
     44
     45   * mjobs/MSequence.cc:
     46     - updated rule used to build file names
    2447
    2548   * mgui/MCamEvent.[h,cc]:
    2649     - implemented new member function GetCameraRMS
    2750     - implemented new member function GetCameraStat
     51
     52   * mraw/MRawFileRead.[h,cc]:
     53     - implemented new I/O scheme
     54
     55
     56
     57 2005/11/30 Thomas Bretz
     58
     59   * showplot.cc:
     60     - fixed some warnings
    2861
    2962   * mmc/MMcFadcHeader.[hxx,cxx]:
     
    3568   * mmc/Makefile:
    3669     - added mgui
    37 
    38    * mbase/MStatusDisplay.cc:
    39      - fixed initial size
    40      - automatically call SetFrameBorderMode for each new canvas
    4170
    4271   * datacenter/macros/plotdb.C:
  • trunk/MagicSoft/Mars/mbase/BaseLinkDef.h

    r6915 r7438  
    1515#pragma link C++ class MLogPlugin+;
    1616#pragma link C++ class MLogHtml+;
     17
     18// I/O
     19#pragma link C++ class MZlib+;
    1720
    1821// Basic Network Tools
  • trunk/MagicSoft/Mars/mbase/MDirIter.cc

    r6466 r7438  
    223223    n.ReplaceAll("+", "\\+");
    224224    n.ReplaceAll("*", "[^\\/:]*");
    225     n.ReplaceAll("?", ".");
    226225    n.Append("$");
    227226
  • trunk/MagicSoft/Mars/mbase/MLog.cc

    r7151 r7438  
    173173// which is used for the output (i)
    174174//
    175 MLog::MLog(int i) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(i), fIsNull(kFALSE), fOut(NULL), fOutAllocated(kFALSE), fGui(NULL), fNumLines(0)
     175MLog::MLog(int i) : ostream(this), fPPtr(fBase), fEPtr(fBase+fgBufferSize), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(i), fIsNull(kFALSE), fOut(NULL), fOutAllocated(kFALSE), fGui(NULL), fNumLines(0)
    176176{
    177177    Init();
     
    183183// ofstream as the default output device
    184184//
    185 MLog::MLog(ofstream &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fIsNull(kFALSE), fOut(&out), fOutAllocated(kFALSE), fGui(NULL), fNumLines(0)
     185MLog::MLog(ofstream &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+fgBufferSize), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fIsNull(kFALSE), fOut(&out), fOutAllocated(kFALSE), fGui(NULL), fNumLines(0)
    186186{
    187187    Init();
     
    193193// TGTextView as the default output device
    194194//
    195 MLog::MLog(TGTextView &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eGui), fOut(NULL), fOutAllocated(kFALSE), fGui(&out), fNumLines(0)
     195MLog::MLog(TGTextView &out) : ostream(this), fPPtr(fBase), fEPtr(fBase+fgBufferSize), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eGui), fOut(NULL), fOutAllocated(kFALSE), fGui(&out), fNumLines(0)
    196196{
    197197    Init();
     
    204204// or not.
    205205//
    206 MLog::MLog(const char *fname, int flag) : ostream(this), fPPtr(fBase), fEPtr(fBase+bsz), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fIsNull(kFALSE), fGui(NULL), fNumLines(0)
     206MLog::MLog(const char *fname, int flag) : ostream(this), fPPtr(fBase), fEPtr(fBase+fgBufferSize), fOutputLevel(0), fDebugLevel((unsigned)-1), fDevice(eFile), fIsNull(kFALSE), fGui(NULL), fNumLines(0)
    207207{
    208208    Init();
  • trunk/MagicSoft/Mars/mbase/MLog.h

    r7001 r7438  
    1313#include <iostream>  // base classes for MLog
    1414
    15 #define bsz    160 // two standard lines
    1615
    1716class MArgs;
     
    5453    static const char *const kDark;
    5554
     55    static const int fgBufferSize = 160;  // two standard lines
     56
    5657    char        fBuffer;      //!
    57     char        fBase[bsz+1]; //! Buffer to store the data in
     58    char        fBase[fgBufferSize+1]; //! Buffer to store the data in
    5859    char       *fPPtr;        //! Pointer to present position in buffer
    5960    const char *fEPtr;        //! Pointer to end of buffer
  • trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc

    r7434 r7438  
    722722    // set the smallest and biggest size of the Main frame
    723723    // and move it to its appearance position
    724     SetWMSizeHints(571, 480, 2048, 1536, 1, 1);
    725     MoveResize(rand()%100+571, rand()%100+480, 570, 480);
     724    SetWMSizeHints(572, 480, 2048, 1536, 1, 1);
     725    MoveResize(rand()%100+572, rand()%100+480, 572, 480);
    726726
    727727    //
     
    998998
    999999    c.SetFillColor(16/*165*//*17*//*203*/);
     1000    c.SetFrameBorderMode(0);
    10001001    c.SetBorderMode(0);
    10011002
     
    15891590
    15901591    case kSize640: 
    1591         Resize(571, 480);
     1592        Resize(572, 480);
    15921593        return kTRUE;
    15931594    case kSize768: 
  • trunk/MagicSoft/Mars/mbase/Makefile

    r6915 r7438  
    5959           MClone.cc \
    6060           MContinue.cc \
    61            MPrint.cc
     61           MPrint.cc \
     62           MZlib.cc
    6263
    6364############################################################
  • trunk/MagicSoft/Mars/mgui/MCamEvent.cc

    r7349 r7438  
    6262Double_t MCamEvent::GetCameraMean(const MGeomCam &cam, Int_t type) const
    6363{
     64    return GetCameraStat(cam, type)[0];
     65    /*
    6466    Int_t    num  = 0;
    6567    Double_t mean = 0;
     
    7476    }
    7577    return num == 0 ? 0 : mean/num;
     78    */
    7679}
     80
     81// --------------------------------------------------------------------------
     82//
     83// Return the rms of all corresponding GetPixelContent
     84//
     85Double_t MCamEvent::GetCameraRMS(const MGeomCam &cam, Int_t type) const
     86{
     87    return GetCameraStat(cam, type)[1];
     88    /*
     89    Int_t    num  = 0;
     90    Double_t sum = 0;
     91    Double_t sq  = 0;
     92
     93    for (unsigned int i=0; i<cam.GetNumPixels(); i++)
     94    {
     95        Double_t val;
     96        if (!GetPixelContent(val, i, cam, type))
     97            continue;
     98
     99        sum += val;
     100        sq  += val;
     101        num ++;
     102    }
     103
     104    if (num==0)
     105        return 0;
     106
     107    sum /= num;
     108    sq  /= num;
     109
     110    return TMath::Sqrt(sq-sum*sum);
     111    */
     112}
     113
     114// --------------------------------------------------------------------------
     115//
     116// Return the rms of all corresponding GetPixelContent
     117//
     118TArrayD MCamEvent::GetCameraStat(const MGeomCam &cam, Int_t type) const
     119{
     120    Int_t    num = 0;
     121    Double_t sum = 0;
     122    Double_t sq  = 0;
     123
     124    for (unsigned int i=0; i<cam.GetNumPixels(); i++)
     125    {
     126        Double_t val;
     127        if (!GetPixelContent(val, i, cam, type))
     128            continue;
     129
     130        sum += val;
     131        sq  += val;
     132        num ++;
     133    }
     134
     135    if (num==0)
     136        return 0;
     137
     138    sum /= num;
     139    sq  /= num;
     140
     141    TArrayD stat(2);
     142    stat[0] = sum;
     143    stat[1] = TMath::Sqrt(sq-sum*sum);
     144    return stat;
     145}
  • trunk/MagicSoft/Mars/mgui/MCamEvent.h

    r7349 r7438  
    22#define MARS_MCamEvent
    33
    4 #ifndef ROOT_TROOT
    5 #include <TROOT.h>
     4#ifndef ROOT_TArrayD
     5#include <TArrayD.h>
    66#endif
    77
     
    1818
    1919    virtual Double_t GetCameraMean(const MGeomCam &cam, Int_t type=0) const;
     20    virtual Double_t GetCameraRMS(const MGeomCam &cam, Int_t type=0) const;
     21    virtual TArrayD  GetCameraStat(const MGeomCam &cam, Int_t type=0) const;
    2022
    2123    ClassDef(MCamEvent, 0) // A camera event
  • trunk/MagicSoft/Mars/mimage/MHillas.cc

    r7224 r7438  
    159159void MHillas::Print(Option_t *) const
    160160{
    161     Double_t atg = atan2(fMeanY, fMeanX)*kRad2Deg;
    162 
    163     if (atg<0)
    164         atg += 180;
     161    const Double_t atg = atan2(fMeanX, fMeanY)*kRad2Deg;
    165162
    166163    *fLog << all;
     
    182179void MHillas::Print(const MGeomCam &geom) const
    183180{
    184     Double_t atg = atan2(fMeanY, fMeanX)*kRad2Deg;
    185 
    186     if (atg<0)
    187         atg += 180;
     181    const Double_t atg = atan2(fMeanX, fMeanY)*kRad2Deg;
    188182
    189183    *fLog << all;
  • trunk/MagicSoft/Mars/mjobs/MJCalibrateSignal.cc

    r7208 r7438  
    403403    read->AddFiles(iter);
    404404
    405     const TString fname(Form("%s{s/_D_/_Y_}{s/.raw$/.root}", fPathOut.Data()));
     405    const TString fname(Form("%s{s/_D_/_Y_}{s/\\.raw$/\\.root}{s/\\.raw\\.gz$/.root}", fPathOut.Data()));
    406406
    407407   
  • trunk/MagicSoft/Mars/mjobs/MSequence.cc

    r7380 r7438  
    279279        case kRawCal:
    280280        case kRawAll:
    281             n += ".raw";
     281            n += ".raw.?g?z?";
    282282            break;
    283283        default:
  • trunk/MagicSoft/Mars/mraw/MRawFileRead.cc

    r6503 r7438  
    4444
    4545#include <errno.h>
    46 #include <fstream>
    4746
    4847#include <TSystem.h>
     
    5150#include "MLogManip.h"
    5251
     52#include "MZlib.h"
    5353#include "MTime.h"
    5454#include "MParList.h"
     
    127127Byte_t MRawFileRead::IsFileValid(const char *name)
    128128{
    129     ifstream fin(name);
     129    MZlib fin(name);
    130130    if (!fin)
    131131        return 0;
     
    188188
    189189    const char *expname = gSystem->ExpandPathName(name);
    190     fIn = new ifstream(expname);
     190    fIn = new MZlib(expname);
    191191
    192192    const Bool_t noexist = !(*fIn);
     
    194194    {
    195195        *fLog << err << "Cannot open file " << expname << ": ";
    196         *fLog << strerror(errno) << endl;
     196        *fLog << (errno==0?strerror(errno):"Insufficient memory for decompression") << endl;
    197197    }
    198198    else
  • trunk/MagicSoft/Mars/mraw/MRawFileRead.h

    r6500 r7438  
    77
    88class TList;
     9class MZlib;
    910class MTaskList;
    1011
     
    1213{
    1314private:
    14     TList     *fFileNames;      // list of file names
    15     UInt_t     fNumFile;        //! number of next file
    16     UInt_t     fNumEvents;      //! input stream (file to read from)
    17     UInt_t     fNumTotalEvents; //! total number of events in all files
     15    TList    *fFileNames;      // list of file names
     16    UInt_t    fNumFile;        //! number of next file
     17    UInt_t    fNumEvents;      //! input stream (file to read from)
     18    UInt_t    fNumTotalEvents; //! total number of events in all files
    1819
    19     ifstream  *fIn;             //! input stream (file to read from)
     20    MZlib    *fIn;             //! input stream (file to read from)
    2021
    21     MParList  *fParList;        //! tasklist to call ReInit from
     22    MParList *fParList;        //! tasklist to call ReInit from
    2223
    23     UInt_t     fInterleave;
     24    UInt_t    fInterleave;
    2425
    2526    Int_t  OpenNextFile(Bool_t print=kTRUE);
  • trunk/MagicSoft/Mars/readdaq.cc

    r7432 r7438  
    9292    TString kNamein = arg.GetArgumentStr(0);
    9393 
    94     if (!kNamein.EndsWith(".raw"))
     94    if (!kNamein.EndsWith(".raw") && !kNamein.EndsWith(".raw.gz"))
    9595        kNamein += ".raw";
    9696
Note: See TracChangeset for help on using the changeset viewer.