6 printf(
"Usage: root4star \'GeomDraw.C(const char *geomDescriptor,Float_t bombFactor=2.0, const char *outRootFile="")\' \n");
7 printf(
"----- where \"geomDescriptor\" can be either \n");
8 printf(
" 1. STAR geometry version like \"year2003\" (see: http://www.star.bnl.gov/STAR/comp/prod/MCGeometry.html) \n");
9 printf(
" example: root4star \'GeomDraw.C(\"year2003\")\'\n");
10 printf(
" 2. the proper ZEBRA fz file, for example \n");
11 printf(
" example: root4star \'GeomDraw.C(\"/star/u/potekhin/gstardata/y2003x_complete.fz \")\'\n\n");
12 printf(
" \"Float_t bombFactor\" - the so-called \"bombFactor\" to get the exploiding view of the detector.\n");
13 printf(
" To get the normal view the bombFactor has to be set to 1.0\n");
14 printf(
" It is usually useless to apply bombFactor < 1.0 \n");
15 printf(
"---------------\n");
16 printf(
" One can adjust the view via ROOT Browser or ROOT TCanvas \n");
17 printf(
" 1. Select the volume you are interesting in with left mouse button\n");
18 printf(
" 2. Bring the ROOT context menu up with the right mouse button click\n");
19 printf(
" 3. Select class method to execute and click it with left mouse button\n");
20 printf(
"---------------\n");
21 printf(
" List of the usefull TVolume methods and its parameters:\n");
22 printf(
" 1. TVolume::Draw(const char *levels=\"3\") - \n");
23 printf(
" - define the number of the levels of the geometry hierarchy to be drawn\n");
24 printf(
" 2. TVolume::SetVisibility - \n");
25 printf(
" 0 - everything visible,\n");
26 printf(
" 2 - this invisible, but sons are visible\n");
27 printf(
" 1 - this visible but sons\n");
28 printf(
" 3 - neither this nor its sons are visible\n\n");
29 printf(
"---------------\n");
30 printf(
" To get the OpenGL view one has to\n");
31 printf(
" 1. Turn Qt ROOT Layer on (see: http://www.rhic.bnl.gov/~fine/EventDisplay \n");
32 printf(
" 2. Select \"OpenGL view\" from the \"View\" menu of ROOT TCanvas \n");
33 printf(
"---------------\n");
34 printf(
" To adjust the so-called bombFactor you can invoke \n");
35 printf(
" the C++ statement from the ROOT command prompt:\n\n");
36 printf(
" gGeometry->SetBomb(1.6);\n\n");
37 printf(
" To change the background color call:\\nn");
38 printf(
" gPad->SetFillColor(kWhite);\n\n");
39 printf(
" \"kWhite\" background is advised \n");
40 printf(
" if you want to print the image to the paper\n");
41 printf(
"---------------\n");
43 printf(
"\n$Id: GeomDraw.C,v 1.10 2006/10/27 21:33:33 fine Exp $\n");
46 void GeomDraw(
const char *fzFile=
"complete",Float_t bombFactor=1.4,
const char *out =
"")
51 TString geomAccess = fzFile;
53 if (gSystem->AccessPathName(geomAccess.Data()) )
56 geomAccess.Strip(TString::kBoth);
57 if (!geomAccess.CountChar(
' ') && (geomAccess.First(
'y')==0 || geomAccess.First(
"complete") == 0 ) ) {
58 geomKuipCmd =
"detp geometry ";
59 geomKuipCmd += geomAccess; geomAccess =
"" ;
61 printf(
"\n *** Error *** Wrong input parameter: <%s>\n", fzFile);
74 gSystem->Load(
"St_base");
75 gSystem->Load(
"StChain");
76 gSystem->Load(
"St_Tables");
77 gSystem->Load(
"St_g2t.so");
78 gSystem->Load(
"StarMagField");
79 gSystem->Load(
"St_geant_Maker");
80 gSystem->Load(
"StUtilities");
84 if (! geomAccess.IsNull() ) {
85 printf(
"\n ----------------------------------------------------------\n");
86 printf(
" Draw the GEANT geometry from <%s> file\n", geomAccess.Data());
87 printf(
" ----------------------------------------------------------\n\n");
88 geant->SetInputFile(geomAccess.Data());
90 printf(
"\n ----------------------------------------------------------\n");
91 printf(
" Draw the GEANT generated geometry <%s> \n", geomKuipCmd.Data());
92 printf(
" ----------------------------------------------------------\n\n");
93 gSystem->Load(
"geometry");
106 new TBrowser(
"STAR Geometry", hall);
107 if (bombFactor < 1) bombFactor = 1.;
108 gGeometry->SetBomb(bombFactor);
110 gPad->SetFillColor(kBlack);
115 TFile outFile(out,
"RECREATE");
121 fprintf(stderr,
"\n\n, ** Error **, No suitable STAR geometry has been found. Abort !!! \n");
virtual void Draw(Option_t *depth="3")
virtual Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0)
virtual void SetVisibility(ENodeSEEN vis=TVolume::kBothVisible)
virtual TDataSet * FindByName(const char *name, const char *path="", Option_t *opt="") const
virtual void SetActive(Bool_t k=kTRUE)
Setters for flags and switches.
virtual void LoadGeometry(const Char_t *option="detp geometry field_only")
Specifies GEANT3 geometry command.