]>
Commit | Line | Data |
---|---|---|
d810d0de | 1 | // $Id$ |
2 | // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 | |
3 | ||
4 | /************************************************************************** | |
5 | * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. * | |
6 | * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * | |
51346b82 | 7 | * full copyright notice. * |
d810d0de | 8 | **************************************************************************/ |
9 | ||
10 | #include "AliEveHOMERManagerEditor.h" | |
707b281a | 11 | #include "AliEveHOMERManager.h" |
d810d0de | 12 | |
13 | #include <TVirtualPad.h> | |
14 | #include <TColor.h> | |
7279ee15 | 15 | #include <TROOT.h> |
d810d0de | 16 | |
17 | #include <TGLabel.h> | |
18 | #include <TGButton.h> | |
19 | #include <TGNumberEntry.h> | |
20 | #include <TGColorSelect.h> | |
21 | #include <TGDoubleSlider.h> | |
cfa641b1 | 22 | #include <TGComboBox.h> |
707b281a | 23 | |
57ffa5fb | 24 | //______________________________________________________________________________ |
d810d0de | 25 | // AliEveHOMERManagerEditor |
26 | // | |
27 | ||
28 | ClassImp(AliEveHOMERManagerEditor) | |
29 | ||
30 | AliEveHOMERManagerEditor::AliEveHOMERManagerEditor(const TGWindow *p, Int_t width, Int_t height, | |
31 | UInt_t options, Pixel_t back) : | |
cfa641b1 | 32 | |
33 | TGedFrame(p, width, height, options | kVerticalFrame, back), | |
d810d0de | 34 | fM(0), |
cfa641b1 | 35 | // fButtonSaveBlockList(0), |
7279ee15 | 36 | fButtonNextEvent(0), |
ea9a0e13 | 37 | fButtonNavigateBack(0), |
38 | fButtonNavigateFwd(0), | |
cfa641b1 | 39 | fBoxTriggerSelector(0), |
40 | fButtonEventLoopText(0), | |
41 | // fBoxEventLoopSpeed(0), | |
7279ee15 | 42 | fButtonEventLoop(0), |
cfa641b1 | 43 | |
44 | fEventLoopStarted(kFALSE) | |
45 | { | |
46 | ||
d810d0de | 47 | MakeTitle("AliEveHOMERManager"); |
48 | ||
49 | // Create widgets | |
50 | // fXYZZ = new TGSomeWidget(this, ...); | |
51 | // AddFrame(fXYZZ, new TGLayoutHints(...)); | |
52 | // fXYZZ->Connect("SignalName()", "AliEveHOMERManagerEditor", this, "DoXYZZ()"); | |
46eadbb4 | 53 | |
cfa641b1 | 54 | // fButtonConnect = new TGTextButton(this, " Connect to HLT "); |
55 | // AddFrame(fButtonConnect); //, new TGLayoutHints(...)); | |
56 | // fButtonConnect->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "ConnectToHLT()"); | |
57 | ||
58 | fButtonWriteToFile = new TGTextButton(this, " Write to file "); | |
59 | AddFrame(fButtonWriteToFile); //, new TGLayoutHints(...)); | |
60 | fButtonWriteToFile->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "WriteBlockListToFile()"); | |
61 | ||
7279ee15 | 62 | |
63 | fButtonNextEvent = new TGTextButton(this, " NextEvent "); | |
64 | AddFrame(fButtonNextEvent); //, new TGLayoutHints(...)); | |
65 | fButtonNextEvent->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "NextEvent()"); | |
66 | ||
ea9a0e13 | 67 | fButtonNavigateBack = new TGTextButton(this, " Navigate Back "); |
68 | AddFrame(fButtonNavigateBack); //, new TGLayoutHints(...)); | |
69 | fButtonNavigateBack->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "NavigateBack()"); | |
70 | ||
71 | fButtonNavigateFwd = new TGTextButton(this, " Navigate Fwd "); | |
72 | AddFrame(fButtonNavigateFwd); //, new TGLayoutHints(...)); | |
73 | fButtonNavigateFwd->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "NavigateFwd()"); | |
a82a31af | 74 | |
cfa641b1 | 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); | |
84 | ||
85 | fButtonEventLoopText = new TGTextButton(this, " Loop Events "); | |
86 | AddFrame(fButtonEventLoopText); //, new TGLayoutHints(...)); | |
87 | fButtonEventLoopText->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "EventLoop()"); | |
88 | ||
a82a31af | 89 | fButtonEventLoop = new TGPictureButton(this, gClient->GetPicture("$ALICE_ROOT/EVE/hlt-macros/HLT-logo.png")); |
7279ee15 | 90 | AddFrame(fButtonEventLoop); //, new TGLayoutHints(...)); |
91 | fButtonEventLoop->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "EventLoop()"); | |
d810d0de | 92 | } |
93 | ||
57ffa5fb | 94 | /******************************************************************************/ |
d810d0de | 95 | |
ea9a0e13 | 96 | void AliEveHOMERManagerEditor::SetModel(TObject* obj) { |
d810d0de | 97 | fM = dynamic_cast<AliEveHOMERManager*>(obj); |
98 | ||
99 | // Set values of widgets | |
100 | // fXYZZ->SetValue(fM->GetXYZZ()); | |
101 | } | |
102 | ||
57ffa5fb | 103 | /******************************************************************************/ |
d810d0de | 104 | |
cfa641b1 | 105 | // void AliEveHOMERManagerEditor::ConnectToHLT() { |
106 | // // Connects to HOMER sources -> to HLT. | |
ea9a0e13 | 107 | |
cfa641b1 | 108 | // fM->ConnectEVEtoHOMER(); |
109 | // } | |
7279ee15 | 110 | |
ea9a0e13 | 111 | void AliEveHOMERManagerEditor::NextEvent() { |
7279ee15 | 112 | // call next event from macro |
7279ee15 | 113 | |
cfa641b1 | 114 | Int_t iResult = 0; |
115 | if ( fM->NextEvent() ) | |
ea9a0e13 | 116 | return; |
117 | ||
cfa641b1 | 118 | |
ea9a0e13 | 119 | gROOT->ProcessLineFast("processEvent();"); |
120 | ||
121 | return; | |
7279ee15 | 122 | } |
123 | ||
cfa641b1 | 124 | void AliEveHOMERManagerEditor::WriteBlockListToFile() { |
125 | ||
126 | ||
127 | gROOT->ProcessLineFast("writeToFile();"); | |
128 | ||
129 | } | |
130 | ||
ea9a0e13 | 131 | void AliEveHOMERManagerEditor::NavigateFwd() { |
132 | // navigate forward | |
133 | ||
134 | if ( !fEventLoopStarted ) { | |
135 | if ( fM->NavigateEventBufferFwd() == -1 ) | |
136 | return; | |
137 | ||
138 | gROOT->ProcessLineFast("processEvent();"); | |
139 | } | |
140 | return; | |
141 | } | |
142 | ||
143 | void AliEveHOMERManagerEditor::NavigateBack() { | |
144 | // navigate back | |
145 | ||
146 | if ( !fEventLoopStarted ) { | |
147 | if ( fM->NavigateEventBufferBack() == -1 ) | |
148 | return; | |
149 | ||
150 | gROOT->ProcessLineFast("processEvent();"); | |
151 | } | |
152 | return; | |
153 | } | |
154 | ||
155 | void AliEveHOMERManagerEditor::EventLoop() { | |
7279ee15 | 156 | |
a82a31af | 157 | // Start/stop event loop |
158 | if ( !fEventLoopStarted ) { | |
159 | gROOT->ProcessLineFast("loopEvent();"); | |
160 | fEventLoopStarted = kTRUE; | |
cfa641b1 | 161 | fButtonEventLoopText->SetText(" Stop Loop "); |
a82a31af | 162 | } |
163 | else { | |
164 | gROOT->ProcessLineFast("stopLoopEvent();"); | |
165 | fEventLoopStarted = kFALSE; | |
cfa641b1 | 166 | fButtonEventLoopText->SetText(" Loop Events "); |
167 | } | |
168 | } | |
169 | ||
170 | void AliEveHOMERManagerEditor::SetTriggerString(int id) { | |
171 | ||
172 | if (id < 0 || id > 4) { | |
173 | return; | |
a82a31af | 174 | } |
cfa641b1 | 175 | |
176 | TString tsa[4] = {"HLTGlobalTrigger", | |
177 | "BarrelMultiplicityTrigger", | |
178 | "PHOSgeomTrigger", | |
179 | "ALL"}; | |
180 | ||
181 | ||
182 | fM->SetTriggerString(tsa[id]); | |
183 | ||
7279ee15 | 184 | } |
ea9a0e13 | 185 |