]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/EveBase/AliEveHFListEditor.cxx
-Fixed bug in offline buffer that deleted event object.
[u/mrichter/AliRoot.git] / EVE / EveBase / AliEveHFListEditor.cxx
1 // @(#)root/eve:$Id$
2 // Main author: Davide Caffarri 2009
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 "AliEveHFListEditor.h"
11 #include "AliEveHF.h"
12
13 #include "TEveGValuators.h"
14
15 #include "TVirtualPad.h"
16 #include "TColor.h"
17
18 // Cleanup these includes:
19 #include "TGLabel.h"
20 #include "TGButton.h"
21 #include "TGNumberEntry.h"
22 #include "TGColorSelect.h"
23 #include "TGDoubleSlider.h"
24 #include "TGComboBox.h"
25 #include "TGLabel.h"
26 #include "TGSlider.h"
27
28 //______________________________________________________________________________
29 // GUI editor for AliEveHFList.
30 //
31
32 ClassImp(AliEveHFListEditor)
33
34 //______________________________________________________________________________
35 AliEveHFListEditor::AliEveHFListEditor(const TGWindow *p, Int_t width, Int_t height,
36              UInt_t options, Pixel_t back) :
37   TGedFrame(p, width, height, options | kVerticalFrame, back),
38   fM(0),
39   fMinMaxPt(0),
40   fMinMaxCosPointingAngle(0),
41   fValueInvMass(0)
42
43 {
44   // Constructor.
45
46   MakeTitle("AliEveHFList");
47
48   // Create widgets
49   // fXYZZ = new TGSomeWidget(this, ...);
50   // AddFrame(fXYZZ, new TGLayoutHints(...));
51   // fXYZZ->Connect("SignalName()", "Reve::AliEveHFListEditor", this, "DoXYZZ()");
52
53    fMinMaxPt = new TEveGDoubleValuator(this,"pT:", 80, 0);
54    fMinMaxPt->SetNELength(5);
55    fMinMaxPt->SetLabelWidth(120);
56    fMinMaxPt->Build();
57    fMinMaxPt->GetSlider()->SetWidth(200);
58    fMinMaxPt->SetLimits(0, 20, TGNumberFormat::kNESRealOne);
59    fMinMaxPt->Connect("ValueSet()", "AliEveHFListEditor", this, "DoMinMaxPt()");
60    AddFrame(fMinMaxPt, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
61
62    fMinMaxCosPointingAngle = new TEveGDoubleValuator(this,"Cos Pointing Angle:", 80, 0);
63    fMinMaxCosPointingAngle->SetNELength(5);
64    fMinMaxCosPointingAngle->SetLabelWidth(120);
65    fMinMaxCosPointingAngle->Build();
66    fMinMaxCosPointingAngle->GetSlider()->SetWidth(200);
67    fMinMaxCosPointingAngle->SetLimits(0, 1, TGNumberFormat::kNESRealOne);
68    fMinMaxCosPointingAngle->Connect("ValueSet()", "AliEveHFListEditor", this, "DoMinMaxCosPointingAngle()");
69    AddFrame(fMinMaxCosPointingAngle, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
70
71
72    fValueInvMass = new TEveGDoubleValuator(this, "Delta Invariant Mass:", 80, 0);
73    fValueInvMass->SetNELength(5);
74    fValueInvMass->SetLabelWidth(120);
75    fValueInvMass->Build();
76    fValueInvMass->GetSlider()->SetWidth(200);
77    fValueInvMass->SetLimits(0,1, TGNumberFormat::kNESRealTwo);
78    fValueInvMass->Connect("ValueSet()", "AliEveHFListEditor", this, "DoMinMaxInvMass()");
79    AddFrame(fValueInvMass, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
80
81
82 }
83
84
85
86 /******************************************************************************/
87
88 //______________________________________________________________________________
89 void AliEveHFListEditor::SetModel(TObject* obj)
90 {
91   // Set model object.
92
93   fM = dynamic_cast<AliEveHFList*>(obj);
94
95   // Set values of widgets
96   // fXYZZ->SetValue(fM->GetXYZZ());
97
98   fMinMaxPt->SetValues(fM->fMinPt, fM->fMaxPt);
99   fMinMaxCosPointingAngle->SetValues(fM->fMinCosPointingAngle, fM->fMaxCosPointingAngle);
100   fValueInvMass->SetValues(0, fM->fDeltaInvariantMass);
101 }
102
103 /******************************************************************************/
104
105 // Implements callback/slot methods
106
107 //______________________________________________________________________________
108 // void AliEveV0ListEditor::DoXYZZ()
109 // {
110 //    // Slot for XYZZ.
111 //
112 //    fM->SetXYZZ(fXYZZ->GetValue());
113 //    Update();
114 // }
115
116
117
118 void AliEveHFListEditor::DoMinMaxPt()
119 {
120   fM->FilterByPt(fMinMaxPt->GetMin(), fMinMaxPt->GetMax());
121 }
122
123 void AliEveHFListEditor::DoMinMaxCosPointingAngle()
124 {
125   fM->FilterByCosPointingAngle(fMinMaxCosPointingAngle->GetMin(), fMinMaxCosPointingAngle->GetMax());
126 }
127
128 void AliEveHFListEditor::DoMinMaxInvMass()
129 {
130   fM->FilterByInvariantMass(0, fValueInvMass->GetMax());
131 }