EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairBoxSetEditor.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairBoxSetEditor.cxx
1 #include "FairBoxSetEditor.h"
2 
3 #include "FairRootManager.h"
4 #include "FairEventManager.h"
5 #include "FairRunAna.h"
6 
7 #include "TGLabel.h"
8 #include "TGButton.h"
9 #include "TGNumberEntry.h"
10 #include "TGeoManager.h"
11 #include "TChain.h"
12 #include "TEveGValuators.h"
13 #include "FairEventManager.h"
14 
15 //______________________________________________________________________________
16 // FairBoxSetEditor
17 //
18 // Specialization of TGedEditor for proper update propagation to
19 // TEveManager.
20 
22 
23 
24 //______________________________________________________________________________
25 FairBoxSetEditor::FairBoxSetEditor(const TGWindow* p, Int_t width, Int_t height,
26  UInt_t options, Pixel_t back)
27  :TGedFrame(p, width, height, options | kVerticalFrame, back),
28  fInfoFrame(NULL), fTimeWindowPlus(NULL), fTimeWindowMinus(NULL),
29  fObject(NULL), fM(NULL)
30 {
31  std::cout << "FairBoxSetEditor called!" << std::endl;
32  Init();
33 }
34 
36 {
37 
39 // TChain* chain =fRootManager->GetInChain();
40 // Int_t Entries= chain->GetEntriesFast();
41 
42  MakeTitle("FairBoxSet Editor");
43  fInfoFrame= CreateEditorTabSubFrame("Time");
44 
45  TGCompositeFrame* title1 = new TGCompositeFrame(fInfoFrame, 250, 10,
46  kVerticalFrame | kLHintsExpandX |
47  kFixedWidth | kOwnBackground);
48 
49  TGLabel* label1 = new TGLabel(title1,"Time window after event time [ns]: ");
50  title1->AddFrame(label1, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 1, 2, 1, 1));
51 
52  fTimeWindowPlus = new TGNumberEntry(title1);//, 0, 5, -1, TGNumberFormat::kNESRealTwo); //, TGNumberFormat::kNEANonNegative);
53 // fTimeWindow->SetLimits(0, MAXE, 2501, TGNumberFormat::kNESRealOne);
54  fTimeWindowPlus->GetNumberEntry()->SetToolTipText("Time window in ns for which points are shown");
55  fTimeWindowPlus->Connect("ValueSet(Long_t)", "FairBoxSetEditor",this, "TimeWindow()");
56  title1->AddFrame(fTimeWindowPlus, new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
57 
58  fInfoFrame->AddFrame(title1);
59 
60  TGCompositeFrame* title2 = new TGCompositeFrame(fInfoFrame, 250, 10,
61  kVerticalFrame | kLHintsExpandX |
62  kFixedWidth | kOwnBackground);
63 
64  TGLabel* label2 = new TGLabel(title2, "Time window before event time [ns]: ");
65  title2->AddFrame(label2, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 1, 2, 1, 1));
66  fTimeWindowMinus = new TGNumberEntry(title2, 0., 6, -1, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative);//, 1, 5, -1, TGNumberFormat::kNESRealTwo, TGNumberFormat::kNEANonNegative);
67 // fTimeWindow->SetLimits(0, MAXE, 2501, TGNumberFormat::kNESRealOne);
68  fTimeWindowMinus->GetNumberEntry()->SetToolTipText("Time window in ns for which points are shown");
69  fTimeWindowMinus->Connect("ValueSet(Long_t)", "FairBoxSetEditor",this, "TimeWindow()");
70  title2->AddFrame(fTimeWindowMinus, new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
71 
72  fInfoFrame->AddFrame(title2);
73 
74 }
75 
77 {
78  std::cout << "FairBoxSetEditor::TimeWindowPlus " << fTimeWindowPlus->GetNumber() << std::endl;
79  std::cout << "FairBoxSetEditor::TimeWindowMinus " << fTimeWindowMinus->GetNumber() << std::endl;
80  fM->SetTimeWindowPlus(fTimeWindowPlus->GetNumber());
81  fM->SetTimeWindowMinus(fTimeWindowMinus->GetNumber());
83  man->GotoEvent(man->GetCurrentEvent());
84  Update();
85 }
86 
87 
88 //______________________________________________________________________________
89 
90 
91