| 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 |
|
|---|
| 30 | ClassImp(MDataCheck)
|
|---|
| 31 |
|
|---|
| 32 | enum {
|
|---|
| 33 | M_BUTTON_PEDADC,
|
|---|
| 34 | M_BUTTON_CRADC,
|
|---|
| 35 | M_BUTTON_PEDTDC,
|
|---|
| 36 | M_BUTTON_CRTDC
|
|---|
| 37 | };
|
|---|
| 38 |
|
|---|
| 39 | MDataCheck::MDataCheck(const TGWindow *main, const TGWindow *p,
|
|---|
| 40 | const UInt_t w, const UInt_t h)
|
|---|
| 41 | : MBrowser(main, p, w, h)
|
|---|
| 42 | {
|
|---|
| 43 | TGTextButton *pedadc = new TGTextButton(fTop2, "ADC Spectra of Pedestals", M_BUTTON_PEDADC);
|
|---|
| 44 | TGTextButton *cradc = new TGTextButton(fTop2, "ADC Specta of Cosmics", M_BUTTON_CRADC);
|
|---|
| 45 | TGTextButton *pedtdc = new TGTextButton(fTop3, "TDC Spectra of Pedestals", M_BUTTON_PEDTDC);
|
|---|
| 46 | TGTextButton *crtdc = new TGTextButton(fTop3, "TDC Specta of Cosmics", M_BUTTON_CRTDC);
|
|---|
| 47 |
|
|---|
| 48 | pedadc->Associate(this);
|
|---|
| 49 | cradc ->Associate(this);
|
|---|
| 50 | pedtdc->Associate(this);
|
|---|
| 51 | crtdc ->Associate(this);
|
|---|
| 52 |
|
|---|
| 53 | fList->Add(pedadc);
|
|---|
| 54 | fList->Add(cradc);
|
|---|
| 55 | fList->Add(pedtdc);
|
|---|
| 56 | fList->Add(crtdc);
|
|---|
| 57 |
|
|---|
| 58 | TGLayoutHints *laybut = new TGLayoutHints(kLHintsTop|kLHintsLeft, 10, 10, 5, 5);
|
|---|
| 59 | fList->Add(laybut);
|
|---|
| 60 |
|
|---|
| 61 | fTop2->AddFrame(pedadc, laybut);
|
|---|
| 62 | fTop2->AddFrame(cradc, laybut);
|
|---|
| 63 |
|
|---|
| 64 | fTop3->AddFrame(pedtdc, laybut);
|
|---|
| 65 | fTop3->AddFrame(crtdc, laybut);
|
|---|
| 66 |
|
|---|
| 67 | MapSubwindows();
|
|---|
| 68 |
|
|---|
| 69 | Layout();
|
|---|
| 70 |
|
|---|
| 71 | SetWindowName("DataCheck Window");
|
|---|
| 72 | SetIconName("DataCheck");
|
|---|
| 73 |
|
|---|
| 74 | MapWindow();
|
|---|
| 75 | }
|
|---|
| 76 |
|
|---|
| 77 | // ======================================================================
|
|---|
| 78 |
|
|---|
| 79 | Bool_t MDataCheck::ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
|
|---|
| 80 | {
|
|---|
| 81 | // Process events generated by the buttons in the frame.
|
|---|
| 82 |
|
|---|
| 83 | if (GET_MSG(msg)!=kC_COMMAND || GET_SUBMSG(msg)!=kCM_BUTTON)
|
|---|
| 84 | return MBrowser::ProcessMessage(msg, parm1, parm2);
|
|---|
| 85 |
|
|---|
| 86 | switch (parm1)
|
|---|
| 87 | {
|
|---|
| 88 | case M_BUTTON_PEDADC:
|
|---|
| 89 | case M_BUTTON_CRADC:
|
|---|
| 90 | case M_BUTTON_PEDTDC:
|
|---|
| 91 | case M_BUTTON_CRTDC:
|
|---|
| 92 | if (!InputFileSelected())
|
|---|
| 93 | {
|
|---|
| 94 | DisplError("No Input (root) File selected!");
|
|---|
| 95 | return kTRUE;
|
|---|
| 96 | }
|
|---|
| 97 |
|
|---|
| 98 | switch (parm1)
|
|---|
| 99 | {
|
|---|
| 100 | case M_BUTTON_PEDADC:
|
|---|
| 101 | fViewAdc.AdcSpectra(fInputFile, "PedEvents");
|
|---|
| 102 | return kTRUE;
|
|---|
| 103 |
|
|---|
| 104 | case M_BUTTON_CRADC:
|
|---|
| 105 | fViewAdc.AdcSpectra(fInputFile, "Events");
|
|---|
| 106 | return kTRUE;
|
|---|
| 107 |
|
|---|
| 108 | case M_BUTTON_PEDTDC:
|
|---|
| 109 | // fOctober.PedTdcSpectra(fInputFile) ;
|
|---|
| 110 | return kTRUE;
|
|---|
| 111 |
|
|---|
| 112 | case M_BUTTON_CRTDC:
|
|---|
| 113 | return kTRUE;
|
|---|
| 114 | }
|
|---|
| 115 | return kTRUE;
|
|---|
| 116 | }
|
|---|
| 117 |
|
|---|
| 118 | return MBrowser::ProcessMessage(msg, parm1, parm2);
|
|---|
| 119 | }
|
|---|