Changeset 7438 for trunk/MagicSoft


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

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Cosy/tpoint/plot.C

    r7147 r7438  
    7777    ifstream fin(fname);
    7878
    79     cout << "Reading from " << fname << "..." << flush;
     79    cout << "Reading " << setw(23) << fname << "..." << flush;
    8080
    8181    while (1)
     
    109109    }
    110110
    111     cout << "done (" << g[0].GetN() << ")" << endl;
     111    cout << "done (" << setw(3) << (Int_t)h->GetEntries() << "/";
     112    cout << setw(3) << g[0].GetN() << ") " << flush;
    112113
    113114    return g[0].GetN();
     
    121122};
    122123
    123 const Int_t counts = 13-4;
     124const Int_t counts = 17-4;
    124125Description_t desc[counts] =
    125126{
     
    137138    {"0503",  "TPoints Residuals 3/2005" ,   "tpoint/tpoint0503.txt"},
    138139    {"0504",  "TPoints Residuals 4/2005" ,   "tpoint/tpoint0504.txt"},
    139     {"05051", "TPoints Residuals 5/2004-1" , "tpoint/tpoint0505-1.txt"},
     140    {"05051", "TPoints Residuals 5/2005-1" , "tpoint/tpoint0505-1.txt"},
    140141    // Mirror alignment has been fixed
    141     {"05052", "TPoints Residuals 5/2004-2" , "tpoint/tpoint0505-2.txt"},
     142    {"05052", "TPoints Residuals 5/2005-2" , "tpoint/tpoint0505-2.txt"},
    142143    // Fixes to pointing model due to fixing a screw
    143     {"0506", "TPoints Residuals 6/2004" , "tpoint/tpoint0506.txt"}
     144    {"0506", "TPoints Residuals 6/2005" , "tpoint/tpoint0506.txt"},
     145
     146    {"0508", "TPoints Residuals 8/2005" , "tpoint/tpoint0508.txt"},
     147    {"0509", "TPoints Residuals 9/2005" , "tpoint/tpoint0509.txt"},
     148    // Quick-and-dirty mirror alignment
     149    {"0510", "TPoints Residuals 10/2005" , "tpoint/tpoint0510.txt"},
     150    // New mirror alignment after Tenerife meeting
     151    {"0511", "TPoints Residuals 11/2005" , "tpoint/tpoint0511.txt"}
    144152};
    145153
     
    161169        cout << setw(2) << i << ": " << flush;
    162170        n[i] = fill(desc[i].fFile, g, &hx[i]);
     171        cout << " Mean: " << setw(5) << setprecision(2) << hx[i].GetMean() << " deg" <<  hx[i].GetRMS()<<endl;
    163172    }
    164173
  • trunk/MagicSoft/Cosy/tpoint/tpoint0511.txt

    r7430 r7438  
    413413# Capella               0.08    41   -52
    414414-51.7696 48.90804 90.75324 40.04845 5.278056 45.99806 -0.005096606 -0.02454738 53698.227554 197.9 2.627
     415
     416# --- 25.11.2005 --- 05:24:26.665
     417-112.7778 47.83293 29.71322 39.00944 5.919444 7.406944 0.03266414 0.0009378095 53699.225309 204 2.6
     418-143.7334 61.8596 358.7161 52.9985 7.655 5.225 0.007570955 0.01169973 53699.235536 204.6 2.769
     419168.2918 51.8943 310.7723 42.92117 9.459722 -8.658611 0.02000216 0.02253327 53699.24525 209.6 3.605
     420-52.39955 41.5637 90.11908 32.74121 5.278056 45.99806 0.02508735 0.002372406 53699.25409 199.4 2.982
  • 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.