BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
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>
12using namespace std;
13
14MpdBoxSetEditor::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
27{
28 MakeTitle("MpdBoxSet Editor");
30
31 TGCompositeFrame* title1 =
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
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 =
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));
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
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
70 man->GotoEvent(man->GetCurrentEvent());
71 Update();
72}
kVerticalFrame
kFixedWidth
kOwnBackground
ULong_t Pixel_t
int Int_t
kLHintsLeft
kLHintsCenterY
kLHintsTop
kLHintsExpandX
TGNumberEntry * fTimeWindowMinus
TGVerticalFrame * fInfoFrame
MpdBoxSetEditor(const TGWindow *p=0, Int_t width=170, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
TGNumberEntry * fTimeWindowPlus
virtual void Init()
virtual void TimeWindow()
static MpdEventManager * Instance()
virtual void GotoEvent(Int_t event)
virtual Int_t GetCurrentEvent()
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
TGCompositeFrame(const TGWindow *p=nullptr, UInt_t w=1, UInt_t h=1, UInt_t options=0, Pixel_t back=GetDefaultFrameBackground())
virtual TGVerticalFrame * CreateEditorTabSubFrame(const char *name)
virtual void MakeTitle(const char *title)
virtual void Update()
TGedFrame(const TGWindow *p=nullptr, Int_t width=140, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Definition json.hpp:4446