Changeset 2563 for trunk/MagicSoft/Mars


Ignore:
Timestamp:
11/23/03 21:18:30 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2557 r2563  
    44
    55                                                 -*-*- END OF LINE -*-*-
     6  2003/11/23: Thomas Bretz
     7
     8   * star.cc:
     9     - fixed a typo
     10     
     11   * manalysis/MCerPhotCalc.cc:
     12     - fixed logging stream
     13     
     14   * mbase/MStatusDisplay.[h,cc]:
     15     - made fLog available to derived classes
     16     - added Reset()-function
     17     - added some debug messages to CloseWindow()
     18     - put 'return' back into HandleConfigureNotify (fixes the
     19       problem with the random size of the Mona display)
     20     - added a new workaround in HandleEvent which fixed a crash
     21       when switching back to the 'main' tab in MEventDisplay
     22       This is NOT understood!
     23     - changed bit 14/15 to 15/16. BIT(14) is used in TGMainFrame
     24       already
     25     
     26   * mfilter/MFRealTimePeriod.h:
     27     - added Setter for timeout
     28     
     29   * mhist/MHCamEvent.cc:
     30     - fill the rms for each event. This may be switched off by
     31       a status bit in the future for speed reasons.
     32       
     33   * mhist/MHCamera.[h,cc]:
     34     - removed Profile() from GetMaximum/GetMinimum if no
     35       autoscale is done
     36     - added 'content' Draw option
     37     
     38   * mhist/MHEvent.cc:
     39     - fixed a typo: GetNumEvents() --> GetRunNumber()
     40     
     41   * mhist/MHTriggerLvl0.cc:
     42     - small changes to output
     43     
     44   * mraw/MRawSocketRead.[h,cc]:
     45     - renamed fRawEvtTime to fTime
     46     - changed 'MRawEvtTime' to 'MTime'
     47     - added some debugging output in case of kContinue
     48
     49
     50
    651  2003/11/22: Thomas Bretz
    752
  • trunk/MagicSoft/Mars/manalysis/MCerPhotCalc.cc

    r2470 r2563  
    9797    if (!fRunHeader)
    9898    {
    99         *fLog << dbginf << "MRawRunHeader not found... aborting." << endl;
     99        *fLog << err << "MRawRunHeader not found... aborting." << endl;
    100100        return kFALSE;
    101101    }
     
    104104    if (!fRawEvt)
    105105    {
    106         *fLog << dbginf << "MRawEvtData not found... aborting." << endl;
     106        *fLog << err << "MRawEvtData not found... aborting." << endl;
    107107        return kFALSE;
    108108    }
     
    111111    if (!fPedestals)
    112112    {
    113         *fLog << dbginf << "MPedestalCam not found... aborting." << endl;
     113        *fLog << err << "MPedestalCam not found... aborting." << endl;
    114114        return kFALSE;
    115115    }
  • trunk/MagicSoft/Mars/mbase/MStatusDisplay.cc

    r2550 r2563  
    560560//
    561561MStatusDisplay::MStatusDisplay(Long_t t)
    562 : TGMainFrame(NULL, 1, 1), fTab(NULL), fTimer(this, t, kTRUE), fStatus(kLoopNone), fLog(&gLog), fLogIdx(-1), fLogTimer(this, 250, kTRUE), fLogBox(NULL), fIsLocked(0)
     562: TGMainFrame(NULL, 1, 1), fLog(&gLog), fTab(NULL), fTimer(this, t, kTRUE), fStatus(kLoopNone), fLogIdx(-1), fLogTimer(this, 250, kTRUE), fLogBox(NULL), fIsLocked(0)
    563563{
    564564    // p==NULL means: Take gClient->GetRoot() if not in batch mode
     
    587587    fList = new MGList;
    588588    fList->SetOwner();
    589 
    590     //
    591     // set the smallest and biggest size of the Main frame
    592     // and move it to its appearance position
    593     SetWMSizeHints(570, 480, 1280, 980, 1, 1);
    594     Move(rand()%100+50, rand()%100+50);
    595     Resize(570, 480);
    596589
    597590    //
     
    612605        AddStatusBar();
    613606    }
     607
     608    //
     609    // set the smallest and biggest size of the Main frame
     610    // and move it to its appearance position
     611    SetWMSizeHints(570, 480, 1280, 980, 1, 1);
     612    MoveResize(rand()%100+570, rand()%100+480, 570, 480);
    614613
    615614    //
     
    10521051 */
    10531052
     1053void MStatusDisplay::Reset()
     1054{
     1055    for (int i=fTab->GetNumberOfTabs()-1; i>0; i--)
     1056        RemoveTab(i);
     1057}
     1058
    10541059// --------------------------------------------------------------------------
    10551060//
     
    10771082
    10781083    case kFileReset:
    1079         for (int i=fTab->GetNumberOfTabs()-1; i>0; i--)
    1080             RemoveTab(i);
     1084        Reset();
    10811085        return kTRUE;
    10821086        /*
     
    12171221    switch (submsg)
    12181222    {
    1219     case kCM_MENU:
     1223    case kCM_MENU: // 1
    12201224        return ProcessMessageCommandMenu(mp1); // mp2=userdata
    1221     case kCM_TAB:
     1225    case kCM_TAB:  // 8
    12221226        /*
    12231227         for (int i=0; i<fTab->GetNumberOfTabs(); i++)
     
    12381242        return kTRUE;
    12391243#ifdef DEBUG
    1240     case kCM_MENUSELECT:
     1244    case kCM_MENUSELECT: // 2
    12411245        cout << "Command-Menuselect #" << mp1 << " (UserData=" << (void*)mp2 << ")" << endl;
    12421246        return kTRUE;
    12431247
    1244     case kCM_BUTTON:
     1248    case kCM_BUTTON: // 3
    12451249        cout << "Command-Button." << endl;
    12461250        return kTRUE;
    12471251
    1248     case kCM_CHECKBUTTON:
     1252    case kCM_CHECKBUTTON: // 4
    12491253        cout << "Command-CheckButton." << endl;
    12501254        return kTRUE;
    12511255
    1252     case kCM_RADIOBUTTON:
     1256    case kCM_RADIOBUTTON: // 5
    12531257        cout << "Command-RadioButton." << endl;
    12541258        return kTRUE;
    12551259
    1256     case kCM_LISTBOX:
     1260    case kCM_LISTBOX: // 6
    12571261        cout << "Command-Listbox #" << mp1 << " (LineId #" << mp2 << ")" << endl;
    12581262        return kTRUE;
    12591263
    1260     case kCM_COMBOBOX:
     1264    case kCM_COMBOBOX: // 7
    12611265        cout << "Command-ComboBox." << endl;
    12621266        return kTRUE;
     
    13511355{
    13521356    // Can be found in WidgetMessageTypes.h
     1357#ifdef DEBUG
    13531358    cout << "Msg: " << GET_MSG(msg) << " Submsg:" << GET_SUBMSG(msg);
    13541359    cout << " Mp1=" << mp1 << " Mp2=" << mp2 << endl;
     1360#endif
    13551361    switch (GET_MSG(msg))
    13561362    {
    1357     case kC_COMMAND:
     1363    case kC_COMMAND:  // 1
    13581364        return ProcessMessageCommand(GET_SUBMSG(msg), mp1, mp2);
    13591365
    1360     case kC_TEXTVIEW:
     1366    case kC_TEXTVIEW: // 9
    13611367        return ProcessMessageTextview(GET_SUBMSG(msg), mp1, mp2);
    13621368
    1363     case kC_USER:
     1369    case kC_USER:     // 1001
    13641370        return ProcessMessageUser(GET_SUBMSG(msg), mp1, mp2);
    13651371    }
     
    13871393    gLog << dbg << "MStatusDisplay is on heap: " << (int)IsOnHeap() << endl;
    13881394
    1389     if (TestBit(kExitLoopOnExit))
     1395    if (TestBit(kExitLoopOnExit) || TestBit(kExitLoopOnClose))
     1396    {
     1397        gLog << dbg << "CloseWindow() calling ExitLoop." << endl;
    13901398        gSystem->ExitLoop();
    1391     if (TestBit(kExitLoopOnClose))
    1392         gSystem->ExitLoop();
     1399    }
    13931400
    13941401    if (fIsLocked<=0 && IsOnHeap())
     1402    {
     1403        gLog << dbg << "delete MStatusDisplay;" << endl;
    13951404        delete this;
     1405    }
    13961406    fStatus = kFileExit;
     1407    gLog << dbg << "MStatusDisplay.fStatus=kFileExit;" << endl;
    13971408}
    13981409
     
    21172128     */
    21182129
    2119     //Bool_t wchanged = w!=GetWidth();
     2130    Bool_t wchanged = w!=GetWidth();
    21202131    Bool_t hchanged = h!=GetHeight();
    2121     /*
     2132
    21222133    if (!wchanged && !hchanged)
    21232134    {
    21242135        Layout();
    21252136        // FIXME: Make sure that this doesn't result in endless loops.
    2126         // return kTRUE;
    2127     }
    2128     */
     2137        return kTRUE;
     2138    }
     2139
    21292140
    21302141    if (GetWidth()==1 && GetHeight()==1)
     
    21492160Bool_t MStatusDisplay::HandleEvent(Event_t *event)
    21502161{
     2162#if ROOT_VERSION_CODE == ROOT_VERSION(3,05,07)
     2163    // Strange... crashes on the LP machines...
     2164    if (event->fType==kClientMessage)
     2165        if (event->fHandle == gROOT_MESSAGE)
     2166            if (event->fUser[0]==264 && event->fUser[1] == 0 && event->fUser[2]==0)
     2167                return kTRUE;
     2168#endif
     2169
    21512170    Bool_t rc = TGMainFrame::HandleEvent(event);
    21522171
  • trunk/MagicSoft/Mars/mbase/MStatusDisplay.h

    r2550 r2563  
    5656    enum
    5757    {
    58         kExitLoopOnExit  = BIT(14),
    59         kExitLoopOnClose = BIT(15)
     58        // TGMainFrame::kDontCallClose = BIT(14)
     59        kExitLoopOnExit  = BIT(15),
     60        kExitLoopOnClose = BIT(16)
    6061     };
    6162
    6263protected:
     64    MLog             *fLog;
    6365    MGList           *fList;
    6466    TGCompositeFrame *fUserFrame;
     
    8082    TString fPrinter;
    8183
    82     MLog *fLog;
    8384    Int_t fLogIdx;
    8485    TTimer fLogTimer;
     
    179180     void UnLock() { if (fIsLocked>0) fIsLocked--; }
    180181
     182     void Reset();
     183
    181184     Bool_t CheckTabForCanvas(int num) const;
    182185
  • trunk/MagicSoft/Mars/mfilter/MFRealTimePeriod.h

    r2490 r2563  
    2121    }
    2222
     23    void SetTime(UInt_t millis) { fMilliSec = millis; }
     24
    2325    Int_t Process();
    2426    Bool_t IsExpressionTrue() const { return fResult; }
  • trunk/MagicSoft/Mars/mhist/MHCamEvent.cc

    r2550 r2563  
    124124    if (!evt)
    125125    {
    126         *fLog << err << dbginf << "No MCamEvent found..." << endl;
     126        *fLog << err << dbginf << "Got no MCamEvent as argument of Fill()..." << endl;
    127127        return kFALSE;
    128128    }
    129129    fSum->AddCamContent(*evt, fType);
    130 
     130    fRms->SetCamContent(*fSum, 1);
    131131    return kTRUE;
    132132}
     
    138138Bool_t MHCamEvent::Finalize()
    139139{
    140     fRms->AddCamContent(*fSum, 1);
     140    //fRms->AddCamContent(*fSum, 1);
    141141    return kTRUE;
    142142}
  • trunk/MagicSoft/Mars/mhist/MHCamera.cc

    r2557 r2563  
    299299{
    300300    if (fMinimum != -1111)
    301         return Profile(fMinimum);
     301        return fMinimum;
    302302
    303303    if (fNcells<=1)
     
    329329{
    330330    if (fMaximum!=-1111)
    331         return Profile(fMaximum);
     331        return fMaximum;
    332332
    333333    if (fNcells<=1)
     
    359359// To draw a camera into its own pad do something like:
    360360//
    361 // MGeomCamMagic m;
    362 // MHCamera *d=new MHCamera(m);
    363 //
    364 // TCanvas *c = new TCanvas;
    365 // c->Divide(2,1);
    366 // c->cd(1);
    367 //
    368 // d->FillRandom();
    369 // d->Draw();
    370 // d->SetBit(kCanDelete);
     361//   MGeomCamMagic m;
     362//   MHCamera *d=new MHCamera(m);
     363//
     364//   TCanvas *c = new TCanvas;
     365//   c->Divide(2,1);
     366//   c->cd(1);
     367//
     368//   d->FillRandom();
     369//   d->Draw();
     370//   d->SetBit(kCanDelete);
     371//
     372// There are several drawing options:
     373//   'hist'        Draw as a standard TH1 histogram (value vs. pixel index)
     374//   'box'         Draw hexagons which size is in respect to its contents
     375//   'nocol'       Leave the 'boxed' hexagons empty
     376//   'pixelindex'  Display the pixel index in each pixel
     377//   'sectorindex' Display the sector index in each pixel
     378//   'content'     Display the relative content aligned to GetMaximum() and
     379//                 GeMinimum() ((val-min)/(max-min))
    371380//
    372381void MHCamera::Draw(Option_t *option)
     
    570579
    571580    if (opt.Contains("pixelindex"))
    572         PaintIndices(kFALSE);
     581        PaintIndices(0);
    573582    if (opt.Contains("sectorindex"))
    574         PaintIndices(kTRUE);
     583        PaintIndices(1);
     584    if (opt.Contains("content"))
     585        PaintIndices(2);
    575586}
    576587
     
    632643}
    633644
    634 void MHCamera::PaintIndices(Bool_t sector)
     645void MHCamera::PaintIndices(Int_t type)
    635646{
    636647    if (fNcells<=1)
     648        return;
     649
     650    const Double_t min = GetMinimum();
     651    const Double_t max = GetMaximum();
     652
     653    if (type==2 && max==min)
    637654        return;
    638655
     
    646663
    647664        TString num;
    648         num += sector ? h.GetSector() : i;
     665        switch (type)
     666        {
     667        case 0: num += i; break;
     668        case 1: num += h.GetSector(); break;
     669        case 2: num += (Int_t)((fArray[i+1]-min)/(max-min)); break;
     670        }
    649671
    650672        txt.SetTextSize(0.3*h.GetD()/fGeomCam->GetMaxRadius()/1.05);
  • trunk/MagicSoft/Mars/mhist/MHCamera.h

    r2557 r2563  
    3030public:
    3131    enum {
    32         kProfile  = BIT(18),
     32        kProfile  = BIT(18), // FIXME: When changing change max/min!
    3333        kFreezed  = BIT(19),
    3434        kNoLegend = BIT(20)
     
    5959    Int_t GetColor(Float_t val, Float_t min, Float_t max, Bool_t islog);
    6060
    61     void  PaintIndices(Bool_t sector);
     61    void  PaintIndices(Int_t type);
    6262    void  Update(Bool_t islog, Bool_t isbox, Bool_t iscol);
    6363    void  UpdateLegend(Float_t min, Float_t max, Bool_t islog);
  • trunk/MagicSoft/Mars/mhist/MHEvent.cc

    r2529 r2563  
    200200    {
    201201        s += "Run #";
    202         s += fRawRunHeader->GetNumEvents();
     202        s += fRawRunHeader->GetRunNumber();
    203203    }
    204204
  • trunk/MagicSoft/Mars/mhist/MHTriggerLvl0.cc

    r2550 r2563  
    126126    if (!evt)
    127127    {
    128         *fLog << err << dbginf << "No MCamEvent found..." << endl;
     128        *fLog << err << dbginf << "Got no MCamEvent as argument of Fill()..." << endl;
    129129        return kFALSE;
    130130    }
  • trunk/MagicSoft/Mars/mraw/MRawSocketRead.cc

    r2529 r2563  
    3939//   MRawEvtData
    4040//   MRawCrateArray
    41 //   MRawEvtTime
     41//   MTime
    4242//
    4343//////////////////////////////////////////////////////////////////////////////
     
    147147//   MRawEvtData <output>     if not found it is created
    148148//   MRawCrateArray <output>  if not found it is created
    149 //   MRawEvtTime <output>     if not found it is created (MTime)
     149//   MTime <output>           if not found it is created
    150150//
    151151// If all containers are found or created the run header is read from the
     
    180180        return kFALSE;
    181181
    182     fRawEvtTime = (MTime*)pList->FindCreateObj("MTime", "MRawEvtTime");
    183     if (!fRawEvtTime)
     182    fTime = (MTime*)pList->FindCreateObj("MTime");
     183    if (!fTime)
    184184        return kTRUE;
    185185
     
    268268
    269269    if (atoi(size)==fRawRunHeader->GetNumTotalBytes())
     270    {
     271        *fLog << dbg << "Event contains only run header information... skipped." << endl;
    270272        return kCONTINUE;
     273    }
    271274
    272275    //
    273276    // Give the run header information to the 'sub-classes'
    274277    //
    275     fRawEvtHeader->Init(fRawRunHeader, fRawEvtTime);
     278    fRawEvtHeader->Init(fRawRunHeader, fTime);
    276279    fRawEvtData  ->Init(fRawRunHeader);
    277280
     
    317320    //
    318321    if (fEvtNumber==fRawEvtHeader->GetDAQEvtNumber())
     322    {
     323        *fLog << dbg << "Event number #" << dec << fEvtNumber << " didn't change... skipped." << endl;
    319324        return kCONTINUE;
     325    }
    320326
    321327    fEvtNumber=fRawEvtHeader->GetDAQEvtNumber();
  • trunk/MagicSoft/Mars/mraw/MRawSocketRead.h

    r2490 r2563  
    2121    MRawEvtData    *fRawEvtData;    // raw evt header infomation container to fill from file
    2222    MRawCrateArray *fRawCrateArray; // crate information array container to fill from file
    23     MTime          *fRawEvtTime;    // raw evt time information container to fill from file
     23    MTime          *fTime;          // raw evt time information container to fill from file
    2424
    2525    MReadSocket    *fIn;            //! buffered input stream (file to read from)
  • trunk/MagicSoft/Mars/star.cc

    r2562 r2563  
    5252    gLog << all << endl;
    5353    gLog << "Sorry the usage is:" << endl;
    54     gLog << "   star [-a0] [-vn] [-cn] inputfile[.roor] outputfile[.root]" << endl << endl;
     54    gLog << "   star [-a0] [-vn] [-cn] inputfile[.root] outputfile[.root]" << endl << endl;
    5555    gLog << "     input file: Merpped or MC root file." << endl;
    5656    gLog << "     ouput file: Star-file (image parameter file)" << endl;
Note: See TracChangeset for help on using the changeset viewer.