2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
10 #include "AliEveHOMERManagerEditor.h"
11 #include "AliEveHOMERManager.h"
13 #include <TVirtualPad.h>
19 #include <TGNumberEntry.h>
20 #include <TGColorSelect.h>
21 #include <TGDoubleSlider.h>
22 #include <TGComboBox.h>
24 //______________________________________________________________________________
25 // AliEveHOMERManagerEditor
28 ClassImp(AliEveHOMERManagerEditor)
30 AliEveHOMERManagerEditor::AliEveHOMERManagerEditor(const TGWindow *p, Int_t width, Int_t height,
31 UInt_t options, Pixel_t back) :
33 TGedFrame(p, width, height, options | kVerticalFrame, back),
36 fButtonWriteToFile(0),
38 fButtonNavigateBack(0),
39 fButtonNavigateFwd(0),
40 fButtonPrintScreens(NULL),
41 fBoxTriggerSelector(0),
42 // fBoxEventLoopSpeed(0),
43 fButtonEventLoopText(0),
45 fEventLoopStarted(kFALSE)
48 MakeTitle("AliEveHOMERManager");
51 // fXYZZ = new TGSomeWidget(this, ...);
52 // AddFrame(fXYZZ, new TGLayoutHints(...));
53 // fXYZZ->Connect("SignalName()", "AliEveHOMERManagerEditor", this, "DoXYZZ()");
55 fButtonConnect = new TGTextButton(this, " Reconnect ");
56 AddFrame(fButtonConnect); //, new TGLayoutHints(...));
57 fButtonConnect->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "ConnectToHLT()");
59 fButtonWriteToFile = new TGTextButton(this, " Write to file ");
60 AddFrame(fButtonWriteToFile); //, new TGLayoutHints(...));
61 fButtonWriteToFile->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "WriteBlockListToFile()");
64 fButtonNextEvent = new TGTextButton(this, " NextEvent ");
65 AddFrame(fButtonNextEvent); //, new TGLayoutHints(...));
66 fButtonNextEvent->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "NextEvent()");
68 fButtonNavigateBack = new TGTextButton(this, " Navigate Back ");
69 AddFrame(fButtonNavigateBack); //, new TGLayoutHints(...));
70 fButtonNavigateBack->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "NavigateBack()");
72 fButtonNavigateFwd = new TGTextButton(this, " Navigate Fwd ");
73 AddFrame(fButtonNavigateFwd); //, new TGLayoutHints(...));
74 fButtonNavigateFwd->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "NavigateFwd()");
77 fButtonPrintScreens = new TGTextButton(this, " Save Viewers ");
78 AddFrame(fButtonPrintScreens); //, new TGLayoutHints(...));
79 fButtonPrintScreens->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "PrintScreens()");
82 fBoxTriggerSelector = new TGComboBox(this, "Select Trigger");
83 fBoxTriggerSelector->AddEntry("HLT Global Trigger", 0);
84 fBoxTriggerSelector->AddEntry("Barrel multiplicity trigger", 1);
85 fBoxTriggerSelector->AddEntry("PHOS Geometry trigger", 2);
86 fBoxTriggerSelector->AddEntry("No trigger selection", 3);
87 fBoxTriggerSelector->Connect("Selected(Int_t)","AliEveHOMERManagerEditor", this, "SetTriggerString(int)");
88 fBoxTriggerSelector->SetWidth(150);
89 fBoxTriggerSelector->SetHeight(25);
90 AddFrame(fBoxTriggerSelector);
92 fButtonEventLoopText = new TGTextButton(this, " Loop Events ");
93 AddFrame(fButtonEventLoopText); //, new TGLayoutHints(...));
94 fButtonEventLoopText->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "EventLoop()");
96 fButtonEventLoop = new TGPictureButton(this, gClient->GetPicture("$ALICE_ROOT/EVE/hlt-macros/HLT-logo.png"));
97 AddFrame(fButtonEventLoop); //, new TGLayoutHints(...));
98 fButtonEventLoop->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "EventLoop()");
101 /******************************************************************************/
103 void AliEveHOMERManagerEditor::SetModel(TObject* obj) {
104 fM = dynamic_cast<AliEveHOMERManager*>(obj);
106 // Set values of widgets
107 // fXYZZ->SetValue(fM->GetXYZZ());
110 /******************************************************************************/
112 void AliEveHOMERManagerEditor::ConnectToHLT() {
113 // Connects to HOMER sources -> to HLT.
114 fM->ReConnectHOMER();
117 void AliEveHOMERManagerEditor::NextEvent() {
118 // call next event from AliEveHOMERManger
119 fM->NextHOMEREvent();
122 void AliEveHOMERManagerEditor::WriteBlockListToFile() {
123 gROOT->ProcessLineFast("writeToFile();");
128 void AliEveHOMERManagerEditor::PrintScreens() {
133 void AliEveHOMERManagerEditor::NavigateFwd() {
136 if ( !fEventLoopStarted ) {
137 if ( fM->NavigateEventBufferFwd() == -1 )
141 // gROOT->ProcessLineFast("processEvent();");
146 void AliEveHOMERManagerEditor::NavigateBack() {
149 if ( !fEventLoopStarted ) {
150 if ( fM->NavigateEventBufferBack() == -1 )
154 //gROOT->ProcessLineFast("processEvent();");
159 void AliEveHOMERManagerEditor::EventLoop() {
160 // Start/stop event loop
161 if ( !fEventLoopStarted ) {
162 fEventLoopStarted = kTRUE;
163 fButtonEventLoopText->SetText(" Stop Loop ");
164 //fM->SetEventLoopStarted(kTRUE);
167 // gROOT->ProcessLineFast("loopEvent();");
171 //gROOT->ProcessLineFast("stopLoopEvent();");
173 fEventLoopStarted = kFALSE;
174 //fM->SetEventLoopStarted(kFALSE);
175 fButtonEventLoopText->SetText(" Loop Events ");
179 void AliEveHOMERManagerEditor::SetTriggerString(int id) {
181 if (id < 0 || id > 4) {
185 TString tsa[4] = {"HLTGlobalTrigger",
186 "BarrelMultiplicityTrigger",
191 fM->SetTriggerString(tsa[id]);