63 gGeoManager->SetVisOption( 0 );
64 gGeoManager->SetVisLevel( 5 );
66 TGeoIdentity* identity =
new TGeoIdentity();
68 TGeoMaterial* mat =
new TGeoMaterial(
"VOID", 0, 0, 0 );
69 mat->SetTransparency( 20 );
70 TGeoMedium* med =
new TGeoMedium(
"MED", 1, mat );
71 m_Bes = gGeoManager->MakeBox(
"volBes", med, m_BesR, m_BesR, 0.5 * m_BesZ );
73 TGeoVolume* topVolume =
new TGeoVolume();
74 gGeoManager->SetTopVolume( topVolume );
75 gGeoManager->SetTopVolume( m_Bes );
79 m_MdcROOTGeo->InitFromGDML( ( fPath + TString(
"Mdc.gdml" ) ).Data(),
81 cout <<
"in BesGeometry construct mdc1" << endl;
82 m_Mdc = m_MdcROOTGeo->GetVolumeMdc();
83 if ( m_Mdc ) cout <<
"Construct Mdc" << endl;
84 else cout <<
"Volume Mdc not found " << endl;
85 m_Bes->AddNode( m_Mdc, iChildNo, identity );
86 m_MdcROOTGeo->SetChildNo( iChildNo );
94 m_TofROOTGeo->InitFromGDML( ( fPath + TString(
"Tof_mrpc.gdml" ) ).Data(),
97 m_TofROOTGeo->InitFromGDML( ( fPath + TString(
"Tof.gdml" ) ).Data(),
100 cout <<
"construct tof" << endl;
101 m_Tof = m_TofROOTGeo->GetVolumeTof();
102 if ( m_Tof ) cout <<
"Construct Tof" << endl;
103 else cout <<
"Volume Tof not found " << endl;
104 m_Bes->AddNode( m_Tof, iChildNo, identity );
105 m_TofROOTGeo->SetChildNo( iChildNo );
109 m_EmcROOTGeo->InitFromGDML( ( fPath + TString(
"Emc.gdml" ) ).Data(),
111 m_Emc = m_EmcROOTGeo->GetVolumeEmc();
112 if ( m_Emc ) cout <<
"Construct Emc" << endl;
113 else cout <<
"Volume Emc not found " << endl;
114 m_Bes->AddNode( m_Emc, iChildNo, identity );
115 m_EmcROOTGeo->SetChildNo( iChildNo );
119 m_MucROOTGeo->InitFromGDML( ( fPath + TString(
"Muc.gdml" ) ).Data(),
121 m_Muc = m_MucROOTGeo->GetVolumeMuc();
122 if ( m_Muc ) cout <<
"Construct Muc" << endl;
123 else cout <<
"Volume Muc not found " << endl;
124 m_Bes->AddNode( m_Muc, iChildNo, identity );
125 m_MucROOTGeo->SetChildNo( iChildNo );
128 Int_t beamPipeColor = m_BeamPipeColor;
130 gGeoManager->MakeTube(
"volBeamPipe", med, m_BeamPipeRMin, m_BeamPipeRMax, m_BeamPipeZ );
131 m_BeamPipe->SetLineColor( beamPipeColor );
132 m_Bes->AddNode( m_BeamPipe, iChildNo, identity );
134 Int_t nDaughters = m_Bes->GetNodes()->GetEntries();
135 cout <<
"volBes contains " << nDaughters <<
" nodes : " << endl;
136 for ( Int_t i = 0; i < nDaughters; i++ )
137 { cout << i <<
" : " << m_Bes->GetNode( i )->GetName() << endl; }
143 gGeoManager->SetVisOption( 0 );
144 gGeoManager->SetVisLevel( 5 );
147 m_BesR = ( (TGeoBBox*)m_Bes->GetShape() )->GetDX();
148 m_BesZ = ( (TGeoBBox*)m_Bes->GetShape() )->GetDZ() * 2.0;
150 TGeoVolume* topVolume =
new TGeoVolume();
151 gGeoManager->SetTopVolume( topVolume );
152 gGeoManager->SetTopVolume( m_Bes );
154 Int_t nDaughters = m_Bes->GetNodes()->GetEntries();
163 TGeoNode* nodeMdc = m_Bes->GetNode( iChildNo );
164 if ( nodeMdc ) m_Mdc = nodeMdc->GetVolume();
168 m_MdcROOTGeo->InitFromROOT( m_Mdc );
169 m_MdcROOTGeo->SetChildNo( iChildNo );
174 TGeoNode* nodeTof = m_Bes->GetNode( iChildNo );
175 if ( nodeTof ) m_Tof = nodeTof->GetVolume();
179 m_TofROOTGeo->InitFromROOT( m_Tof );
180 m_TofROOTGeo->SetChildNo( iChildNo );
184 TGeoNode* nodeEmc = m_Bes->GetNode( iChildNo );
185 if ( nodeEmc ) m_Emc = nodeEmc->GetVolume();
189 m_EmcROOTGeo->InitFromROOT( m_Emc );
190 m_EmcROOTGeo->SetChildNo( iChildNo );
194 TGeoNode* nodeMuc = m_Bes->GetNode( iChildNo );
195 if ( nodeMuc ) m_Muc = nodeMuc->GetVolume();
199 m_MucROOTGeo->InitFromROOT( m_Muc );
200 m_MucROOTGeo->SetChildNo( iChildNo );
203 TGeoNode* nodeBeamPipe = m_Bes->GetNode( iChildNo );
206 m_BeamPipe = nodeBeamPipe->GetVolume();
207 m_BeamPipe->SetLineColor( m_BeamPipeColor );
218 gGeoManager->SetDrawExtraPaths();
219 gGeoManager->CloseGeometry();
220 gGeoManager->SetNsegments( 20 );
224 m_MdcROOTGeo->SetPhysicalNode();
225 m_TofROOTGeo->SetPhysicalNode();
226 m_EmcROOTGeo->SetPhysicalNode();
227 m_MucROOTGeo->SetPhysicalNode();
231 gGeoManager->MakePhysicalNode( TString(
"/" ) + m_Bes->GetName() + TString(
"_1/" ) +
232 m_BeamPipe->GetName() + TString(
"_4" ) );
233 m_phyBeamPipe->SetVisibility( 0 );
234 m_phyBeamPipe->SetIsVolAtt( kFALSE );
235 m_phyBeamPipe->SetLineColor( m_BeamPipeColor );
241 m_TofROOTGeo->Init2DGeometry();
242 m_MdcROOTGeo->Init2DGeometry();
243 m_EmcROOTGeo->Init2DGeometry();
244 m_MucROOTGeo->Init2DGeometry();
246 Double_t
P[3 * 4] = { 0.0 };
249 Double_t beamPipeCenter[3] = { 0.0, 0.0, 0.0 };
250 m_BeamPipeXY =
new BesCircle2D(
"BeamPipe",
"BeamPipe", m_BeamPipeRMin, m_BeamPipeRMax,
251 &beamPipeCenter[0] );
253 for ( Int_t i = 0; i < 4; i++ )
256 if ( i == 0 || i == 3 )
P[3 * i + 1] = -1.0 * m_BeamPipeRMax;
257 else P[3 * i + 1] = m_BeamPipeRMax;
258 if ( i == 0 || i == 1 )
P[3 * i + 2] = -1.0 * m_BeamPipeZ;
259 else P[3 * i + 2] = m_BeamPipeZ;
261 m_BeamPipeZR =
new BesPolygon2D(
"BeamPipe",
"BeamPipe", 4, &
P[0] );
262 m_BeamPipeZR->SetRotatable(
true );
266 if ( !m_Bes ) cout <<
"BesGeometry:InitGeometry, top volume m_Bes not found" << endl;
267 TGeoBBox* besShape = (TGeoBBox*)m_Bes->GetShape();
268 m_BesR = besShape->GetDX();
269 m_BesZ = besShape->GetDZ() * 2.0;
270 for ( Int_t i = 0; i < 4; i++ )
273 if ( i == 0 || i == 3 )
P[3 * i + 1] = -1.0 * m_BesR;
274 else P[3 * i + 1] = m_BesR;
275 if ( i == 0 || i == 1 )
P[3 * i + 2] = -1.0 * m_BesZ;
276 else P[3 * i + 2] = m_BesZ;
279 m_ZRPlaneOnXY =
new BesPolygon2D(
"ZRPlaneOnXY",
"ZRPlaneOnXY", 4, &
P[0] );
280 m_ZRPlaneOnXY->SetRotatable(
true );
281 m_ZRPlaneOnXY->SetLineWidth( 1 );
282 m_ZRPlaneOnXY->SetLineStyle( 3 );
283 m_ZRPlaneOnXY->SetFillStyle( 4000 );
327 m_BeamPipe->AppendPad();
331 else m_phyBeamPipe->SetVisibility( 0 );
335 m_MdcROOTGeo->SetVisMdcDetector();
336 m_MdcROOTGeo->SetPhysicalDefaultVis();
337 m_MdcROOTGeo->SetVisMdcHits();
342 m_TofROOTGeo->SetVisTofDetector();
343 m_TofROOTGeo->SetPhysicalDefaultVis();
344 m_TofROOTGeo->SetVisTofHits();
349 m_EmcROOTGeo->SetVisEmcDetector();
350 m_EmcROOTGeo->SetPhysicalDefaultVis();
351 m_EmcROOTGeo->SetVisEmcHits();
356 m_MucROOTGeo->SetVisMucDetector();
357 m_MucROOTGeo->SetPhysicalDefaultVis();
358 m_MucROOTGeo->SetVisMucHits();