Ignore:
Timestamp:
09/26/01 15:23:21 (23 years ago)
Author:
tbretz
Message:
*** empty log message ***
File:
1 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        }
Note: See TracChangeset for help on using the changeset viewer.