#include "ScanRootGui.h"
ClassImp(ScanRootGui)
ScanRootGui::ScanRootGui(TDirectory* dir):ScanRoot(dir)
{
mTools = new PelTools();
isGUIActive = false;
fMainFrame2357 = 0;
}
ScanRootGui::ScanRootGui(bool debug):ScanRoot(debug)
{
mTools = new PelTools();
isGUIActive = false;
fMainFrame2357 = 0;
}
ScanRootGui::~ScanRootGui()
{
if(fMainFrame2357)
{
fMainFrame2357->Cleanup();
delete fMainFrame2357;
}
delete mTools;
}
void ScanRootGui::help()
{
openHelp();
}
void ScanRootGui::makeGUI()
{
if(isGUIActive) return;
isGUIActive = true;
fMainFrame2357 = new TGMainFrame(gClient->GetRoot(),10,10,kMainFrame | kVerticalFrame);
fMainFrame2357->SetLayoutBroken(kTRUE);
fMainFrame2357->SetWindowName("ScanROOT");
fMainFrame2357->SetIconName("ScanROOT");
TGCompositeFrame *fMainFrame701 = new TGCompositeFrame(fMainFrame2357,541,372,kVerticalFrame);
fMainFrame701->SetLayoutBroken(kTRUE);
TGGroupFrame *fGroupFrame702 = new TGGroupFrame(fMainFrame701,"Quick access");
fGroupFrame702->SetLayoutBroken(kTRUE);
TGTextButton *fTextButton703 = new TGTextButton(fGroupFrame702,"Load HIST");
fTextButton703->SetTextJustify(36);
fTextButton703->Resize(80,32);
fGroupFrame702->AddFrame(fTextButton703, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton703->MoveResize(96,16,80,32);
TGTextButton *fTextButton704 = new TGTextButton(fGroupFrame702,"Open FIL");
fTextButton704->SetTextJustify(36);
fTextButton704->Resize(80,32);
fGroupFrame702->AddFrame(fTextButton704, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton704->MoveResize(8,16,80,32);
TGTextButton *fTextButton705 = new TGTextButton(fGroupFrame702,"Zero ALL");
fTextButton705->SetTextJustify(36);
fTextButton705->Resize(80,32);
fGroupFrame702->AddFrame(fTextButton705, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton705->MoveResize(184,16,80,32);
TGTextButton *fTextButton706 = new TGTextButton(fGroupFrame702,"GO");
fTextButton706->SetTextJustify(36);
fTextButton706->Resize(80,32);
fGroupFrame702->AddFrame(fTextButton706, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton706->MoveResize(272,16,80,32);
TGTextButton *fTextButton707 = new TGTextButton(fGroupFrame702,"Save HIST");
fTextButton707->SetTextJustify(36);
fTextButton707->Resize(80,32);
fGroupFrame702->AddFrame(fTextButton707, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton707->MoveResize(360,16,80,32);
TGTextButton *fTextButton708 = new TGTextButton(fGroupFrame702,"PelTools");
fTextButton708->SetTextJustify(36);
fTextButton708->Resize(80,32);
fGroupFrame702->AddFrame(fTextButton708, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton708->MoveResize(448,16,80,32);
fGroupFrame702->SetLayoutManager(new TGVerticalLayout(fGroupFrame702));
fGroupFrame702->Resize(536,64);
fMainFrame701->AddFrame(fGroupFrame702, new TGLayoutHints(kLHintsLeft | kLHintsCenterX | kLHintsTop | kLHintsCenterY,2,3,2,2));
fGroupFrame702->MoveResize(3,2,536,64);
TGTab *fTab709 = new TGTab(fMainFrame701,534,296,TGTab::GetDefaultGC()(),TGTab::GetDefaultFontStruct(),kRaisedFrame | kDoubleBorder);
TGCompositeFrame *fCompositeFrame712;
fCompositeFrame712 = fTab709->AddTab("File");
fCompositeFrame712->SetLayoutManager(new TGVerticalLayout(fCompositeFrame712));
fCompositeFrame712->SetLayoutBroken(kTRUE);
TGTextButton *fTextButton713 = new TGTextButton(fCompositeFrame712,"Open FIL");
fTextButton713->SetTextJustify(36);
fTextButton713->Resize(112,32);
fCompositeFrame712->AddFrame(fTextButton713, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton713->MoveResize(16,8,112,32);
TGTextButton *fTextButton714 = new TGTextButton(fCompositeFrame712,"Close FIL");
fTextButton714->SetTextJustify(36);
fTextButton714->Resize(112,32);
fCompositeFrame712->AddFrame(fTextButton714, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton714->MoveResize(16,48,112,32);
TGTextButton *fTextButton715 = new TGTextButton(fCompositeFrame712,"New Output");
fTextButton715->SetTextJustify(36);
fTextButton715->Resize(112,32);
fCompositeFrame712->AddFrame(fTextButton715, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton715->MoveResize(136,8,112,32);
TGTextButton *fTextButton716 = new TGTextButton(fCompositeFrame712,"Close Output");
fTextButton716->SetTextJustify(36);
fTextButton716->Resize(112,32);
fCompositeFrame712->AddFrame(fTextButton716, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton716->MoveResize(136,48,112,32);
TGTextButton *fTextButton717 = new TGTextButton(fCompositeFrame712,"Load HIST");
fTextButton717->SetTextJustify(36);
fTextButton717->Resize(112,32);
fCompositeFrame712->AddFrame(fTextButton717, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton717->MoveResize(256,8,112,32);
TGTextButton *fTextButton718 = new TGTextButton(fCompositeFrame712,"Save HiIST");
fTextButton718->SetTextJustify(36);
fTextButton718->Resize(112,32);
fCompositeFrame712->AddFrame(fTextButton718, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton718->MoveResize(256,48,112,32);
TGTextButton *fTextButton719 = new TGTextButton(fCompositeFrame712,"Load L2");
fTextButton719->SetTextJustify(36);
fTextButton719->Resize(112,32);
fCompositeFrame712->AddFrame(fTextButton719, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton719->MoveResize(376,8,112,32);
TGTextButton *fTextButton720 = new TGTextButton(fCompositeFrame712,"Unload L2");
fTextButton720->SetTextJustify(36);
fTextButton720->Resize(112,32);
fCompositeFrame712->AddFrame(fTextButton720, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton720->MoveResize(376,48,112,32);
TGFont *ufont;
ufont = gClient->GetFont("-*-helvetica-medium-r-*-*-14-*-*-*-*-*-*-*");
TGGC *uGC;
GCValues_t vall721;
vall721.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
gClient->GetColorByName("#000000",vall721.fForeground);
gClient->GetColorByName("#c0c0c0",vall721.fBackground);
vall721.fFillStyle = kFillSolid;
vall721.fFont = ufont->GetFontHandle();
vall721.fGraphicsExposures = kFALSE;
uGC = gClient->GetGC(&vall721, kTRUE);
TGLabel *fLabel721 = new TGLabel(fCompositeFrame712,"Input File",uGC->GetGC(),ufont->GetFontStruct());
fLabel721->SetTextJustify(33);
fCompositeFrame712->AddFrame(fLabel721, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fLabel721->MoveResize(16,96,128,18);
ufont = gClient->GetFont("-*-helvetica-medium-r-*-*-14-*-*-*-*-*-*-*");
GCValues_t vall722;
vall722.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
gClient->GetColorByName("#000000",vall722.fForeground);
gClient->GetColorByName("#c0c0c0",vall722.fBackground);
vall722.fFillStyle = kFillSolid;
vall722.fFont = ufont->GetFontHandle();
vall722.fGraphicsExposures = kFALSE;
uGC = gClient->GetGC(&vall722, kTRUE);
TGLabel *fLabel722 = new TGLabel(fCompositeFrame712,"Output File",uGC->GetGC(),ufont->GetFontStruct());
fLabel722->SetTextJustify(33);
fCompositeFrame712->AddFrame(fLabel722, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fLabel722->MoveResize(16,120,128,18);
ufont = gClient->GetFont("-*-helvetica-medium-r-*-*-14-*-*-*-*-*-*-*");
GCValues_t vall723;
vall723.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
gClient->GetColorByName("#000000",vall723.fForeground);
gClient->GetColorByName("#c0c0c0",vall723.fBackground);
vall723.fFillStyle = kFillSolid;
vall723.fFont = ufont->GetFontHandle();
vall723.fGraphicsExposures = kFALSE;
uGC = gClient->GetGC(&vall723, kTRUE);
TGLabel *fLabel723 = new TGLabel(fCompositeFrame712,"Histogram File",uGC->GetGC(),ufont->GetFontStruct());
fLabel723->SetTextJustify(33);
fCompositeFrame712->AddFrame(fLabel723, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fLabel723->MoveResize(16,144,128,18);
ufont = gClient->GetFont("-*-helvetica-medium-r-*-*-14-*-*-*-*-*-*-*");
GCValues_t vall724;
vall724.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
gClient->GetColorByName("#000000",vall724.fForeground);
gClient->GetColorByName("#c0c0c0",vall724.fBackground);
vall724.fFillStyle = kFillSolid;
vall724.fFont = ufont->GetFontHandle();
vall724.fGraphicsExposures = kFALSE;
uGC = gClient->GetGC(&vall724, kTRUE);
TGLabel *fLabel724 = new TGLabel(fCompositeFrame712,"L2 File",uGC->GetGC(),ufont->GetFontStruct());
fLabel724->SetTextJustify(33);
fCompositeFrame712->AddFrame(fLabel724, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fLabel724->MoveResize(16,168,128,18);
ufont = gClient->GetFont("-*-helvetica-medium-r-*-*-14-*-*-*-*-*-*-*");
GCValues_t vall725;
vall725.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
gClient->GetColorByName("#000000",vall725.fForeground);
gClient->GetColorByName("#c0c0c0",vall725.fBackground);
vall725.fFillStyle = kFillSolid;
vall725.fFont = ufont->GetFontHandle();
vall725.fGraphicsExposures = kFALSE;
uGC = gClient->GetGC(&vall725, kTRUE);
TGLabel *fLabel725 = new TGLabel(fCompositeFrame712,"Output saving mode",uGC->GetGC(),ufont->GetFontStruct());
fLabel725->SetTextJustify(33);
fCompositeFrame712->AddFrame(fLabel725, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fLabel725->MoveResize(16,208,128,18);
ufont = gClient->GetFont("-adobe-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-1");
GCValues_t valEntry726;
valEntry726.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
gClient->GetColorByName("#000000",valEntry726.fForeground);
gClient->GetColorByName("#c0c0c0",valEntry726.fBackground);
valEntry726.fFillStyle = kFillSolid;
valEntry726.fFont = ufont->GetFontHandle();
valEntry726.fGraphicsExposures = kFALSE;
uGC = gClient->GetGC(&valEntry726, kTRUE);
TGTextEntry *fTextEntry726 = new TGTextEntry(fCompositeFrame712, new TGTextBuffer(15),-1,uGC->GetGC(),ufont->GetFontStruct(),kSunkenFrame | kDoubleBorder | kOwnBackground);
fTextEntry726->SetMaxLength(255);
fTextEntry726->SetAlignment(kTextLeft);
fTextEntry726->SetText("");
fTextEntry726->Resize(344,fTextEntry726->GetDefaultHeight());
fCompositeFrame712->AddFrame(fTextEntry726, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextEntry726->MoveResize(144,96,344,22);
mText[kTextINPUT] = fTextEntry726;
ufont = gClient->GetFont("-adobe-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-1");
GCValues_t valEntry727;
valEntry727.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
gClient->GetColorByName("#000000",valEntry727.fForeground);
gClient->GetColorByName("#c0c0c0",valEntry727.fBackground);
valEntry727.fFillStyle = kFillSolid;
valEntry727.fFont = ufont->GetFontHandle();
valEntry727.fGraphicsExposures = kFALSE;
uGC = gClient->GetGC(&valEntry727, kTRUE);
TGTextEntry *fTextEntry727 = new TGTextEntry(fCompositeFrame712, new TGTextBuffer(15),-1,uGC->GetGC(),ufont->GetFontStruct(),kSunkenFrame | kDoubleBorder | kOwnBackground);
fTextEntry727->SetMaxLength(255);
fTextEntry727->SetAlignment(kTextLeft);
fTextEntry727->SetText("");
fTextEntry727->Resize(344,fTextEntry727->GetDefaultHeight());
fCompositeFrame712->AddFrame(fTextEntry727, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextEntry727->MoveResize(144,120,344,22);
mText[kTextOUT] = fTextEntry727;
ufont = gClient->GetFont("-adobe-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-1");
GCValues_t valEntry728;
valEntry728.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
gClient->GetColorByName("#000000",valEntry728.fForeground);
gClient->GetColorByName("#c0c0c0",valEntry728.fBackground);
valEntry728.fFillStyle = kFillSolid;
valEntry728.fFont = ufont->GetFontHandle();
valEntry728.fGraphicsExposures = kFALSE;
uGC = gClient->GetGC(&valEntry728, kTRUE);
TGTextEntry *fTextEntry728 = new TGTextEntry(fCompositeFrame712, new TGTextBuffer(15),-1,uGC->GetGC(),ufont->GetFontStruct(),kSunkenFrame | kDoubleBorder | kOwnBackground);
fTextEntry728->SetMaxLength(255);
fTextEntry728->SetAlignment(kTextLeft);
fTextEntry728->SetText("");
fTextEntry728->Resize(344,fTextEntry728->GetDefaultHeight());
fCompositeFrame712->AddFrame(fTextEntry728, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextEntry728->MoveResize(144,144,344,22);
mText[kTextHIST] = fTextEntry728;
ufont = gClient->GetFont("-adobe-helvetica-medium-r-*-*-12-*-*-*-*-*-iso8859-1");
GCValues_t valEntry729;
valEntry729.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
gClient->GetColorByName("#000000",valEntry729.fForeground);
gClient->GetColorByName("#c0c0c0",valEntry729.fBackground);
valEntry729.fFillStyle = kFillSolid;
valEntry729.fFont = ufont->GetFontHandle();
valEntry729.fGraphicsExposures = kFALSE;
uGC = gClient->GetGC(&valEntry729, kTRUE);
TGTextEntry *fTextEntry729 = new TGTextEntry(fCompositeFrame712, new TGTextBuffer(15),-1,uGC->GetGC(),ufont->GetFontStruct(),kSunkenFrame | kDoubleBorder | kOwnBackground);
fTextEntry729->SetMaxLength(255);
fTextEntry729->SetAlignment(kTextLeft);
fTextEntry729->SetText("");
fTextEntry729->Resize(344,fTextEntry729->GetDefaultHeight());
fCompositeFrame712->AddFrame(fTextEntry729, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextEntry729->MoveResize(144,168,344,22);
mText[kTextL2] = fTextEntry729;
ufont = gClient->GetFont("-adobe-helvetica-medium-r-*-*-14-*-*-*-*-*-iso8859-1");
GCValues_t valoButton730;
valoButton730.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
gClient->GetColorByName("#000000",valoButton730.fForeground);
gClient->GetColorByName("#c0c0c0",valoButton730.fBackground);
valoButton730.fFillStyle = kFillSolid;
valoButton730.fFont = ufont->GetFontHandle();
valoButton730.fGraphicsExposures = kFALSE;
uGC = gClient->GetGC(&valoButton730, kTRUE);
TGRadioButton *fRadioButton730 = new TGRadioButton(fCompositeFrame712,"All parameters",-1,uGC->GetGC());
fCompositeFrame712->AddFrame(fRadioButton730, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fRadioButton730->MoveResize(152,208,113,19);
mRadio[kRadioALL] = fRadioButton730;
GCValues_t valoButton734;
valoButton734.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
gClient->GetColorByName("#000000",valoButton734.fForeground);
gClient->GetColorByName("#c0c0c0",valoButton734.fBackground);
valoButton734.fFillStyle = kFillSolid;
valoButton734.fFont = ufont->GetFontHandle();
valoButton734.fGraphicsExposures = kFALSE;
uGC = gClient->GetGC(&valoButton734, kTRUE);
TGRadioButton *fRadioButton734 = new TGRadioButton(fCompositeFrame712,"Only new parameters",-1,uGC->GetGC(),ufont->GetFontStruct());
fCompositeFrame712->AddFrame(fRadioButton734, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fRadioButton734->MoveResize(280,208,160,19);
mRadio[kRadioNEW] = fRadioButton734;
TGCompositeFrame *fCompositeFrame736;
fCompositeFrame736 = fTab709->AddTab("Data processing");
fCompositeFrame736->SetLayoutManager(new TGVerticalLayout(fCompositeFrame736));
fCompositeFrame736->SetLayoutBroken(kTRUE);
TGTextButton *fTextButton737 = new TGTextButton(fCompositeFrame736,"Zero");
fTextButton737->SetTextJustify(36);
fTextButton737->Resize(112,32);
fCompositeFrame736->AddFrame(fTextButton737, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton737->MoveResize(16,8,112,32);
TGTextButton *fTextButton738 = new TGTextButton(fCompositeFrame736,"Zero ALL");
fTextButton738->SetTextJustify(36);
fTextButton738->Resize(112,32);
fCompositeFrame736->AddFrame(fTextButton738, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton738->MoveResize(16,48,112,32);
TGTextButton *fTextButton739 = new TGTextButton(fCompositeFrame736,"GO");
fTextButton739->SetTextJustify(36);
fTextButton739->Resize(112,32);
fCompositeFrame736->AddFrame(fTextButton739, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton739->MoveResize(136,8,112,32);
TGTextButton *fTextButton740 = new TGTextButton(fCompositeFrame736,"Set NPAR");
fTextButton740->SetTextJustify(36);
fTextButton740->Resize(112,32);
fCompositeFrame736->AddFrame(fTextButton740, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton740->MoveResize(136,48,112,32);
TGTextButton *fTextButton7410 = new TGTextButton(fCompositeFrame736,"Rewind");
fTextButton7410->SetTextJustify(36);
fTextButton7410->Resize(112,32);
fCompositeFrame736->AddFrame(fTextButton7410, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton7410->MoveResize(256,8,112,32);
TGTextButton *fTextButton7420 = new TGTextButton(fCompositeFrame736,"Skip");
fTextButton7420->SetTextJustify(36);
fTextButton7420->Resize(112,32);
fCompositeFrame736->AddFrame(fTextButton7420, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton7420->MoveResize(256,48,112,32);
TGTextButton *fTextButton741 = new TGTextButton(fCompositeFrame736,"Call INIT");
fTextButton741->SetTextJustify(36);
fTextButton741->Resize(112,32);
fCompositeFrame736->AddFrame(fTextButton741, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton741->MoveResize(376,8,112,32);
TGTextButton *fTextButton742 = new TGTextButton(fCompositeFrame736,"Call FINISH");
fTextButton742->SetTextJustify(36);
fTextButton742->Resize(112,32);
fCompositeFrame736->AddFrame(fTextButton742, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton742->MoveResize(376,48,112,32);
ufont = gClient->GetFont("-*-helvetica-medium-r-*-*-14-*-*-*-*-*-*-*");
GCValues_t vall753;
vall753.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
gClient->GetColorByName("#000000",vall753.fForeground);
gClient->GetColorByName("#c0c0c0",vall753.fBackground);
vall753.fFillStyle = kFillSolid;
vall753.fFont = ufont->GetFontHandle();
vall753.fGraphicsExposures = kFALSE;
uGC = gClient->GetGC(&vall753, kTRUE);
TGLabel *fLabel753 = new TGLabel(fCompositeFrame736,"Data smearing",uGC->GetGC(),ufont->GetFontStruct());
fLabel753->SetTextJustify(33);
fCompositeFrame736->AddFrame(fLabel753, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fLabel753->MoveResize(16,96,112,18);
ufont = gClient->GetFont("-*-helvetica-medium-r-*-*-14-*-*-*-*-*-*-*");
GCValues_t valButton886;
valButton886.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
gClient->GetColorByName("#000000",valButton886.fForeground);
gClient->GetColorByName("#c0c0c0",valButton886.fBackground);
valButton886.fFillStyle = kFillSolid;
valButton886.fFont = ufont->GetFontHandle();
valButton886.fGraphicsExposures = kFALSE;
uGC = gClient->GetGC(&valButton886, kTRUE);
TGRadioButton *fTextButton886 = new TGRadioButton(fCompositeFrame736,"OFF",-1,uGC->GetGC(),ufont->GetFontStruct());
fCompositeFrame736->AddFrame(fTextButton886, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton886->MoveResize(136,96,106,19);
mRadio[kRadioNOSMEAR] = fTextButton886;
ufont = gClient->GetFont("-*-helvetica-medium-r-*-*-14-*-*-*-*-*-*-*");
GCValues_t valButton903;
valButton903.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
gClient->GetColorByName("#000000",valButton903.fForeground);
gClient->GetColorByName("#c0c0c0",valButton903.fBackground);
valButton903.fFillStyle = kFillSolid;
valButton903.fFont = ufont->GetFontHandle();
valButton903.fGraphicsExposures = kFALSE;
uGC = gClient->GetGC(&valButton903, kTRUE);
TGRadioButton *fTextButton903 = new TGRadioButton(fCompositeFrame736,"ON",-1,uGC->GetGC(),ufont->GetFontStruct());
fCompositeFrame736->AddFrame(fTextButton903, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton903->MoveResize(256,96,106,19);
mRadio[kRadioSMEAR] = fTextButton903;
ufont = gClient->GetFont("-*-helvetica-medium-r-*-*-14-*-*-*-*-*-*-*");
GCValues_t vall1546;
vall1546.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
gClient->GetColorByName("#000000",vall1546.fForeground);
gClient->GetColorByName("#c0c0c0",vall1546.fBackground);
vall1546.fFillStyle = kFillSolid;
vall1546.fFont = ufont->GetFontHandle();
vall1546.fGraphicsExposures = kFALSE;
uGC = gClient->GetGC(&vall1546, kTRUE);
TGLabel *fLabel1546 = new TGLabel(fCompositeFrame736,"Data debug",uGC->GetGC(),ufont->GetFontStruct());
fLabel1546->SetTextJustify(33);
fCompositeFrame736->AddFrame(fLabel1546, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fLabel1546->MoveResize(16,128,112,18);
ufont = gClient->GetFont("-*-helvetica-medium-r-*-*-14-*-*-*-*-*-*-*");
GCValues_t valButton1563;
valButton1563.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
gClient->GetColorByName("#000000",valButton1563.fForeground);
gClient->GetColorByName("#c0c0c0",valButton1563.fBackground);
valButton1563.fFillStyle = kFillSolid;
valButton1563.fFont = ufont->GetFontHandle();
valButton1563.fGraphicsExposures = kFALSE;
uGC = gClient->GetGC(&valButton1563, kTRUE);
TGRadioButton *fTextButton1563 = new TGRadioButton(fCompositeFrame736,"OFF",-1,uGC->GetGC(),ufont->GetFontStruct());
fCompositeFrame736->AddFrame(fTextButton1563, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton1563->MoveResize(136,128,104,19);
mRadio[kRadioDEBUGOFF] = fTextButton1563;
ufont = gClient->GetFont("-*-helvetica-medium-r-*-*-14-*-*-*-*-*-*-*");
GCValues_t valButton1585;
valButton1585.fMask = kGCForeground | kGCBackground | kGCFillStyle | kGCFont | kGCGraphicsExposures;
gClient->GetColorByName("#000000",valButton1585.fForeground);
gClient->GetColorByName("#c0c0c0",valButton1585.fBackground);
valButton1585.fFillStyle = kFillSolid;
valButton1585.fFont = ufont->GetFontHandle();
valButton1585.fGraphicsExposures = kFALSE;
uGC = gClient->GetGC(&valButton1585, kTRUE);
TGRadioButton *fTextButton1585 = new TGRadioButton(fCompositeFrame736,"ON",-1,uGC->GetGC(),ufont->GetFontStruct());
fCompositeFrame736->AddFrame(fTextButton1585, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton1585->MoveResize(256,128,104,19);
mRadio[kRadioDEBUGON] = fTextButton1585;
TGCompositeFrame *fCompositeFrame746;
fCompositeFrame746 = fTab709->AddTab("Tools");
fCompositeFrame746->SetLayoutManager(new TGVerticalLayout(fCompositeFrame746));
fCompositeFrame746->SetLayoutBroken(kTRUE);
TGTextButton *fTextButton1869 = new TGTextButton(fCompositeFrame746,"new Canvas");
fTextButton1869->SetTextJustify(36);
fTextButton1869->Resize(112,32);
fCompositeFrame746->AddFrame(fTextButton1869, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton1869->MoveResize(16,8,112,32);
TGTextButton *fTextButton1895 = new TGTextButton(fCompositeFrame746,"new Browser");
fTextButton1895->SetTextJustify(36);
fTextButton1895->Resize(112,32);
fCompositeFrame746->AddFrame(fTextButton1895, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton1895->MoveResize(16,48,112,32);
TGTextButton *fTextButton1915 = new TGTextButton(fCompositeFrame746,"PelTools");
fTextButton1915->SetTextJustify(36);
fTextButton1915->Resize(112,32);
fCompositeFrame746->AddFrame(fTextButton1915, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton1915->MoveResize(136,8,112,32);
TGTextButton *fTextButton1935 = new TGTextButton(fCompositeFrame746,"STATS");
fTextButton1935->SetTextJustify(36);
fTextButton1935->Resize(112,32);
fCompositeFrame746->AddFrame(fTextButton1935, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton1935->MoveResize(136,48,112,32);
TGTextButton *fTextButton1955 = new TGTextButton(fCompositeFrame746,"Run Macro");
fTextButton1955->SetTextJustify(36);
fTextButton1955->Resize(112,32);
fCompositeFrame746->AddFrame(fTextButton1955, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton1955->MoveResize(256,8,112,32);
TGTextButton *fTextButton1975 = new TGTextButton(fCompositeFrame746,"QUIT");
fTextButton1975->SetTextJustify(36);
fTextButton1975->Resize(112,32);
fCompositeFrame746->AddFrame(fTextButton1975, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton1975->MoveResize(400,232,112,32);
TGTextButton *fTextButton2025 = new TGTextButton(fCompositeFrame746,"exec Command");
fTextButton2025->SetTextJustify(36);
fTextButton2025->Resize(112,32);
fCompositeFrame746->AddFrame(fTextButton2025, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton2025->MoveResize(256,48,112,32);
TGTextButton *fTextButton2086 = new TGTextButton(fCompositeFrame746,"HELP");
fTextButton2086->SetTextJustify(36);
fTextButton2086->Resize(112,32);
fCompositeFrame746->AddFrame(fTextButton2086, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTextButton2086->MoveResize(16,232,112,32);
fMainFrame2357->Connect("CloseWindow()","ScanRootGui",this,"quitGUI()");
fTextButton703->Connect("Clicked()","ScanRootGui",this,"hacGUI()");
fTextButton704->Connect("Clicked()","ScanRootGui",this,"openInputGUI()");
fTextButton705->Connect("Clicked()","ScanRootGui",this,"zeroAllGUI()");
fTextButton706->Connect("Clicked()","ScanRootGui",this,"goGUI()");
fTextButton707->Connect("Clicked()","ScanRootGui",this,"saveHistGUI()");
fTextButton708->Connect("Clicked()","ScanRootGui",this,"pelTools()");
fTextButton713->Connect("Clicked()","ScanRootGui",this,"openInputGUI()");
fTextButton714->Connect("Clicked()","ScanRootGui",this,"closeInputGUI()");
fTextButton715->Connect("Clicked()","ScanRootGui",this,"openOutputGUI()");
fTextButton716->Connect("Clicked()","ScanRootGui",this,"closeOutputGUI()");
fTextButton717->Connect("Clicked()","ScanRootGui",this,"hacGUI()");
fTextButton718->Connect("Clicked()","ScanRootGui",this,"saveHistGUI()");
fTextButton719->Connect("Clicked()","ScanRootGui",this,"loadL2GUI()");
fTextButton720->Connect("Clicked()","ScanRootGui",this,"unloadL2GUI()");
fRadioButton730->Connect("Clicked()","ScanRootGui",this,"outputSaveModeGUI(=false)");
fRadioButton734->Connect("Clicked()","ScanRootGui",this,"outputSaveModeGUI(=true)");
fTextButton737->Connect("Clicked()","ScanRootGui",this,"zeroGUI()");
fTextButton738->Connect("Clicked()","ScanRootGui",this,"zeroAllGUI()");
fTextButton739->Connect("Clicked()","ScanRootGui",this,"goGUI()");
fTextButton740->Connect("Clicked()","ScanRootGui",this,"setNParGUI()");
fTextButton7410->Connect("Clicked()","ScanRootGui",this,"rewindGUI()");
fTextButton7420->Connect("Clicked()","ScanRootGui",this,"skipGUI(");
fTextButton741->Connect("Clicked()","ScanRootGui",this,"initGUI()");
fTextButton742->Connect("Clicked()","ScanRootGui",this,"finishGUI(");
fTextButton886->Connect("Clicked()","ScanRootGui",this,"smearingModeGUI(=false)");
fTextButton903->Connect("Clicked()","ScanRootGui",this,"smearingModeGUI(=true)");
fTextButton1563->Connect("Clicked()","ScanRootGui",this,"debugGUI(=false)");
fTextButton1585->Connect("Clicked()","ScanRootGui",this,"debugGUI(=true)");
fTextButton1869->Connect("Clicked()","ScanRootGui",this,"canvas()");
fTextButton1895->Connect("Clicked()","ScanRootGui",this,"browser()");
fTextButton1915->Connect("Clicked()","ScanRootGui",this,"pelTools()");
fTextButton1935->Connect("Clicked()","ScanRootGui",this,"stat()");
fTextButton1955->Connect("Clicked()","ScanRootGui",this,"runMacro()");
fTextButton1975->Connect("Clicked()","ScanRootGui",this,"quitGUI()");
fTextButton2025->Connect("Clicked()","ScanRootGui",this,"execLine()");
fTextButton2086->Connect("Clicked()","ScanRootGui",this,"help()");
if(mRadio[kRadioDEBUGOFF] && mRadio[kRadioDEBUGON])
{
if(getDebug())
{
mRadio[kRadioDEBUGOFF]->SetState(kButtonUp);
mRadio[kRadioDEBUGON]->SetState(kButtonDown);
}
else
{
mRadio[kRadioDEBUGOFF]->SetState(kButtonDown);
mRadio[kRadioDEBUGON]->SetState(kButtonUp);
}
}
if(mRadio[kRadioSMEAR] && mRadio[kRadioNOSMEAR] && getIO())
{
if(getIO()->isSmearing())
{
mRadio[kRadioSMEAR]->SetState(kButtonDown);
mRadio[kRadioNOSMEAR]->SetState(kButtonUp);
}
else
{
mRadio[kRadioSMEAR]->SetState(kButtonUp);
mRadio[kRadioNOSMEAR]->SetState(kButtonDown);
}
}
if(mRadio[kRadioALL] && mRadio[kRadioNEW])
{
if(getIO()->isSaveOnlyNewPar())
{
mRadio[kRadioALL]->SetState(kButtonUp);
mRadio[kRadioNEW]->SetState(kButtonDown);
}
else
{
mRadio[kRadioALL]->SetState(kButtonDown);
mRadio[kRadioNEW]->SetState(kButtonUp);
}
}
for(int i = 0; i<4; i++)
{
mText[i]->SetEdited(kFALSE);
mText[i]->SetEnabled(kFALSE);
}
fTab709->SetTab(2);
fTab709->Resize(fTab709->GetDefaultSize());
fMainFrame701->AddFrame(fTab709, new TGLayoutHints(kLHintsLeft | kLHintsTop,2,2,2,2));
fTab709->MoveResize(2,72,534,296);
fMainFrame2357->AddFrame(fMainFrame701, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
fMainFrame701->MoveResize(0,0,541,372);
fMainFrame2357->MapSubwindows();
fMainFrame2357->Resize(fMainFrame2357->GetDefaultSize());
fMainFrame2357->MapWindow();
fMainFrame2357->Resize(541,372);
return;
}
void ScanRootGui::openInputGUI()
{
TGFileInfo fi;
new TGFileDialog(gClient->GetRoot(),gClient->GetRoot(),kFDOpen,&fi);
if(fi.fFilename)
{
getIO()->closeInput();
getIO()->openInput(fi.fFilename);
if(mText[kTextINPUT]) mText[kTextINPUT]->SetText(fi.fFilename);
}
}
void ScanRootGui::rewindGUI()
{
getIO()->rewind();
TString title="Rewind FIL";
TString msg = "The input file is now in the beginning";
int retCode;
new TGMsgBox(gClient->GetRoot(),0,title.Data(),msg.Data(),kMBIconExclamation,kMBOk,&retCode);
}
void ScanRootGui::closeInputGUI()
{
getIO()->closeInput();
if(mText[kTextINPUT]) mText[kTextINPUT]->SetText("");
TString title="Close FIL";
TString msg = "Input file is closed";
int retCode;
new TGMsgBox(gClient->GetRoot(),0,title.Data(),msg.Data(),kMBIconExclamation,kMBOk,&retCode);
}
void ScanRootGui::openOutputGUI()
{
TGFileInfo fi;
new TGFileDialog(gClient->GetRoot(),gClient->GetRoot(),kFDSave,&fi);
if(fi.fFilename)
{
getIO()->closeOutput();
getIO()->openOutput(fi.fFilename);
if(mText[kTextOUT]) mText[kTextOUT]->SetText(fi.fFilename);
}
}
void ScanRootGui::closeOutputGUI()
{
getIO()->closeOutput();
if(mText[kTextOUT]) mText[kTextOUT]->SetText("");
TString title="Close Output";
TString msg = "Output file is closed";
int retCode;
new TGMsgBox(gClient->GetRoot(),0,title.Data(),msg.Data(),kMBIconExclamation,kMBOk,&retCode);
}
void ScanRootGui::outputSaveModeGUI(bool mode)
{
if(getIO()) getIO()->saveOnlyNewPar(mode);
else return;
if(mRadio[kRadioALL] && mRadio[kRadioNEW])
{
if(getIO()->isSaveOnlyNewPar())
{
mRadio[kRadioALL]->SetState(kButtonUp);
mRadio[kRadioNEW]->SetState(kButtonDown);
}
else
{
mRadio[kRadioALL]->SetState(kButtonDown);
mRadio[kRadioNEW]->SetState(kButtonUp);
}
}
}
void ScanRootGui::smearingModeGUI(bool mode)
{
if(getIO()) getIO()->setSmearing(mode);
else return;
if(mRadio[kRadioSMEAR] && mRadio[kRadioNOSMEAR])
{
if(getIO()->isSmearing())
{
mRadio[kRadioSMEAR]->SetState(kButtonDown);
mRadio[kRadioNOSMEAR]->SetState(kButtonUp);
}
else
{
mRadio[kRadioSMEAR]->SetState(kButtonUp);
mRadio[kRadioNOSMEAR]->SetState(kButtonDown);
}
}
}
void ScanRootGui::hacGUI()
{
TGFileInfo fi;
new TGFileDialog(gClient->GetRoot(),gClient->GetRoot(),kFDOpen,&fi);
if(fi.fFilename)
{
loadHist(fi.fFilename);
if(mText[kTextHIST]) mText[kTextHIST]->SetText(fi.fFilename);
}
}
void ScanRootGui::saveHistGUI()
{
TGFileInfo fi;
new TGFileDialog(gClient->GetRoot(),gClient->GetRoot(),kFDSave,&fi);
if(fi.fFilename) saveHist(fi.fFilename);
}
void ScanRootGui::addHistGUI()
{
TGFileInfo fi;
new TGFileDialog(gClient->GetRoot(),gClient->GetRoot(),kFDOpen,&fi);
if(fi.fFilename) addHist(fi.fFilename);
}
void ScanRootGui::loadL2GUI()
{
TGFileInfo fi;
new TGFileDialog(gClient->GetRoot(),gClient->GetRoot(),kFDOpen,&fi);
if(fi.fFilename)
{
loadL2(fi.fFilename);
if(mText[kTextL2]) mText[kTextL2]->SetText(fi.fFilename);
}
}
void ScanRootGui::unloadL2GUI()
{
unloadL2();
if(mText[kTextL2]) mText[kTextL2]->SetText("");
TString title="Unload L2";
TString msg = "L2 trigger is unloaded";
int retCode;
new TGMsgBox(gClient->GetRoot(),0,title.Data(),msg.Data(),kMBIconExclamation,kMBOk,&retCode);
}
void ScanRootGui::zeroGUI()
{
char *title = " Zero Histogram";
TString label = " Enter the name of histogram ";
TString output = "";
int stat;
new TDialog(title,1,&label,&output,&stat);
if(stat==1)
{
zero((char*)output.Data());
}
}
void ScanRootGui::zeroAllGUI()
{
if(!yesno("Zero all","Zero all histograms?")) return;
zero();
}
void ScanRootGui::goGUI()
{
int N = 0;
char *title = " Process events from FIL file";
TString label = " Enter the number of events (blank for full file) ";
TString output = "";
int stat;
new TDialog(title,1,&label,&output,&stat);
if(stat==1)
{
N = atoi((char*)output.Data());
if(N<=0) N=0;
go(N);
}
}
void ScanRootGui::skipGUI()
{
int N = 0;
char *title = " Skip events from FIL file";
TString label = " Enter the number of events (blank for 1 event) ";
TString output = "";
int stat;
new TDialog(title,1,&label,&output,&stat);
if(stat==1)
{
N = atoi((char*)output.Data());
if(N<=0) N=1;
getIO()->skipEvents(N);
}
}
void ScanRootGui::setNParGUI()
{
int N = 0;
char *title = " Number of parameters";
TString label = " Enter the number of parameters ";
char line[20];
sprintf(line,"%d",getNPar());
TString output = line;
int stat;
new TDialog(title,1,&label,&output,&stat);
if(stat==1) setNPar(atoi((char*)output.Data()));
}
void ScanRootGui::quitGUI()
{
if(!yesno("Quit Program","Quit SPM-Root acquisition system?")) return;
if(fMainFrame2357)
{
fMainFrame2357->Cleanup();
delete fMainFrame2357;
fMainFrame2357 = 0;
}
gROOT->ProcessLine(".q");
}
void ScanRootGui::debugGUI(bool mode)
{
debug(mode);
if(mRadio[kRadioDEBUGOFF] && mRadio[kRadioDEBUGON])
{
if(getDebug())
{
mRadio[kRadioDEBUGOFF]->SetState(kButtonUp);
mRadio[kRadioDEBUGON]->SetState(kButtonDown);
}
else
{
mRadio[kRadioDEBUGOFF]->SetState(kButtonDown);
mRadio[kRadioDEBUGON]->SetState(kButtonUp);
}
}
}
void ScanRootGui::initGUI()
{
init();
TString title="Call init()";
TString msg = "init() method was called";
int retCode;
new TGMsgBox(gClient->GetRoot(),0,title.Data(),msg.Data(),kMBIconExclamation,kMBOk,&retCode);
}
void ScanRootGui::finishGUI()
{
finish();
TString title="Call finish()";
TString msg = "finish() method was called";
int retCode;
new TGMsgBox(gClient->GetRoot(),0,title.Data(),msg.Data(),kMBIconExclamation,kMBOk,&retCode);
}
void ScanRootGui::runMacro()
{
TGFileInfo fi;
new TGFileDialog(gClient->GetRoot(),gClient->GetRoot(),kFDOpen,&fi);
if(fi.fFilename)
{
char line[200];
sprintf(line,".x %s",fi.fFilename);
gROOT->ProcessLine(line);
}
}
void ScanRootGui::execLine()
{
int N = 0;
char *title = " Execute command line";
TString label = " Command ";
TString output = "";
int stat;
new TDialog(title,1,&label,&output,&stat);
if(stat==1)
{
gROOT->ProcessLine((char*)output.Data());
}
}