2 // Author: Matevz Tadel 2007
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 **************************************************************************/
12 #include "TVirtualPad.h"
16 #include "TEveGValuators.h"
18 // Cleanup these includes:
20 //#include "TGButton.h"
21 //#include "TGNumberEntry.h"
22 //#include "TGColorSelect.h"
23 #include "TGDoubleSlider.h"
24 #include <TGComboBox.h>
26 #include "AliEveCascadeListEditor.h"
27 #include "AliEveCascade.h"
31 //______________________________________________________________________________
32 // GUI editor for AliEveCascadeList.
35 ClassImp(AliEveCascadeListEditor)
37 //______________________________________________________________________________
38 AliEveCascadeListEditor::AliEveCascadeListEditor(const TGWindow *p, Int_t width, Int_t height,
39 UInt_t options, Pixel_t back) :
40 TGedFrame(p, width, height, options | kVerticalFrame, back),
44 fMinMaxDaughterDCA(0),
46 fMinMaxInvariantMass(0)
50 MakeTitle("AliEveCascadeList");
53 // fXYZZ = new TGSomeWidget(this, ...);
54 // AddFrame(fXYZZ, new TGLayoutHints(...));
55 // fXYZZ->Connect("SignalName()", "Reve::AliEveCascadeListEditor", this, "DoXYZZ()");
57 fMinMaxRCut = new TEveGDoubleValuator(this,"Radius:", 130, 0);
58 fMinMaxRCut->SetNELength(5);
59 fMinMaxRCut->SetLabelWidth(74);
61 fMinMaxRCut->GetSlider()->SetWidth(200);
62 fMinMaxRCut->SetLimits(0, 100, TGNumberFormat::kNESRealOne);
63 fMinMaxRCut->Connect("ValueSet()", "AliEveCascadeListEditor", this, "DoMinMaxRCut()");
64 AddFrame(fMinMaxRCut, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
66 fMinMaxDaughterDCA = new TEveGDoubleValuator(this,"DCA:", 130, 0);
67 fMinMaxDaughterDCA->SetNELength(5);
68 fMinMaxDaughterDCA->SetLabelWidth(74);
69 fMinMaxDaughterDCA->Build();
70 fMinMaxDaughterDCA->GetSlider()->SetWidth(200);
71 fMinMaxDaughterDCA->SetLimits(0, 1, TGNumberFormat::kNESRealTwo);
72 fMinMaxDaughterDCA->Connect("ValueSet()", "AliEveCascadeListEditor", this, "DoMinMaxDaughterDCA()");
73 AddFrame(fMinMaxDaughterDCA, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
75 fMinMaxPt = new TEveGDoubleValuator(this,"pT:", 130, 0);
76 fMinMaxPt->SetNELength(5);
77 fMinMaxPt->SetLabelWidth(74);
79 fMinMaxPt->GetSlider()->SetWidth(200);
80 fMinMaxPt->SetLimits(0, 20, TGNumberFormat::kNESRealOne);
81 fMinMaxPt->Connect("ValueSet()", "AliEveCascadeListEditor", this, "DoMinMaxPt()");
82 AddFrame(fMinMaxPt, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
85 TGHorizontalFrame* fCascadeFrame = new TGHorizontalFrame(this);
86 TGLabel* labPos = new TGLabel(fCascadeFrame, "Cascade:");
87 fCascadeFrame->AddFrame(labPos, new TGLayoutHints(kLHintsLeft|kLHintsBottom, 1, 1, 1, 1));
88 fCascadeSpecies = new TGComboBox(fCascadeFrame);
89 fCascadeSpecies->AddEntry("Xi", kXiMinus);
90 fCascadeSpecies->AddEntry("Omega", kOmegaMinus);
91 TGListBox* lbPos = fCascadeSpecies->GetListBox();
92 lbPos->Resize(lbPos->GetWidth(), 2*18);
93 fCascadeSpecies->Resize(45, 20);
94 fCascadeSpecies->Connect("Selected(Int_t)", "AliEveCascadeListEditor", this, "DoSelectInvMassHyp(Int_t)");
95 fCascadeFrame->AddFrame(fCascadeSpecies, new TGLayoutHints(kLHintsTop, 3, 1, 1, 1));
96 AddFrame(fCascadeFrame);
99 fMinMaxInvariantMass = new TEveGDoubleValuator(this,"Inv. Mass:", 130, 0);
100 fMinMaxInvariantMass->SetNELength(5);
101 fMinMaxInvariantMass->SetLabelWidth(74);
102 fMinMaxInvariantMass->Build();
103 fMinMaxInvariantMass->GetSlider()->SetWidth(200);
104 fMinMaxInvariantMass->SetLimits(1, 6, TGNumberFormat::kNESRealThree);
105 fMinMaxInvariantMass->Connect("ValueSet()", "AliEveCascadeListEditor", this, "DoMinMaxInvariantMass()");
106 AddFrame(fMinMaxInvariantMass, new TGLayoutHints(kLHintsBottom, 1, 1, 1, 1));
110 /******************************************************************************/
112 //______________________________________________________________________________
113 void AliEveCascadeListEditor::SetModel(TObject* obj)
117 fM = static_cast<AliEveCascadeList*>(obj);
119 // Set values of widgets
120 // fXYZZ->SetValue(fM->GetXYZZ());
122 fMinMaxRCut->SetValues(fM->fMinRCut, fM->fMaxRCut);
123 fMinMaxDaughterDCA->SetValues(fM->fMinDaughterDCA, fM->fMaxDaughterDCA);
124 fMinMaxPt->SetValues(fM->fMinPt, fM->fMaxPt);
125 fMinMaxInvariantMass->SetValues(fM->fMinInvariantMass,fM->fMaxInvariantMass);
128 /******************************************************************************/
130 // Implements callback/slot methods
132 //______________________________________________________________________________
133 // void AliEveCascadeListEditor::DoXYZZ()
137 // fM->SetXYZZ(fXYZZ->GetValue());
141 void AliEveCascadeListEditor::DoMinMaxRCut()
143 // Filter cascade candidates by transverse radius
145 fM->FilterByRadius(fMinMaxRCut->GetMin(), fMinMaxRCut->GetMax());
148 void AliEveCascadeListEditor::DoMinMaxDaughterDCA()
150 // Filter cascade candidates by DCA to primary vertex
152 fM->FilterByDaughterDCA(fMinMaxDaughterDCA->GetMin(), fMinMaxDaughterDCA->GetMax());
155 void AliEveCascadeListEditor::DoMinMaxPt()
157 // Filter cascade candidates by transverse momentum
159 fM->FilterByPt(fMinMaxPt->GetMin(), fMinMaxPt->GetMax());
164 void AliEveCascadeListEditor::DoSelectInvMassHyp(Int_t rInvMassHyp)
166 // Apply the invariant mass hypothesis according the choice made by user
168 fM->SetInvMassHyp(rInvMassHyp);
172 void AliEveCascadeListEditor::DoMinMaxInvariantMass()
174 // Filter cascade candidates by invariant mass (under mass hypothesis made by user)
176 Int_t rInvMassHyp = fM->GetInvMassHyp();
178 fM->FilterByInvariantMass(fMinMaxInvariantMass->GetMin(), fMinMaxInvariantMass->GetMax(), rInvMassHyp);
180 fM->FilterByInvariantMass(fMinMaxInvariantMass->GetMin(), fMinMaxInvariantMass->GetMax(), kXiMinus);