1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 //-----------------------------------------------------------------
20 // The class that deals with the event tag tab of the GUI
21 // Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
22 //-----------------------------------------------------------------
26 #include "TGNumberEntry.h"
29 #include "AliTagFrame.h"
33 //___________________________________________________________________________
34 AliTagFrame::AliTagFrame(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h, UInt_t options, const char* tagName, Int_t /*tagId*/, ETagRangeType range)
35 : TGTransientFrame(p, main, w, h, options),
36 fMin(0), fMax(0), fRange(range),
37 fEntry1(0), fEntry2(0),
38 fButton(0), fVFrame1(0), fVFrame2(0) {
40 SetCleanup(kDeepCleanup);
42 SetWindowName(tagName);
44 AliTagFrameFunctions tagFunctions [6] = {
45 &AliTagFrame::Vx, &AliTagFrame::Vy, &AliTagFrame::Vz,
46 &AliTagFrame::Participants, &AliTagFrame::ImpactParameter, &AliTagFrame::PrimaryVertex
49 AliTagFrameFunctions tagFunctions [3] = {
50 &AliTagFrame::NegMultiplicityRange, &AliTagFrame::VOsRange, &AliTagFrame::NPionRange
54 CreateTagName(tagName);
55 // CREATE_TAG_FRAME(this, tagFunctions[tagId])();
56 if(fRange == kRangeMinMax){
57 CreateTagRange(fVFrame1, fEntry1, "Min");
58 CreateTagRange(fVFrame2, fEntry2, "Max");
60 else if(fRange == kRangeMin){
61 CreateTagRange(fVFrame1, fEntry1, "Min");
63 else if(fRange == kRangeMax){
64 CreateTagRange(fVFrame1, fEntry1, "Max");
69 fButton->Connect("Clicked()", "AliTagFrame", this, "OnClicked()");
75 gClient->WaitFor(this);
78 //___________________________________________________________________________
79 AliTagFrame::~AliTagFrame() {
85 //___________________________________________________________________________
86 void AliTagFrame::CreateTagName(const char* name) {
87 // Creates the Tag Name and insert it at Result Group Frame
89 AddFrame(new TGLabel(this, new TGString(name)), new TGLayoutHints(kLHintsLeft, 5,5,40,5));
92 //___________________________________________________________________________
93 void AliTagFrame::CreateTagRange(TGVerticalFrame * vFrame, TGNumberEntryField *& entry, const char* name) {
94 // Creates the label and entries.
96 vFrame = new TGVerticalFrame(this);
97 AddFrame(vFrame, new TGLayoutHints(kLHintsCenterX, 5,5,5,5));
99 TGLabel * label2 = new TGLabel(vFrame, new TGString(name));
100 vFrame->AddFrame(label2, new TGLayoutHints(kLHintsTop | kLHintsCenterX, 5,5,5,5));
101 entry = new TGNumberEntryField(vFrame);
102 vFrame->AddFrame(entry, new TGLayoutHints(kLHintsBottom, 5,5,5,5));
105 //___________________________________________________________________________
106 void AliTagFrame::CreateTagButton() {
107 // Creates the OK button.
109 fButton = new TGTextButton(this, "OK", 1);
110 AddFrame(fButton, new TGLayoutHints(kLHintsRight, 5,5,35,5));
113 //___________________________________________________________________________
114 void AliTagFrame::OnClicked() {
117 if(fRange == kRangeMinMax){
118 fMin = static_cast<int>(fEntry1->GetNumber());
119 fMax = static_cast<int>(fEntry2->GetNumber());
121 else if(fRange == kRangeMin){
122 fMin = static_cast<int>(fEntry1->GetNumber());
124 else if(fRange == kRangeMax){
125 fMax = static_cast<int>(fEntry1->GetNumber());
128 TTimer::SingleShot(1, "AliTagFrame", this, "CloseWindow()");