BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
MpdBoxSetEditor.cxx
Go to the documentation of this file.
1
// MpdBoxSetEditor
2
//
3
// Specialization of TGedEditor for proper update propagation to TEveManager
4
5
#include "
MpdBoxSetEditor.h
"
6
7
#include "
MpdEventManager.h
"
8
#include "
TGLabel.h
"
9
#include "
TGLayout.h
"
// for TGLayoutHints, etc
10
11
#include <iostream>
12
using namespace
std
;
13
14
MpdBoxSetEditor::MpdBoxSetEditor
(
const
TGWindow
* p,
Int_t
width,
Int_t
height, UInt_t options,
Pixel_t
back)
15
:
TGedFrame
(p, width, height, options |
kVerticalFrame
, back)
16
,
fInfoFrame
(NULL)
17
,
fTimeWindowPlus
(NULL)
18
,
fTimeWindowMinus
(NULL)
19
,
fObject
(NULL)
20
,
fM
(NULL)
21
{
22
cout <<
"MpdBoxSetEditor called!"
<< endl;
23
Init
();
24
}
25
26
void
MpdBoxSetEditor::Init
()
27
{
28
MakeTitle
(
"MpdBoxSet Editor"
);
29
fInfoFrame
=
CreateEditorTabSubFrame
(
"Time"
);
30
31
TGCompositeFrame
* title1 =
32
new
TGCompositeFrame
(
fInfoFrame
, 250, 10,
kVerticalFrame
|
kLHintsExpandX
|
kFixedWidth
|
kOwnBackground
);
33
34
TGLabel
* label1 =
new
TGLabel
(title1,
"Time window after event time [ns]: "
);
35
title1->
AddFrame
(label1,
new
TGLayoutHints
(
kLHintsLeft
|
kLHintsCenterY
, 1, 2, 1, 1));
36
37
fTimeWindowPlus
=
38
new
TGNumberEntry
(title1);
//, 0, 5, -1, TGNumberFormat::kNESRealTwo); //, TGNumberFormat::kNEANonNegative);
39
// fTimeWindow->SetLimits(0, MAXE, 2501, TGNumberFormat::kNESRealOne);
40
fTimeWindowPlus
->GetNumberEntry()->SetToolTipText(
"Time window in ns for which points are shown"
);
41
fTimeWindowPlus
->Connect(
"ValueSet(Long_t)"
,
"MpdBoxSetEditor"
,
this
,
"TimeWindow()"
);
42
title1->
AddFrame
(
fTimeWindowPlus
,
new
TGLayoutHints
(
kLHintsTop
, 1, 1, 1, 0));
43
44
fInfoFrame
->AddFrame(title1);
45
46
TGCompositeFrame
* title2 =
47
new
TGCompositeFrame
(
fInfoFrame
, 250, 10,
kVerticalFrame
|
kLHintsExpandX
|
kFixedWidth
|
kOwnBackground
);
48
49
TGLabel
* label2 =
new
TGLabel
(title2,
"Time window before event time [ns]: "
);
50
title2->
AddFrame
(label2,
new
TGLayoutHints
(
kLHintsLeft
|
kLHintsCenterY
, 1, 2, 1, 1));
51
fTimeWindowMinus
=
new
TGNumberEntry
(
52
title2, 0., 6, -1,
TGNumberFormat::kNESInteger
,
53
TGNumberFormat::kNEANonNegative
);
//, 1, 5, -1, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative);
54
// fTimeWindow->SetLimits(0, MAXE, 2501, TGNumberFormat::kNESRealOne);
55
fTimeWindowMinus
->GetNumberEntry()->SetToolTipText(
"Time window in ns for which points are shown"
);
56
fTimeWindowMinus
->Connect(
"ValueSet(Long_t)"
,
"MpdBoxSetEditor"
,
this
,
"TimeWindow()"
);
57
title2->
AddFrame
(
fTimeWindowMinus
,
new
TGLayoutHints
(
kLHintsTop
, 1, 1, 1, 0));
58
59
fInfoFrame
->AddFrame(title2);
60
}
61
62
void
MpdBoxSetEditor::TimeWindow
()
63
{
64
cout <<
"MpdBoxSetEditor::TimeWindowPlus "
<<
fTimeWindowPlus
->GetNumber() << endl;
65
cout <<
"MpdBoxSetEditor::TimeWindowMinus "
<<
fTimeWindowMinus
->GetNumber() << endl;
66
fM
->SetTimeWindowPlus(
fTimeWindowPlus
->GetNumber());
67
fM
->SetTimeWindowMinus(
fTimeWindowMinus
->GetNumber());
68
69
MpdEventManager
* man =
MpdEventManager::Instance
();
70
man->
GotoEvent
(man->
GetCurrentEvent
());
71
Update
();
72
}
kVerticalFrame
kVerticalFrame
kFixedWidth
kFixedWidth
kOwnBackground
kOwnBackground
Pixel_t
ULong_t Pixel_t
Int_t
int Int_t
TGLabel.h
TGLayout.h
kLHintsLeft
kLHintsLeft
kLHintsCenterY
kLHintsCenterY
kLHintsTop
kLHintsTop
kLHintsExpandX
kLHintsExpandX
MpdBoxSetEditor::fTimeWindowMinus
TGNumberEntry * fTimeWindowMinus
Definition
MpdBoxSetEditor.h:52
MpdBoxSetEditor::fInfoFrame
TGVerticalFrame * fInfoFrame
Definition
MpdBoxSetEditor.h:50
MpdBoxSetEditor::MpdBoxSetEditor
MpdBoxSetEditor(const TGWindow *p=0, Int_t width=170, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Definition
MpdBoxSetEditor.cxx:14
MpdBoxSetEditor::fObject
TObject * fObject
Definition
MpdBoxSetEditor.h:55
MpdBoxSetEditor::fM
MpdBoxSet * fM
Definition
MpdBoxSetEditor.h:56
MpdBoxSetEditor::fTimeWindowPlus
TGNumberEntry * fTimeWindowPlus
Definition
MpdBoxSetEditor.h:51
MpdBoxSetEditor::Init
virtual void Init()
Definition
MpdBoxSetEditor.cxx:26
MpdBoxSetEditor::TimeWindow
virtual void TimeWindow()
Definition
MpdBoxSetEditor.cxx:62
MpdEventManager
Definition
MpdEventManager.h:32
MpdEventManager::Instance
static MpdEventManager * Instance()
Definition
MpdEventManager.cxx:30
MpdEventManager::GotoEvent
virtual void GotoEvent(Int_t event)
Definition
MpdEventManager.cxx:647
MpdEventManager::GetCurrentEvent
virtual Int_t GetCurrentEvent()
Definition
MpdEventManager.h:96
TGCompositeFrame::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
TGCompositeFrame::TGCompositeFrame
TGCompositeFrame(const TGWindow *p=nullptr, UInt_t w=1, UInt_t h=1, UInt_t options=0, Pixel_t back=GetDefaultFrameBackground())
TGLabel
TGLayoutHints
TGNumberEntry
TGNumberFormat::kNEANonNegative
kNEANonNegative
TGNumberFormat::kNESInteger
kNESInteger
TGWindow
TGedFrame::CreateEditorTabSubFrame
virtual TGVerticalFrame * CreateEditorTabSubFrame(const char *name)
TGedFrame::MakeTitle
virtual void MakeTitle(const char *title)
TGedFrame::Update
virtual void Update()
TGedFrame::TGedFrame
TGedFrame(const TGWindow *p=nullptr, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
MpdBoxSetEditor.h
MpdEventManager.h
std
Definition
json.hpp:4446
eventdisplay
MpdBoxSetEditor.cxx
Generated on
for BmnRoot by
1.17.0