Changeset 1076 for trunk/MagicSoft


Ignore:
Timestamp:
11/14/01 10:03:20 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
6 added
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r1058 r1076  
    11                                                                  -*-*- END -*-*-
     2 2001/11/09: Thomas Bretz
     3
     4   * mbase/MGList.[h,cc], mbase/MGTask.[h,cc], mbase/MGGroupFrame.[h,cc]:
     5     - added
     6
     7   * Makefile.conf.linux, Makefile.conf.linux-gnu:
     8     - changed to O3
     9     - added -fnonnull-objects
     10     - added -Woverloaded-virtual
     11
     12   * macros/readCT1.C, macros/readMagic.C:
     13     - changed to use MClone
     14
     15   * manalysis/MImgCleanStd.[h,cc]:
     16     - derived from TGTask
     17     - added CreateGuiElements
     18     - added ProcessMessage
     19
     20   * mbase/BaseLinkDef.h, mbase/Makefile:
     21     - added MGTask
     22     - added MGList
     23     - added MGGroupFrame
     24
     25   * mbase/MInputStreamID.cc:
     26     - rmoved old comment
     27
     28   * mbase/MParContainer.[h,cc]:
     29     - changed output
     30     - made Hash const
     31     - added GetDiscriptor
     32
     33   * mbase/MParList.[h,cc]:
     34     - made FindObject const correct (see TObject)
     35
     36   * mbase/MTask.[h,cc]:
     37     - changed output to use GetDescriptor
     38     - made Call* functions virtual (used in TGTask)
     39
     40   * mbase/MTaskList.[h,cc]:
     41     - made FindObject const correct (see TObject)
     42     - changed output to use GetDescriptor
     43
     44   * mbase/MTime.cc:
     45     - code reformatting
     46
     47   * mbase/MWriteRootFile.cc:
     48     - small changes in output
     49
     50   * mgui/MHexagon.cc:
     51     - changed output according to TEllipse and similar
     52     - made ls const
     53
     54   * mhist/MFillH.cc:
     55     - changed output to use GetDescriptor
     56
     57   * mmain/MAnalysis.[h,cc]:
     58     - changed to use new GUI of MImgCleanStd
     59
     60   * mraw/MRawEvtData.cc:
     61     - small changes to output
     62     - better sanity check for non existing fRunHeader
     63
     64
     65
    266 2001/11/09: Thomas Bretz
    367
  • trunk/MagicSoft/Mars/Makefile.conf.linux

    r1044 r1076  
    2020#  ----->>>   settings for compilation
    2121#
    22 OPTIM    = -O2 -Wall -fno-rtti -fno-exceptions -fPIC -Wtraditional -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs
     22OPTIM    = -O3 -Wall -fno-rtti -fnonnull-objects -fno-exceptions -fPIC -Wtraditional -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual
    2323DEBUG    =
    2424ARCHDEF  = -D__LINUX__
  • trunk/MagicSoft/Mars/Makefile.conf.linux-gnu

    r1044 r1076  
    2020#
    2121
    22 OPTIM    = -O2 -Wall -fno-rtti -fno-exceptions -fPIC -Wtraditional -Wpointer-arith -Wcast-align -Wwrite-strings -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs
     22OPTIM    = -O3 -Wall -fno-rtti -fnonnull-objects -fno-exceptions -fPIC -Wtraditional -Wpointer-arith -Wcast-align -Wconversion -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Woverloaded-virtual
    2323DEBUG    =
    2424ARCHDEF  = -D__LINUX__
  • trunk/MagicSoft/Mars/macros/readCT1.C

    r1038 r1076  
    3737
    3838    MCT1ReadAscii read("/home/tbretz/data/CT1_97_off1.dat");
     39    MClone        clone("MCerPhotEvt");
    3940    MImgCleanStd  clean;
    4041    MHillasCalc   hcalc;
    4142
    4243    tlist.AddToList(&read);
     44    tlist.AddToList(&clone);
    4345    tlist.AddToList(&clean);
    4446    tlist.AddToList(&hcalc);
     
    5052        return;
    5153
    52     MCerPhotEvt &phevt = *(MCerPhotEvt*)plist->FindObject("MCerPhotEvt");
    53 
    5454    Int_t icount = 0;
    5555    MCamDisplay display(&geomcam);
    5656    display.Draw();
    5757
    58     while (read.Process())
     58    while (tlist.Process())
    5959    {
    60         cout << "Event: " << icount++  << endl;
    61         hillas.Reset();
     60        cout << "Event #" << icount++ << endl;
    6261
    63         display.DrawPhotNum(&phevt);
     62        display.DrawPhotNum((MCerPhotEvt*)clone.GetClone());
    6463        gClient->HandleInput();
    6564        if(getchar()=='q')
    6665            break;
    6766
    68         clean.Process();
    69 
    70         if (hcalc.Process()==kCONTINUE)
    71         {
    72             cout << "skipped." << endl;
    73             continue;
    74         }
    75 
    7667        hillas.Print();
    7768        hillas.Draw();
    78 
    79         display.DrawPhotNum(&phevt);
     69        display.DrawPhotNum((MCerPhotEvt*)plist.FindObject("MCerPhotEvt"));
    8070
    8171        gClient->HandleInput();
  • trunk/MagicSoft/Mars/macros/readMagic.C

    r1038 r1076  
    4040    MReadTree    read("Events", "~/data/camera.root");
    4141    MCerPhotCalc ncalc;
     42    MClone       clone("MCerPhotEvt");
    4243    MImgCleanStd clean;
    4344    MHillasCalc  hcalc;
     
    4546    tlist.AddToList(&read);
    4647    tlist.AddToList(&ncalc);
     48    tlist.AddToList(&clone);
    4749    tlist.AddToList(&clean);
    4850    tlist.AddToList(&hcalc);
     
    5456        return;
    5557
    56     MCerPhotEvt &phevt = *(MCerPhotEvt*)plist.FindObject("MCerPhotEvt");
    57 
    5858    MCamDisplay display(&geomcam);
    5959    display.Draw();
    6060
    61     while (read.Process())
     61    while (tlist.Process())
    6262    {
    63         cout << "Event #" << read.GetEventNum() ":" << endl;
    64         hillas.Reset();
    65         phevt.Reset();
     63        cout << "Event #" << read.GetEventNum() << endl;
    6664
    67         ncalc.Process();
    68 
    69         display.DrawPhotNum(&phevt);
     65        display.DrawPhotNum((MCerPhotEvt*)clone.GetClone());
    7066        gClient->HandleInput();
    7167        if(getchar()=='q')
    7268            break;
    7369
    74         clean.Process();
    75         hcalc.Process();
    76 
    7770        hillas.Print();
    7871        hillas.Draw();
    79 
    80         display.DrawPhotNum(&phevt);
     72        display.DrawPhotNum((MCerPhotEvt*)plist.FindObject("MCerPhotEvt"));
    8173
    8274        gClient->HandleInput();
  • trunk/MagicSoft/Mars/manalysis/MImgCleanStd.cc

    r1049 r1076  
    258258    return kTRUE;
    259259}
    260    
     260
     261
    261262// --------------------------------------------------------------------------
    262263//
     
    272273}
    273274
     275#include <stdlib.h>       // atof
     276
     277#include <TGFrame.h>      // TGFrame
     278#include <TGLabel.h>      // TGLabel
     279#include <TGTextEntry.h>  // TGTextEntry
     280
     281#include "MGGroupFrame.h" // MGGroupFrame
     282
     283enum {
     284    kImgCleanLvl1,
     285    kImgCleanLvl2
     286};
     287
     288void MImgCleanStd::CreateGuiElements(MGGroupFrame *f)
     289{
     290    //
     291    // Create a frame for line 3 and 4 to be able
     292    // to align entry field and label in one line
     293    //
     294    TGHorizontalFrame *f1 = new TGHorizontalFrame(f, 0, 0);
     295    TGHorizontalFrame *f2 = new TGHorizontalFrame(f, 0, 0);
     296
     297    /*
     298     * --> use with root >=3.02 <--
     299     *
     300
     301     TGNumberEntry *fNumEntry1 = new TGNumberEntry(frame, 3.0, 2, M_NENT_LVL1, kNESRealOne, kNEANonNegative);
     302     TGNumberEntry *fNumEntry2 = new TGNumberEntry(frame, 2.5, 2, M_NENT_LVL1, kNESRealOne, kNEANonNegative);
     303
     304     */
     305    TGTextEntry *entry1 = new TGTextEntry(f1, "****", kImgCleanLvl1);
     306    TGTextEntry *entry2 = new TGTextEntry(f2, "****", kImgCleanLvl2);
     307
     308    // --- doesn't work like expected (until root 3.02?) --- fNumEntry1->SetAlignment(kTextRight);
     309    // --- doesn't work like expected (until root 3.02?) --- fNumEntry2->SetAlignment(kTextRight);
     310
     311    entry1->SetText("3.0");
     312    entry2->SetText("2.5");
     313
     314    entry1->Associate(f);
     315    entry2->Associate(f);
     316
     317    TGLabel *l1 = new TGLabel(f1, "Cleaning Level 1 for standard image cleaning.");
     318    TGLabel *l2 = new TGLabel(f2, "Cleaning Level 2 for standard image cleaning.");
     319
     320    l1->SetTextJustify(kTextLeft);
     321    l2->SetTextJustify(kTextLeft);
     322
     323    //
     324    // Align the text of the label centered, left in the row
     325    // with a left padding of 10
     326    //
     327    TGLayoutHints *laylabel = new TGLayoutHints(kLHintsCenterY|kLHintsLeft, 10);
     328    TGLayoutHints *layframe = new TGLayoutHints(kLHintsCenterY|kLHintsLeft,  5, 0, 10);
     329
     330    //
     331    // Add one entry field and the corresponding label to each line
     332    //
     333    f1->AddFrame(entry1);
     334    f2->AddFrame(entry2);
     335
     336    f1->AddFrame(l1, laylabel);
     337    f2->AddFrame(l2, laylabel);
     338
     339    f->AddFrame(f1, layframe);
     340    f->AddFrame(f2, layframe);
     341
     342    f->AddToList(entry1);
     343    f->AddToList(entry2);
     344    f->AddToList(l1);
     345    f->AddToList(l2);
     346    f->AddToList(laylabel);
     347    f->AddToList(layframe);
     348}
     349
     350Bool_t MImgCleanStd::ProcessMessage(Int_t msg, Int_t submsg, Long_t param1, Long_t param2)
     351{
     352    if (msg!=kC_TEXTENTRY || submsg!=kTE_ENTER)
     353        return kTRUE;
     354
     355    TGTextEntry *txt = (TGTextEntry*)FindWidget(param1);
     356
     357    if (!txt)
     358        return kTRUE;
     359
     360    Float_t lvl = atof(txt->GetText());
     361
     362    switch (param1)
     363    {
     364    case kImgCleanLvl1:
     365        fCleanLvl1 = lvl;
     366        *fLog << "Cleaning level 1 set to " << lvl << " sigma." << endl;
     367        return kTRUE;
     368
     369    case kImgCleanLvl2:
     370        fCleanLvl2 = lvl;
     371        *fLog << "Cleaning level 2 set to " << lvl << " sigma." << endl;
     372        return kTRUE;
     373    }
     374
     375    return kTRUE;
     376}
  • trunk/MagicSoft/Mars/manalysis/MImgCleanStd.h

    r1014 r1076  
    22#define MARS_MImgCleanStd
    33
    4 #ifndef MARS_MTask
    5 #include "MTask.h"
     4#ifndef MARS_MGTask
     5#include "MGTask.h"
    66#endif
    77
     
    99class MCerPhotEvt;
    1010
    11 class MImgCleanStd : public MTask
     11class MGGroupFrame;
     12
     13class MImgCleanStd : public MGTask
    1214{
    1315private:
    14     const MGeomCam *fCam;
    15           MCerPhotEvt *fEvt;
     16    const MGeomCam    *fCam;  //!
     17          MCerPhotEvt *fEvt;  //!
    1618
    1719    Float_t fCleanLvl1;
    1820    Float_t fCleanLvl2;
     21
     22    void CreateGuiElements(MGGroupFrame *f);
    1923
    2024public:
     
    2630    void CleanStep3();
    2731
    28     Bool_t PreProcess (MParList *pList);
     32    Bool_t PreProcess(MParList *pList);
    2933    Bool_t Process();
     34
     35    Bool_t ProcessMessage(Int_t msg, Int_t submsg, Long_t param1, Long_t param2);
    3036
    3137    ClassDef(MImgCleanStd, 0)    // task doing a standard image cleaning
  • trunk/MagicSoft/Mars/mbase/BaseLinkDef.h

    r1035 r1076  
    3131#pragma link C++ class MInputStreamID+;
    3232
     33#pragma link C++ class MGTask+;
     34#pragma link C++ class MGList+;
     35#pragma link C++ class MGGroupFrame+;
     36
    3337#pragma link C++ class MClone+;
    3438#pragma link C++ class MPrint+;
  • trunk/MagicSoft/Mars/mbase/MInputStreamID.cc

    r1003 r1076  
    4747    fTitle = title;
    4848
    49     fStreamId = "All"; //new char[4];
    50     //strcpy(fStreamId, "All");
     49    fStreamId = "All";
    5150}
    5251
  • trunk/MagicSoft/Mars/mbase/MParContainer.cc

    r1030 r1076  
    137137{
    138138    TROOT::IndentLevel();
    139     *fLog <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << " : "
     139    *fLog <<"OBJ: " << GetDescriptor() << ": " << GetTitle() << ", "
    140140        << Int_t(TestBit(kCanDelete)) << endl;
    141141}
     
    147147void MParContainer::Print(Option_t *) const
    148148{
    149     *fLog <<"OBJ: " << IsA()->GetName() << "\t" << GetName() << "\t" << GetTitle() << endl;
     149    *fLog <<"OBJ: " << GetDescriptor() << ": " << GetTitle() << endl;
    150150}
    151151
     
    199199{
    200200    *fLog << "To use the the ascii input of " << GetName();
    201     *fLog << " you have to overload " << GetName() << "::AsciiRead." << endl;
     201    *fLog << " you have to overload " << ClassName() << "::AsciiRead." << endl;
    202202}
    203203
     
    205205{
    206206    *fLog << "To use the the ascii output of " << GetName();
    207     *fLog << " you have to overload " << GetName() << "::AsciiWrite." << endl;
    208 }
     207    *fLog << " you have to overload " << ClassName() << "::AsciiWrite." << endl;
     208}
  • trunk/MagicSoft/Mars/mbase/MParContainer.h

    r1030 r1076  
    100100    virtual ~MParContainer() {}
    101101
     102    virtual const char *GetDescriptor() const { return Form("%s [%s]", GetName(), ClassName()); }
     103
    102104    virtual TObject    *Clone(const char *newname="") const;
    103105    virtual Int_t       Compare(const TObject *obj) const;
     
    107109    virtual const char *GetName() const    { return fName.Data(); }
    108110    virtual const char *GetTitle() const   { return fTitle.Data(); }
    109     virtual ULong_t     Hash()             { return fName.Hash(); }
     111    virtual ULong_t     Hash() const       { return fName.Hash(); }
    110112    virtual Bool_t      IsSortable() const { return kTRUE; }
    111113
  • trunk/MagicSoft/Mars/mbase/MParList.cc

    r1027 r1076  
    227227//  check if the object is in the list or not
    228228//
    229 TObject *MParList::FindObject(TObject *obj) const
     229TObject *MParList::FindObject(const TObject *obj) const
    230230{
    231231    return fContainer->FindObject(obj);
  • trunk/MagicSoft/Mars/mbase/MParList.h

    r1030 r1076  
    4444
    4545    TObject       *FindObject(const char *name) const;
    46     TObject       *FindObject(TObject *obj) const;
     46    TObject       *FindObject(const TObject *obj) const;
    4747    MParContainer *FindCreateObj(const char *classname, const char *objname=NULL);
    4848
  • trunk/MagicSoft/Mars/mbase/MTask.cc

    r1027 r1076  
    6767#include "MTask.h"
    6868
     69#include <TMethod.h>
    6970#include <TOrdCollection.h>
    7071
     
    7374
    7475#include "MFilter.h"
     76#include "MGGroupFrame.h"
    7577
    7678ClassImp(MTask);
     
    176178
    177179    fIsPreprocessed = kFALSE;
     180
    178181    return PostProcess();
    179182}
     
    224227void MTask::PrintStatistics(const Int_t lvl) const
    225228{
    226     *fLog << setw(lvl) << " " << GetName() << " [";
    227     *fLog << ClassName() << "] \t" << fNumExecutions;
    228     *fLog << endl;
    229 }
     229    *fLog << setw(lvl) << " " << GetDescriptor() << "\t";
     230    *fLog << dec << fNumExecutions << endl;
     231}
     232
  • trunk/MagicSoft/Mars/mbase/MTask.h

    r1020 r1076  
    7373    UInt_t GetNumExecutions() { return fNumExecutions; }
    7474
    75     Bool_t CallPreProcess(MParList *plist);
    76     Bool_t CallProcess();
    77     Bool_t CallPostProcess();
     75    virtual Bool_t CallPreProcess(MParList *plist);
     76    virtual Bool_t CallProcess();
     77    virtual Bool_t CallPostProcess();
    7878
    7979    const TOrdCollection *GetListOfBranches() const { return fListOfBranches; }
    8080
    81     ClassDef(MTask, 0)          //Abstract base class for a task
     81    ClassDef(MTask, 0) //Abstract base class for a task
    8282};
    8383
  • trunk/MagicSoft/Mars/mbase/MTaskList.cc

    r1027 r1076  
    197197//  check if the object is in the list or not
    198198//
    199 TObject *MTaskList::FindObject(TObject *obj) const
     199TObject *MTaskList::FindObject(const TObject *obj) const
    200200{
    201201    return fTasks->FindObject(obj);
     
    360360        *fLog << "Execution Statistics: " << endl;
    361361        *fLog << "---------------------" << endl;
    362         *fLog << GetName() << " [" << ClassName() << "]" << endl;
     362        *fLog << GetDescriptor() << endl;
    363363    }
    364364    else
    365365    {
    366         *fLog << setw(lvl) << " " << GetName() << " [";
    367         *fLog << ClassName() << "]" << endl;
     366        *fLog << setw(lvl) << " " << GetDescriptor() << endl;
    368367    }
    369368
     
    380379void MTaskList::Print(Option_t *t) const
    381380{
    382     *fLog << "TaskList: " << GetName() << " <" << GetTitle() << ">" << endl;
     381    *fLog << GetDescriptor() << " <" << GetTitle() << ">" << endl;
    383382
    384383    fTasks->Print();
  • trunk/MagicSoft/Mars/mbase/MTaskList.h

    r1014 r1076  
    4040
    4141    TObject *FindObject(const char *name) const;
    42     TObject *FindObject(TObject *obj) const;
     42    TObject *FindObject(const TObject *obj) const;
    4343
    4444    Bool_t PreProcess(MParList *pList);
  • trunk/MagicSoft/Mars/mbase/MTime.cc

    r986 r1076  
    4343    fLog->setf(ios::showbase);
    4444    *fLog << "MTime Information:  " << hex
    45         << " " <<setfill('0') << setw(2) << fTimeStamp[0]
    46         << " " <<setfill('0') << setw(2) << fTimeStamp[1] << endl << endl;
     45        << " " << setfill('0') << setw(2) << fTimeStamp[0]
     46        << " " << setfill('0') << setw(2) << fTimeStamp[1] << endl << endl;
    4747}
    4848
  • trunk/MagicSoft/Mars/mbase/MWriteRootFile.cc

    r1028 r1076  
    116116void MWriteRootFile::Print(Option_t *) const
    117117{
    118     cout << "File: " << GetFileName() << endl;
     118    cout << "File: " << GetFileName() << dec << endl;
    119119    cout << "--------------------------------------------------" << endl;
    120120
  • trunk/MagicSoft/Mars/mbase/Makefile

    r1052 r1076  
    4444           MWriteAsciiFile.cc \
    4545           MWriteRootFile.cc \
     46           MGList.cc \
     47           MGTask.cc \
     48           MGGroupFrame.cc \
    4649           MArray.cc \
    4750           MArrayB.cc \
  • trunk/MagicSoft/Mars/mgui/MHexagon.cc

    r1023 r1076  
    191191//  list this hexagon with its attributes
    192192//
    193 void MHexagon::ls(Option_t *)
     193void MHexagon::ls(const Option_t *) const
    194194{
    195195    TROOT::IndentLevel();
     
    247247void MHexagon::Print(Option_t *) const
    248248{
    249     cout << "MHexagon - " << GetName() << ": ";
     249    cout << "MHexagon: ";
    250250    cout << "x=" << fX << "mm y=" << fY << "mm r=" << fD << "mm" << endl;
    251251
  • trunk/MagicSoft/Mars/mgui/MHexagon.h

    r1023 r1076  
    5151    //virtual void  ExecuteEvent(Int_t event, Int_t px, Int_t py);
    5252
    53     virtual void  ls (Option_t *Option="");
     53    virtual void  ls(const Option_t *Option="") const;
    5454    virtual void  Paint(Option_t *Option="");
    5555    virtual void  PaintHexagon(Float_t x, Float_t y, Float_t d);
  • trunk/MagicSoft/Mars/mhist/MFillH.cc

    r1030 r1076  
    172172    if (!fH->InheritsFrom("MH"))
    173173    {
    174         *fLog << dbginf << fH->GetName() << " [" << fH->ClassName();
    175         *fLog << "] doesn't inherit from MH - cannot be used for MFillH... aborting." << endl;
     174        *fLog << dbginf << fH->GetDescriptor() << " ";
     175        *fLog << "doesn't inherit from MH - cannot be used for MFillH... aborting." << endl;
    176176        return kFALSE;
    177177    }
  • trunk/MagicSoft/Mars/mmain/MAnalysis.cc

    r1030 r1076  
    2525#include "MAnalysis.h"
    2626
    27 #include <stdlib.h>        // atof
    2827#include <iostream.h>
    2928
     
    3231#include <TGTextEntry.h>   // TGNumberEntry
    3332
     33#include "MImgCleanStd.h"  // MImgCleanStd
     34
    3435ClassImp(MAnalysis)
    3536
     
    5960    TGCompositeFrame *frame = CreateNewTab("Setup");
    6061
     62    TGGroupFrame *grp = new TGGroupFrame(frame, "Setup Display");
     63    fList->Add(grp);
     64
    6165    //
    6266    // Align the lines:
     
    6468    //  - padding: top=20, bottom=0, left=20, right=0
    6569    //
    66     TGLayoutHints *layline = new TGLayoutHints(kLHintsNormal, 20, 0, 20);
    67     fList->Add(layline);
     70    TGLayoutHints *laybut = new TGLayoutHints(kLHintsNormal, 10, 10, 10);
     71    fList->Add(laybut);
    6872
    6973    //
    7074    // Create check buttons for the first two lines
    7175    //
    72     fCheckButton1 = new TGCheckButton(frame, "Display Hillas Histograms when finished");  //, M_CHECK_DISPLHIL);
    73     fCheckButton2 = new TGCheckButton(frame, "Display Star Map Histogram when finished"); //, M_CHECK_DISPLHIL);
     76    fCheckButton1 = new TGCheckButton(grp, "Display Hillas Histograms when finished");  //, M_CHECK_DISPLHIL);
     77    fCheckButton2 = new TGCheckButton(grp, "Display Star Map Histogram when finished"); //, M_CHECK_DISPLHIL);
     78
     79    fList->AddFirst(fCheckButton1);
     80    fList->AddFirst(fCheckButton2);
     81
     82    //
     83    // Create first two lines with the checkbuttons
     84    //
     85    grp->AddFrame(fCheckButton1, laybut);
     86    grp->AddFrame(fCheckButton2, laybut);
     87
     88    TGLayoutHints *laygrp = new TGLayoutHints(kLHintsNormal|kLHintsExpandX, 20, 20, 20);
     89    fList->Add(laygrp);
     90
     91    frame->AddFrame(grp, laygrp);
    7492
    7593    /*
    76      FIXME...
    77 
    78      fList->Add(fCheckButton1);
    79      fList->Add(fCheckButton2);
     94     * Create GUI for image cleaning
    8095     */
    81 
    82     //
    83     // Create first two lines with the checkbuttons
    84     //
    85     frame->AddFrame(fCheckButton1, layline);
    86     frame->AddFrame(fCheckButton2, layline);
    87 
    88     //
    89     // Create entry fields and labels for line 3 and 4
    90     //
    91 
    92     /*
    93      * --> use with root >=3.02 <--
    94      *
    95 
    96      TGNumberEntry *fNumEntry1 = new TGNumberEntry(frame, 3.0, 2, M_NENT_LVL1, kNESRealOne, kNEANonNegative);
    97      TGNumberEntry *fNumEntry2 = new TGNumberEntry(frame, 2.5, 2, M_NENT_LVL1, kNESRealOne, kNEANonNegative);
    98 
    99      */
    100 
    101     //
    102     // Create a frame for line 3 and 4 to be able
    103     // to align entry field and label in one line
    104     //
    105     TGHorizontalFrame *f1 = new TGHorizontalFrame(frame, 0, 0);
    106     TGHorizontalFrame *f2 = new TGHorizontalFrame(frame, 0, 0);
    107 
    108     fNumEntry1 = new TGTextEntry(f1, "****");
    109     fNumEntry2 = new TGTextEntry(f2, "****");
    110 
    111     // --- doesn't work like expected --- fNumEntry1->SetAlignment(kTextRight);
    112     // --- doesn't work like expected --- fNumEntry2->SetAlignment(kTextRight);
    113 
    114     fNumEntry1->SetText("3.0");
    115     fNumEntry2->SetText("2.5");
    116  
    117     fList->Add(fNumEntry1);
    118     fList->Add(fNumEntry2);
    119 
    120     TGLabel *l1 = new TGLabel(f1, "Cleaning Level 1 for standard image cleaning.");
    121     TGLabel *l2 = new TGLabel(f2, "Cleaning Level 2 for standard image cleaning.");
    122 
    123     l1->SetTextJustify(kTextLeft);
    124     l2->SetTextJustify(kTextLeft);
    125 
    126     fList->Add(l1);
    127     fList->Add(l2);
    128 
    129     //
    130     // Align the text of the label centered, left in the row
    131     // with a left padding of 10
    132     //
    133     TGLayoutHints *laylabel = new TGLayoutHints(kLHintsCenterY|kLHintsLeft, 10); //, 10); //, 5, 5);
    134     fList->Add(laylabel);
    135 
    136     //
    137     // Add one entry field and the corresponding label to each line
    138     //
    139     f1->AddFrame(fNumEntry1);
    140     f2->AddFrame(fNumEntry2);
    141 
    142     f1->AddFrame(l1, laylabel);
    143     f2->AddFrame(l2, laylabel);
    144 
    145     //
    146     // Add line 3 and 4 to tab
    147     //
    148     frame->AddFrame(f1, layline);
    149     frame->AddFrame(f2, layline);
     96    fImgClean = new MImgCleanStd;
     97    fImgClean->CreateGui(frame, laygrp);
     98    fList->Add(fImgClean);
    15099}
    151100
     
    192141    const Bool_t displstarmap = fCheckButton2->GetState();
    193142
    194     Float_t cleanlvl1 = atof(fNumEntry1->GetText());
    195     Float_t cleanlvl2 = atof(fNumEntry2->GetText());
    196 
    197     if (cleanlvl1<0)
    198     {
    199         cleanlvl1=0;
    200         fNumEntry1->SetText("0");
    201     }
    202 
    203     if (cleanlvl2<0)
    204     {
    205         cleanlvl2=0;
    206         fNumEntry2->SetText("0");
    207     }
    208 
    209143    //
    210144    // Create a empty Parameter List and an empty Task List
     
    245179
    246180    MCerPhotCalc ncalc;
    247     MImgCleanStd clean(cleanlvl1, cleanlvl2);
    248181    MHillasCalc  hcalc;
    249182
    250183    tlist.AddToList(&read);
    251184    tlist.AddToList(&ncalc);
    252     tlist.AddToList(&clean);
     185    tlist.AddToList(fImgClean);
    253186    tlist.AddToList(&hcalc);
    254187
  • trunk/MagicSoft/Mars/mmain/MAnalysis.h

    r1021 r1076  
    99class TGCheckButton;
    1010
     11class MImgCleanStd;
     12
    1113class MAnalysis : public MBrowser
    1214{
     
    1517    TGCheckButton *fCheckButton2;
    1618
    17     TGTextEntry   *fNumEntry1;
    18     TGTextEntry   *fNumEntry2;
     19//    TGTextEntry   *fNumEntry1;
     20//    TGTextEntry   *fNumEntry2;
     21
     22    MImgCleanStd  *fImgClean;
    1923
    2024    void CalculateHillas();
  • trunk/MagicSoft/Mars/mraw/MRawEvtData.cc

    r1045 r1076  
    5959
    6060#include "MLog.h"
     61#include "MLogManip.h"
     62
    6163#include "MArrayS.h"
    6264#include "MArrayB.h"
     
    286288    }
    287289
    288     *fLog << "MRawEvtData::Draw: Warning: You must specify either 'GRAPH' or 'HIST'" << endl;
     290    *fLog << dbginf << "Warning - You must specify either 'GRAPH' or 'HIST'" << endl;
    289291}
    290292
     
    296298void MRawEvtData::DeletePixels(Bool_t flag)
    297299{
    298     const int npix = fRunHeader->GetNumCrates()*fRunHeader->GetNumPixInCrate();
    299 
    300     if (fArraySize == npix && flag)
    301     {
    302         fPosInArray = 0;
    303         return;
     300    if (fRunHeader && flag)
     301    {
     302        const int npix = fRunHeader->GetNumCrates()*fRunHeader->GetNumPixInCrate();
     303
     304        if (fArraySize == npix)
     305        {
     306            fPosInArray = 0;
     307            return;
     308        }
    304309    }
    305310
     
    327332void MRawEvtData::InitArrays(Bool_t flag)
    328333{
    329     if (flag)
     334    if (flag && fRunHeader)
    330335    {
    331336        const int npix = fRunHeader->GetNumCrates()*fRunHeader->GetNumPixInCrate();
Note: See TracChangeset for help on using the changeset viewer.