CGEM BOSS 6.6.5.f
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;.
 
 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;.
 
 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;.
 

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/4]

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/4]

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/4]

SubDetectorROOTGeo::SubDetectorROOTGeo ( )

Constructor.

◆ ~SubDetectorROOTGeo() [2/4]

virtual SubDetectorROOTGeo::~SubDetectorROOTGeo ( )
virtual

Destructor.

◆ SubDetectorROOTGeo() [3/4]

SubDetectorROOTGeo::SubDetectorROOTGeo ( )

Constructor.

◆ ~SubDetectorROOTGeo() [3/4]

virtual SubDetectorROOTGeo::~SubDetectorROOTGeo ( )
virtual

Destructor.

◆ SubDetectorROOTGeo() [4/4]

SubDetectorROOTGeo::SubDetectorROOTGeo ( )

Constructor.

◆ ~SubDetectorROOTGeo() [4/4]

virtual SubDetectorROOTGeo::~SubDetectorROOTGeo ( )
virtual

Destructor.

Member Function Documentation

◆ GetAssemblyVolume() [1/4]

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/4]

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

Get an assembly by name;.

◆ GetAssemblyVolume() [3/4]

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

Get an assembly by name;.

◆ GetAssemblyVolume() [4/4]

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

Get an assembly by name;.

◆ GetHit() [1/2]

TGeoPhysicalNode * SubDetectorROOTGeo::GetHit ( int  i)
virtual

Get ith hit in HitsArray;.

Definition at line 71 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/SubDetectorROOTGeo.cxx.

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

◆ GetHit() [2/2]

virtual TGeoPhysicalNode * SubDetectorROOTGeo::GetHit ( int  i)
virtual

Get ith hit in HitsArray;.

◆ GetHitsNum() [1/2]

virtual int SubDetectorROOTGeo::GetHitsNum ( )
inlinevirtual

Get number of hits in HitsArray;.

Definition at line 61 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/BesVisLib/SubDetectorROOTGeo.h.

61{ return m_HitsArray->GetEntries(); }

◆ GetHitsNum() [2/2]

virtual int SubDetectorROOTGeo::GetHitsNum ( )
inlinevirtual

Get number of hits in HitsArray;.

Definition at line 61 of file InstallArea/include/BesVisLib/BesVisLib/SubDetectorROOTGeo.h.

61{ return m_HitsArray->GetEntries(); }

◆ GetLogicalVolume() [1/4]

◆ GetLogicalVolume() [2/4]

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

Get a logical volume by name;.

◆ GetLogicalVolume() [3/4]

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

Get a logical volume by name;.

◆ GetLogicalVolume() [4/4]

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

Get a logical volume by name;.

◆ GetNode() [1/4]

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(), TofROOTGeo::SetNode(), and CgemROOTGeo::SetNode().

◆ GetNode() [2/4]

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

Get a node(physical volume) by name;.

◆ GetNode() [3/4]

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

Get a node(physical volume) by name;.

◆ GetNode() [4/4]

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

Get a node(physical volume) by name;.

◆ GetTopVolume() [1/4]

◆ GetTopVolume() [2/4]

virtual TGeoVolume * SubDetectorROOTGeo::GetTopVolume ( )
inlinevirtual

Get the top(world) volume;.

Definition at line 52 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/BesVisLib/SubDetectorROOTGeo.h.

52{ return m_TopVolume; }

◆ GetTopVolume() [3/4]

virtual TGeoVolume * SubDetectorROOTGeo::GetTopVolume ( )
inlinevirtual

Get the top(world) volume;.

Definition at line 52 of file InstallArea/include/BesVisLib/BesVisLib/SubDetectorROOTGeo.h.

52{ return m_TopVolume; }

◆ GetTopVolume() [4/4]

TGeoVolume * SubDetectorROOTGeo::GetTopVolume ( )
inline

Get the top(world) volume;.

Definition at line 51 of file InstallArea/include/ROOTGeo/ROOTGeo/SubDetectorROOTGeo.h.

51{ return m_TopVolume; }

◆ IsInitialized() [1/4]

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/4]

virtual int SubDetectorROOTGeo::IsInitialized ( )
inlinevirtual

If the ROOT geometry of this subdetctor is initialized;.

Definition at line 43 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/BesVisLib/SubDetectorROOTGeo.h.

43{ return m_ROOTGeoInit; }

◆ IsInitialized() [3/4]

virtual int SubDetectorROOTGeo::IsInitialized ( )
inlinevirtual

If the ROOT geometry of this subdetctor is initialized;.

Definition at line 43 of file InstallArea/include/BesVisLib/BesVisLib/SubDetectorROOTGeo.h.

43{ return m_ROOTGeoInit; }

◆ IsInitialized() [4/4]

int SubDetectorROOTGeo::IsInitialized ( )
inline

If the ROOT geometry of this subdetctor is initialized;.

Definition at line 42 of file InstallArea/include/ROOTGeo/ROOTGeo/SubDetectorROOTGeo.h.

42{ return m_ROOTGeoInit; }

◆ ReadGdml() [1/4]

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(), CgemROOTGeo::InitFromGDML(), EmcROOTGeo::InitFromGDML(), MdcROOTGeo::InitFromGDML(), MucROOTGeo::InitFromGDML(), and TofROOTGeo::InitFromGDML().

◆ ReadGdml() [2/4]

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

Initialize the instance of ROOTGeo.

◆ ReadGdml() [3/4]

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

Initialize the instance of ROOTGeo.

◆ ReadGdml() [4/4]

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

Initialize the instance of ROOTGeo.

◆ SetChildNo() [1/4]

◆ SetChildNo() [2/4]

virtual void SubDetectorROOTGeo::SetChildNo ( int  childNo)
inlinevirtual

◆ SetChildNo() [3/4]

virtual void SubDetectorROOTGeo::SetChildNo ( int  childNo)
inlinevirtual

Definition at line 46 of file InstallArea/include/BesVisLib/BesVisLib/SubDetectorROOTGeo.h.

46{ m_childNo = childNo; }

◆ SetChildNo() [4/4]

void SubDetectorROOTGeo::SetChildNo ( int  childNo)
inline

Definition at line 45 of file InstallArea/include/ROOTGeo/ROOTGeo/SubDetectorROOTGeo.h.

45{ m_childNo = childNo; }

◆ SetDetectorOn() [1/2]

void SubDetectorROOTGeo::SetDetectorOn ( )
virtual

Set all physicalNodes in m_DeteorsArray visible;.

Definition at line 79 of file EventDisplay/BesVisLib/BesVisLib-00-06-08/src/SubDetectorROOTGeo.cxx.

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

◆ SetDetectorOn() [2/2]

virtual void SubDetectorROOTGeo::SetDetectorOn ( )
virtual

Set all physicalNodes in m_DeteorsArray visible;.

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: