source: tags/Mars-V0.3/mmain/MDataCheck.cc

Last change on this file was 749, checked in by tbretz, 23 years ago
*** empty log message ***
File size: 3.5 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Harald Kornmayer 1/2001 (harald@mppmu.mpg.de)
19! Author(s): Thomas Bretz 12/2000 (tbretz@uni-sw.gwdg.de)
20!
21! Copyright: MAGIC Software Development, 2000-2001
22!
23!
24\* ======================================================================== */
25
26#include "MDataCheck.h"
27
28#include <TGButton.h> // TGTextButton
29
30ClassImp(MDataCheck)
31
32enum {
33 M_BUTTON_PEDADC,
34 M_BUTTON_CRADC,
35 M_BUTTON_PEDTDC,
36 M_BUTTON_CRTDC
37};
38
39MDataCheck::MDataCheck(const TGWindow *main, const TGWindow *p,
40 const UInt_t w, const UInt_t h)
41: MBrowser(main, p, w, h)
42{
43
44 fButPedADC = new TGTextButton(fTop2, "ADC Spectra of Pedestals", M_BUTTON_PEDADC );
45 fButPedADC->Associate(this) ;
46 fTop2->AddFrame (fButPedADC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
47
48 fButCrADC = new TGTextButton(fTop2, "ADC Specta of Cosmics", M_BUTTON_CRADC );
49 fButCrADC->Associate(this) ;
50 fTop2->AddFrame (fButCrADC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
51
52 fButPedTDC = new TGTextButton(fTop3, "TDC Spectra of Pedestals", M_BUTTON_PEDTDC );
53 fButPedTDC->Associate(this) ;
54 fTop3->AddFrame (fButPedTDC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
55
56 fButCrTDC = new TGTextButton(fTop3, "TDC Specta of Cosmics", M_BUTTON_CRTDC );
57 fButCrTDC->Associate(this) ;
58 fTop3->AddFrame (fButCrTDC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
59
60 MapSubwindows();
61
62 Layout();
63
64 SetWindowName("DataCheck Window");
65 SetIconName("DataCheck");
66
67 MapWindow();
68}
69
70MDataCheck::~MDataCheck()
71{
72 delete fButPedADC;
73 delete fButCrADC;
74 delete fButPedTDC;
75 delete fButCrTDC;
76}
77
78// ======================================================================
79
80Bool_t MDataCheck::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
81{
82 // Process events generated by the buttons in the frame.
83
84 if (GET_MSG(msg)!=kC_COMMAND || GET_SUBMSG(msg)!=kCM_BUTTON)
85 return MBrowser::ProcessMessage(msg, parm1, parm2);
86
87 switch (parm1)
88 {
89 case M_BUTTON_PEDADC:
90 case M_BUTTON_CRADC:
91 case M_BUTTON_PEDTDC:
92 case M_BUTTON_CRTDC:
93 if (!InputFileSelected())
94 {
95 DisplError("No Input (root) File selected!");
96 return kTRUE;
97 }
98
99 switch (parm1)
100 {
101 case M_BUTTON_PEDADC:
102 fViewAdc.AdcSpectra(fInputFile, "PedEvents" ) ;
103 return kTRUE;
104
105 case M_BUTTON_CRADC:
106 fViewAdc.AdcSpectra(fInputFile, "Events" ) ;
107 return kTRUE;
108
109 case M_BUTTON_PEDTDC:
110 // fOctober.PedTdcSpectra(fInputFile) ;
111 return kTRUE;
112
113 case M_BUTTON_CRTDC:
114 return kTRUE;
115 }
116 return kTRUE;
117 }
118
119 return MBrowser::ProcessMessage(msg, parm1, parm2);
120}
Note: See TracBrowser for help on using the repository browser.