forked from alisw/AliPhysics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAliEveBeamsInfoEditor.cxx
More file actions
149 lines (122 loc) · 5.12 KB
/
Copy pathAliEveBeamsInfoEditor.cxx
File metadata and controls
149 lines (122 loc) · 5.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
// $Id$
// Author: Stefano Carrazza 2010, CERN, stefano.carrazza@cern.ch
/**************************************************************************
* Copyright(c) 1998-2009, ALICE Experiment at CERN, all rights reserved. *
* See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
* full copyright notice. *
**************************************************************************/
#include "AliEveBeamsInfo.h"
#include "AliEveBeamsInfoEditor.h"
#include "TVirtualPad.h"
#include "TColor.h"
#include "TGButton.h"
#include "TGColorSelect.h"
#include "TGComboBox.h"
#include "TGDoubleSlider.h"
#include "TGFrame.h"
#include "TGLabel.h"
#include "TGNumberEntry.h"
#include "TGString.h"
//______________________________________________________________________________
// GUI editor for AliEveBeamsInfo.
//
ClassImp(AliEveBeamsInfoEditor)
//______________________________________________________________________________
AliEveBeamsInfoEditor::AliEveBeamsInfoEditor(const TGWindow *p, Int_t width, Int_t height,
UInt_t options, Pixel_t back) :
TGedFrame(p, width, height, options | kVerticalFrame, back),
fM(0),
fIsMC(0),
fEventSelection(0),
fShowEvents(0),
fSelect(0),
fButtonPrev(0),
fButtonNext(0),
fSetAlpha(0),
fAlpha(0)
{
// Constructor.
MakeTitle("AliEveBeamsInfo");
// Events selection
fShowEvents = new TGCheckButton(this, new TGHotString("&Show information box"));
fShowEvents->SetState(kButtonDown);
fShowEvents->Connect("Clicked()", "AliEveBeamsInfoEditor", this, "ShowEventSelection()");
AddFrame(fShowEvents, new TGLayoutHints(kLHintsExpandX));
fIsMC = new TGCheckButton(this, new TGHotString("&Data is from simulation (MC)"));
fIsMC->SetState(kButtonUp);
fIsMC->Connect("Clicked()", "AliEveBeamsInfoEditor", this, "SwitchDataType()");
AddFrame(fIsMC, new TGLayoutHints(kLHintsExpandX));
fEventSelection = new TGGroupFrame(this, "Event filter:", kHorizontalFrame);
fSelect = new TGComboBox(fEventSelection,-1,kHorizontalFrame | kSunkenFrame | kDoubleBorder | kOwnBackground);
fSelect->AddEntry("Show all events",0);
fSelect->AddEntry("Only Beam 1 events",1);
fSelect->AddEntry("Only Beam 2 events",2);
fSelect->AddEntry("Beams 1 & 2 events",3);
fSelect->Resize(120,22);
fSelect->Select(0);
fEventSelection->AddFrame(fSelect, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
fSelect->Connect("Selected(Int_t)", "AliEveBeamsInfoEditor", this, "SelectEventSelection(Int_t)");
AddFrame(fEventSelection, new TGLayoutHints(kLHintsExpandX));
//------
TGHorizontalFrame *h = new TGHorizontalFrame(this);
fButtonPrev = new TGTextButton(h, "Previous event");
h->AddFrame(fButtonPrev, new TGLayoutHints(kLHintsLeft | kLHintsCenterY | kLHintsExpandX));
fButtonPrev->Connect("Clicked()", "AliEveBeamsInfoEditor", this, "ShowPrevEvent()");
fButtonNext = new TGTextButton(h, "Next event");
h->AddFrame( fButtonNext, new TGLayoutHints(kLHintsRight | kLHintsNormal | kLHintsExpandX));
fButtonNext->Connect("Clicked()", "AliEveBeamsInfoEditor", this, "ShowNextEvent()");
AddFrame(h, new TGLayoutHints(kLHintsExpandX | kLHintsCenterY));
fSetAlpha = new TGGroupFrame(this, "Transparency value:", kHorizontalFrame);
fAlpha = new TGNumberEntry(fSetAlpha, 1.5, 7, -1,
TGNumberFormat::kNESRealOne,
TGNumberFormat::kNEANonNegative,
TGNumberFormat::kNELLimitMinMax,
0, 1.5);
fAlpha->Resize(120,22);
fSetAlpha->AddFrame(fAlpha, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY));
fAlpha->Connect("ValueSet(Long_t)", "AliEveBeamsInfoEditor", this, "SetAlpha()");
AddFrame(fSetAlpha, new TGLayoutHints(kLHintsExpandX));
}
//______________________________________________________________________________
void AliEveBeamsInfoEditor::SetModel(TObject* obj)
{
// Set model object.
fM = dynamic_cast<AliEveBeamsInfo*>(obj);
}
//______________________________________________________________________________
void AliEveBeamsInfoEditor::ShowEventSelection()
{
// Show event selection
fM->ShowEventSelection(fShowEvents->IsOn());
}
//______________________________________________________________________________
void AliEveBeamsInfoEditor::SelectEventSelection(Int_t id)
{
// Show event selection
fM->SelectEventSelection(id);
}
//______________________________________________________________________________
void AliEveBeamsInfoEditor::ShowPrevEvent()
{
// Show previous event
fM->ShowPrevEvent();
}
//______________________________________________________________________________
void AliEveBeamsInfoEditor::ShowNextEvent()
{
// Show next event
fM->ShowNextEvent();
}
//______________________________________________________________________________
void AliEveBeamsInfoEditor::SwitchDataType()
{
// Show previous event
fM->SwitchDataType(fIsMC->IsOn());
}
//______________________________________________________________________________
void AliEveBeamsInfoEditor::SetAlpha()
{
// Set alpha
fM->SetAlpha(fAlpha->GetNumber());
}
/******************************************************************************/