00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 {
00014
00015
00016
00017
00018
00019
00020
00021
00022 gROOT->Reset();
00023 cout << " Loading share library" << endl;
00024 gROOT->Reset();
00025 printf( " Loading share library\n");
00026 gSystem->Load("libSTAR");
00027 if (!gGeometry) new TGeometry;
00028
00029
00030
00031 cout << " Creating an empty TCanvas object to draw in" << endl;
00032 TCanvas starCanvas("STAR","Star",400,600);
00033 Int_t PadColumns = 2;
00034 Int_t PadRows = 2;
00035 starCanvas.Divide(PadColumns,PadRows);
00036
00037
00038 cout << " Open the remote Web file with STAR geometry database in ROOT format" << endl;
00039
00040 TFile f("~fine/WWW/atlas.root");
00041
00042 cout << " Reading STAR geometry database (the full size of this database 3Mb bytes - ROOT-object" << endl;
00043 TDataSetIter volume(HALL);
00044 volume.Cd("ATLS");
00045
00046 const Char_t *parts[] = {"INNE"
00047 ,"PIPE"
00048 ,"OUTE"
00049 ,"CENT"
00050 };
00051 const Int_t numParts = sizeof(parts)/sizeof(void *);
00052 cout << numParts << " different parts of the ATALS detector will be built" << endl;
00053
00054 for (Int_t i =0; i< numParts; i++) {
00055 const Char_t *part = parts[i];
00056 cout << "Drawing \"" << part << "\"" << endl;
00057 TVolume *vol = volume(part);
00058 starCanvas.cd(i+1);
00059 if (vol) vol->Draw();
00060 gPad->Update();
00061 }
00062
00063 Int_t ThreeDPart = 2;
00064 cout << " Plot 3D view of the " << ThreeDPart << " part: " << parts[ThreeDPart-1] << endl <<
00065 " Note: Under Windows NT OpenGL will be used by default instead x3d for UNIX" << endl <<
00066 " ================================================================" << endl <<
00067 " Select x3d windows and type \"m\" in there to get x3d HELP windows" << endl <<
00068 " ================================================================" << endl <<
00069 " DON NOT FORGET to type \"q\" letter to terminate x3d widget and" << endl <<
00070 " to continue this session" << endl <<
00071 " ================================================================" << endl;
00072 starCanvas.cd(ThreeDPart);
00073 gPad->x3d();
00074
00075 cout << "Drawing ROOT TBrowser" << endl;
00076 TBrowser b("STAR",HALL);
00077 cout << "Now. Try yourself:" << endl <<
00078 " 1. Select any STAR geometry TVolume object with \"double-left-mouse click\" on the TVolumePosition" << endl <<
00079 " TVolume object has no \";<n>\" in its name." << endl <<
00080 " The objects with trail \";<n>\" are TVolumePosition ones" << endl <<
00081 " 2. Pop the context menu up with \"right-mouse click\" on the ROOT browser" << endl <<
00082 " 3. Select \"Draw\" position" << endl <<
00083 " 4. Click OK" << endl;
00084 cout << " Get this macro form $(STAR)/StRoot/macro/StarFromWeb.C and customize it for fun" << endl;
00085 }