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 fBoxTriggerSelector(0),
41 fButtonEventLoopText(0),
42 // fBoxEventLoopSpeed(0),
44 fEventLoopStarted(kFALSE)
47 MakeTitle("AliEveHOMERManager");
50 // fXYZZ = new TGSomeWidget(this, ...);
51 // AddFrame(fXYZZ, new TGLayoutHints(...));
52 // fXYZZ->Connect("SignalName()", "AliEveHOMERManagerEditor", this, "DoXYZZ()");
54 fButtonConnect = new TGTextButton(this, " Reconnect ");
55 AddFrame(fButtonConnect); //, new TGLayoutHints(...));
56 fButtonConnect->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "ConnectToHLT()");
58 fButtonWriteToFile = new TGTextButton(this, " Write to file ");
59 AddFrame(fButtonWriteToFile); //, new TGLayoutHints(...));
60 fButtonWriteToFile->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "WriteBlockListToFile()");
63 fButtonNextEvent = new TGTextButton(this, " NextEvent ");
64 AddFrame(fButtonNextEvent); //, new TGLayoutHints(...));
65 fButtonNextEvent->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "NextEvent()");
67 fButtonNavigateBack = new TGTextButton(this, " Navigate Back ");
68 AddFrame(fButtonNavigateBack); //, new TGLayoutHints(...));
69 fButtonNavigateBack->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "NavigateBack()");
71 fButtonNavigateFwd = new TGTextButton(this, " Navigate Fwd ");
72 AddFrame(fButtonNavigateFwd); //, new TGLayoutHints(...));
73 fButtonNavigateFwd->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "NavigateFwd()");
75 fBoxTriggerSelector = new TGComboBox(this, "Select Trigger");
76 fBoxTriggerSelector->AddEntry("HLT Global Trigger", 0);
77 fBoxTriggerSelector->AddEntry("Barrel multiplicity trigger", 1);
78 fBoxTriggerSelector->AddEntry("PHOS Geometry trigger", 2);
79 fBoxTriggerSelector->AddEntry("No trigger selection", 3);
80 fBoxTriggerSelector->Connect("Selected(Int_t)","AliEveHOMERManagerEditor", this, "SetTriggerString(int)");
81 fBoxTriggerSelector->SetWidth(150);
82 fBoxTriggerSelector->SetHeight(25);
83 AddFrame(fBoxTriggerSelector);
85 fButtonEventLoopText = new TGTextButton(this, " Loop Events ");
86 AddFrame(fButtonEventLoopText); //, new TGLayoutHints(...));
87 fButtonEventLoopText->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "EventLoop()");
89 fButtonEventLoop = new TGPictureButton(this, gClient->GetPicture("$ALICE_ROOT/EVE/hlt-macros/HLT-logo.png"));
90 AddFrame(fButtonEventLoop); //, new TGLayoutHints(...));
91 fButtonEventLoop->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "EventLoop()");
94 /******************************************************************************/
96 void AliEveHOMERManagerEditor::SetModel(TObject* obj) {
97 fM = dynamic_cast<AliEveHOMERManager*>(obj);
99 // Set values of widgets
100 // fXYZZ->SetValue(fM->GetXYZZ());
103 /******************************************************************************/
105 void AliEveHOMERManagerEditor::ConnectToHLT() {
106 // Connects to HOMER sources -> to HLT.
107 fM->ReConnectHOMER();
110 void AliEveHOMERManagerEditor::NextEvent() {
111 // call next event from AliEveHOMERManger
112 fM->NextHOMEREvent();
115 void AliEveHOMERManagerEditor::WriteBlockListToFile() {
116 gROOT->ProcessLineFast("writeToFile();");
120 void AliEveHOMERManagerEditor::NavigateFwd() {
123 if ( !fEventLoopStarted ) {
124 if ( fM->NavigateEventBufferFwd() == -1 )
128 // gROOT->ProcessLineFast("processEvent();");
133 void AliEveHOMERManagerEditor::NavigateBack() {
136 if ( !fEventLoopStarted ) {
137 if ( fM->NavigateEventBufferBack() == -1 )
141 //gROOT->ProcessLineFast("processEvent();");
146 void AliEveHOMERManagerEditor::EventLoop() {
147 // Start/stop event loop
148 if ( !fEventLoopStarted ) {
149 fEventLoopStarted = kTRUE;
150 fButtonEventLoopText->SetText(" Stop Loop ");
151 //fM->SetEventLoopStarted(kTRUE);
154 // gROOT->ProcessLineFast("loopEvent();");
158 //gROOT->ProcessLineFast("stopLoopEvent();");
160 fEventLoopStarted = kFALSE;
161 //fM->SetEventLoopStarted(kFALSE);
162 fButtonEventLoopText->SetText(" Loop Events ");
166 void AliEveHOMERManagerEditor::SetTriggerString(int id) {
168 if (id < 0 || id > 4) {
172 TString tsa[4] = {"HLTGlobalTrigger",
173 "BarrelMultiplicityTrigger",
178 fM->SetTriggerString(tsa[id]);