BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
SubDetectorROOTGeo Class Reference

#include <SubDetectorROOTGeo.h>

+ Inheritance diagram for SubDetectorROOTGeo:

Public Member Functions

 SubDetectorROOTGeo ()
 Constructor.
 
virtual ~SubDetectorROOTGeo ()
 Destructor.
 
void ReadGdml (const char *gdmlFile, const char *setupName)
 Initialize the instance of ROOTGeo.
 
int IsInitialized ()
 If the ROOT geometry of this subdetctor is initialized;.
 
void SetChildNo (int childNo)
 
TGeoVolume * GetLogicalVolume (const std::string &vn)
 Get a logical volume by name;.
 
TGeoVolume * GetTopVolume ()
 Get the top(world) volume;.
 
TGeoVolumeAssembly * GetAssemblyVolume (const std::string &an)
 Get an assembly by name;.
 
TGeoNode * GetNode (const std::string &nn)
 Get a node(physical volume) by name;.
 
 SubDetectorROOTGeo ()
 Constructor.
 
virtual ~SubDetectorROOTGeo ()
 Destructor.
 
virtual void ReadGdml (const char *gdmlFile, const char *setupName)
 Initialize the instance of ROOTGeo.
 
virtual int IsInitialized ()
 If the ROOT geometry of this subdetctor is initialized;.
 
virtual void SetChildNo (int childNo)
 
virtual TGeoVolume * GetLogicalVolume (const std::string &vn)
 Get a logical volume by name;.
 
virtual TGeoVolume * GetTopVolume ()
 Get the top(world) volume;.
 
virtual TGeoVolumeAssembly * GetAssemblyVolume (const std::string &an)
 Get an assembly by name;.
 
virtual TGeoNode * GetNode (const std::string &nn)
 Get a node(physical volume) by name;.
 
virtual int GetHitsNum ()
 Get number of hits in HitsArray;.
 
virtual TGeoPhysicalNode * GetHit (int i)
 Get ith hit in HitsArray;.
 
virtual void SetDetectorOn ()
 Set all physicalNodes in m_DeteorsArray visible;.
 

Protected Attributes

int m_ROOTGeoInit
 
int m_childNo
 
TGeoVolume * m_TopVolume
 
int m_2DGeoInit
 
TObjArray * m_DetectorsArray
 
TObjArray * m_HitsArray
 
TObjArray * m_2DHitsArray
 

Detailed Description

Class SubDetectorROOTGeo is a base class for the four subdetector ROOT geometry class.

Author
Zhengyun You \URL{youzy.nosp@m.@hep.nosp@m..pku..nosp@m.cn}

Definition at line 28 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/ROOTGeo/SubDetectorROOTGeo.h.

Constructor & Destructor Documentation

◆ SubDetectorROOTGeo() [1/2]

SubDetectorROOTGeo::SubDetectorROOTGeo ( )

Constructor.

Definition at line 18 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/SubDetectorROOTGeo.cxx.

19 : m_ROOTGeoInit(0)
20{
21 // Default constructor.
22 //m_sxp.Initialize();
23}

◆ ~SubDetectorROOTGeo() [1/2]

SubDetectorROOTGeo::~SubDetectorROOTGeo ( )
virtual

Destructor.

Definition at line 25 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/SubDetectorROOTGeo.cxx.

26{
27 m_sxp.Finalize();
28}

◆ SubDetectorROOTGeo() [2/2]

SubDetectorROOTGeo::SubDetectorROOTGeo ( )

Constructor.

◆ ~SubDetectorROOTGeo() [2/2]

virtual SubDetectorROOTGeo::~SubDetectorROOTGeo ( )
virtual

Destructor.

Member Function Documentation

◆ GetAssemblyVolume() [1/2]

TGeoVolumeAssembly * SubDetectorROOTGeo::GetAssemblyVolume ( const std::string &  an)

Get an assembly by name;.

Definition at line 52 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/SubDetectorROOTGeo.cxx.

53{
54 TGeoVolumeAssembly *av = (TGeoVolumeAssembly*)TGDMLProcessor::GetInstance()->GetAssemblyVolume(an);
55 if (!av) std::cout << "Assembly Volume " << an << " not found " << std::endl;
56 return av;
57}

Referenced by TofROOTGeo::GetVolumeAssembly().

◆ GetAssemblyVolume() [2/2]

virtual TGeoVolumeAssembly * SubDetectorROOTGeo::GetAssemblyVolume ( const std::string &  an)
virtual

Get an assembly by name;.

◆ GetHit()

TGeoPhysicalNode * SubDetectorROOTGeo::GetHit ( int  i)
virtual

Get ith hit in HitsArray;.

Definition at line 69 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/SubDetectorROOTGeo.cxx.

70{
71 if (i < m_HitsArray->GetEntries())
72 return (TGeoPhysicalNode*)m_HitsArray->At(i);
73 else
74 return 0;
75}

◆ GetHitsNum()

virtual int SubDetectorROOTGeo::GetHitsNum ( )
inlinevirtual

Get number of hits in HitsArray;.

Definition at line 61 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/BesVisLib/SubDetectorROOTGeo.h.

61{ return m_HitsArray->GetEntries(); }

◆ GetLogicalVolume() [1/2]

◆ GetLogicalVolume() [2/2]

virtual TGeoVolume * SubDetectorROOTGeo::GetLogicalVolume ( const std::string &  vn)
virtual

Get a logical volume by name;.

◆ GetNode() [1/2]

TGeoNode * SubDetectorROOTGeo::GetNode ( const std::string &  nn)

Get a node(physical volume) by name;.

Definition at line 59 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/SubDetectorROOTGeo.cxx.

60{
61 TGeoNode *node = (TGeoNode*)TGDMLProcessor::GetInstance()->GetPhysicalVolume(nn);
62 if (!node) std::cout << "Physical Volume " << nn << " not found " << std::endl;
63 return node;
64}

Referenced by TofROOTGeo::GetBucket(), MdcROOTGeo::GetLayer(), EmcROOTGeo::GetPart(), EmcROOTGeo::GetPhi(), MdcROOTGeo::GetSegment(), MdcROOTGeo::SetNode(), MucROOTGeo::SetNode(), and TofROOTGeo::SetNode().

◆ GetNode() [2/2]

virtual TGeoNode * SubDetectorROOTGeo::GetNode ( const std::string &  nn)
virtual

Get a node(physical volume) by name;.

◆ GetTopVolume() [1/2]

TGeoVolume * SubDetectorROOTGeo::GetTopVolume ( )
inline

◆ GetTopVolume() [2/2]

virtual TGeoVolume * SubDetectorROOTGeo::GetTopVolume ( )
inlinevirtual

Get the top(world) volume;.

Definition at line 52 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/BesVisLib/SubDetectorROOTGeo.h.

52{ return m_TopVolume; }

◆ IsInitialized() [1/2]

int SubDetectorROOTGeo::IsInitialized ( )
inline

If the ROOT geometry of this subdetctor is initialized;.

Definition at line 42 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/ROOTGeo/SubDetectorROOTGeo.h.

42{ return m_ROOTGeoInit; }

◆ IsInitialized() [2/2]

virtual int SubDetectorROOTGeo::IsInitialized ( )
inlinevirtual

If the ROOT geometry of this subdetctor is initialized;.

Definition at line 43 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/BesVisLib/SubDetectorROOTGeo.h.

43{ return m_ROOTGeoInit; }

◆ ReadGdml() [1/2]

void SubDetectorROOTGeo::ReadGdml ( const char *  gdmlFile,
const char *  setupName 
)

Initialize the instance of ROOTGeo.

Definition at line 31 of file DetectorDescription/ROOTGeo/ROOTGeo-00-00-15/src/SubDetectorROOTGeo.cxx.

32{
33 m_config.SetURI( gdmlFile );
34 m_config.SetSetupName( setupName );
35 m_config.SetType ( "ROOT" );
36
37 m_sxp.Configure( &m_config );
38 m_sxp.Initialize();
39 m_sxp.Run();
40
41 m_TopVolume = (TGeoVolume*)TGDMLProcessor::GetInstance()->GetWorldVolume();
42 if (!m_TopVolume) std::cout << "Top Volume not found " << std::endl;
43}

Referenced by EmcROOTGeo::InitFromGdml(), MdcROOTGeo::InitFromGdml(), MucROOTGeo::InitFromGdml(), TofROOTGeo::InitFromGdml(), EmcROOTGeo::InitFromGDML(), MdcROOTGeo::InitFromGDML(), MucROOTGeo::InitFromGDML(), and TofROOTGeo::InitFromGDML().

◆ ReadGdml() [2/2]

virtual void SubDetectorROOTGeo::ReadGdml ( const char *  gdmlFile,
const char *  setupName 
)
virtual

Initialize the instance of ROOTGeo.

◆ SetChildNo() [1/2]

◆ SetChildNo() [2/2]

virtual void SubDetectorROOTGeo::SetChildNo ( int  childNo)
inlinevirtual

◆ SetDetectorOn()

void SubDetectorROOTGeo::SetDetectorOn ( )
virtual

Set all physicalNodes in m_DeteorsArray visible;.

Definition at line 77 of file EventDisplay/BesVisLib/BesVisLib-00-05-04/src/SubDetectorROOTGeo.cxx.

78{
79 for (Int_t i = 0; i < m_DetectorsArray->GetEntries(); i++) {
80 TGeoPhysicalNode *pNode = (TGeoPhysicalNode*)m_DetectorsArray->At(i);
81 if (pNode) pNode->SetVisibility(1);
82 }
83}

Member Data Documentation

◆ m_2DGeoInit

◆ m_2DHitsArray

◆ m_childNo

◆ m_DetectorsArray

◆ m_HitsArray

◆ m_ROOTGeoInit

◆ m_TopVolume

TGeoVolume * SubDetectorROOTGeo::m_TopVolume
protected

The documentation for this class was generated from the following files: