1 ///////////////////////////////////////////////////////////////////////////////
3 // Interface Class to the Geant3.21 MonteCarlo //
4 // Author : Rene Brun 08/12/98 //
6 // A TPaveTree is a TPaveLabel specialized to draw Geant GDtree //
8 // When a TPaveTree object is drawn in a canvas, one can: //
9 // - double click to draw the spec //
10 // - select pop-up item DrawTree to draw its tree //
11 // - select pop-up item DrawTreeParent to draw its parent tree //
15 <img src="picts/TPaveTreeClass.gif">
19 ///////////////////////////////////////////////////////////////////////////////
24 #include <TVirtualPad.h>
26 #include "TPaveTree.h"
31 //_____________________________________________________________________________
32 TPaveTree::TPaveTree(): TPaveLabel()
35 // Default Constructor
39 //_____________________________________________________________________________
40 TPaveTree::TPaveTree(Coord_t x1, Coord_t y1,Coord_t x2, Coord_t y2,
42 :TPaveLabel(x1,y1,x2,y2,label,"br")
45 // TPaveTree normal constructor
50 //_____________________________________________________________________________
51 TPaveTree::~TPaveTree()
54 // Standard Destructor
58 //_____________________________________________________________________________
59 TPaveTree::TPaveTree(const TPaveTree &PaveTree)
64 ((TPaveTree&)PaveTree).Copy(*this);
67 //_____________________________________________________________________________
68 void TPaveTree::Copy(TObject &obj)
71 // Copy this PaveTree to PaveTree
73 TPaveLabel::Copy(obj);
76 //_____________________________________________________________________________
77 void TPaveTree::DrawSpec()
80 // Draw specs of the volume in this TPaveTree
82 AliMC* pMC = AliMC::GetMC();
84 pMC->DrawOneSpec(GetLabel());
87 //_____________________________________________________________________________
88 void TPaveTree::DrawTree(Int_t levmax, Int_t isel)
91 // Draw tree of the volume in this TPaveTree
93 TGeant3 *geant3=(TGeant3*)AliMC::GetMC();
94 geant3->Gdtree(GetLabel(),levmax,isel);
97 //_____________________________________________________________________________
98 void TPaveTree::DrawTreeParent(Int_t levmax, Int_t isel)
101 // Draw parent tree of the volume in this TPaveTree
103 TGeant3 *geant3=(TGeant3*)AliMC::GetMC();
104 geant3->GdtreeParent(GetLabel(),levmax,isel);
107 //_____________________________________________________________________________
108 void TPaveTree::ExecuteEvent(Int_t event, Int_t px, Int_t py)
111 // Process mouse events.
112 // Invokes TPabeLabel::ExecuteEvent. In case of a double click
113 // draw specs of volume corresponding to this TPaveTree
115 AliMC* pMC = AliMC::GetMC();
117 TPaveLabel::ExecuteEvent(event,px,py);
119 if (event == kButton1Double) {
120 //printf("TPaveTree::ExecuteEvent\n");
121 gPad->SetCursor(kWatch);
122 pMC->DrawOneSpec(GetLabel());
126 //_____________________________________________________________________________
127 void TPaveTree::SavePrimitive(ofstream &out, Option_t *)
130 // Save primitive as a C++ statement(s) on output stream out
134 if (gROOT->ClassSaved(TPaveTree::Class())) {
139 out<<"pvar = new TPaveTree("<<fX1<<","<<fY1<<","<<fX2<<","<<fY2
140 <<","<<quote<<fLabel<<quote<<","<<quote<<fOption<<quote<<");"<<endl;
142 SaveFillAttributes(out,"pvar",0,1001);
143 SaveLineAttributes(out,"pvar",1,1,1);
144 SaveTextAttributes(out,"pvar",22,0,1,62,0);
146 out<<" pvar->Draw();"<<endl;