Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

GeoNode Class Reference

#include <GeoNode.h>

Inheritance diagram for GeoNode:

GeoRefCnt GeoPlnNode GeoScintMdlNode GeoStripNode GeoScintPlnNode GeoSteelPlnNode List of all members.

Public Member Functions

 GeoNode ()
virtual ~GeoNode ()
virtual void UpdateGlobalManager () const
virtual GeoGeometryGetGeoGeometry () const
virtual std::string GetGlobalPath () const
virtual TVector3 LocalToGlobal (const TVector3 &local) const
virtual TVector3 GlobalToLocal (const TVector3 &global) const
virtual void LocalToGlobal (Double_t *lxyz, Double_t *gxyz) const
virtual void GlobalToLocal (Double_t *gxyz, Double_t *lxyz) const
virtual TVector3 LocalToGlobalVect (const TVector3 &local) const
virtual TVector3 GlobalToLocalVect (const TVector3 &global) const
virtual void LocalToGlobalVect (Double_t *lxyz, Double_t *gxyz) const
virtual void GlobalToLocalVect (Double_t *gxyz, Double_t *lxyz) const

Protected Member Functions

 GeoNode (GeoGeometry *geoGeometry, TGeoVolume *vol, TGeoMatrix *matrix, TGeoVolume *parVol, std::string globalpath, std::string nodename)
virtual void UpdateGlobalMatrix ()
virtual void IncrementRef ()
virtual void DecrementRef ()

Private Member Functions

void SetParent (TGeoVolume *parent)
 GeoNode (const GeoNode &that)
GeoNodeoperator= (const GeoNode &that)

Private Attributes

GeoGeometryfGeoGeometry
std::string fGlobalPath
 reference link to geometry creator
TGeoCombiTrans * fGlobalMatrix

Friends

class GeoGeometry

Constructor & Destructor Documentation

GeoNode::GeoNode  )  [inline]
 

Definition at line 32 of file GeoNode.h.

References fGeoGeometry, fGlobalMatrix, and fGlobalPath.

00032 : fGeoGeometry(0),fGlobalPath(""),fGlobalMatrix(0) {} 

GeoNode::~GeoNode  )  [virtual]
 

Definition at line 43 of file GeoNode.cxx.

References GeoRefCnt::CountRef(), fGlobalMatrix, MSG, and UpdateGlobalManager().

00043                   {
00044   // Destructor should delete any owned objects
00045 
00046   UpdateGlobalManager();
00047 
00048   if ( CountRef() ) {
00049     MSG("Geo",Msg::kWarning)
00050       << "GeoNode destructor " << CountRef()
00051       << " outstanding references " << endl;
00052   }
00053 
00054   if ( fGlobalMatrix ) delete fGlobalMatrix; fGlobalMatrix = 0;
00055 
00056 }

GeoNode::GeoNode GeoGeometry geoGeometry,
TGeoVolume *  vol,
TGeoMatrix *  matrix,
TGeoVolume *  parVol,
std::string  globalpath,
std::string  nodename
[protected]
 

Definition at line 25 of file GeoNode.cxx.

00027                                      : 
00028                  TGeoNodeMatrix(vol,matrix), fGeoGeometry(geom),
00029                  fGlobalPath(globalpath),fGlobalMatrix(0) {
00030   
00031   // Normal constructor - Protected.
00032 
00033   UpdateGlobalManager();
00034   this -> SetName(nodename.c_str());
00035   this -> SetParent(parVol);
00036   
00037   matrix -> RegisterYourself();
00038   
00039 }

GeoNode::GeoNode const GeoNode that  )  [private]
 


Member Function Documentation

void GeoNode::DecrementRef  )  [protected, virtual]
 

Reimplemented from GeoRefCnt.

Definition at line 71 of file GeoNode.cxx.

References GeoRefCnt::CountRef(), GeoRefCnt::DecrementRef(), fGeoGeometry, and UpdateGlobalManager().

Referenced by UgliStripHandle::operator=(), UgliScintMdlHandle::operator=(), UgliPlnHandle::operator=(), UgliPlnHandle::~UgliPlnHandle(), UgliScintMdlHandle::~UgliScintMdlHandle(), and UgliStripHandle::~UgliStripHandle().

00071                            {
00072   // Decrement reference count to this node
00073 
00074   UpdateGlobalManager();
00075 
00076   fRef--; // decrement own reference count
00077   fGeoGeometry->DecrementRef(); // and that of GeoGeometry
00078   if (!CountRef() )SetVisibility(0);
00079 }

virtual GeoGeometry* GeoNode::GetGeoGeometry  )  const [inline, virtual]
 

Definition at line 41 of file GeoNode.h.

Referenced by GeoStripNode::DistanceAlong(), GeoStripNode::Intersection(), UgliStripHandle::IsFrozen(), UgliSteelPlnHandle::IsFrozen(), UgliScintPlnHandle::IsFrozen(), and UgliScintMdlHandle::IsFrozen().

00041 { return fGeoGeometry; }

virtual std::string GeoNode::GetGlobalPath  )  const [inline, virtual]
 

Definition at line 42 of file GeoNode.h.

Referenced by GeoGeometry::BuildModules().

00042 { return fGlobalPath; }

void GeoNode::GlobalToLocal Double_t *  gxyz,
Double_t *  lxyz
const [virtual]
 

Definition at line 208 of file GeoNode.cxx.

References fGlobalMatrix, Nav::GetName(), MSG, and UpdateGlobalManager().

00208                                                                 {
00209   
00210   UpdateGlobalManager();
00211 
00212   if ( !fGlobalMatrix ) {
00213     MSG("Geo",Msg::kFatal) << "GlobalToLocal for node "
00214                           << this->GetName() << " has null fGlobalMatrix ptr." 
00215                           << endl;
00216     abort();
00217   }
00218   
00219   fGlobalMatrix -> MasterToLocal(gxyz,lxyz);
00220    
00221 }

TVector3 GeoNode::GlobalToLocal const TVector3 &  global  )  const [virtual]
 

Definition at line 176 of file GeoNode.cxx.

References UpdateGlobalManager().

Referenced by GeoGeometry::GetPlaneIdFromZ(), UgliStripHandle::GlobalToLocal(), UgliSteelPlnHandle::GlobalToLocal(), UgliScintPlnHandle::GlobalToLocal(), and UgliScintMdlHandle::GlobalToLocal().

00176                                                             {
00177   // Convert from local to global (MARS) coordinates
00178 
00179   UpdateGlobalManager();
00180   
00181   Double_t gxyz[3] = {global.X(),global.Y(),global.Z()};
00182   Double_t lxyz[3] = {0};
00183   
00184   GlobalToLocal(gxyz,lxyz);
00185   
00186   return TVector3(lxyz[0],lxyz[1],lxyz[2]);
00187   
00188 }

void GeoNode::GlobalToLocalVect Double_t *  gxyz,
Double_t *  lxyz
const [virtual]
 

Definition at line 270 of file GeoNode.cxx.

References fGlobalMatrix, Nav::GetName(), MSG, and UpdateGlobalManager().

00270                                                                     {
00271   
00272   UpdateGlobalManager();
00273 
00274   if ( !fGlobalMatrix ) {
00275     MSG("Geo",Msg::kFatal) << "GlobalToLocalVect for node "
00276                           << this->GetName() << " has null fGlobalMatrix ptr." 
00277                           << endl;
00278     abort();
00279   }
00280   
00281   fGlobalMatrix -> MasterToLocalVect(gxyz,lxyz);
00282    
00283 }

TVector3 GeoNode::GlobalToLocalVect const TVector3 &  global  )  const [virtual]
 

Definition at line 239 of file GeoNode.cxx.

References UpdateGlobalManager().

Referenced by UgliSteelPlnHandle::GlobalToLocalVect().

00239                                                                 {
00240   // Convert from local to global (MARS) direction vector
00241 
00242   UpdateGlobalManager();
00243   
00244   Double_t gxyz[3] = {global.X(),global.Y(),global.Z()};
00245   Double_t lxyz[3] = {0};
00246   
00247   GlobalToLocalVect(gxyz,lxyz);
00248   
00249   return TVector3(lxyz[0],lxyz[1],lxyz[2]);
00250   
00251 }

void GeoNode::IncrementRef  )  [protected, virtual]
 

Reimplemented from GeoRefCnt.

Definition at line 59 of file GeoNode.cxx.

References fGeoGeometry, GeoRefCnt::IncrementRef(), and UpdateGlobalManager().

Referenced by UgliStripHandle::operator=(), UgliScintMdlHandle::operator=(), UgliPlnHandle::operator=(), UgliPlnHandle::UgliPlnHandle(), UgliScintMdlHandle::UgliScintMdlHandle(), and UgliStripHandle::UgliStripHandle().

00059                            {
00060   // Increment reference count to this node
00061 
00062   UpdateGlobalManager();
00063 
00064   fRef++; // increment own reference count
00065   fGeoGeometry->IncrementRef(); // and that of GeoGeometry
00066   SetVisibility(1);
00067   
00068 }

void GeoNode::LocalToGlobal Double_t *  lxyz,
Double_t *  gxyz
const [virtual]
 

Definition at line 191 of file GeoNode.cxx.

References fGlobalMatrix, Nav::GetName(), MSG, and UpdateGlobalManager().

00191                                                                 {
00192   
00193   UpdateGlobalManager();
00194 
00195   if ( !fGlobalMatrix ) {
00196     MSG("Geo",Msg::kFatal) << "LocalToGlobal for node "
00197                           << this->GetName() << " has null fGlobalMatrix ptr." 
00198                           << endl;
00199     abort();
00200   }
00201   
00202   fGlobalMatrix -> LocalToMaster(lxyz,gxyz);
00203   
00204   
00205 }

TVector3 GeoNode::LocalToGlobal const TVector3 &  local  )  const [virtual]
 

Definition at line 161 of file GeoNode.cxx.

References UpdateGlobalManager().

Referenced by GeoPlnNode::GetCenter(), GeoPlnNode::GetX0(), GeoPlnNode::GetY0(), GeoPlnNode::GetZ0(), GeoStripNode::GlobalPos(), UgliStripHandle::LocalToGlobal(), UgliSteelPlnHandle::LocalToGlobal(), UgliScintPlnHandle::LocalToGlobal(), and UgliScintMdlHandle::LocalToGlobal().

00161                                                            {
00162   // Convert from local to global (MARS) coordinates
00163 
00164   UpdateGlobalManager();
00165   
00166   Double_t lxyz[3] = {local.X(),local.Y(),local.Z()};
00167   Double_t gxyz[3] = {0};
00168   
00169   LocalToGlobal(lxyz,gxyz);
00170   
00171   return TVector3(gxyz[0],gxyz[1],gxyz[2]);
00172   
00173 }

void GeoNode::LocalToGlobalVect Double_t *  lxyz,
Double_t *  gxyz
const [virtual]
 

Definition at line 254 of file GeoNode.cxx.

References fGlobalMatrix, Nav::GetName(), MSG, and UpdateGlobalManager().

00254                                                                     {
00255   
00256   UpdateGlobalManager();
00257 
00258   if ( !fGlobalMatrix ) {
00259     MSG("Geo",Msg::kFatal) << "LocalToGlobalVect for node "
00260                           << this->GetName() << " has null fGlobalMatrix ptr." 
00261                           << endl;
00262     abort();
00263   }
00264   
00265   fGlobalMatrix -> LocalToMasterVect(lxyz,gxyz);
00266   
00267 }

TVector3 GeoNode::LocalToGlobalVect const TVector3 &  local  )  const [virtual]
 

Definition at line 224 of file GeoNode.cxx.

References UpdateGlobalManager().

Referenced by UgliSteelPlnHandle::LocalToGlobalVect().

00224                                                                {
00225   // Convert from local to global (MARS) direction vector
00226 
00227   UpdateGlobalManager();
00228   
00229   Double_t lxyz[3] = {local.X(),local.Y(),local.Z()};
00230   Double_t gxyz[3] = {0};
00231   
00232   LocalToGlobalVect(lxyz,gxyz);
00233   
00234   return TVector3(gxyz[0],gxyz[1],gxyz[2]);
00235   
00236 }

GeoNode& GeoNode::operator= const GeoNode that  )  [private]
 

void GeoNode::SetParent TGeoVolume *  parent  )  [private]
 

Definition at line 82 of file GeoNode.cxx.

References MSG, and UpdateGlobalManager().

00082                                              {
00083   // Set the node in its parent volume and update the parent list of
00084   // child nodes
00085   // Private method used during geometry build.
00086 
00087   UpdateGlobalManager();
00088 
00089   if ( !parentvol ) {
00090     MSG("Geo",Msg::kWarning) << "Null parent volume arg" 
00091                              << "\n No action taken" << endl;
00092     return;
00093   }
00094 
00095   this -> SetMotherVolume(parentvol);
00096   TObjArray* listofnodes = parentvol->GetNodes();
00097    
00098   if (!listofnodes) { 
00099     listofnodes = new TObjArray();
00100     parentvol -> SetNodes(listofnodes); // SetBit(kVolumeImportNodes) called 
00101     ((TObject*)parentvol) -> 
00102               ResetBit(TGeoVolume::kVolumeImportNodes); // mark to be deleted
00103   }
00104   
00105   listofnodes -> Add(this);
00106   this -> SetNumber(1);
00107   
00108   return;
00109 
00110 }

virtual void GeoNode::UpdateGlobalManager  )  const [inline, virtual]
 

Definition at line 37 of file GeoNode.h.

References fGeoGeometry, and GeoGeometry::UpdateGlobalManager().

Referenced by GeoStripNode::ClearFiber(), DecrementRef(), GeoStripNode::DistanceAlong(), GeoPlnNode::GetCenter(), GeoScintPlnNode::GetClosestStrip(), GeoStripNode::GetHalfLength(), GeoStripNode::GetHalfThickness(), GeoPlnNode::GetHalfThickness(), GeoStripNode::GetHalfWidth(), GeoStripNode::GetLPosRelMdl(), GeoScintMdlNode::GetLPosRelPln(), GeoScintPlnNode::GetScintMdlNodePtrVector(), GeoStripNode::GetScintPlnNode(), GeoScintPlnNode::GetStripNode(), GeoScintMdlNode::GetStripNode(), GeoScintPlnNode::GetStripNodePtrVector(), GeoScintMdlNode::GetStripNodePtrVector(), GeoStripNode::GetTPos(), GeoStripNode::GetTPosRelMdl(), GeoScintMdlNode::GetTPosRelPln(), GeoPlnNode::GetX0(), GeoScintPlnNode::GetX0RelSteel(), GeoPlnNode::GetY0(), GeoScintPlnNode::GetY0RelSteel(), GeoPlnNode::GetZ0(), GeoStripNode::GetZRotRelMdlRad(), GeoScintMdlNode::GetZRotRelPlnRad(), GeoScintPlnNode::GetZRotRelSteelRad(), GeoStripNode::GlobalPos(), GlobalToLocal(), GlobalToLocalVect(), IncrementRef(), GeoStripNode::Intersection(), GeoStripNode::IsMirrored(), LocalToGlobal(), LocalToGlobalVect(), GeoScintPlnNode::NumberOfModules(), GeoScintPlnNode::NumberOfStrips(), GeoStripNode::PartialLength(), GeoStripNode::SetLTPosRelMdl(), GeoScintMdlNode::SetLTPosRelPln(), SetParent(), GeoScintPlnNode::SetXY0RelSteel(), GeoStripNode::SetZRotRelMdlRad(), GeoScintMdlNode::SetZRotRelPlnRad(), GeoScintPlnNode::SetZRotRelSteelRad(), GeoStripNode::TotalAttenuation(), UpdateGlobalMatrix(), GeoStripNode::WlsBypass(), GeoStripNode::WlsPigtail(), ~GeoNode(), GeoPlnNode::~GeoPlnNode(), GeoScintMdlNode::~GeoScintMdlNode(), and GeoStripNode::~GeoStripNode().

00038     { if ( fGeoGeometry ) fGeoGeometry->UpdateGlobalManager();
00039       else gGeoManager = 0; }

void GeoNode::UpdateGlobalMatrix  )  [protected, virtual]
 

Definition at line 113 of file GeoNode.cxx.

References fGlobalMatrix, fGlobalPath, Nav::GetName(), MSG, and UpdateGlobalManager().

00113                                  {
00114   // Stores a copy of the matrix to perform local-to-global(MARS) 
00115   // and global-to-local transformations with this node.  Protected method
00116   // called by GeoGeometry after geometry is closed.
00117 
00118   UpdateGlobalManager();
00119 
00120   if ( fGlobalMatrix ) {
00121     // In principal this should only be called once at geometry closure.
00122     MSG("Geo",Msg::kWarning) << "UpdateGlobalMatrix deleting previous matrix\n"
00123                              << " for node " << this->GetName() << "." << endl;
00124     delete fGlobalMatrix;
00125     fGlobalMatrix = 0;
00126   }
00127   
00128   if ( fGlobalPath.empty() ) {
00129     MSG("Geo",Msg::kFatal) 
00130             << "UpdateGlobalMatrix called with empty path. Abort." << endl;
00131     abort();
00132   }
00133 
00134   if ( !gGeoManager->cd(fGlobalPath.c_str()) ) {
00135     MSG("Geo",Msg::kFatal)
00136       << "UpdateGlobalMatrix unable to cd to global path\n" 
00137       << fGlobalPath.c_str() << ". Abort." << endl;
00138     abort();
00139   }
00140   
00141   TGeoHMatrix* currentmatrix = gGeoManager->GetCurrentMatrix();
00142   if ( currentmatrix ) {
00143     // Take a copy to store with node. Store as TGeoCombiTrans to
00144     // avoid storing additional bytes associated with TGeoHMatrix::fScale 
00145     // since this is not used.
00146     fGlobalMatrix = new TGeoCombiTrans(*currentmatrix);
00147   }
00148   else {
00149     // should never happen
00150     MSG("Geo",Msg::kFatal) 
00151     << "UpdateGlobalMatrix retrieved null matrix ptr from TGeoManager." 
00152     << " Abort." << endl;
00153     abort();
00154   }
00155 
00156   return;
00157   
00158 }


Friends And Related Function Documentation

friend class GeoGeometry [friend]
 

Reimplemented in GeoScintMdlNode, GeoScintPlnNode, GeoSteelPlnNode, and GeoStripNode.

Definition at line 26 of file GeoNode.h.


Member Data Documentation

GeoGeometry* GeoNode::fGeoGeometry [private]
 

Definition at line 77 of file GeoNode.h.

Referenced by DecrementRef(), GeoNode(), IncrementRef(), and UpdateGlobalManager().

TGeoCombiTrans* GeoNode::fGlobalMatrix [private]
 

Definition at line 79 of file GeoNode.h.

Referenced by GeoNode(), GlobalToLocal(), GlobalToLocalVect(), LocalToGlobal(), LocalToGlobalVect(), UpdateGlobalMatrix(), and ~GeoNode().

std::string GeoNode::fGlobalPath [private]
 

reference link to geometry creator

Definition at line 78 of file GeoNode.h.

Referenced by GeoNode(), and UpdateGlobalMatrix().


The documentation for this class was generated from the following files:
Generated on Sat Nov 21 22:50:28 2009 for loon by  doxygen 1.3.9.1