SubDetectorROOTGeo Class Reference

#include <SubDetectorROOTGeo.h>

Inheritance diagram for SubDetectorROOTGeo:

EmcROOTGeo EmcROOTGeo MdcROOTGeo MdcROOTGeo MucROOTGeo MucROOTGeo TofROOTGeo TofROOTGeo List of all members.

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
TGeoVolume * m_TopVolume
TObjArray * m_DetectorsArray
TObjArray * m_HitsArray
TObjArray * m_2DHitsArray

Private Attributes

SAXProcessor m_sxp
ProcessingConfigurator m_config

Detailed Description

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

Author:
Zhengyun You {mailto:youzy@hep.pku.cn}

Definition at line 28 of file SubDetectorROOTGeo.h.


Constructor & Destructor Documentation

SubDetectorROOTGeo::SubDetectorROOTGeo (  ) 

Constructor.

Definition at line 18 of file SubDetectorROOTGeo.cxx.

00019   : m_ROOTGeoInit(0)
00020 { 
00021   // Default constructor.
00022   //m_sxp.Initialize();
00023 }

SubDetectorROOTGeo::~SubDetectorROOTGeo (  )  [virtual]

Destructor.

Definition at line 25 of file SubDetectorROOTGeo.cxx.

References m_sxp.

00026 { 
00027   m_sxp.Finalize();
00028 }

SubDetectorROOTGeo::SubDetectorROOTGeo (  ) 

Constructor.

virtual SubDetectorROOTGeo::~SubDetectorROOTGeo (  )  [virtual]

Destructor.


Member Function Documentation

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

Get an assembly by name;.

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

Get an assembly by name;.

Definition at line 52 of file SubDetectorROOTGeo.cxx.

Referenced by TofROOTGeo::GetVolumeAssembly().

00053 {
00054   TGeoVolumeAssembly *av = (TGeoVolumeAssembly*)TGDMLProcessor::GetInstance()->GetAssemblyVolume(an);
00055   if (!av) std::cout << "Assembly Volume " << an << " not found " << std::endl;
00056   return av;
00057 }

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

Get ith hit in HitsArray;.

Definition at line 65 of file SubDetectorROOTGeo.cxx.

References m_HitsArray.

00066 {
00067     if (i < m_HitsArray->GetEntries())
00068         return (TGeoPhysicalNode*)m_HitsArray->At(i);
00069     else
00070         return 0;
00071 }

virtual int SubDetectorROOTGeo::GetHitsNum (  )  [inline, virtual]

Get number of hits in HitsArray;.

Definition at line 61 of file SubDetectorROOTGeo.h.

References m_HitsArray.

00061 { return m_HitsArray->GetEntries(); }

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

Get a logical volume by name;.

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

Get a logical volume by name;.

Definition at line 45 of file SubDetectorROOTGeo.cxx.

Referenced by MucROOTGeo::GetVolumeAbsorber(), MucROOTGeo::GetVolumeAbsorberPanel(), MucROOTGeo::GetVolumeAbsorberSmallBlock(), TofROOTGeo::GetVolumeAl(), MucROOTGeo::GetVolumeAluminumBox(), MucROOTGeo::GetVolumeBakelite(), MucROOTGeo::GetVolumeBox(), MucROOTGeo::GetVolumeBoxSurface(), TofROOTGeo::GetVolumeBucket(), EmcROOTGeo::GetVolumeCrystal(), MucROOTGeo::GetVolumeGap(), MucROOTGeo::GetVolumeGasBorder(), MucROOTGeo::GetVolumeGasChamber(), MdcROOTGeo::GetVolumeLayer(), TofROOTGeo::GetVolumePart(), EmcROOTGeo::GetVolumePart(), EmcROOTGeo::GetVolumePhi(), TofROOTGeo::GetVolumePVF(), MdcROOTGeo::GetVolumeReplica(), TofROOTGeo::GetVolumeScin(), MdcROOTGeo::GetVolumeSegment(), MucROOTGeo::GetVolumeStrip(), MucROOTGeo::GetVolumeStripPlane(), EmcROOTGeo::GetVolumeTheta(), MucROOTGeo::SetNode(), EmcROOTGeo::SetNode(), EmcROOTGeo::SetPhysicalNode(), and EmcROOTGeo::SetVolumeAppendInVis().

00046 {
00047   TGeoVolume *lv = (TGeoVolume*)TGDMLProcessor::GetInstance()->GetLogicalVolume(vn);
00048   if (!lv) std::cout << "Logical Volume " << vn << " not found " << std::endl;
00049   return lv;
00050 }

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

Get a node(physical volume) by name;.

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

Get a node(physical volume) by name;.

Definition at line 59 of file SubDetectorROOTGeo.cxx.

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

00060 {
00061   TGeoNode *node = (TGeoNode*)TGDMLProcessor::GetInstance()->GetPhysicalVolume(nn);
00062   if (!node) std::cout << "Physical Volume " << nn << " not found " << std::endl;
00063   return node;
00064 }

virtual TGeoVolume* SubDetectorROOTGeo::GetTopVolume (  )  [inline, virtual]

Get the top(world) volume;.

Definition at line 52 of file SubDetectorROOTGeo.h.

References m_TopVolume.

00052 { return m_TopVolume; }

TGeoVolume* SubDetectorROOTGeo::GetTopVolume (  )  [inline]

Get the top(world) volume;.

Definition at line 51 of file SubDetectorROOTGeo.h.

References m_TopVolume.

Referenced by MucROOTGeo::Init2DGeometry(), TofROOTGeo::SetNode(), MucROOTGeo::SetNode(), MdcROOTGeo::SetNode(), and EmcROOTGeo::SetNode().

00051 { return m_TopVolume; }

virtual int SubDetectorROOTGeo::IsInitialized (  )  [inline, virtual]

If the ROOT geometry of this subdetctor is initialized;.

Definition at line 43 of file SubDetectorROOTGeo.h.

References m_ROOTGeoInit.

00043 { return m_ROOTGeoInit; }

int SubDetectorROOTGeo::IsInitialized (  )  [inline]

If the ROOT geometry of this subdetctor is initialized;.

Definition at line 42 of file SubDetectorROOTGeo.h.

References m_ROOTGeoInit.

00042 { return m_ROOTGeoInit; }

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

Initialize the instance of ROOTGeo.

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

Initialize the instance of ROOTGeo.

Definition at line 31 of file SubDetectorROOTGeo.cxx.

References m_config, m_sxp, and m_TopVolume.

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

00032 {
00033   m_config.SetURI( gdmlFile );
00034   m_config.SetSetupName( setupName );
00035   m_config.SetType ( "ROOT" );
00036   
00037   m_sxp.Configure( &m_config );
00038   m_sxp.Initialize();
00039   m_sxp.Run();
00040   
00041   m_TopVolume = (TGeoVolume*)TGDMLProcessor::GetInstance()->GetWorldVolume();
00042   if (!m_TopVolume) std::cout << "Top Volume not found " << std::endl;
00043 }

virtual void SubDetectorROOTGeo::SetChildNo ( int  childNo  )  [inline, virtual]

Definition at line 46 of file SubDetectorROOTGeo.h.

References m_childNo.

00046 { m_childNo = childNo; }

void SubDetectorROOTGeo::SetChildNo ( int  childNo  )  [inline]

Definition at line 45 of file SubDetectorROOTGeo.h.

References m_childNo.

Referenced by BesGeometry::InitFromGDML(), BesGeometry::InitFromROOT(), MucGeoGeneral::InitFromXML(), and EmcROOTGeo::SetPhysicalNode().

00045 { m_childNo = childNo; }

void SubDetectorROOTGeo::SetDetectorOn (  )  [virtual]

Set all physicalNodes in m_DeteorsArray visible;.

Definition at line 73 of file SubDetectorROOTGeo.cxx.

References genRecEmupikp::i, and m_DetectorsArray.

00074 {
00075     for (Int_t i = 0; i < m_DetectorsArray->GetEntries(); i++) {
00076         TGeoPhysicalNode *pNode = (TGeoPhysicalNode*)m_DetectorsArray->At(i);
00077         if (pNode) pNode->SetVisibility(1);
00078     }
00079 }


Member Data Documentation

int SubDetectorROOTGeo::m_2DGeoInit [protected]

Definition at line 79 of file SubDetectorROOTGeo.h.

Referenced by TofROOTGeo::Draw(), MucROOTGeo::Draw(), MdcROOTGeo::Draw(), EmcROOTGeo::Draw(), TofROOTGeo::Init2DGeometry(), MucROOTGeo::Init2DGeometry(), MdcROOTGeo::Init2DGeometry(), and EmcROOTGeo::Init2DGeometry().

TObjArray* SubDetectorROOTGeo::m_2DHitsArray [protected]

Definition at line 85 of file SubDetectorROOTGeo.h.

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

int SubDetectorROOTGeo::m_childNo [protected]

Definition at line 67 of file SubDetectorROOTGeo.h.

Referenced by SetChildNo(), TofROOTGeo::SetPhysicalNode(), MucROOTGeo::SetPhysicalNode(), and MdcROOTGeo::SetPhysicalNode().

ProcessingConfigurator SubDetectorROOTGeo::m_config [private]

Definition at line 62 of file SubDetectorROOTGeo.h.

Referenced by ReadGdml().

TObjArray* SubDetectorROOTGeo::m_DetectorsArray [protected]

Definition at line 83 of file SubDetectorROOTGeo.h.

Referenced by TofROOTGeo::SetDetector(), MucROOTGeo::SetDetector(), MdcROOTGeo::SetDetector(), EmcROOTGeo::SetDetector(), SetDetectorOn(), EmcROOTGeo::SetVisEmcDetector(), MdcROOTGeo::SetVisMdcDetector(), MucROOTGeo::SetVisMucDetector(), and TofROOTGeo::SetVisTofDetector().

TObjArray* SubDetectorROOTGeo::m_HitsArray [protected]

Definition at line 84 of file SubDetectorROOTGeo.h.

Referenced by GetHit(), GetHitsNum(), TofROOTGeo::SetHits(), MucROOTGeo::SetHits(), MdcROOTGeo::SetHits(), EmcROOTGeo::SetHits(), EmcROOTGeo::SetVisEmcHits(), MdcROOTGeo::SetVisMdcHits(), MucROOTGeo::SetVisMucHits(), and TofROOTGeo::SetVisTofHits().

int SubDetectorROOTGeo::m_ROOTGeoInit [protected]

Definition at line 66 of file SubDetectorROOTGeo.h.

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

SAXProcessor SubDetectorROOTGeo::m_sxp [private]

Definition at line 61 of file SubDetectorROOTGeo.h.

Referenced by ReadGdml(), and ~SubDetectorROOTGeo().

TGeoVolume* SubDetectorROOTGeo::m_TopVolume [protected]

Definition at line 81 of file SubDetectorROOTGeo.h.

TGeoVolume* SubDetectorROOTGeo::m_TopVolume [protected]

Definition at line 69 of file SubDetectorROOTGeo.h.

Referenced by GetTopVolume(), and ReadGdml().


Generated on Tue Nov 29 23:35:55 2016 for BOSS_7.0.2 by  doxygen 1.4.7