TRestBrowser.h 2.71 KB
Newer Older
1
2
3
#ifndef RestCore_TRestBrowser
#define RestCore_TRestBrowser

4
5
6
#include "TApplication.h"
#include "TBrowser.h"
#include "TCanvas.h"
7
#include "TGButton.h"
8
#include "TGDimension.h"
9
#include "TGFileDialog.h"
10
#include "TGFrame.h"
11
#include "TGLabel.h"
12
13
14
#include "TGNumberEntry.h"
#include "TGTextEntry.h"
#include "TObject.h"
15
#include "TROOT.h"
16
#include "TSystem.h"
17

18
#include "TRestEventViewer.h"
19
#include "TRestRun.h"
20
21
22

#include <iostream>

23
/// Event browser for different input file
24
class TRestBrowser {
25
   protected:
26
#ifndef __CINT__
27
    TGMainFrame* frmMain = 0;  //!
28

29
    // Frames and buttons
30

31
    TGVerticalFrame* fVFrame = 0;     //! < Vertical frame.
32
33
34
35
36
37
38
39
40
    TGLabel* fEventRowLabel = 0;           //! label(content"plot options:")
    TGLabel* fEventIdLabel = 0;                //! label(content"plot options:")
    TGLabel* fEventSubIdLabel = 0;        //! label(content"plot options:")
    TGNumberEntry* fEventRowNumberBox = 0;      //! Event number.
    TGNumberEntry* fEventIdNumberBox = 0;       //! Event number.
    TGNumberEntry* fEventSubIdNumberBox = 0;  //! Event number.
    TGPictureButton* fButEventPrev = 0;    //! Previous event.
    TGPictureButton* fButEventLoad = 0;  //! Load Event button
    TGPictureButton* fButEventNext = 0;    //! Next number.
41
42
    TGPictureButton* fMenuOpen = 0;   //! Open file
    TGTextButton* fExit = 0;          //! Load Event button
43

44
45
46
47
48
49
    TGLabel* fPlotOptionLabel = 0;  //! label(content"plot options:")
    TGTextEntry* fPlotOptionTextBox = 0; 
    TGTextButton* fButOptPrev = 0;     //! Previous event.
    TGTextButton* fButOptLoad = 0;     //! Load Event button
    TGTextButton* fButOptNext = 0;     //! Next number.

50
    TCanvas* fCanDefault = 0;  //!
51

52
53
54
    TBrowser* b = 0;  //!
    TRestRun* r = 0;  //!
#endif
55

56
   private:
57
#ifndef __CINT__
58
59
    Bool_t pureAnalysis;
    TString fInputFileName;
60

61
    TRestEventViewer* fEventViewer = 0;  //!
62
63
64

    Bool_t LoadEventId(Int_t id, Int_t subid = -1);
    Bool_t LoadEventEntry(Int_t n);
65
66
#endif

67
68
69
70
   public:
    // Constructors
    TRestBrowser();
    TRestBrowser(TString viewerName);
71

72
73
    // Destructor
    ~TRestBrowser();
74

75
76
    void Initialize(TString opt = "FI");
    void InitFromConfigFile();
77
    Bool_t OpenFile(TString filename);
78

79
80
81
    void SetViewer(TRestEventViewer* eV);
    void SetViewer(TString viewerName);
    void SetInputEvent(TRestEvent*);
82

83
    void setWindowName(TString wName) { frmMain->SetWindowName(wName.Data()); }
84

85
    void setButtons();
86

87
    TRestEventViewer* GetViewer() { return fEventViewer; }
88

89
    // actions
90
91
    void LoadFileAction();
    void ExitAction();
92

93
94
95
96
97
98
99
100
    void RowValueChangedAction(Long_t val);
    void IdValueChangedAction(Long_t val);

    void NextPlotOptionAction();
    void PreviousPlotOptionAction();
    void PlotAction();


101
102
};
#endif