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 **************************************************************************/
10 #include "AliEveV0Editor.h"
13 #include "TVirtualPad.h"
16 // Cleanup these includes:
19 #include "TGNumberEntry.h"
20 #include "TGColorSelect.h"
21 #include "TGDoubleSlider.h"
24 //______________________________________________________________________________
25 // GUI editor for AliEveV0.
28 ClassImp(AliEveV0Editor)
30 //______________________________________________________________________________
31 AliEveV0Editor::AliEveV0Editor(const TGWindow *p, Int_t width, Int_t height,
32 UInt_t options, Pixel_t back) :
33 TGedFrame(p, width, height, options | kVerticalFrame, back),
37 fInfoLabelNegDaughter(0),
38 fInfoLabelPosDaughter(0),
40 // Initialize widget pointers to 0
44 MakeTitle("AliEveV0");
46 fInfoLabel0 = new TGLabel(this);
47 fInfoLabel0->SetTextJustify(kTextLeft);
48 AddFrame(fInfoLabel0, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
51 fInfoLabel1 = new TGLabel(this);
52 fInfoLabel1->SetTextJustify(kTextLeft);
53 AddFrame(fInfoLabel1, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
56 fInfoLabelNegDaughter = new TGLabel(this);
57 fInfoLabelNegDaughter->SetTextJustify(kTextLeft);
58 AddFrame(fInfoLabelNegDaughter, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
61 fInfoLabelPosDaughter = new TGLabel(this);
62 fInfoLabelPosDaughter->SetTextJustify(kTextLeft);
63 AddFrame(fInfoLabelPosDaughter, new TGLayoutHints(kLHintsLeft|kLHintsExpandX,
66 fXButton = new TGTextButton(this, "Detailed View");
67 AddFrame(fXButton, new TGLayoutHints(kLHintsLeft|kLHintsExpandX, 1, 1, 0, 0));
68 fXButton->Connect("Clicked()", "AliEveV0Editor", this, "DisplayDetailed()");
71 /******************************************************************************/
73 //______________________________________________________________________________
74 void AliEveV0Editor::SetModel(TObject* obj)
78 fM = dynamic_cast<AliEveV0*>(obj);
80 // Set values of widgets
81 fInfoLabel0->SetText(Form("Radius = %f, DCA = %f", fM->GetRadius(), fM->GetDaughterDCA()));
82 fInfoLabel1->SetText(Form("Pt = %f", fM->GetPt()));
83 fInfoLabelNegDaughter->SetText(Form("Neg. Daughter Prob= %.2f for Pdg= %d", fM->GetNegMaxProbPid(), fM->GetNegMaxProbPdg()));
84 fInfoLabelPosDaughter->SetText(Form("Pos. Daughter Prob= %.2f for Pdg= %d", fM->GetPosMaxProbPid(), fM->GetPosMaxProbPdg()));
88 /******************************************************************************/
90 // Implements callback/slot methods
92 //______________________________________________________________________________
93 // void AliEveV0Editor::DoXYZZ()
97 // fM->SetXYZZ(fXYZZ->GetValue());
101 #include <TEveManager.h>
102 #include <TEveWindow.h>
103 #include <TEveViewer.h>
104 #include <TEveScene.h>
106 #include <TGLCamera.h>
107 #include <TGLViewer.h>
110 #include <TRootEmbeddedCanvas.h>
112 void AliEveV0Editor::DisplayDetailed()
114 printf("\n Checking invariant mass calculations: K0s %.3f lambda %.3f antilambda %.3f \n",fM->GetK0sInvMass(),fM->GetLambdaInvMass(),fM->GetAntiLambdaInvMass());
116 TEveWindowSlot *slot = TEveWindow::CreateWindowMainFrame();
117 TEveWindowPack *pack = slot->MakePack();
118 pack->SetShowTitleBar(kFALSE);
119 pack->NewSlot()->MakeCurrent();
121 TEveViewer *viewer = gEve->SpawnNewViewer("V0 Detailed View");
122 TEveScene *scene = gEve->SpawnNewScene("V0 Detail Scene");
123 viewer->AddScene(scene);
124 scene->AddElement(fM);
126 viewer->GetGLViewer()->ResetCamerasAfterNextUpdate();
128 TGLCamera& cam = viewer->GetGLViewer()->CurrentCamera();
129 cam.SetExternalCenter(kTRUE);
130 cam.SetCenterVec(fM->fRecDecayV.fX, fM->fRecDecayV.fY, fM->fRecDecayV.fZ);
132 slot = pack->NewSlot();
134 TEveWindowFrame *frame = slot->MakeFrame(new TRootEmbeddedCanvas());
135 frame->SetElementName("Details");
137 TLatex* ltx = new TLatex(0.2, 0.2, "#eta = #frac{1}{2} #times Ln(#frac{E+p_{z}}{E-p_{z}} )");
138 ltx->SetTextSize(0.08);