StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StarWebView.C
1 // $Id: StarWebView.C,v 1.4 2000/04/07 17:07:08 fine Exp $
2 // $Log: StarWebView.C,v $
3 // Revision 1.4 2000/04/07 17:07:08 fine
4 // adjusted to the ROOT 2.24
5 //
6 // Revision 1.3 1999/05/21 15:33:54 kathy
7 // made sure Log & Id are in each file and also put in standard comment line with name of owner
8 //
9 //=======================================================================
10 // owner: Valery Fine
11 // what it does:
12 //=======================================================================
13 //*-- Author : Valery Fine 28/08/98 (E-mail: fine@bnl.gov)
14 {
15  // To run this example one needs the access to Internet
16  // To start this example launch ROOT as follows:
17  //
18  //*-* root.exe StarWebView.C
19  //
20 
21  gROOT->Reset();
22  Bool_t NT=kFALSE;
23  if (strcmp(gSystem.GetName(),"WinNT") == 0 ) NT=kTRUE;
24  if (NT) gSystem->Load("ROOT_STAR");
25  else gSystem->Load("libSTAR");
26  if (!gGeometry) new TGeometry;
27  TCanvas Star("Star","Star",400,600);
28  // Pick the geomtery file from the remote Web site at CERN: http://root.cern.ch
29  gBenchmark->Start("pick");
30  TWebFile f("http://www.star.bnl.gov/~fine/star_year_2a.root");
31  gBenchmark->Show("pick");
32  // List first 3 levels of the geometry
33  HALL->ls(3);
34  // Create an TPad view of "ECAL" from this geometry if any
35  HALL->FindByName("ECAL")->Draw();
36  // Now create ROOT browser to inspect the geometry
37  TBrowser b("STAR",HALL);
38  // Begin_Html <P ALIGN=CENTER> <IMG SRC="gif/browser.gif"> </P> End_Html //
39  // Call TPad::x3d() method to create 3D view with the "default" 3D viewer
40  // Under UNIX it is X3D package
41  // Under Windows NT/95 - OpenGL
42  if (NT) Star.x3d();
43  // Begin_Html <P ALIGN=CENTER> <IMG SRC="gif/year2a_hadron2.gif"> </P> End_Html //
44 }