Ignore:
Timestamp:
09/26/01 15:23:21 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mmain
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mmain/MAnalysis.cc

    r949 r950  
    3030
    3131enum {
    32   M_BUTTON_HILLAS
     32    M_BUTTON_HILLAS,
     33    M_CHECK_DISPLHIL
    3334};
     35
     36void MAnalysis::AddButtons()
     37{
     38    TGTextButton *hillas = new TGTextButton(fTop2, "Calculate Standard Hillas", M_BUTTON_HILLAS);
     39
     40    hillas->Associate(this);
     41
     42    fList->Add(hillas);
     43
     44    TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsLeft, 10, 10, 5, 5);
     45    fList->Add(laybut);
     46
     47    fTop2->AddFrame(hillas, laybut);
     48}
     49
     50void MAnalysis::AddSetupTab()
     51{
     52    TGCompositeFrame *frame = CreateNewTab("Setup");
     53
     54    TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsLeft, 10, 10, 5, 5);
     55    fList->Add(laybut);
     56
     57    fCheckButton1 = new TGCheckButton(frame, "Display Hillas Histograms when finished", M_CHECK_DISPLHIL);
     58    fCheckButton2 = new TGCheckButton(frame, "Display Star Map Histogram when finished", M_CHECK_DISPLHIL);
     59
     60    fList->Add(fCheckButton1);
     61    fList->Add(fCheckButton2);
     62
     63    frame->AddFrame(fCheckButton1, laybut);
     64    frame->AddFrame(fCheckButton2, laybut);
     65}
    3466
    3567MAnalysis::MAnalysis(const TGWindow *main, const TGWindow *p,
     
    3769: MBrowser(main, p, w, h)
    3870{
    39     TGTextButton *hillas = new TGTextButton(fTop2, "Calculate Standard Hillas", M_BUTTON_HILLAS);
    40 
    41     hillas->Associate(this);
    42 
    43     fList->Add(hillas);
    44 
    45     TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsLeft, 10, 10, 5, 5);
    46     fList->Add(laybut);
    47 
    48     fTop2->AddFrame(hillas, laybut);
     71    AddButtons();
     72    AddSetupTab();
    4973
    5074    MapSubwindows();
     
    7498#include "MHillas.h"
    7599
    76 void MAnalysis::CalculateHillas(const char *fname)
     100void MAnalysis::CalculateHillas() const
    77101{
    78102    //
    79103    // This is a demonstration program which calculates the Hillas
    80104    // parameter out of a Magic root file.
     105
     106    const Bool_t displhillas  = fCheckButton1->GetState();
     107    const Bool_t displstarmap = fCheckButton2->GetState();
    81108
    82109    //
     
    131158    //   CalEvents:  Calibration Events
    132159    //
    133     MReadTree      read("Events", fname);
     160    MReadTree      read("Events", fInputFile);
    134161    MCerPhotCalc   ncalc;
    135162    MImgCleanStd   clean;
     
    137164    MFillH         hfill(&hillas, hists);
    138165    MFillH         sfill(&hillas, smap);
    139     //
    140     // FIXME:
    141     // -----
    142     // I cannot use MFillH fill("name", "name") here.
    143     // for me it is not yet clear why this doesn't work
    144     //
    145 
    146     /*
    147      MWriteRootFile write("hillas.root");
    148      write.AddContainer("MHillas");
    149      write.AddContainer("MHHillas");
    150      write.AddContainer(smap);
    151      */
    152166
    153167    tlist.AddToList(&read);
     
    157171    tlist.AddToList(&hfill);
    158172    tlist.AddToList(&sfill);
    159     //tlist.AddToList(&write);
    160173
    161174    //
     
    174187    // After the analysis is finished we can display the histograms
    175188    //
    176     hists->Draw();
    177     smap->Draw();
     189
     190    if (displhillas)
     191        hists->Draw();
     192
     193    if (displstarmap)
     194        smap->Draw();
    178195}
    179196
     
    199216        {
    200217        case M_BUTTON_HILLAS:
    201             CalculateHillas(fInputFile);
     218            CalculateHillas();
    202219            return kTRUE;
    203220        }
  • trunk/MagicSoft/Mars/mmain/MAnalysis.h

    r949 r950  
    1010#endif
    1111
     12class TGCheckButton;
     13
    1214class MAnalysis : public MBrowser
    1315{
    1416private:
    15     void CalculateHillas(const char *fname);
     17    TGCheckButton *fCheckButton1;
     18    TGCheckButton *fCheckButton2;
     19
     20    void CalculateHillas() const;
     21
     22    void AddButtons();
     23    void AddSetupTab();
    1624
    1725public:
  • trunk/MagicSoft/Mars/mmain/MBrowser.cc

    r947 r950  
    175175}
    176176
    177 void MBrowser::CreateTab1(TGCompositeFrame *frame)
    178 {
     177void MBrowser::CreateTab1()
     178{
     179    TGCompositeFrame *frame = CreateNewTab("Input File");
     180
    179181    //
    180182    // Create three frames for the first tab
     
    202204}
    203205
     206TGCompositeFrame *MBrowser::CreateNewTab(const char *name)
     207{
     208    return fTabs->AddTab(name);
     209}
     210
    204211void MBrowser::CreateLowerFrame(TGCompositeFrame *framelow)
    205212{
     
    211218    // ----- Create Object holding the Tabs -----
    212219    //
    213     TGTab *tabs = new TGTab(framelow, 400, 400);
    214     fList->Add(tabs);
     220    fTabs = new TGTab(framelow, 400, 400);
     221    fList->Add(fTabs);
    215222
    216223    TGLayoutHints *laytabs = new TGLayoutHints(kLHintsBottom|kLHintsExpandX|kLHintsExpandY, 5, 5, 5, 5);
    217224    fList->Add(laytabs);
    218225
    219     framelow->AddFrame(tabs, laytabs);
     226    framelow->AddFrame(fTabs, laytabs);
    220227
    221228    //
    222229    // --- Create the first tab of the tabs ---
    223230    //
    224     TGCompositeFrame *tf = tabs->AddTab("Input File");
    225 
    226     CreateTab1(tf);
     231    CreateTab1();
    227232}
    228233
  • trunk/MagicSoft/Mars/mmain/MBrowser.h

    r947 r950  
    1111
    1212class TList;
     13class TGTab;
    1314class TGListView;
    1415class TGComboBox;
     
    1920{
    2021private:
    21     TGComboBox        *fDir;
     22    TGTab            *fTabs;
    2223
    23     TGPictureButton   *fCdup;
    24     TGPictureButton   *fListMode;
    25     TGPictureButton   *fDetail;
     24    TGComboBox       *fDir;
    2625
    27     TGFileContainer   *fFileCont;
    28     TGListView        *fFileView;
     26    TGPictureButton  *fCdup;
     27    TGPictureButton  *fListMode;
     28    TGPictureButton  *fDetail;
    2929
    30     const TGPicture   *fPic1;
    31     const TGPicture   *fPic2;
    32     const TGPicture   *fPic3;
     30    TGFileContainer  *fFileCont;
     31    TGListView       *fFileView;
     32
     33    const TGPicture  *fPic1;
     34    const TGPicture  *fPic2;
     35    const TGPicture  *fPic3;
    3336
    3437    void CreateMenuBar();
     38    void CreateTab1();
    3539    void CreateUpperFrame(TGCompositeFrame *frameup);
    3640    void CreateLowerFrame(TGCompositeFrame *framelow);
    37     void CreateTab1(TGCompositeFrame *frame);
    3841    void CreateDirListMenu(TGCompositeFrame *frame);
    3942    void CreateDirListBox(TGCompositeFrame *frame);
     
    4245    TList  *fList;
    4346    Char_t  fInputFile[256];
     47
     48    TGCompositeFrame *CreateNewTab(const char *name);
    4449
    4550    void DisplError(const char *txt);
Note: See TracChangeset for help on using the changeset viewer.