BesGeometry Class Reference

#include <BesGeometry.h>

List of all members.

Public Member Functions

 BesGeometry ()
virtual ~BesGeometry ()
virtual void InitFromGDML (const TString fPath)
virtual void InitFromROOT (TGeoVolume *volBes)
virtual void InitGeometry ()
const char * GetFilename (const char *RunPeriod)
virtual void SetDefaultVis ()
virtual void Draw (Option_t *option="3D")
virtual void Draw3D ()
virtual void Draw2DXY ()
virtual void Draw2DZR ()
Float_t GetBesR ()
Float_t GetBesZ ()
TGeoVolume * GetVolBes ()
TGeoVolume * GetVolumeBeamPipe ()
MdcROOTGeoGetMdcROOTGeo ()
TofROOTGeoGetTofROOTGeo ()
EmcROOTGeoGetEmcROOTGeo ()
MucROOTGeoGetMucROOTGeo ()
TGeoVolume * GetVolumeMdc ()
TGeoVolume * GetVolumeMdcSegment (int segment)
TGeoVolume * GetVolumeMdcLayer (int layer)
TGeoVolume * GetVolumeMdcReplica (int layer)
TGeoPhysicalNode * GetPhysicalMdcReplica (int layer, int replica)
TGeoVolume * GetVolumeTof ()
TGeoPhysicalNode * GetPhysicalTofScin (int part, int layer, int scin)
TGeoVolume * GetVolumeEmc ()
TGeoVolume * GetVolumeEmcPart (int part)
TGeoVolume * GetVolumeEmcPhi (int part, int phi)
TGeoVolume * GetVolumeEmcTheta (int part, int phi, int theta)
TGeoVolume * GetVolumeEmcCrystal (int part, int phi, int theta)
TGeoPhysicalNode * GetPhysicalEmcCrystal (int part, int phi, int theta)
TGeoVolume * GetVolumeMuc ()
TGeoVolume * GetVolumeMucAbsorber (int part, int seg, int absorber)
TGeoVolume * GetVolumeMucAbsorberPanel (int part, int seg, int absorber, int panel)
TGeoVolume * GetVolumeMucGap (int part, int seg, int gap)
TGeoVolume * GetVolumeMucStripPlane (int part, int seg, int gap)
TGeoVolume * GetVolumeMucStrip (int part, int seg, int gap, int strip)
TGeoVolume * GetVolumeMucGasChamber (int part, int seg, int gap, int panel, int gasChamber)
TGeoVolume * GetVolumeMucBakelite (int part, int seg, int gap, int RpcUpDown, int panel, int bakelite)
TGeoPhysicalNode * GetPhysicalMucGap (int part, int seg, int gap)
TGeoPhysicalNode * GetPhysicalMucStrip (int part, int seg, int gap, int strip)

Private Attributes

Double_t m_BesR
Double_t m_BesZ
Double_t m_BeamPipeRMin
Double_t m_BeamPipeRMax
Double_t m_BeamPipeZ
TGeoVolume * m_Bes
TGeoVolume * m_BeamPipe
TGeoVolume * m_Mdc
TGeoVolume * m_Tof
TGeoVolume * m_Emc
TGeoVolume * m_Muc
MdcROOTGeom_MdcROOTGeo
TofROOTGeom_TofROOTGeo
EmcROOTGeom_EmcROOTGeo
MucROOTGeom_MucROOTGeo
BesCircle2Dm_BeamPipeXY
BesPolygon2Dm_BeamPipeZR
BesPolygon2Dm_ZRPlaneOnXY


Detailed Description

Definition at line 18 of file BesGeometry.h.


Constructor & Destructor Documentation

BesGeometry::BesGeometry (  ) 

BesGeometry::~BesGeometry (  )  [virtual]

Definition at line 52 of file BesGeometry.cxx.

References m_BeamPipe, m_Bes, m_EmcROOTGeo, m_MdcROOTGeo, m_MucROOTGeo, and m_TofROOTGeo.

00053 {
00054     delete m_Bes;
00055     delete m_BeamPipe;
00056 
00057     delete m_MdcROOTGeo;
00058     delete m_TofROOTGeo;
00059     delete m_EmcROOTGeo;
00060     delete m_MucROOTGeo;
00061 }


Member Function Documentation

void BesGeometry::Draw ( Option_t *  option = "3D"  )  [virtual]

Definition at line 279 of file BesGeometry.cxx.

References Draw2DXY(), Draw2DZR(), and Draw3D().

Referenced by BesVisDisplay::DrawView(), and BesView::SetViewType().

00280 {
00281     //
00282     // BesGeometry draw function
00283     TString opt = option;
00284     opt.ToUpper();
00285 
00286     if ( opt.Contains("3D") ) {
00287         Draw3D();
00288     }
00289     else if ( opt.Contains("XY") ) {
00290         Draw2DXY();
00291     }
00292     else if ( opt.Contains("ZR") ) {
00293         Draw2DZR();
00294     }
00295 }

void BesGeometry::Draw2DXY (  )  [virtual]

Definition at line 340 of file BesGeometry.cxx.

References BesPolygon2D::Draw(), MucROOTGeo::Draw(), EmcROOTGeo::Draw(), TofROOTGeo::Draw(), MdcROOTGeo::Draw(), BesCircle2D::Draw(), BesView::GetVisAxis(), BesView::GetVisBeamPipe(), BesView::GetVisZRPlaneOnXY(), m_BeamPipeXY, m_EmcROOTGeo, m_MdcROOTGeo, m_MucROOTGeo, m_TofROOTGeo, m_ZRPlaneOnXY, and BesTView::ShowAxis().

Referenced by Draw().

00341 {
00342     BesView *view = (BesView*)gPad->GetView();
00343 
00344     if (view && view->GetVisBeamPipe())    m_BeamPipeXY->Draw();
00345 
00346     if (m_MdcROOTGeo) m_MdcROOTGeo->Draw("XY");
00347     if (m_TofROOTGeo) m_TofROOTGeo->Draw("XY");
00348     if (m_EmcROOTGeo) m_EmcROOTGeo->Draw("XY");
00349     if (m_MucROOTGeo) m_MucROOTGeo->Draw("XY");
00350 
00351     if (view && view->GetVisZRPlaneOnXY()) m_ZRPlaneOnXY->Draw();
00352     if (view && view->GetVisAxis())        view->ShowAxis();
00353 }

void BesGeometry::Draw2DZR (  )  [virtual]

Definition at line 355 of file BesGeometry.cxx.

References MucROOTGeo::Draw(), EmcROOTGeo::Draw(), TofROOTGeo::Draw(), MdcROOTGeo::Draw(), BesPolygon2D::Draw(), BesView::GetVisAxis(), BesView::GetVisBeamPipe(), m_BeamPipeZR, m_EmcROOTGeo, m_MdcROOTGeo, m_MucROOTGeo, m_TofROOTGeo, and BesTView::ShowAxis().

Referenced by Draw().

00356 {
00357     BesView *view = (BesView*)gPad->GetView();
00358 
00359     if (view && view->GetVisBeamPipe()) m_BeamPipeZR->Draw();
00360 
00361     if (m_MdcROOTGeo) m_MdcROOTGeo->Draw("ZR");
00362     if (m_TofROOTGeo) m_TofROOTGeo->Draw("ZR");
00363     if (m_EmcROOTGeo) m_EmcROOTGeo->Draw("ZR");
00364     if (m_MucROOTGeo) m_MucROOTGeo->Draw("ZR");
00365 
00366     if (view && view->GetVisAxis())     view->ShowAxis();
00367 }

void BesGeometry::Draw3D (  )  [virtual]

Definition at line 297 of file BesGeometry.cxx.

References BesView::GetViewType(), k3DView, m_EmcROOTGeo, m_MdcROOTGeo, m_MucROOTGeo, m_TofROOTGeo, EmcROOTGeo::SetVisEmcDetector(), EmcROOTGeo::SetVisEmcHits(), MucROOTGeo::SetVisMucDetector(), MucROOTGeo::SetVisMucHits(), TofROOTGeo::SetVisTofDetector(), and TofROOTGeo::SetVisTofHits().

Referenced by Draw().

00298 {
00299     BesView *view = (BesView*)gPad->GetView();
00300 
00301     if (view && view->GetViewType() == k3DView) {
00302 
00303         if (m_MdcROOTGeo) {
00304             m_MdcROOTGeo->SetVisMdcDetector();
00305             m_MdcROOTGeo->SetVisMdcHits();
00306         }
00307 
00308         if (m_TofROOTGeo) {
00309             m_TofROOTGeo->SetVisTofDetector();
00310             m_TofROOTGeo->SetVisTofHits();
00311         }
00312 
00313         if (m_EmcROOTGeo) {
00314             m_EmcROOTGeo->SetVisEmcDetector();
00315             m_EmcROOTGeo->SetVisEmcHits();
00316         }
00317 
00318         if (m_MucROOTGeo) {
00319             m_MucROOTGeo->SetVisMucDetector();
00320             m_MucROOTGeo->SetVisMucHits();
00321         }
00322     }
00323 
00324     //if (gGeoManager) {
00325     //    cout << "gGeoManager exit" << endl;
00326     //}
00327     //else {
00328     //    cout << "gGeoManager do not exit" << endl;
00329     //}
00330 
00331     //if (m_Bes){
00332     //    cout << "m_Bes address:" << m_Bes << endl;
00333     //}
00334 
00335 
00336     //if (m_Bes) m_Bes->Draw();
00337     //if (view && view->GetVisAxis()) view->ShowAxis();
00338 }

Float_t BesGeometry::GetBesR (  )  [inline]

Definition at line 35 of file BesGeometry.h.

References m_BesR.

Referenced by ClassImp().

00035 { return m_BesR; }

Float_t BesGeometry::GetBesZ (  )  [inline]

Definition at line 36 of file BesGeometry.h.

References m_BesZ.

Referenced by ClassImp().

00036 { return m_BesZ; }

EmcROOTGeo* BesGeometry::GetEmcROOTGeo (  )  [inline]

Definition at line 43 of file BesGeometry.h.

References m_EmcROOTGeo.

Referenced by BesEvent::ConstructEmcTrackFromRec(), BesEvent::DrawHits(), BesClient::HandleViewOptionMenu(), BesVisDisplay::InitGeometryFromGDML(), BesVisDisplay::InitGeometryFromROOT(), and BesEvent::SetHits().

00043 { return m_EmcROOTGeo; }

const char * BesGeometry::GetFilename ( const char *  RunPeriod  ) 

Definition at line 259 of file BesGeometry.cxx.

00260 {
00261     return RunPeriod;
00262 }

MdcROOTGeo* BesGeometry::GetMdcROOTGeo (  )  [inline]

Definition at line 41 of file BesGeometry.h.

References m_MdcROOTGeo.

Referenced by BesEvent::ConstructMdcTrackFromRec(), BesEvent::DrawHits(), BesClient::HandleViewOptionMenu(), BesVisDisplay::InitGeometryFromGDML(), BesVisDisplay::InitGeometryFromROOT(), BesEvent::SetHits(), BesClient::SetMdcColorfulWire(), BesClient::SetMdcQFire(), BesClient::SetMdcQNotOverflow(), BesClient::SetMdcTFire(), and BesClient::SetMdcTimeSubEvTime().

00041 { return m_MdcROOTGeo; }

MucROOTGeo* BesGeometry::GetMucROOTGeo (  )  [inline]

Definition at line 44 of file BesGeometry.h.

References m_MucROOTGeo.

Referenced by BesEvent::ConstructMucTrackFromRec(), BesEvent::DrawHits(), BesClient::HandleViewOptionMenu(), BesVisDisplay::InitGeometryFromGDML(), BesVisDisplay::InitGeometryFromROOT(), and BesEvent::SetHits().

00044 { return m_MucROOTGeo; }

TGeoPhysicalNode* BesGeometry::GetPhysicalEmcCrystal ( int  part,
int  phi,
int  theta 
) [inline]

Definition at line 63 of file BesGeometry.h.

References EmcROOTGeo::GetPhysicalCrystal(), and m_EmcROOTGeo.

00063 { return m_EmcROOTGeo->GetPhysicalCrystal(part, phi, theta); }

TGeoPhysicalNode* BesGeometry::GetPhysicalMdcReplica ( int  layer,
int  replica 
) [inline]

Definition at line 50 of file BesGeometry.h.

References MdcROOTGeo::GetPhysicalReplica(), and m_MdcROOTGeo.

00050 { return m_MdcROOTGeo->GetPhysicalReplica(layer, replica); }

TGeoPhysicalNode* BesGeometry::GetPhysicalMucGap ( int  part,
int  seg,
int  gap 
) [inline]

Definition at line 73 of file BesGeometry.h.

References MucROOTGeo::GetPhysicalGap(), and m_MucROOTGeo.

00073 { return m_MucROOTGeo->GetPhysicalGap(part, seg, gap); }

TGeoPhysicalNode* BesGeometry::GetPhysicalMucStrip ( int  part,
int  seg,
int  gap,
int  strip 
) [inline]

Definition at line 74 of file BesGeometry.h.

References MucROOTGeo::GetPhysicalStrip(), and m_MucROOTGeo.

00074 { return m_MucROOTGeo->GetPhysicalStrip(part, seg, gap, strip); }

TGeoPhysicalNode* BesGeometry::GetPhysicalTofScin ( int  part,
int  layer,
int  scin 
) [inline]

Definition at line 56 of file BesGeometry.h.

References TofROOTGeo::GetPhysicalScin(), and m_TofROOTGeo.

00056 { return m_TofROOTGeo->GetPhysicalScin(part, layer, scin); }

TofROOTGeo* BesGeometry::GetTofROOTGeo (  )  [inline]

Definition at line 42 of file BesGeometry.h.

References m_TofROOTGeo.

Referenced by BesEvent::ConstructTofTrackFromRec(), BesEvent::DrawHits(), BesClient::HandleViewOptionMenu(), BesVisDisplay::InitGeometryFromGDML(), BesVisDisplay::InitGeometryFromROOT(), BesEvent::SetHits(), BesClient::SetTofQMatch(), and BesClient::SetTofTMatch().

00042 { return m_TofROOTGeo; }

TGeoVolume* BesGeometry::GetVolBes (  )  [inline]

Definition at line 38 of file BesGeometry.h.

References m_Bes.

Referenced by BesClient::SaveGeoAs().

00038 { return m_Bes; }

TGeoVolume* BesGeometry::GetVolumeBeamPipe (  )  [inline]

Definition at line 39 of file BesGeometry.h.

References m_BeamPipe.

00039 { return m_BeamPipe; } 

TGeoVolume* BesGeometry::GetVolumeEmc (  )  [inline]

Definition at line 58 of file BesGeometry.h.

References EmcROOTGeo::GetVolumeEmc(), and m_EmcROOTGeo.

00058 { return m_EmcROOTGeo->GetVolumeEmc(); }

TGeoVolume* BesGeometry::GetVolumeEmcCrystal ( int  part,
int  phi,
int  theta 
) [inline]

Definition at line 62 of file BesGeometry.h.

References EmcROOTGeo::GetVolumeCrystal(), and m_EmcROOTGeo.

00062 { return m_EmcROOTGeo->GetVolumeCrystal(part, phi, theta); }

TGeoVolume* BesGeometry::GetVolumeEmcPart ( int  part  )  [inline]

Definition at line 59 of file BesGeometry.h.

References EmcROOTGeo::GetVolumePart(), and m_EmcROOTGeo.

00059 { return m_EmcROOTGeo->GetVolumePart(part); }

TGeoVolume* BesGeometry::GetVolumeEmcPhi ( int  part,
int  phi 
) [inline]

Definition at line 60 of file BesGeometry.h.

References EmcROOTGeo::GetVolumePhi(), and m_EmcROOTGeo.

00060 { return m_EmcROOTGeo->GetVolumePhi(part, phi); }

TGeoVolume* BesGeometry::GetVolumeEmcTheta ( int  part,
int  phi,
int  theta 
) [inline]

Definition at line 61 of file BesGeometry.h.

References EmcROOTGeo::GetVolumeTheta(), and m_EmcROOTGeo.

00061 { return m_EmcROOTGeo->GetVolumeTheta(part, phi, theta); }

TGeoVolume* BesGeometry::GetVolumeMdc (  )  [inline]

Definition at line 46 of file BesGeometry.h.

References MdcROOTGeo::GetVolumeMdc(), and m_MdcROOTGeo.

00046 { return m_MdcROOTGeo->GetVolumeMdc(); }

TGeoVolume* BesGeometry::GetVolumeMdcLayer ( int  layer  )  [inline]

Definition at line 48 of file BesGeometry.h.

References MdcROOTGeo::GetVolumeLayer(), and m_MdcROOTGeo.

00048 { return m_MdcROOTGeo->GetVolumeLayer(layer); }

TGeoVolume* BesGeometry::GetVolumeMdcReplica ( int  layer  )  [inline]

Definition at line 49 of file BesGeometry.h.

References MdcROOTGeo::GetVolumeReplica(), and m_MdcROOTGeo.

00049 { return m_MdcROOTGeo->GetVolumeReplica(layer); }

TGeoVolume* BesGeometry::GetVolumeMdcSegment ( int  segment  )  [inline]

Definition at line 47 of file BesGeometry.h.

References MdcROOTGeo::GetVolumeSegment(), and m_MdcROOTGeo.

00047 { return m_MdcROOTGeo->GetVolumeSegment(segment); }

TGeoVolume* BesGeometry::GetVolumeMuc (  )  [inline]

Definition at line 65 of file BesGeometry.h.

References MucROOTGeo::GetVolumeMuc(), and m_MucROOTGeo.

00065 { return m_MucROOTGeo->GetVolumeMuc(); }

TGeoVolume* BesGeometry::GetVolumeMucAbsorber ( int  part,
int  seg,
int  absorber 
) [inline]

Definition at line 66 of file BesGeometry.h.

References MucROOTGeo::GetVolumeAbsorber(), and m_MucROOTGeo.

00066 {  return m_MucROOTGeo->GetVolumeAbsorber(part, seg, absorber); }

TGeoVolume* BesGeometry::GetVolumeMucAbsorberPanel ( int  part,
int  seg,
int  absorber,
int  panel 
) [inline]

Definition at line 67 of file BesGeometry.h.

References MucROOTGeo::GetVolumeAbsorberPanel(), and m_MucROOTGeo.

00067 { return m_MucROOTGeo->GetVolumeAbsorberPanel(part, seg, absorber, panel); }

TGeoVolume* BesGeometry::GetVolumeMucBakelite ( int  part,
int  seg,
int  gap,
int  RpcUpDown,
int  panel,
int  bakelite 
) [inline]

Definition at line 72 of file BesGeometry.h.

References MucROOTGeo::GetVolumeBakelite(), and m_MucROOTGeo.

00072 { return m_MucROOTGeo->GetVolumeBakelite(part, seg, gap, RpcUpDown, panel, bakelite); }

TGeoVolume* BesGeometry::GetVolumeMucGap ( int  part,
int  seg,
int  gap 
) [inline]

Definition at line 68 of file BesGeometry.h.

References MucROOTGeo::GetVolumeGap(), and m_MucROOTGeo.

00068 { return m_MucROOTGeo->GetVolumeGap(part, seg, gap); }

TGeoVolume* BesGeometry::GetVolumeMucGasChamber ( int  part,
int  seg,
int  gap,
int  panel,
int  gasChamber 
) [inline]

Definition at line 71 of file BesGeometry.h.

References MucROOTGeo::GetVolumeGasChamber(), and m_MucROOTGeo.

00071 { return m_MucROOTGeo->GetVolumeGasChamber(part, seg, gap, panel, gasChamber); }

TGeoVolume* BesGeometry::GetVolumeMucStrip ( int  part,
int  seg,
int  gap,
int  strip 
) [inline]

Definition at line 70 of file BesGeometry.h.

References MucROOTGeo::GetVolumeStripPlane(), and m_MucROOTGeo.

00070 { return m_MucROOTGeo->GetVolumeStripPlane(part, seg, gap); }

TGeoVolume* BesGeometry::GetVolumeMucStripPlane ( int  part,
int  seg,
int  gap 
) [inline]

Definition at line 69 of file BesGeometry.h.

References MucROOTGeo::GetVolumeStripPlane(), and m_MucROOTGeo.

00069 { return m_MucROOTGeo->GetVolumeStripPlane(part, seg, gap); }

TGeoVolume* BesGeometry::GetVolumeTof (  )  [inline]

Definition at line 52 of file BesGeometry.h.

References TofROOTGeo::GetVolumeTof(), and m_TofROOTGeo.

00052 { return m_TofROOTGeo->GetVolumeTof(); }

void BesGeometry::InitFromGDML ( const TString  fPath  )  [virtual]

Definition at line 63 of file BesGeometry.cxx.

References EmcROOTGeo::GetVolumeEmc(), MdcROOTGeo::GetVolumeMdc(), MucROOTGeo::GetVolumeMuc(), TofROOTGeo::GetVolumeTof(), genRecEmupikp::i, MucROOTGeo::InitFromGDML(), EmcROOTGeo::InitFromGDML(), TofROOTGeo::InitFromGDML(), MdcROOTGeo::InitFromGDML(), InitGeometry(), m_BeamPipe, m_BeamPipeRMax, m_BeamPipeRMin, m_BeamPipeZ, m_Bes, m_BesR, m_BesZ, m_Emc, m_EmcROOTGeo, m_Mdc, m_MdcROOTGeo, m_Muc, m_MucROOTGeo, m_Tof, m_TofROOTGeo, and SubDetectorROOTGeo::SetChildNo().

Referenced by BesVisDisplay::InitGeometryFromGDML().

00064 {
00065     gGeoManager->SetVisOption(0);  // to show all visible volumes.
00066     gGeoManager->SetVisLevel(5);
00067 
00068     TGeoIdentity *identity = new TGeoIdentity();
00069 
00070     TGeoMaterial *mat = new TGeoMaterial("VOID",0,0,0);
00071     mat->SetTransparency(20);
00072     TGeoMedium   *med = new TGeoMedium("MED",1,mat);
00073     m_Bes = gGeoManager->MakeBox("volBes", med, m_BesR, m_BesR, 0.5*m_BesZ);
00074 
00075     TGeoVolume *topVolume = new TGeoVolume(); // temp top volume for load geometry more than once
00076     gGeoManager->SetTopVolume(topVolume);
00077     gGeoManager->SetTopVolume(m_Bes);
00078 
00079     Int_t iChildNo = 0;
00080     m_MdcROOTGeo = new MdcROOTGeo();
00081     m_MdcROOTGeo->InitFromGDML( (fPath + TString("Mdc.gdml")).Data(), "Mdc" );
00082     cout<<"in BesGeometry construct mdc1"<<endl;
00083     m_Mdc = m_MdcROOTGeo->GetVolumeMdc();
00084     if (m_Mdc)  cout << "Construct Mdc" << endl;
00085     else       cout << "Volume Mdc not found " << endl;
00086     m_Bes->AddNode(m_Mdc, iChildNo, identity);
00087     m_MdcROOTGeo->SetChildNo(iChildNo);//Connect bes with mdc, form physcialnode path.  m_Bes->GetNdaughters()-1
00088 
00089     iChildNo++;
00090     m_TofROOTGeo = new TofROOTGeo();
00091     m_TofROOTGeo->InitFromGDML( (fPath + TString("Tof.gdml")).Data(), "Tof" );
00092     cout<<"construct tof"<<endl;
00093     m_Tof = m_TofROOTGeo->GetVolumeTof();
00094     if (m_Tof)  cout << "Construct Tof" << endl;
00095     else       cout << "Volume Tof not found " << endl;
00096     m_Bes->AddNode(m_Tof, iChildNo, identity);
00097     m_TofROOTGeo->SetChildNo(iChildNo);
00098 
00099     iChildNo++;
00100     m_EmcROOTGeo = new EmcROOTGeo();
00101     m_EmcROOTGeo->InitFromGDML( (fPath + TString("Emc.gdml")).Data(), "Emc" );
00102     m_Emc = m_EmcROOTGeo->GetVolumeEmc();
00103     if (m_Emc)  cout << "Construct Emc" << endl;
00104     else       cout << "Volume Emc not found " << endl;
00105     m_Bes->AddNode(m_Emc, iChildNo, identity);
00106     m_EmcROOTGeo->SetChildNo(iChildNo);
00107 
00108     iChildNo++;
00109     m_MucROOTGeo = new MucROOTGeo();
00110     m_MucROOTGeo->InitFromGDML( (fPath + TString("Muc.gdml")).Data(), "Muc" );
00111     m_Muc = m_MucROOTGeo->GetVolumeMuc();
00112     if (m_Muc)  cout << "Construct Muc" << endl;
00113     else       cout << "Volume Muc not found " << endl;
00114     m_Bes->AddNode(m_Muc, iChildNo, identity);
00115     m_MucROOTGeo->SetChildNo(iChildNo);
00116 
00117     iChildNo++;
00118     Int_t beamPipeColor = 3;
00119     m_BeamPipe = gGeoManager->MakeTube("volBeamPipe", med, m_BeamPipeRMin, m_BeamPipeRMax, m_BeamPipeZ);
00120     m_BeamPipe->SetLineColor(beamPipeColor);
00121     m_Bes->AddNode(m_BeamPipe, iChildNo, identity);
00122 
00123     Int_t nDaughters = m_Bes->GetNodes()->GetEntries();
00124     cout << "volBes contains " << nDaughters  << " nodes : " << endl;
00125     for (Int_t i = 0; i < nDaughters; i++) {
00126         cout << i << " : " << m_Bes->GetNode(i)->GetName() << endl;
00127     }
00128 
00129     InitGeometry();
00130 }

void BesGeometry::InitFromROOT ( TGeoVolume *  volBes  )  [virtual]

Definition at line 132 of file BesGeometry.cxx.

References MucROOTGeo::InitFromROOT(), EmcROOTGeo::InitFromROOT(), TofROOTGeo::InitFromROOT(), MdcROOTGeo::InitFromROOT(), InitGeometry(), m_BeamPipe, m_Bes, m_BesR, m_BesZ, m_Emc, m_EmcROOTGeo, m_Mdc, m_MdcROOTGeo, m_Muc, m_MucROOTGeo, m_Tof, m_TofROOTGeo, and SubDetectorROOTGeo::SetChildNo().

Referenced by BesVisDisplay::InitGeometryFromROOT().

00133 {
00134     gGeoManager->SetVisOption(0);  // to show all visible volumes.
00135     gGeoManager->SetVisLevel(5);
00136 
00137     m_Bes = volBes;
00138     m_BesR = ((TGeoBBox*)m_Bes->GetShape())->GetDX();
00139     m_BesZ = ((TGeoBBox*)m_Bes->GetShape())->GetDZ()*2.0;
00140 
00141     TGeoVolume *topVolume = new TGeoVolume();
00142     gGeoManager->SetTopVolume(topVolume);
00143     gGeoManager->SetTopVolume(m_Bes);
00144 
00145     Int_t nDaughters = m_Bes->GetNodes()->GetEntries();
00146 
00147     //cout << "volBes contains " << nDaughters  << " nodes : " << endl;
00148     //for (Int_t i = 0; i < nDaughters; i++) {
00149     //    cout << i << " : " << m_Bes->GetNode(i)->GetName() << endl;
00150     //}
00151 
00152     Int_t iChildNo = 0;
00153     m_MdcROOTGeo = new MdcROOTGeo();
00154     TGeoNode *nodeMdc = m_Bes->GetNode(iChildNo);
00155     if (nodeMdc) m_Mdc = nodeMdc->GetVolume();
00156     //else cout << "Node logicalMdc not found" << endl;
00157     //if (m_Mdc)  cout << "Set Mdc" << endl;
00158     //else       cout << "Volume Mdc not found " << endl;
00159     m_MdcROOTGeo->InitFromROOT( m_Mdc );
00160     m_MdcROOTGeo->SetChildNo(iChildNo);//Connect bes with mdc, form physcialnode path.  m_Bes->GetNdaughters()-1
00161 
00162     iChildNo++;
00163     m_TofROOTGeo = new TofROOTGeo();
00164     TGeoNode *nodeTof = m_Bes->GetNode(iChildNo);
00165     if (nodeTof) m_Tof = nodeTof->GetVolume();
00166     //else cout << "Node logicalTof not found" << endl;
00167     //if (m_Tof)  cout << "Set Tof" << endl;
00168     //else       cout << "Volume Tof not found " << endl;
00169     m_TofROOTGeo->InitFromROOT( m_Tof );
00170     m_TofROOTGeo->SetChildNo(iChildNo);
00171 
00172     iChildNo++;
00173     m_EmcROOTGeo = new EmcROOTGeo();
00174     TGeoNode *nodeEmc = m_Bes->GetNode(iChildNo);
00175     if (nodeEmc) m_Emc = nodeEmc->GetVolume();
00176     //else cout << "Node logicalEmc not found" << endl;
00177     //if (m_Emc)  cout << "Set Emc" << endl;
00178     //else       cout << "Volume Emc not found " << endl;
00179     m_EmcROOTGeo->InitFromROOT( m_Emc );
00180     m_EmcROOTGeo->SetChildNo(iChildNo);
00181 
00182     iChildNo++;
00183     m_MucROOTGeo = new MucROOTGeo();
00184     TGeoNode *nodeMuc = m_Bes->GetNode(iChildNo);
00185     if (nodeMuc) m_Muc = nodeMuc->GetVolume();
00186     //else cout << "Node logicalMuc not found" << endl;
00187     //if (m_Muc)  cout << "Set Muc" << endl;
00188     //else       cout << "Volume Muc not found " << endl;
00189     m_MucROOTGeo->InitFromROOT( m_Muc );
00190     m_MucROOTGeo->SetChildNo(iChildNo);
00191 
00192     iChildNo++;
00193     TGeoNode *nodeBeamPipe = m_Bes->GetNode(iChildNo);
00194     if (nodeBeamPipe) {
00195         m_BeamPipe = nodeBeamPipe->GetVolume();
00196         m_BeamPipe->SetLineColor(4);
00197     }
00198     //else cout << "Node volBeamPipe not found " << endl;
00199     //cout << "Set beanmpi complete" << endl;
00200     InitGeometry();
00201     //cout << "init root ok" << endl;
00202 }

void BesGeometry::InitGeometry (  )  [virtual]

Definition at line 204 of file BesGeometry.cxx.

References genRecEmupikp::i, MucROOTGeo::Init2DGeometry(), EmcROOTGeo::Init2DGeometry(), TofROOTGeo::Init2DGeometry(), MdcROOTGeo::Init2DGeometry(), m_BeamPipeRMax, m_BeamPipeRMin, m_BeamPipeXY, m_BeamPipeZ, m_BeamPipeZR, m_Bes, m_BesR, m_BesZ, m_EmcROOTGeo, m_MdcROOTGeo, m_MucROOTGeo, m_TofROOTGeo, m_ZRPlaneOnXY, P(), MucROOTGeo::SetPhysicalNode(), EmcROOTGeo::SetPhysicalNode(), TofROOTGeo::SetPhysicalNode(), MdcROOTGeo::SetPhysicalNode(), and BesPolygon2D::SetRotatable().

Referenced by InitFromGDML(), and InitFromROOT().

00205 {
00206     gGeoManager->SetDrawExtraPaths();  // draw physical node or not;
00207     gGeoManager->CloseGeometry();
00208     gGeoManager->SetNsegments(20);  // devide a circle to 20 slides
00209 
00210     // PhysicalNode necessary for fast setting node visible or not in an event
00211     // Should be set after gGeoManager closed
00212     m_MdcROOTGeo->SetPhysicalNode();    //here liang
00213     m_TofROOTGeo->SetPhysicalNode();    //here liang
00214     m_EmcROOTGeo->SetPhysicalNode();    //here liang
00215     m_MucROOTGeo->SetPhysicalNode();
00216 
00217     // 2D Geometry initialization should be after SetPhysicalNode();
00218     m_MdcROOTGeo->Init2DGeometry();    //here liang
00219     m_TofROOTGeo->Init2DGeometry();    //here liang
00220     m_EmcROOTGeo->Init2DGeometry();    //here liang
00221     m_MucROOTGeo->Init2DGeometry();
00222 
00223     Double_t  P[3*4] = {0.0};
00224 
00225     // BeamPipe
00226     Double_t beamPipeCenter[3] = {0.0, 0.0, 0.0};
00227     m_BeamPipeXY =
00228       new BesCircle2D("BeamPipe", "BeamPipe", m_BeamPipeRMin, m_BeamPipeRMax, &beamPipeCenter[0]);
00229 
00230     for (Int_t i = 0; i < 4; i++) {
00231         P[3*i]   = 0.0;
00232         if (i == 0 || i == 3) P[3*i+1] = -1.0*m_BeamPipeRMax;
00233         else P[3*i+1] = m_BeamPipeRMax;
00234         if (i == 0 || i == 1) P[3*i+2] = -1.0*m_BeamPipeZ;
00235         else P[3*i+2] = m_BeamPipeZ;
00236     }
00237     m_BeamPipeZR = new BesPolygon2D("BeamPipe", "BeamPipe", 4, &P[0]);
00238 
00239     // Auxiliary line
00240     if (!m_Bes) cout << "BesGeometry:InitGeometry, top volume m_Bes not found" << endl;
00241     TGeoBBox *besShape = (TGeoBBox*)m_Bes->GetShape();
00242     m_BesR = besShape->GetDX();
00243     m_BesZ = besShape->GetDZ()*2.0;
00244     for (Int_t i = 0; i < 4; i++) {
00245         P[3*i]   = 0.0;
00246         if (i == 0 || i == 3) P[3*i+1] = -1.0*m_BesR;
00247         else P[3*i+1] = m_BesR;
00248         if (i == 0 || i == 1) P[3*i+2] = -1.0*m_BesZ;
00249         else P[3*i+2] = m_BesZ;
00250     }
00251 
00252     m_ZRPlaneOnXY = new BesPolygon2D("ZRPlaneOnXY", "ZRPlaneOnXY", 4, &P[0]);
00253     m_ZRPlaneOnXY->SetRotatable(true);
00254     m_ZRPlaneOnXY->SetLineWidth(1);
00255     m_ZRPlaneOnXY->SetLineStyle(3);
00256     m_ZRPlaneOnXY->SetFillStyle(4000);
00257 }

void BesGeometry::SetDefaultVis (  )  [virtual]

Definition at line 264 of file BesGeometry.cxx.

References m_BeamPipe, m_Bes, m_EmcROOTGeo, m_MdcROOTGeo, m_MucROOTGeo, m_TofROOTGeo, MucROOTGeo::SetAllVisible(), EmcROOTGeo::SetAllVisible(), TofROOTGeo::SetAllVisible(), and MdcROOTGeo::SetAllVisible().

Referenced by BesVisDisplay::InitGeometryFromGDML().

00265 {
00266     m_Bes->SetLineColor(2);
00267     m_Bes->SetVisibility(0);
00268 
00269     m_BeamPipe->SetLineColor(4);
00270     m_BeamPipe->SetVisibility(0);
00271 
00272     m_MdcROOTGeo->SetAllVisible();
00273     m_TofROOTGeo->SetAllVisible();
00274     m_EmcROOTGeo->SetAllVisible();
00275     m_MucROOTGeo->SetAllVisible();
00276 
00277 }


Member Data Documentation

TGeoVolume* BesGeometry::m_BeamPipe [private]

Definition at line 85 of file BesGeometry.h.

Referenced by GetVolumeBeamPipe(), InitFromGDML(), InitFromROOT(), SetDefaultVis(), and ~BesGeometry().

Double_t BesGeometry::m_BeamPipeRMax [private]

Definition at line 81 of file BesGeometry.h.

Referenced by InitFromGDML(), and InitGeometry().

Double_t BesGeometry::m_BeamPipeRMin [private]

Definition at line 80 of file BesGeometry.h.

Referenced by InitFromGDML(), and InitGeometry().

BesCircle2D* BesGeometry::m_BeamPipeXY [private]

Definition at line 96 of file BesGeometry.h.

Referenced by Draw2DXY(), and InitGeometry().

Double_t BesGeometry::m_BeamPipeZ [private]

Definition at line 82 of file BesGeometry.h.

Referenced by InitFromGDML(), and InitGeometry().

BesPolygon2D* BesGeometry::m_BeamPipeZR [private]

Definition at line 97 of file BesGeometry.h.

Referenced by Draw2DZR(), and InitGeometry().

TGeoVolume* BesGeometry::m_Bes [private]

Definition at line 84 of file BesGeometry.h.

Referenced by GetVolBes(), InitFromGDML(), InitFromROOT(), InitGeometry(), SetDefaultVis(), and ~BesGeometry().

Double_t BesGeometry::m_BesR [private]

Definition at line 77 of file BesGeometry.h.

Referenced by GetBesR(), InitFromGDML(), InitFromROOT(), and InitGeometry().

Double_t BesGeometry::m_BesZ [private]

Definition at line 78 of file BesGeometry.h.

Referenced by GetBesZ(), InitFromGDML(), InitFromROOT(), and InitGeometry().

TGeoVolume* BesGeometry::m_Emc [private]

Definition at line 88 of file BesGeometry.h.

Referenced by InitFromGDML(), and InitFromROOT().

EmcROOTGeo* BesGeometry::m_EmcROOTGeo [private]

Definition at line 93 of file BesGeometry.h.

Referenced by Draw2DXY(), Draw2DZR(), Draw3D(), GetEmcROOTGeo(), GetPhysicalEmcCrystal(), GetVolumeEmc(), GetVolumeEmcCrystal(), GetVolumeEmcPart(), GetVolumeEmcPhi(), GetVolumeEmcTheta(), InitFromGDML(), InitFromROOT(), InitGeometry(), SetDefaultVis(), and ~BesGeometry().

TGeoVolume* BesGeometry::m_Mdc [private]

Definition at line 86 of file BesGeometry.h.

Referenced by InitFromGDML(), and InitFromROOT().

MdcROOTGeo* BesGeometry::m_MdcROOTGeo [private]

Definition at line 91 of file BesGeometry.h.

Referenced by Draw2DXY(), Draw2DZR(), Draw3D(), GetMdcROOTGeo(), GetPhysicalMdcReplica(), GetVolumeMdc(), GetVolumeMdcLayer(), GetVolumeMdcReplica(), GetVolumeMdcSegment(), InitFromGDML(), InitFromROOT(), InitGeometry(), SetDefaultVis(), and ~BesGeometry().

TGeoVolume* BesGeometry::m_Muc [private]

Definition at line 89 of file BesGeometry.h.

Referenced by InitFromGDML(), and InitFromROOT().

MucROOTGeo* BesGeometry::m_MucROOTGeo [private]

Definition at line 94 of file BesGeometry.h.

Referenced by Draw2DXY(), Draw2DZR(), Draw3D(), GetMucROOTGeo(), GetPhysicalMucGap(), GetPhysicalMucStrip(), GetVolumeMuc(), GetVolumeMucAbsorber(), GetVolumeMucAbsorberPanel(), GetVolumeMucBakelite(), GetVolumeMucGap(), GetVolumeMucGasChamber(), GetVolumeMucStrip(), GetVolumeMucStripPlane(), InitFromGDML(), InitFromROOT(), InitGeometry(), SetDefaultVis(), and ~BesGeometry().

TGeoVolume* BesGeometry::m_Tof [private]

Definition at line 87 of file BesGeometry.h.

Referenced by InitFromGDML(), and InitFromROOT().

TofROOTGeo* BesGeometry::m_TofROOTGeo [private]

Definition at line 92 of file BesGeometry.h.

Referenced by Draw2DXY(), Draw2DZR(), Draw3D(), GetPhysicalTofScin(), GetTofROOTGeo(), GetVolumeTof(), InitFromGDML(), InitFromROOT(), InitGeometry(), SetDefaultVis(), and ~BesGeometry().

BesPolygon2D* BesGeometry::m_ZRPlaneOnXY [private]

Definition at line 98 of file BesGeometry.h.

Referenced by Draw2DXY(), and InitGeometry().


Generated on Tue Nov 29 23:17:31 2016 for BOSS_7.0.2 by  doxygen 1.4.7