00001 class AgModule;
00002 class Geometry;
00003
00004 Geometry *builder = 0;
00005
00006 void SandBox(Bool_t closeGeo = true, Bool_t draw = true ) {
00007 printf("\nIN SAND_BOX: closeGeo=%d draw=%d\n",closeGeo,draw);
00008 gSystem -> Load (".$STAR_HOST_SYS/lib/libStarAgmlLib.so");
00009 gSystem -> Load (".$STAR_HOST_SYS/lib/libStarGeometry.so");
00010 gSystem -> Load (".$STAR_HOST_SYS/lib/libGeometry.so");
00011
00012
00013 AgBlock::SetStacker( new StarTGeoStacker() );
00014
00015
00016 builder = new Geometry();
00017
00018
00019 playground();
00020
00021
00022 builder -> ConstructGeometry("SandBox");
00023
00024
00025 ConstructFgtd();
00026
00027
00028 if(closeGeo) gGeoManager -> CloseGeometry();
00029
00030
00031 ColorScheme();
00032
00033
00034 Invisibles();
00035
00036
00037 gGeoManager -> SetVisLevel(10);
00038
00039
00040 if (draw)
00041 gGeoManager -> GetTopVolume() -> Draw("ogl");
00042
00043
00044
00045
00046
00047
00048
00049 }
00054 void playground()
00055 {
00056
00057 Geom_t geom;
00058 geom.select = "SandBox"; {
00059
00060
00061 geom.sconFlag = "SCON13"; geom.sconStat = 0;
00062 geom.tpceFlag = "TPCE04"; geom.tpceStat = 0;
00063 geom.btofFlag = "BTOFc6"; geom.btofStat = 0;
00064 geom.calbFlag = "CALB02"; geom.calbStat = 0;
00065
00066 geom.vpddFlag = "VPDD07"; geom.vpddStat = 0;
00067 geom.ftpcFlag = "FTPC01"; geom.ftpcStat = 0;
00068 geom.svttFlag = "SVTTof"; geom.svttStat = 0;
00069 geom.phmdFlag = "PHMDof"; geom.phmdStat = 0;
00070
00071 geom.ftroFlag = "FTRO01"; geom.ftroStat = 0;
00072 geom.mutdFlag = "MUTD03"; geom.mutdStat = 0;
00073
00074 geom.sisdFlag = "SISDof"; geom.sisdStat = 0;
00075 geom.ecalFlag = "ECALv6"; geom.ecalStat = 0;
00076 geom.fpdmFlag = "FPDM03"; geom.fpdmStat = 0;
00077
00078 geom.bbcmFlag = "BBCMon"; geom.bbcmStat = 0;
00079 geom.caveFlag = "CAVE04"; geom.caveStat = 1;
00080 geom.pipeFlag = "PIPE06"; geom.pipeStat = 1;
00081 geom.fgtdFlag = "FGTDon"; geom.fgtdStat = 1;
00082 geom.fgtdFlag = "FGMOon"; geom.fgtdStat = 0;
00083 geom.magpFlag = "MAGPon"; geom.magpStat = 0;
00084
00085 geom.closeGeometry = false;
00086
00087 geom.SetTitle("STAR Geometry SanBox");
00088 geom.fill();
00089 }
00090
00091
00092 }
00097 Bool_t ConstructFgtd()
00098 {
00099
00100
00101
00102 AgStructure::AgDetpNew( "FgtdGeo3", "Forward Gem Tracker Configuration" );
00103
00104
00105
00106
00107 AgStructure::AgDetpAdd( "Fgtg_t", "configjan", (float)2 );
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119 builder -> CreateModule( "FgtdGeo3" );
00120
00121 }
00122
00124
00125
00126
00127 TDataSet *CreateTable()
00128 {
00129
00130
00131 draw = false;
00132
00133
00134 SandBox();
00135
00136 TObjectSet *mygeom = 0;
00137 if (gGeoManager) {
00138 mygeom = new TObjectSet("Geometry",gGeoManager,kFALSE);
00139 mygeom->SetTitle("Dyson");
00140 }
00141 return (TDataSet *) mygeom;
00142
00143 }
00144
00145
00150 void Invisibles()
00151 {
00152
00153 const Char_t *invisible[] =
00154 {
00155 "MAGP",
00156
00157
00158 "TPSS",
00159 "FSEN"
00160 };
00161
00162 TGeoVolume *volume = 0;
00163 for ( UInt_t i=0;i<sizeof(invisible)/sizeof(Char_t *);i++ )
00164 {
00165 volume = gGeoManager->FindVolumeFast( invisible[i] );
00166 if ( volume ) {
00167 volume->InvisibleAll();
00168 volume->SetVisDaughters(false);
00169 }
00170 }
00171 }
00172
00173
00174 void ColorScheme()
00175 {
00176 Int_t color_map[] = {kGray+2,1,42,kGreen+2, 11,32,kBlue-9,22,8};
00177
00178 TIter next( gGeoManager->GetListOfVolumes() );
00179 while ((volume=(TGeoVolume*)next()))
00180 {
00181 Int_t color = volume->GetLineColor();
00182 if ( color < 8 )
00183 color = color_map[color];
00184 volume->SetLineColor(color);
00185 volume->SetFillColor(color);
00186
00187 TString name=volume->GetName();
00188 if ( name=="TPAD" || name=="TPA1" || name=="TPSS" )
00189 {
00190 volume->SetLineColor(47);
00191 volume->SetFillColor(47);
00192 }
00193 }
00194 }