Changeset 2438 for trunk


Ignore:
Timestamp:
10/28/03 14:54:20 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2437 r2438  
    11                                                 -*-*- END OF LINE -*-*-
    22
     3  2003/10/28: Thomas Bretz
     4 
     5   * macros/readCT1.C:
     6     - fixed to work with the correct geometry
     7     
     8   * macros/readMagic.C:
     9     - fixed - was crashing
     10     
     11   * macros/tar.C:
     12     - exclude 'Tag' files from tar
     13     
     14   * manalysis/MGeomApply.[h,cc]:
     15     - replaced constructor by SetGeometry (constructor was
     16       not unique)
     17
     18   * mbase/MEvtLoop.[h,cc]:
     19     - set fProgress already when setting fDisplay (gives the
     20       possibility to overwrite fProgress)
     21     - removed 'entries' from ProcessGuiEvents (moved to fNumEvents)
     22     - Set ProgressBar position in percent instead of event number
     23     - Set progress bar range from 0 to 1
     24     
     25   * mbase/MReadSocket.cc:
     26     - fixed to treat timeout correctly
     27     - replaces usleep() by gSystem->Sleep()
     28
     29   * mbase/MTime.h:
     30     - added SetTime(ULong_t) (support for gSystem->Now())
     31     - added SetTime(Double_t)
     32     - added operator()
     33     - fixed all comparison operators to use time instead of
     34       time lo/hi - will be removed soon
     35       
     36   * mimage/MHHillasSrc.cc:
     37     - delete 3rd Pad
     38     
     39   * mraw/MRawEvtData.cc:
     40     - when drawing print gPad
     41
     42
     43
    344  2003/10/28: Wolfgang Wittek
    445
    5   * manalysis/MCT1PadONOFF.cc
    6     - replace GetMeanRms() by GetPedestalRms()
    7     - replace SetMeanRms() by SetPedestalRms()
    8     - reactivate code which was commented out by tgb
    9                      (no compilation errors on Alpha OSF)
    10 
    11   * manalysis/AnalysisLinkDef.h
    12              /Makefile
    13     - put back MCT1PadONOFF
    14 
    15   * macros/CT1Analysis.C
    16           /ONOFFCT1Analysis.C
    17     - current versions of macros for the analysis of CT1 data
     46   * manalysis/MCT1PadONOFF.cc
     47     - replace GetMeanRms() by GetPedestalRms()
     48     - replace SetMeanRms() by SetPedestalRms()
     49     - reactivate code which was commented out by tgb
     50       (no compilation errors on Alpha OSF)
     51
     52   * manalysis/AnalysisLinkDef.h, manalysis/Makefile
     53     - put back MCT1PadONOFF
     54
     55   * macros/CT1Analysis.C, macros/ONOFFCT1Analysis.C
     56     - current versions of macros for the analysis of CT1 data
    1857
    1958
     
    2564       that goes with the same value to both FADC gains (fDigitalNoise)
    2665     - Class version has been changed from 2 to 3.
     66
     67
    2768
    2869  2003/10/24: Abelardo Moralejo
     
    3778       class would produce wrong results.
    3879
     80
     81
    3982  2003/10/23: Abelardo Moralejo
    4083
     
    4487       we had in 3.02, and the graphics output had become unreadable.
    4588       Replacing some Draw() calls by DrawCopy() has solved the problem.
     89
    4690
    4791
  • trunk/MagicSoft/Mars/macros/readCT1.C

    r2377 r2438  
    4949    MParList plist;
    5050
    51     MGeomCamCT1  geomcam;
    5251    MHillas      hillas;
    5352    MHillasExt   hillasext;
     
    6766    MHillasCalc   hcalc;
    6867
     68    geomapl.SetGeometry("MGeomCamCT1");
     69
    6970    tlist.AddToList(&read);
    7071    tlist.AddToList(&clone);
     
    7778    if (!evtloop.PreProcess())
    7879        return;
     80
     81    MGeomCam *geomcam = (MGeomCam*)plist->FindObject("MGeomCam");
    7982
    8083    Int_t icount = 0;
  • trunk/MagicSoft/Mars/macros/readMagic.C

    r2377 r2438  
    9696        return;
    9797
    98     MHCamera display1(geomcam);
    99     MHCamera display2(geomcam);
     98    MGeomCam *geomcam = (MGeomCam*)plist->FindObject("MGeomCam");
     99
     100    MHCamera display1(*geomcam);
     101    MHCamera display2(*geomcam);
    100102
    101103    TCanvas c("Events", "Real Events", 300, 600);
  • trunk/MagicSoft/Mars/macros/tar.C

    r1323 r2438  
    2121    gSystem->cd("..");
    2222
    23     TString cmd = "tar cvf "+name+".tar --exclude=Root "+name+"/.rootrc "+name+"/*";
     23    TString cmd = "tar cvf "+name+".tar --exclude=Root Tag "+name+"/.rootrc "+name+"/*";
    2424
    2525    cout << "Executing: " << cmd << endl;
  • trunk/MagicSoft/Mars/manalysis/MGeomApply.cc

    r2380 r2438  
    7474// --------------------------------------------------------------------------
    7575//
    76 //  Give the name of the geometry you want to have, eg. MGeomCamCT1
    77 //
    78 MGeomApply::MGeomApply(const TString cam, const char *name, const char *title) : fGeomName(cam)
    79 {
    80     fName  = name  ? name  : "MGeomApply";
    81     fTitle = title ? title : "Task to apply geometry settings";
    82 }
    83 
    84 // --------------------------------------------------------------------------
    85 //
    8676//  Try to find 'MGeomCam' in the Parameter List. If it is not found,
    8777//  try to create a fGeomName object.
  • trunk/MagicSoft/Mars/manalysis/MGeomApply.h

    r2380 r2438  
    2020public:
    2121    MGeomApply(const char *name=NULL, const char *title=NULL);
    22     MGeomApply(const TString name, const char *name=NULL, const char *title=NULL);
     22
     23    void SetGeometry(TString geom) { fGeomName = geom; }
    2324
    2425    ClassDef(MGeomApply, 0) // Task to apply geometry settings
  • trunk/MagicSoft/Mars/mbase/MEvtLoop.cc

    r2416 r2438  
    1616!
    1717!
    18 !   Author(s): Thomas Bretz  12/2000 <mailto:tbretz@uni-sw.gwdg.de>
     18!   Author(s): Thomas Bretz, 12/2000 <mailto:tbretz@astro.uni-wuerzburg.de>
    1919!
    20 !   Copyright: MAGIC Software Development, 2000-2001
     20!   Copyright: MAGIC Software Development, 2000-2003
    2121!
    2222!
     
    7878#include <TSystem.h>        // gSystem
    7979#include <TStopwatch.h>
    80 #include <TGProgressBar.h>
     80#include <TGProgressBar.h> 
    8181
    8282#include "MLog.h"
     
    191191        fProgress=NULL;
    192192    else
     193    {
    193194        d->SetBit(kMustCleanup);
     195
     196        // Get pointer to update Progress bar
     197        fProgress = fDisplay->GetBar();
     198    }
    194199
    195200    if (fParList)
     
    237242        // Lock display to prevent user from deleting it
    238243        fDisplay->Lock();
    239         // Get pointer to update Progress bar
    240         fProgress = fDisplay->GetBar();
    241244        // Don't display context menus
    242245        fDisplay->SetNoContextMenu();
     
    267270}
    268271
    269 Bool_t MEvtLoop::ProcessGuiEvents(Int_t num, Int_t entries)
     272Bool_t MEvtLoop::ProcessGuiEvents(Int_t num)
    270273{
    271274    if (gROOT->IsBatch())
     
    347350            txt += " (";
    348351            txt += speed;
    349             txt += "Evts/s, est: ";
    350             txt += (int)((long int)(t0-t2)*entries/(60000.*(num-start)));
    351             txt += "m";
     352            txt += "Evts/s";
     353            if (fNumEvents>0)
     354            {
     355                txt += ", est: ";
     356                txt += (int)((long int)(t0-t2)*fNumEvents/(60000.*(num-start)));
     357                txt += "m";
     358            }
    352359            //txt += (int)fmod(entries/(1000.*(num-start)/(long int)(t0-t2)), 60);
    353360            //txt += "s";
     
    362369    // Set new progress bar position
    363370    //
    364     if (fProgress)
    365         fProgress->SetPosition(num);
     371    if (fProgress && fNumEvents>0)
     372        fProgress->SetPosition(num/fNumEvents);
    366373
    367374    //
     
    409416
    410417    Int_t entries = INT_MAX;
     418    fNumEvents = 0;
    411419
    412420    if (fProgress && !gROOT->IsBatch())
    413421    {
    414422        fProgress->Reset();
     423        fProgress->SetRange(0, 1);
     424
    415425#ifdef __MARS__
    416426        // limits.h
     
    421431
    422432        if (maxcnt>0)
    423             fProgress->SetRange(0, TMath::Min(maxcnt, entries));
     433            fNumEvents = TMath::Min(maxcnt, entries);
    424434        else
    425435            if (entries!=INT_MAX)
    426                 fProgress->SetRange(0, entries);
     436                fNumEvents = entries;
    427437    }
    428438
     
    454464        {
    455465            numcnts++;
    456             if (!ProcessGuiEvents(++dummy, entries))
     466            if (!ProcessGuiEvents(++dummy))
    457467                break;
    458468        }
     
    462472        {
    463473            numcnts++;
    464             if (!ProcessGuiEvents(maxcnt - dummy, entries))
     474            if (!ProcessGuiEvents(maxcnt - dummy))
    465475                break;
    466476        }
     
    473483    if (fProgress && !gROOT->IsBatch())
    474484    {
    475         fProgress->SetPosition(maxcnt>0 ? TMath::Min(maxcnt, entries) : entries);
     485        //fProgress->SetPosition(maxcnt>0 ? TMath::Min(maxcnt, entries) : entries);
     486        fProgress->SetPosition(1);
    476487        // FIXME: This is a workaround, because TApplication::Run is not thread safe against ProcessEvents
    477488        if (gApplication->InheritsFrom(TRint::Class()))
  • trunk/MagicSoft/Mars/mbase/MEvtLoop.h

    r2299 r2438  
    3030    TGProgressBar *fProgress;  //!
    3131
     32    ULong_t fNumEvents;        //!
     33
    3234    enum { kIsOwner = BIT(14) };
    3335
     
    3739    void StreamPrimitive(ofstream &out) const;
    3840
    39     Bool_t ProcessGuiEvents(Int_t num, Int_t entries);
     41    Bool_t ProcessGuiEvents(Int_t num);
    4042
    4143public:
  • trunk/MagicSoft/Mars/mbase/MReadSocket.cc

    r2386 r2438  
    3030//////////////////////////////////////////////////////////////////////////////
    3131#include "MReadSocket.h"
    32 
    33 /*
    34  #ifdef _REENTRANT
    35  #include <pthread.h>
    36  #endif
    37 */
    3832
    3933#include <unistd.h>          // usleep
     
    155149int MReadSocket::underflow()
    156150{
     151    if (fail())
     152    {
     153        setg(fBuffer, fBuffer, fBuffer+fMtu);
     154        return 0;
     155    }
     156
    157157    //
    158158    // This simple trick should do its job, because the
     
    161161    const TTime timeout = fTimeout+gSystem->Now();
    162162
    163     Int_t l, len=-1;
     163    Int_t len=-1;
    164164    while (len<0 && gSystem->Now()<timeout)
    165165    {
     166        Int_t l;
    166167        fRxSocket->GetOption(kBytesToRead, l);
    167168        if (l==0)
    168169        {
    169             usleep(1);
     170            gSystem->Sleep(1);
    170171            continue;
    171172        }
     
    177178        cout << "MReadSocket: TSocket::RecvRaw - Connection timed out." << endl;
    178179        setstate(ios::failbit);
     180        memset(fBuffer, 0, fMtu);
     181        len = fMtu;
    179182    }
    180183
  • trunk/MagicSoft/Mars/mbase/MTime.h

    r2386 r2438  
    7676    }
    7777
     78    void SetTime(ULong_t t)
     79    {
     80        // t [millisec]
     81        fNanoSec  = (t*1000000)%1000;
     82        t /= 1000;
     83        fSec      = t%60;
     84        t /= 60;
     85        fMin      = t%60;
     86        t /= 60;
     87        fHour     = t%24;
     88    }
     89
     90    void SetTime(Double_t t)
     91    {
     92        // t [s]
     93        fNanoSec  = (UInt_t)(fmod(t, 1)*1e9);
     94        fSec      = (Byte_t)fmod(t, 60);
     95        t /= 60;
     96        fMin      = (Byte_t)fmod(t, 60);
     97        t /= 60;
     98        fHour     = (Byte_t)fmod(t, 24);
     99    }
     100
    78101    void SetTime(Byte_t h, Byte_t m, Byte_t s, UShort_t ns)
    79102    {
     
    112135        return fNanoSec/1e9+(fHour*24*60*60+fMin*60+fSec);
    113136    }
     137    double operator()() const //[s]
     138    {
     139        return operator double();
     140    }
    114141
    115142    ClassDef(MTime, 1)  //A generalized MARS time stamp
     
    118145inline Double_t operator-(MTime &t1, MTime &t2)
    119146{
    120     return (Double_t)t1.GetTimeLo()-(Double_t)t2.GetTimeLo();
     147    return t1()-t2();
    121148}
    122149
    123150inline Bool_t operator<(MTime &t1, MTime &t2)
    124151{
    125     return (t1.GetTimeHi()<=t2.GetTimeHi()) && (t1.GetTimeLo()<t2.GetTimeLo());
     152    return t1()<t2();
    126153}
    127154
    128155inline Bool_t operator>(MTime &t1, MTime &t2)
    129156{
    130     return (t1.GetTimeHi()>=t2.GetTimeHi()) && (t1.GetTimeLo()>t2.GetTimeLo());
     157    return t1()>t2();
    131158}
    132159
    133160inline Bool_t operator<=(MTime &t1, MTime &t2)
    134161{
    135     return (t1.GetTimeHi()<=t2.GetTimeHi()) && (t1.GetTimeLo()<=t2.GetTimeLo());
     162    return t1<=t2();
    136163}
    137164
    138165inline Bool_t operator>=(MTime &t1, MTime &t2)
    139166{
    140     return (t1.GetTimeHi()>=t2.GetTimeHi()) && (t1.GetTimeLo()>=t2.GetTimeLo());
     167    return t1()>=t2();
    141168}
    142169
    143170inline Bool_t operator==(MTime &t1, MTime &t2)
    144171{
    145     return (t1.GetTimeLo()==t2.GetTimeLo()) && (t1.GetTimeHi()==t2.GetTimeHi());
     172    return t1()==t2();
    146173}
    147174
  • trunk/MagicSoft/Mars/mimage/MHHillasSrc.cc

    r2416 r2438  
    217217    fDist->Draw();
    218218
     219    delete pad->GetPad(3);
     220
    219221    pad->cd(4);
    220222    gPad->SetBorderMode(0);
  • trunk/MagicSoft/Mars/mraw/MRawEvtData.cc

    r2416 r2438  
    215215//     <index>      The pixel with the given index is drawn
    216216//
     217#include <TVirtualPad.h>
    217218void MRawEvtData::Draw(Option_t *opt)
    218219{
     
    300301    {
    301302        // FIXME: Add Legend
    302         *fLog << inf << "Drawing Histogram of Pixel with Idx #" << dec << pix.GetPixelId() << endl;
     303        *fLog << inf << "Drawing Histogram of Pixel with Idx #" << dec << pix.GetPixelId() << " to " << gPad << endl;
    303304
    304305        TH1F *histh = new TH1F(name, "FADC Samples", nh, -0.5, nh-.5);
Note: See TracChangeset for help on using the changeset viewer.