bugfix
[u/mrichter/AliRoot.git] / EVE / EveHLT / AliEveHOMERManagerEditor.cxx
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          *
7  * full copyright notice.                                                 *
8  **************************************************************************/
9
10 #include "AliEveHOMERManagerEditor.h"
11 #include "AliEveHOMERManager.h"
12
13 #include <TVirtualPad.h>
14 #include <TColor.h>
15 #include <TROOT.h>
16
17 #include <TGLabel.h>
18 #include <TGButton.h>
19 #include <TGNumberEntry.h>
20 #include <TGColorSelect.h>
21 #include <TGDoubleSlider.h>
22 #include <TGComboBox.h>
23
24 //______________________________________________________________________________
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) :
32   
33 TGedFrame(p, width, height, options | kVerticalFrame, back),
34   fM(0),
35   fButtonConnect(NULL),
36   fButtonWriteToFile(0),
37   fButtonNextEvent(0),
38   fButtonPrintScreens(NULL),
39   fBoxTriggerSelector(0)
40 {
41   
42   MakeTitle("AliEveHOMERManager");
43
44   // Create widgets
45   // fXYZZ = new TGSomeWidget(this, ...);
46   // AddFrame(fXYZZ, new TGLayoutHints(...));
47   // fXYZZ->Connect("SignalName()", "AliEveHOMERManagerEditor", this, "DoXYZZ()");
48
49   fButtonConnect = new TGTextButton(this, " Reconnect ");
50   AddFrame(fButtonConnect); //, new TGLayoutHints(...));
51   fButtonConnect->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "ConnectToHLT()");
52
53   fButtonWriteToFile = new TGTextButton(this, " Write to file  ");
54   AddFrame(fButtonWriteToFile); //, new TGLayoutHints(...));
55   fButtonWriteToFile->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "WriteBlockListToFile()");
56
57
58   fButtonNextEvent = new TGTextButton(this, "  NextEvent  ");
59   AddFrame(fButtonNextEvent); //, new TGLayoutHints(...));
60   fButtonNextEvent->Connect("Clicked()", "AliEveHOMERManagerEditor", this, "NextEvent()");
61
62
63   fBoxTriggerSelector = new TGComboBox(this, "Select Trigger");
64   fBoxTriggerSelector->AddEntry("HLT Global Trigger", 0);
65   fBoxTriggerSelector->AddEntry("Barrel multiplicity trigger", 1);
66   fBoxTriggerSelector->AddEntry("PHOS Geometry trigger", 2);
67   fBoxTriggerSelector->AddEntry("No trigger selection", 3);
68   fBoxTriggerSelector->Connect("Selected(Int_t)","AliEveHOMERManagerEditor", this, "SetTriggerString(int)");
69   fBoxTriggerSelector->SetWidth(150);
70   fBoxTriggerSelector->SetHeight(25);
71   AddFrame(fBoxTriggerSelector);
72
73
74 }
75
76 /******************************************************************************/
77
78 void AliEveHOMERManagerEditor::SetModel(TObject* obj) {
79   fM = dynamic_cast<AliEveHOMERManager*>(obj);
80
81   // Set values of widgets
82   // fXYZZ->SetValue(fM->GetXYZZ());
83 }
84
85 /******************************************************************************/
86
87 void AliEveHOMERManagerEditor::ConnectToHLT() {
88    // Connects to HOMER sources -> to HLT.
89   fM->ReConnectHOMER();
90 }
91
92 void AliEveHOMERManagerEditor::NextEvent() {
93   // call next event from AliEveHOMERManger
94   fM->NextHOMEREvent();
95 }
96
97
98
99 void AliEveHOMERManagerEditor::SetTriggerString(int id) {
100
101   if (id < 0 || id > 4) {
102     return;
103   }
104   
105   TString tsa[4] = {"HLTGlobalTrigger", 
106                     "BarrelMultiplicityTrigger", 
107                     "PHOSgeomTrigger",
108                     "ALL"};
109    
110  
111   fM->SetTriggerString(tsa[id]);
112     
113 }
114